483 lines
15 KiB
Python
483 lines
15 KiB
Python
# coding: utf-8
|
|
|
|
"""
|
|
eLabFTW REST API v2 Documentation
|
|
|
|
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
|
|
|
OpenAPI spec version: 2.0.0
|
|
|
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
"""
|
|
|
|
import pprint
|
|
import re # noqa: F401
|
|
|
|
import six
|
|
from elabapi_python.models.users import Users # noqa: F401,E501
|
|
|
|
class UsersFull(Users):
|
|
"""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 = {
|
|
'created_at': 'str',
|
|
'validated': 'int',
|
|
'valid_until': 'str',
|
|
'last_login': 'str',
|
|
'orgid': 'str',
|
|
'auth_service': 'int',
|
|
'is_sysadmin': 'int',
|
|
'default_read': 'str',
|
|
'default_read_base': 'float',
|
|
'default_read_base_human': 'str',
|
|
'default_write': 'str',
|
|
'default_write_base': 'float',
|
|
'default_write_base_human': 'str',
|
|
'teams': 'list[UsersFullTeams]'
|
|
}
|
|
if hasattr(Users, "swagger_types"):
|
|
swagger_types.update(Users.swagger_types)
|
|
|
|
attribute_map = {
|
|
'created_at': 'created_at',
|
|
'validated': 'validated',
|
|
'valid_until': 'valid_until',
|
|
'last_login': 'last_login',
|
|
'orgid': 'orgid',
|
|
'auth_service': 'auth_service',
|
|
'is_sysadmin': 'is_sysadmin',
|
|
'default_read': 'default_read',
|
|
'default_read_base': 'default_read_base',
|
|
'default_read_base_human': 'default_read_base_human',
|
|
'default_write': 'default_write',
|
|
'default_write_base': 'default_write_base',
|
|
'default_write_base_human': 'default_write_base_human',
|
|
'teams': 'teams'
|
|
}
|
|
if hasattr(Users, "attribute_map"):
|
|
attribute_map.update(Users.attribute_map)
|
|
|
|
def __init__(self, created_at=None, validated=None, valid_until=None, last_login=None, orgid=None, auth_service=None, is_sysadmin=0, default_read='{"teams": [], "users": [], "teamgroups": []}', default_read_base=None, default_read_base_human=None, default_write='{"teams": [], "users": [], "teamgroups": []}', default_write_base=None, default_write_base_human=None, teams=None, *args, **kwargs): # noqa: E501
|
|
"""UsersFull - a model defined in Swagger""" # noqa: E501
|
|
self._created_at = None
|
|
self._validated = None
|
|
self._valid_until = None
|
|
self._last_login = None
|
|
self._orgid = None
|
|
self._auth_service = None
|
|
self._is_sysadmin = None
|
|
self._default_read = None
|
|
self._default_read_base = None
|
|
self._default_read_base_human = None
|
|
self._default_write = None
|
|
self._default_write_base = None
|
|
self._default_write_base_human = None
|
|
self._teams = None
|
|
self.discriminator = None
|
|
if created_at is not None:
|
|
self.created_at = created_at
|
|
if validated is not None:
|
|
self.validated = validated
|
|
if valid_until is not None:
|
|
self.valid_until = valid_until
|
|
if last_login is not None:
|
|
self.last_login = last_login
|
|
if orgid is not None:
|
|
self.orgid = orgid
|
|
if auth_service is not None:
|
|
self.auth_service = auth_service
|
|
if is_sysadmin is not None:
|
|
self.is_sysadmin = is_sysadmin
|
|
if default_read is not None:
|
|
self.default_read = default_read
|
|
if default_read_base is not None:
|
|
self.default_read_base = default_read_base
|
|
if default_read_base_human is not None:
|
|
self.default_read_base_human = default_read_base_human
|
|
if default_write is not None:
|
|
self.default_write = default_write
|
|
if default_write_base is not None:
|
|
self.default_write_base = default_write_base
|
|
if default_write_base_human is not None:
|
|
self.default_write_base_human = default_write_base_human
|
|
if teams is not None:
|
|
self.teams = teams
|
|
Users.__init__(self, *args, **kwargs)
|
|
|
|
@property
|
|
def created_at(self):
|
|
"""Gets the created_at of this UsersFull. # noqa: E501
|
|
|
|
Account creation timestamp. # noqa: E501
|
|
|
|
:return: The created_at of this UsersFull. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._created_at
|
|
|
|
@created_at.setter
|
|
def created_at(self, created_at):
|
|
"""Sets the created_at of this UsersFull.
|
|
|
|
Account creation timestamp. # noqa: E501
|
|
|
|
:param created_at: The created_at of this UsersFull. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._created_at = created_at
|
|
|
|
@property
|
|
def validated(self):
|
|
"""Gets the validated of this UsersFull. # noqa: E501
|
|
|
|
|
|
:return: The validated of this UsersFull. # noqa: E501
|
|
:rtype: int
|
|
"""
|
|
return self._validated
|
|
|
|
@validated.setter
|
|
def validated(self, validated):
|
|
"""Sets the validated of this UsersFull.
|
|
|
|
|
|
:param validated: The validated of this UsersFull. # noqa: E501
|
|
:type: int
|
|
"""
|
|
|
|
self._validated = validated
|
|
|
|
@property
|
|
def valid_until(self):
|
|
"""Gets the valid_until of this UsersFull. # noqa: E501
|
|
|
|
|
|
:return: The valid_until of this UsersFull. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._valid_until
|
|
|
|
@valid_until.setter
|
|
def valid_until(self, valid_until):
|
|
"""Sets the valid_until of this UsersFull.
|
|
|
|
|
|
:param valid_until: The valid_until of this UsersFull. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._valid_until = valid_until
|
|
|
|
@property
|
|
def last_login(self):
|
|
"""Gets the last_login of this UsersFull. # noqa: E501
|
|
|
|
Last time a full authentication happened. # noqa: E501
|
|
|
|
:return: The last_login of this UsersFull. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._last_login
|
|
|
|
@last_login.setter
|
|
def last_login(self, last_login):
|
|
"""Sets the last_login of this UsersFull.
|
|
|
|
Last time a full authentication happened. # noqa: E501
|
|
|
|
:param last_login: The last_login of this UsersFull. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._last_login = last_login
|
|
|
|
@property
|
|
def orgid(self):
|
|
"""Gets the orgid of this UsersFull. # noqa: E501
|
|
|
|
Internal organization id used to match user with something other than email. # noqa: E501
|
|
|
|
:return: The orgid of this UsersFull. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._orgid
|
|
|
|
@orgid.setter
|
|
def orgid(self, orgid):
|
|
"""Sets the orgid of this UsersFull.
|
|
|
|
Internal organization id used to match user with something other than email. # noqa: E501
|
|
|
|
:param orgid: The orgid of this UsersFull. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._orgid = orgid
|
|
|
|
@property
|
|
def auth_service(self):
|
|
"""Gets the auth_service of this UsersFull. # noqa: E501
|
|
|
|
What mechanism was used to login, see AuthType Enum. # noqa: E501
|
|
|
|
:return: The auth_service of this UsersFull. # noqa: E501
|
|
:rtype: int
|
|
"""
|
|
return self._auth_service
|
|
|
|
@auth_service.setter
|
|
def auth_service(self, auth_service):
|
|
"""Sets the auth_service of this UsersFull.
|
|
|
|
What mechanism was used to login, see AuthType Enum. # noqa: E501
|
|
|
|
:param auth_service: The auth_service of this UsersFull. # noqa: E501
|
|
:type: int
|
|
"""
|
|
|
|
self._auth_service = auth_service
|
|
|
|
@property
|
|
def is_sysadmin(self):
|
|
"""Gets the is_sysadmin of this UsersFull. # noqa: E501
|
|
|
|
|
|
:return: The is_sysadmin of this UsersFull. # noqa: E501
|
|
:rtype: int
|
|
"""
|
|
return self._is_sysadmin
|
|
|
|
@is_sysadmin.setter
|
|
def is_sysadmin(self, is_sysadmin):
|
|
"""Sets the is_sysadmin of this UsersFull.
|
|
|
|
|
|
:param is_sysadmin: The is_sysadmin of this UsersFull. # noqa: E501
|
|
:type: int
|
|
"""
|
|
|
|
self._is_sysadmin = is_sysadmin
|
|
|
|
@property
|
|
def default_read(self):
|
|
"""Gets the default_read of this UsersFull. # noqa: E501
|
|
|
|
|
|
:return: The default_read of this UsersFull. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._default_read
|
|
|
|
@default_read.setter
|
|
def default_read(self, default_read):
|
|
"""Sets the default_read of this UsersFull.
|
|
|
|
|
|
:param default_read: The default_read of this UsersFull. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._default_read = default_read
|
|
|
|
@property
|
|
def default_read_base(self):
|
|
"""Gets the default_read_base of this UsersFull. # noqa: E501
|
|
|
|
Base permission for default read access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501
|
|
|
|
:return: The default_read_base of this UsersFull. # noqa: E501
|
|
:rtype: float
|
|
"""
|
|
return self._default_read_base
|
|
|
|
@default_read_base.setter
|
|
def default_read_base(self, default_read_base):
|
|
"""Sets the default_read_base of this UsersFull.
|
|
|
|
Base permission for default read access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501
|
|
|
|
:param default_read_base: The default_read_base of this UsersFull. # noqa: E501
|
|
:type: float
|
|
"""
|
|
allowed_values = [10, 20, 30, 40, 50] # noqa: E501
|
|
if default_read_base not in allowed_values:
|
|
raise ValueError(
|
|
"Invalid value for `default_read_base` ({0}), must be one of {1}" # noqa: E501
|
|
.format(default_read_base, allowed_values)
|
|
)
|
|
|
|
self._default_read_base = default_read_base
|
|
|
|
@property
|
|
def default_read_base_human(self):
|
|
"""Gets the default_read_base_human of this UsersFull. # noqa: E501
|
|
|
|
Default read base permission as human readable value # noqa: E501
|
|
|
|
:return: The default_read_base_human of this UsersFull. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._default_read_base_human
|
|
|
|
@default_read_base_human.setter
|
|
def default_read_base_human(self, default_read_base_human):
|
|
"""Sets the default_read_base_human of this UsersFull.
|
|
|
|
Default read base permission as human readable value # noqa: E501
|
|
|
|
:param default_read_base_human: The default_read_base_human of this UsersFull. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._default_read_base_human = default_read_base_human
|
|
|
|
@property
|
|
def default_write(self):
|
|
"""Gets the default_write of this UsersFull. # noqa: E501
|
|
|
|
|
|
:return: The default_write of this UsersFull. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._default_write
|
|
|
|
@default_write.setter
|
|
def default_write(self, default_write):
|
|
"""Sets the default_write of this UsersFull.
|
|
|
|
|
|
:param default_write: The default_write of this UsersFull. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._default_write = default_write
|
|
|
|
@property
|
|
def default_write_base(self):
|
|
"""Gets the default_write_base of this UsersFull. # noqa: E501
|
|
|
|
Base permission for default write access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501
|
|
|
|
:return: The default_write_base of this UsersFull. # noqa: E501
|
|
:rtype: float
|
|
"""
|
|
return self._default_write_base
|
|
|
|
@default_write_base.setter
|
|
def default_write_base(self, default_write_base):
|
|
"""Sets the default_write_base of this UsersFull.
|
|
|
|
Base permission for default write access: - 10: Owner only - 20: Owner + Admins - 30: Team members - 40: Everyone with an account - 50: Everyone including anonymous users # noqa: E501
|
|
|
|
:param default_write_base: The default_write_base of this UsersFull. # noqa: E501
|
|
:type: float
|
|
"""
|
|
allowed_values = [10, 20, 30, 40, 50] # noqa: E501
|
|
if default_write_base not in allowed_values:
|
|
raise ValueError(
|
|
"Invalid value for `default_write_base` ({0}), must be one of {1}" # noqa: E501
|
|
.format(default_write_base, allowed_values)
|
|
)
|
|
|
|
self._default_write_base = default_write_base
|
|
|
|
@property
|
|
def default_write_base_human(self):
|
|
"""Gets the default_write_base_human of this UsersFull. # noqa: E501
|
|
|
|
Default write base permission as human readable value # noqa: E501
|
|
|
|
:return: The default_write_base_human of this UsersFull. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._default_write_base_human
|
|
|
|
@default_write_base_human.setter
|
|
def default_write_base_human(self, default_write_base_human):
|
|
"""Sets the default_write_base_human of this UsersFull.
|
|
|
|
Default write base permission as human readable value # noqa: E501
|
|
|
|
:param default_write_base_human: The default_write_base_human of this UsersFull. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._default_write_base_human = default_write_base_human
|
|
|
|
@property
|
|
def teams(self):
|
|
"""Gets the teams of this UsersFull. # noqa: E501
|
|
|
|
|
|
:return: The teams of this UsersFull. # noqa: E501
|
|
:rtype: list[UsersFullTeams]
|
|
"""
|
|
return self._teams
|
|
|
|
@teams.setter
|
|
def teams(self, teams):
|
|
"""Sets the teams of this UsersFull.
|
|
|
|
|
|
:param teams: The teams of this UsersFull. # noqa: E501
|
|
:type: list[UsersFullTeams]
|
|
"""
|
|
|
|
self._teams = teams
|
|
|
|
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(UsersFull, 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, UsersFull):
|
|
return False
|
|
|
|
return self.__dict__ == other.__dict__
|
|
|
|
def __ne__(self, other):
|
|
"""Returns true if both objects are not equal"""
|
|
return not self == other
|