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

related_identifier_dto.py

Blame
  • Martin Weise's avatar
    177edbc3
    History
    related_identifier_dto.py 7.72 KiB
    # coding: utf-8
    
    """
        Database Repository Identifier Service API
    
        Service that manages the identifiers  # 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 RelatedIdentifierDto(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',
            'value': 'str',
            'type': 'str',
            'relation': 'str',
            'created': 'datetime',
            'last_modified': 'datetime'
        }
    
        attribute_map = {
            'id': 'id',
            'value': 'value',
            'type': 'type',
            'relation': 'relation',
            'created': 'created',
            'last_modified': 'last_modified'
        }
    
        def __init__(self, id=None, value=None, type=None, relation=None, created=None, last_modified=None):  # noqa: E501
            """RelatedIdentifierDto - a model defined in Swagger"""  # noqa: E501
            self._id = None
            self._value = None
            self._type = None
            self._relation = None
            self._created = None
            self._last_modified = None
            self.discriminator = None
            self.id = id
            self.value = value
            if type is not None:
                self.type = type
            if relation is not None:
                self.relation = relation
            self.created = created
            if last_modified is not None:
                self.last_modified = last_modified
    
        @property
        def id(self):
            """Gets the id of this RelatedIdentifierDto.  # noqa: E501
    
    
            :return: The id of this RelatedIdentifierDto.  # noqa: E501
            :rtype: int
            """
            return self._id
    
        @id.setter
        def id(self, id):
            """Sets the id of this RelatedIdentifierDto.
    
    
            :param id: The id of this RelatedIdentifierDto.  # 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 value(self):
            """Gets the value of this RelatedIdentifierDto.  # noqa: E501
    
    
            :return: The value of this RelatedIdentifierDto.  # noqa: E501
            :rtype: str
            """
            return self._value
    
        @value.setter
        def value(self, value):
            """Sets the value of this RelatedIdentifierDto.
    
    
            :param value: The value of this RelatedIdentifierDto.  # noqa: E501
            :type: str
            """
            if value is None:
                raise ValueError("Invalid value for `value`, must not be `None`")  # noqa: E501
    
            self._value = value
    
        @property
        def type(self):
            """Gets the type of this RelatedIdentifierDto.  # noqa: E501
    
    
            :return: The type of this RelatedIdentifierDto.  # noqa: E501
            :rtype: str
            """
            return self._type
    
        @type.setter
        def type(self, type):
            """Sets the type of this RelatedIdentifierDto.
    
    
            :param type: The type of this RelatedIdentifierDto.  # noqa: E501
            :type: str
            """
            allowed_values = ["DOI", "URL", "URN", "ARK", "arXiv", "bibcode", "EAN13", "EISSN", "Handle", "IGSN", "ISBN", "ISTC", "LISSN", "LSID", "PMID", "PURL", "UPC", "w3id"]  # noqa: E501
            if type not in allowed_values:
                raise ValueError(
                    "Invalid value for `type` ({0}), must be one of {1}"  # noqa: E501
                    .format(type, allowed_values)
                )
    
            self._type = type
    
        @property
        def relation(self):
            """Gets the relation of this RelatedIdentifierDto.  # noqa: E501
    
    
            :return: The relation of this RelatedIdentifierDto.  # noqa: E501
            :rtype: str
            """
            return self._relation
    
        @relation.setter
        def relation(self, relation):
            """Sets the relation of this RelatedIdentifierDto.
    
    
            :param relation: The relation of this RelatedIdentifierDto.  # noqa: E501
            :type: str
            """
            allowed_values = ["IsCitedBy", "Cites", "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", "IsDescribedBy", "Describes", "HasMetadata", "IsMetadataFor", "HasVersion", "IsVersionOf", "IsNewVersionOf", "IsPreviousVersionOf", "IsPartOf", "HasPart", "IsPublishedIn", "IsReferencedBy", "References", "IsDocumentedBy", "Documents", "IsCompiledBy", "Compiles", "IsVariantFormOf", "IsOriginalFormOf", "IsIdenticalTo", "IsReviewedBy", "Reviews", "IsDerivedFrom", "IsSourceOf", "IsRequiredBy", "Requires", "IsObsoletedBy", "Obsoletes"]  # noqa: E501
            if relation not in allowed_values:
                raise ValueError(
                    "Invalid value for `relation` ({0}), must be one of {1}"  # noqa: E501
                    .format(relation, allowed_values)
                )
    
            self._relation = relation
    
        @property
        def created(self):
            """Gets the created of this RelatedIdentifierDto.  # noqa: E501
    
    
            :return: The created of this RelatedIdentifierDto.  # noqa: E501
            :rtype: datetime
            """
            return self._created
    
        @created.setter
        def created(self, created):
            """Sets the created of this RelatedIdentifierDto.
    
    
            :param created: The created of this RelatedIdentifierDto.  # 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 last_modified(self):
            """Gets the last_modified of this RelatedIdentifierDto.  # noqa: E501
    
    
            :return: The last_modified of this RelatedIdentifierDto.  # noqa: E501
            :rtype: datetime
            """
            return self._last_modified
    
        @last_modified.setter
        def last_modified(self, last_modified):
            """Sets the last_modified of this RelatedIdentifierDto.
    
    
            :param last_modified: The last_modified of this RelatedIdentifierDto.  # noqa: E501
            :type: datetime
            """
    
            self._last_modified = last_modified
    
        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(RelatedIdentifierDto, 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, RelatedIdentifierDto):
                return False
    
            return self.__dict__ == other.__dict__
    
        def __ne__(self, other):
            """Returns true if both objects are not equal"""
            return not self == other