Source code for swagger_server.models.site_role

# coding: utf-8

from __future__ import absolute_import
from datetime import date, datetime  # noqa: F401

from typing import List, Dict  # noqa: F401

from swagger_server.models.base_model_ import Model
from swagger_server import util


[docs]class SiteRole(Model): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self, site_id: int=None, role_id: int=None, grant_implicitly: bool=None, created_at: datetime=None, updated_at: datetime=None): # noqa: E501 """SiteRole - a model defined in Swagger :param site_id: The site_id of this SiteRole. # noqa: E501 :type site_id: int :param role_id: The role_id of this SiteRole. # noqa: E501 :type role_id: int :param grant_implicitly: The grant_implicitly of this SiteRole. # noqa: E501 :type grant_implicitly: bool :param created_at: The created_at of this SiteRole. # noqa: E501 :type created_at: datetime :param updated_at: The updated_at of this SiteRole. # noqa: E501 :type updated_at: datetime """ self.swagger_types = { 'site_id': int, 'role_id': int, 'grant_implicitly': bool, 'created_at': datetime, 'updated_at': datetime } self.attribute_map = { 'site_id': 'site_id', 'role_id': 'role_id', 'grant_implicitly': 'grant_implicitly', 'created_at': 'created_at', 'updated_at': 'updated_at' } self._site_id = site_id self._role_id = role_id self._grant_implicitly = grant_implicitly self._created_at = created_at self._updated_at = updated_at
[docs] @classmethod def from_dict(cls, dikt) -> 'SiteRole': """Returns the dict as a model :param dikt: A dict. :type: dict :return: The site_role of this SiteRole. # noqa: E501 :rtype: SiteRole """ return util.deserialize_model(dikt, cls)
@property def site_id(self) -> int: """Gets the site_id of this SiteRole. :return: The site_id of this SiteRole. :rtype: int """ return self._site_id @site_id.setter def site_id(self, site_id: int): """Sets the site_id of this SiteRole. :param site_id: The site_id of this SiteRole. :type site_id: int """ if site_id is None: raise ValueError("Invalid value for `site_id`, must not be `None`") # noqa: E501 self._site_id = site_id @property def role_id(self) -> int: """Gets the role_id of this SiteRole. :return: The role_id of this SiteRole. :rtype: int """ return self._role_id @role_id.setter def role_id(self, role_id: int): """Sets the role_id of this SiteRole. :param role_id: The role_id of this SiteRole. :type role_id: int """ if role_id is None: raise ValueError("Invalid value for `role_id`, must not be `None`") # noqa: E501 self._role_id = role_id @property def grant_implicitly(self) -> bool: """Gets the grant_implicitly of this SiteRole. :return: The grant_implicitly of this SiteRole. :rtype: bool """ return self._grant_implicitly @grant_implicitly.setter def grant_implicitly(self, grant_implicitly: bool): """Sets the grant_implicitly of this SiteRole. :param grant_implicitly: The grant_implicitly of this SiteRole. :type grant_implicitly: bool """ if grant_implicitly is None: raise ValueError("Invalid value for `grant_implicitly`, must not be `None`") # noqa: E501 self._grant_implicitly = grant_implicitly @property def created_at(self) -> datetime: """Gets the created_at of this SiteRole. :return: The created_at of this SiteRole. :rtype: datetime """ return self._created_at @created_at.setter def created_at(self, created_at: datetime): """Sets the created_at of this SiteRole. :param created_at: The created_at of this SiteRole. :type created_at: datetime """ if created_at is None: raise ValueError("Invalid value for `created_at`, must not be `None`") # noqa: E501 self._created_at = created_at @property def updated_at(self) -> datetime: """Gets the updated_at of this SiteRole. :return: The updated_at of this SiteRole. :rtype: datetime """ return self._updated_at @updated_at.setter def updated_at(self, updated_at: datetime): """Sets the updated_at of this SiteRole. :param updated_at: The updated_at of this SiteRole. :type updated_at: datetime """ if updated_at is None: raise ValueError("Invalid value for `updated_at`, must not be `None`") # noqa: E501 self._updated_at = updated_at