Skip to content
Snippets Groups Projects
Select Git revision
  • 177edbc3a5ddfe5bd5b6e7782a7c90c5aae762da
  • master default protected
  • dev
  • gh-pages
4 results

token_brief_dto.py

Blame
  • Martin Weise's avatar
    177edbc3
    History
    token_brief_dto.py 5.91 KiB
    # coding: utf-8
    
    """
        Database Repository Authentication Service API
    
        Service that manages the authentication  # noqa: E501
    
        OpenAPI spec version: 1.1.0-alpha
        Contact: andreas.rauber@tuwien.ac.at
        Generated by: https://github.com/swagger-api/swagger-codegen.git
    """
    
    import pprint
    import re  # noqa: F401
    
    import six
    
    class TokenBriefDto(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': 'int',
            'created': 'datetime',
            'expires': 'datetime',
            'token_hash': 'str',
            'last_used': 'datetime'
        }
    
        attribute_map = {
            'id': 'id',
            'created': 'created',
            'expires': 'expires',
            'token_hash': 'token_hash',
            'last_used': 'last_used'
        }
    
        def __init__(self, id=None, created=None, expires=None, token_hash=None, last_used=None):  # noqa: E501
            """TokenBriefDto - a model defined in Swagger"""  # noqa: E501
            self._id = None
            self._created = None
            self._expires = None
            self._token_hash = None
            self._last_used = None
            self.discriminator = None
            self.id = id
            self.created = created
            self.expires = expires
            self.token_hash = token_hash
            if last_used is not None:
                self.last_used = last_used
    
        @property
        def id(self):
            """Gets the id of this TokenBriefDto.  # noqa: E501
    
    
            :return: The id of this TokenBriefDto.  # noqa: E501
            :rtype: int
            """
            return self._id
    
        @id.setter
        def id(self, id):
            """Sets the id of this TokenBriefDto.
    
    
            :param id: The id of this TokenBriefDto.  # noqa: E501
            :type: int
            """
            if id is None:
                raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501
    
            self._id = id
    
        @property
        def created(self):
            """Gets the created of this TokenBriefDto.  # noqa: E501
    
    
            :return: The created of this TokenBriefDto.  # noqa: E501
            :rtype: datetime
            """
            return self._created
    
        @created.setter
        def created(self, created):
            """Sets the created of this TokenBriefDto.
    
    
            :param created: The created of this TokenBriefDto.  # noqa: E501
            :type: datetime
            """
            if created is None:
                raise ValueError("Invalid value for `created`, must not be `None`")  # noqa: E501
    
            self._created = created
    
        @property
        def expires(self):
            """Gets the expires of this TokenBriefDto.  # noqa: E501
    
    
            :return: The expires of this TokenBriefDto.  # noqa: E501
            :rtype: datetime
            """
            return self._expires
    
        @expires.setter
        def expires(self, expires):
            """Sets the expires of this TokenBriefDto.
    
    
            :param expires: The expires of this TokenBriefDto.  # noqa: E501
            :type: datetime
            """
            if expires is None:
                raise ValueError("Invalid value for `expires`, must not be `None`")  # noqa: E501
    
            self._expires = expires
    
        @property
        def token_hash(self):
            """Gets the token_hash of this TokenBriefDto.  # noqa: E501
    
    
            :return: The token_hash of this TokenBriefDto.  # noqa: E501
            :rtype: str
            """
            return self._token_hash
    
        @token_hash.setter
        def token_hash(self, token_hash):
            """Sets the token_hash of this TokenBriefDto.
    
    
            :param token_hash: The token_hash of this TokenBriefDto.  # noqa: E501
            :type: str
            """
            if token_hash is None:
                raise ValueError("Invalid value for `token_hash`, must not be `None`")  # noqa: E501
    
            self._token_hash = token_hash
    
        @property
        def last_used(self):
            """Gets the last_used of this TokenBriefDto.  # noqa: E501
    
    
            :return: The last_used of this TokenBriefDto.  # noqa: E501
            :rtype: datetime
            """
            return self._last_used
    
        @last_used.setter
        def last_used(self, last_used):
            """Sets the last_used of this TokenBriefDto.
    
    
            :param last_used: The last_used of this TokenBriefDto.  # noqa: E501
            :type: datetime
            """
    
            self._last_used = last_used
    
        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(TokenBriefDto, 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, TokenBriefDto):
                return False
    
            return self.__dict__ == other.__dict__
    
        def __ne__(self, other):
            """Returns true if both objects are not equal"""
            return not self == other