290 lines
8.0 KiB
Python
290 lines
8.0 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
|
|
|
|
class UsersBody(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 = {
|
|
'firstname': 'str',
|
|
'lastname': 'str',
|
|
'email': 'str',
|
|
'team': 'int',
|
|
'valid_until': 'str',
|
|
'orgid': 'str',
|
|
'usergroup': 'int'
|
|
}
|
|
|
|
attribute_map = {
|
|
'firstname': 'firstname',
|
|
'lastname': 'lastname',
|
|
'email': 'email',
|
|
'team': 'team',
|
|
'valid_until': 'valid_until',
|
|
'orgid': 'orgid',
|
|
'usergroup': 'usergroup'
|
|
}
|
|
|
|
def __init__(self, firstname=None, lastname=None, email=None, team=None, valid_until=None, orgid=None, usergroup=None): # noqa: E501
|
|
"""UsersBody - a model defined in Swagger""" # noqa: E501
|
|
self._firstname = None
|
|
self._lastname = None
|
|
self._email = None
|
|
self._team = None
|
|
self._valid_until = None
|
|
self._orgid = None
|
|
self._usergroup = None
|
|
self.discriminator = None
|
|
self.firstname = firstname
|
|
self.lastname = lastname
|
|
self.email = email
|
|
if team is not None:
|
|
self.team = team
|
|
if valid_until is not None:
|
|
self.valid_until = valid_until
|
|
if orgid is not None:
|
|
self.orgid = orgid
|
|
if usergroup is not None:
|
|
self.usergroup = usergroup
|
|
|
|
@property
|
|
def firstname(self):
|
|
"""Gets the firstname of this UsersBody. # noqa: E501
|
|
|
|
User's first name. # noqa: E501
|
|
|
|
:return: The firstname of this UsersBody. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._firstname
|
|
|
|
@firstname.setter
|
|
def firstname(self, firstname):
|
|
"""Sets the firstname of this UsersBody.
|
|
|
|
User's first name. # noqa: E501
|
|
|
|
:param firstname: The firstname of this UsersBody. # noqa: E501
|
|
:type: str
|
|
"""
|
|
if firstname is None:
|
|
raise ValueError("Invalid value for `firstname`, must not be `None`") # noqa: E501
|
|
|
|
self._firstname = firstname
|
|
|
|
@property
|
|
def lastname(self):
|
|
"""Gets the lastname of this UsersBody. # noqa: E501
|
|
|
|
User's last name. # noqa: E501
|
|
|
|
:return: The lastname of this UsersBody. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._lastname
|
|
|
|
@lastname.setter
|
|
def lastname(self, lastname):
|
|
"""Sets the lastname of this UsersBody.
|
|
|
|
User's last name. # noqa: E501
|
|
|
|
:param lastname: The lastname of this UsersBody. # noqa: E501
|
|
:type: str
|
|
"""
|
|
if lastname is None:
|
|
raise ValueError("Invalid value for `lastname`, must not be `None`") # noqa: E501
|
|
|
|
self._lastname = lastname
|
|
|
|
@property
|
|
def email(self):
|
|
"""Gets the email of this UsersBody. # noqa: E501
|
|
|
|
User's email address. # noqa: E501
|
|
|
|
:return: The email of this UsersBody. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._email
|
|
|
|
@email.setter
|
|
def email(self, email):
|
|
"""Sets the email of this UsersBody.
|
|
|
|
User's email address. # noqa: E501
|
|
|
|
:param email: The email of this UsersBody. # noqa: E501
|
|
:type: str
|
|
"""
|
|
if email is None:
|
|
raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501
|
|
|
|
self._email = email
|
|
|
|
@property
|
|
def team(self):
|
|
"""Gets the team of this UsersBody. # noqa: E501
|
|
|
|
The team id. # noqa: E501
|
|
|
|
:return: The team of this UsersBody. # noqa: E501
|
|
:rtype: int
|
|
"""
|
|
return self._team
|
|
|
|
@team.setter
|
|
def team(self, team):
|
|
"""Sets the team of this UsersBody.
|
|
|
|
The team id. # noqa: E501
|
|
|
|
:param team: The team of this UsersBody. # noqa: E501
|
|
:type: int
|
|
"""
|
|
|
|
self._team = team
|
|
|
|
@property
|
|
def valid_until(self):
|
|
"""Gets the valid_until of this UsersBody. # noqa: E501
|
|
|
|
Date in the YYYY-MM-DD format for account expiration date. # noqa: E501
|
|
|
|
:return: The valid_until of this UsersBody. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._valid_until
|
|
|
|
@valid_until.setter
|
|
def valid_until(self, valid_until):
|
|
"""Sets the valid_until of this UsersBody.
|
|
|
|
Date in the YYYY-MM-DD format for account expiration date. # noqa: E501
|
|
|
|
:param valid_until: The valid_until of this UsersBody. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._valid_until = valid_until
|
|
|
|
@property
|
|
def orgid(self):
|
|
"""Gets the orgid of this UsersBody. # noqa: E501
|
|
|
|
Internal id. # noqa: E501
|
|
|
|
:return: The orgid of this UsersBody. # noqa: E501
|
|
:rtype: str
|
|
"""
|
|
return self._orgid
|
|
|
|
@orgid.setter
|
|
def orgid(self, orgid):
|
|
"""Sets the orgid of this UsersBody.
|
|
|
|
Internal id. # noqa: E501
|
|
|
|
:param orgid: The orgid of this UsersBody. # noqa: E501
|
|
:type: str
|
|
"""
|
|
|
|
self._orgid = orgid
|
|
|
|
@property
|
|
def usergroup(self):
|
|
"""Gets the usergroup of this UsersBody. # noqa: E501
|
|
|
|
Which permissions level the user will get? `1` is Sysadmin, `2` is Admin, `4` is user (default) # noqa: E501
|
|
|
|
:return: The usergroup of this UsersBody. # noqa: E501
|
|
:rtype: int
|
|
"""
|
|
return self._usergroup
|
|
|
|
@usergroup.setter
|
|
def usergroup(self, usergroup):
|
|
"""Sets the usergroup of this UsersBody.
|
|
|
|
Which permissions level the user will get? `1` is Sysadmin, `2` is Admin, `4` is user (default) # noqa: E501
|
|
|
|
:param usergroup: The usergroup of this UsersBody. # noqa: E501
|
|
:type: int
|
|
"""
|
|
allowed_values = [1, 2, 4] # noqa: E501
|
|
if usergroup not in allowed_values:
|
|
raise ValueError(
|
|
"Invalid value for `usergroup` ({0}), must be one of {1}" # noqa: E501
|
|
.format(usergroup, allowed_values)
|
|
)
|
|
|
|
self._usergroup = usergroup
|
|
|
|
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(UsersBody, 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, UsersBody):
|
|
return False
|
|
|
|
return self.__dict__ == other.__dict__
|
|
|
|
def __ne__(self, other):
|
|
"""Returns true if both objects are not equal"""
|
|
return not self == other
|