user_group_view.py•8.34 kB
# coding: utf-8
"""
Alteryx Server API V3
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from src.server_client.configuration import Configuration
class UserGroupView(object):
"""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 = {
"id": "str",
"name": "str",
"date_added": "datetime",
"role": "str",
"credential_ids": "list[str]",
"connection_ids": "list[str]",
"members": "list[Member]",
}
attribute_map = {
"id": "id",
"name": "name",
"date_added": "dateAdded",
"role": "role",
"credential_ids": "credentialIds",
"connection_ids": "connectionIds",
"members": "members",
}
def __init__(
self,
id=None,
name=None,
date_added=None,
role=None,
credential_ids=None,
connection_ids=None,
members=None,
_configuration=None,
): # noqa: E501
"""UserGroupView - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._id = None
self._name = None
self._date_added = None
self._role = None
self._credential_ids = None
self._connection_ids = None
self._members = None
self.discriminator = None
self.id = id
self.name = name
self.date_added = date_added
self.role = role
if credential_ids is not None:
self.credential_ids = credential_ids
if connection_ids is not None:
self.connection_ids = connection_ids
if members is not None:
self.members = members
@property
def id(self):
"""Gets the id of this UserGroupView. # noqa: E501
:return: The id of this UserGroupView. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this UserGroupView.
:param id: The id of this UserGroupView. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and id is None:
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
self._id = id
@property
def name(self):
"""Gets the name of this UserGroupView. # noqa: E501
:return: The name of this UserGroupView. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this UserGroupView.
:param name: The name of this UserGroupView. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and name is None:
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
self._name = name
@property
def date_added(self):
"""Gets the date_added of this UserGroupView. # noqa: E501
:return: The date_added of this UserGroupView. # noqa: E501
:rtype: datetime
"""
return self._date_added
@date_added.setter
def date_added(self, date_added):
"""Sets the date_added of this UserGroupView.
:param date_added: The date_added of this UserGroupView. # noqa: E501
:type: datetime
"""
if self._configuration.client_side_validation and date_added is None:
raise ValueError("Invalid value for `date_added`, must not be `None`") # noqa: E501
self._date_added = date_added
@property
def role(self):
"""Gets the role of this UserGroupView. # noqa: E501
:return: The role of this UserGroupView. # noqa: E501
:rtype: str
"""
return self._role
@role.setter
def role(self, role):
"""Sets the role of this UserGroupView.
:param role: The role of this UserGroupView. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and role is None:
raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501
allowed_values = ["NoAccess", "Viewer", "Member", "Artisan", "Curator", "Evaluated"] # noqa: E501
if self._configuration.client_side_validation and role not in allowed_values:
raise ValueError(
"Invalid value for `role` ({0}), must be one of {1}".format(role, allowed_values) # noqa: E501
)
self._role = role
@property
def credential_ids(self):
"""Gets the credential_ids of this UserGroupView. # noqa: E501
:return: The credential_ids of this UserGroupView. # noqa: E501
:rtype: list[str]
"""
return self._credential_ids
@credential_ids.setter
def credential_ids(self, credential_ids):
"""Sets the credential_ids of this UserGroupView.
:param credential_ids: The credential_ids of this UserGroupView. # noqa: E501
:type: list[str]
"""
self._credential_ids = credential_ids
@property
def connection_ids(self):
"""Gets the connection_ids of this UserGroupView. # noqa: E501
:return: The connection_ids of this UserGroupView. # noqa: E501
:rtype: list[str]
"""
return self._connection_ids
@connection_ids.setter
def connection_ids(self, connection_ids):
"""Sets the connection_ids of this UserGroupView.
:param connection_ids: The connection_ids of this UserGroupView. # noqa: E501
:type: list[str]
"""
self._connection_ids = connection_ids
@property
def members(self):
"""Gets the members of this UserGroupView. # noqa: E501
:return: The members of this UserGroupView. # noqa: E501
:rtype: list[Member]
"""
return self._members
@members.setter
def members(self, members):
"""Sets the members of this UserGroupView.
:param members: The members of this UserGroupView. # noqa: E501
:type: list[Member]
"""
self._members = members
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(
map(
lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
value.items(),
)
)
else:
result[attr] = value
if issubclass(UserGroupView, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, UserGroupView):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, UserGroupView):
return True
return self.to_dict() != other.to_dict()