Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 24 additions & 44 deletions src/conductor/client/http/models/authorization_request.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,38 @@
import pprint
import re # noqa: F401
from typing import List, Optional
from dataclasses import dataclass, field
from deprecated import deprecated

import six


class AuthorizationRequest(object):
@dataclass
class AuthorizationRequest:
"""NOTE: This class is auto generated by the swagger code generator program.

Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'subject': 'SubjectRef',
'target': 'TargetRef',
'access': 'list[str]'
}

attribute_map = {
'subject': 'subject',
'target': 'target',
'access': 'access'
}
_subject: Optional['SubjectRef'] = field(default=None, init=False, repr=False)
_target: Optional['TargetRef'] = field(default=None, init=False, repr=False)
_access: Optional[List[str]] = field(default=None, init=False, repr=False)

def __init__(self, subject=None, target=None, access=None): # noqa: E501
"""AuthorizationRequest - a model defined in Swagger""" # noqa: E501
self._subject = None
self._target = None
self._access = None
self.discriminator = None
self.subject = subject
self.target = target
self.access = access
self._subject = subject
self._target = target
self._access = access

def __post_init__(self):
if self._access is not None:
allowed_values = ["CREATE", "READ", "UPDATE", "DELETE", "EXECUTE"]
if not set(self._access).issubset(set(allowed_values)):
raise ValueError(
"Invalid values for `access` [{0}], must be a subset of [{1}]"
.format(", ".join(map(str, set(self._access) - set(allowed_values))),
", ".join(map(str, allowed_values)))
)

@property
def subject(self):
"""Gets the subject of this AuthorizationRequest. # noqa: E501


:return: The subject of this AuthorizationRequest. # noqa: E501
:rtype: SubjectRef
"""
Expand All @@ -52,7 +42,6 @@ def subject(self):
def subject(self, subject):
"""Sets the subject of this AuthorizationRequest.


:param subject: The subject of this AuthorizationRequest. # noqa: E501
:type: SubjectRef
"""
Expand All @@ -62,7 +51,6 @@ def subject(self, subject):
def target(self):
"""Gets the target of this AuthorizationRequest. # noqa: E501


:return: The target of this AuthorizationRequest. # noqa: E501
:rtype: TargetRef
"""
Expand All @@ -72,7 +60,6 @@ def target(self):
def target(self, target):
"""Sets the target of this AuthorizationRequest.


:param target: The target of this AuthorizationRequest. # noqa: E501
:type: TargetRef
"""
Expand Down Expand Up @@ -101,18 +88,16 @@ def access(self, access):
allowed_values = ["CREATE", "READ", "UPDATE", "DELETE", "EXECUTE"] # noqa: E501
if not set(access).issubset(set(allowed_values)):
raise ValueError(
"Invalid values for `access` [{0}], must be a subset of [{1}]" # noqa: E501
"Invalid values for `access` [{0}], must be a subset of [{1}]"
.format(", ".join(map(str, set(access) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values)))
)

self._access = access

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.swagger_types):
for attr in ['subject', 'target', 'access']:
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
Expand All @@ -129,10 +114,6 @@ def to_dict(self):
))
else:
result[attr] = value
if issubclass(AuthorizationRequest, dict):
for key, value in self.items():
result[key] = value

return result

def to_str(self):
Expand All @@ -147,9 +128,8 @@ def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, AuthorizationRequest):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
return not self == other
Loading