# coding: utf-8

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

from typing import List, Dict  # noqa: F401

from openapi_server.models.base_model_ import Model
from openapi_server.models.access_method import AccessMethod
from openapi_server.models.checksum import Checksum
from openapi_server.models.contents_object import ContentsObject
from openapi_server import util

from openapi_server.models.access_method import AccessMethod  # noqa: E501
from openapi_server.models.checksum import Checksum  # noqa: E501
from openapi_server.models.contents_object import ContentsObject  # noqa: E501

class DrsObject(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, id=None, name=None, self_uri=None, size=None, created_time=None, updated_time=None, version=None, mime_type=None, checksums=None, access_methods=None, contents=None, description=None, aliases=None):  # noqa: E501
        """DrsObject - a model defined in OpenAPI

        :param id: The id of this DrsObject.  # noqa: E501
        :type id: str
        :param name: The name of this DrsObject.  # noqa: E501
        :type name: str
        :param self_uri: The self_uri of this DrsObject.  # noqa: E501
        :type self_uri: str
        :param size: The size of this DrsObject.  # noqa: E501
        :type size: int
        :param created_time: The created_time of this DrsObject.  # noqa: E501
        :type created_time: datetime
        :param updated_time: The updated_time of this DrsObject.  # noqa: E501
        :type updated_time: datetime
        :param version: The version of this DrsObject.  # noqa: E501
        :type version: str
        :param mime_type: The mime_type of this DrsObject.  # noqa: E501
        :type mime_type: str
        :param checksums: The checksums of this DrsObject.  # noqa: E501
        :type checksums: List[Checksum]
        :param access_methods: The access_methods of this DrsObject.  # noqa: E501
        :type access_methods: List[AccessMethod]
        :param contents: The contents of this DrsObject.  # noqa: E501
        :type contents: List[ContentsObject]
        :param description: The description of this DrsObject.  # noqa: E501
        :type description: str
        :param aliases: The aliases of this DrsObject.  # noqa: E501
        :type aliases: List[str]
        """
        self.openapi_types = {
            'id': str,
            'name': str,
            'self_uri': str,
            'size': int,
            'created_time': datetime,
            'updated_time': datetime,
            'version': str,
            'mime_type': str,
            'checksums': List[Checksum],
            'access_methods': List[AccessMethod],
            'contents': List[ContentsObject],
            'description': str,
            'aliases': List[str]
        }

        self.attribute_map = {
            'id': 'id',
            'name': 'name',
            'self_uri': 'self_uri',
            'size': 'size',
            'created_time': 'created_time',
            'updated_time': 'updated_time',
            'version': 'version',
            'mime_type': 'mime_type',
            'checksums': 'checksums',
            'access_methods': 'access_methods',
            'contents': 'contents',
            'description': 'description',
            'aliases': 'aliases'
        }

        self._id = id
        self._name = name
        self._self_uri = self_uri
        self._size = size
        self._created_time = created_time
        self._updated_time = updated_time
        self._version = version
        self._mime_type = mime_type
        self._checksums = checksums
        self._access_methods = access_methods
        self._contents = contents
        self._description = description
        self._aliases = aliases

    @classmethod
    def from_dict(cls, dikt) -> 'DrsObject':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The DrsObject of this DrsObject.  # noqa: E501
        :rtype: DrsObject
        """
        return util.deserialize_model(dikt, cls)

    @property
    def id(self):
        """Gets the id of this DrsObject.

        An identifier unique to this `DrsObject`.  # noqa: E501

        :return: The id of this DrsObject.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this DrsObject.

        An identifier unique to this `DrsObject`.  # noqa: E501

        :param id: The id of this DrsObject.
        :type id: str
        """
        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

    @property
    def name(self):
        """Gets the name of this DrsObject.

        A string that can be used to name a `DrsObject`. This string is made up of uppercase and lowercase letters, decimal digits, hypen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].  # noqa: E501

        :return: The name of this DrsObject.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this DrsObject.

        A string that can be used to name a `DrsObject`. This string is made up of uppercase and lowercase letters, decimal digits, hypen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].  # noqa: E501

        :param name: The name of this DrsObject.
        :type name: str
        """

        self._name = name

    @property
    def self_uri(self):
        """Gets the self_uri of this DrsObject.

        A drs:// hostname-based URI, as defined in the DRS documentation, that tells clients how to access this object. The intent of this field is to make DRS objects self-contained, and therefore easier for clients to store and pass around.  For example, if you arrive at this DRS JSON by resolving a compact identifier-based DRS URI, the `self_uri` presents you with a hostname and properly encoded DRS ID for use in subsequent `access` endpoint calls.  # noqa: E501

        :return: The self_uri of this DrsObject.
        :rtype: str
        """
        return self._self_uri

    @self_uri.setter
    def self_uri(self, self_uri):
        """Sets the self_uri of this DrsObject.

        A drs:// hostname-based URI, as defined in the DRS documentation, that tells clients how to access this object. The intent of this field is to make DRS objects self-contained, and therefore easier for clients to store and pass around.  For example, if you arrive at this DRS JSON by resolving a compact identifier-based DRS URI, the `self_uri` presents you with a hostname and properly encoded DRS ID for use in subsequent `access` endpoint calls.  # noqa: E501

        :param self_uri: The self_uri of this DrsObject.
        :type self_uri: str
        """
        if self_uri is None:
            raise ValueError("Invalid value for `self_uri`, must not be `None`")  # noqa: E501

        self._self_uri = self_uri

    @property
    def size(self):
        """Gets the size of this DrsObject.

        For blobs, the blob size in bytes. For bundles, the cumulative size, in bytes, of items in the `contents` field.  # noqa: E501

        :return: The size of this DrsObject.
        :rtype: int
        """
        return self._size

    @size.setter
    def size(self, size):
        """Sets the size of this DrsObject.

        For blobs, the blob size in bytes. For bundles, the cumulative size, in bytes, of items in the `contents` field.  # noqa: E501

        :param size: The size of this DrsObject.
        :type size: int
        """
        if size is None:
            raise ValueError("Invalid value for `size`, must not be `None`")  # noqa: E501

        self._size = size

    @property
    def created_time(self):
        """Gets the created_time of this DrsObject.

        Timestamp of content creation in RFC3339. (This is the creation time of the underlying content, not of the JSON object.)  # noqa: E501

        :return: The created_time of this DrsObject.
        :rtype: datetime
        """
        return self._created_time

    @created_time.setter
    def created_time(self, created_time):
        """Sets the created_time of this DrsObject.

        Timestamp of content creation in RFC3339. (This is the creation time of the underlying content, not of the JSON object.)  # noqa: E501

        :param created_time: The created_time of this DrsObject.
        :type created_time: datetime
        """
        if created_time is None:
            raise ValueError("Invalid value for `created_time`, must not be `None`")  # noqa: E501

        self._created_time = created_time

    @property
    def updated_time(self):
        """Gets the updated_time of this DrsObject.

        Timestamp of content update in RFC3339, identical to `created_time` in systems that do not support updates. (This is the update time of the underlying content, not of the JSON object.)  # noqa: E501

        :return: The updated_time of this DrsObject.
        :rtype: datetime
        """
        return self._updated_time

    @updated_time.setter
    def updated_time(self, updated_time):
        """Sets the updated_time of this DrsObject.

        Timestamp of content update in RFC3339, identical to `created_time` in systems that do not support updates. (This is the update time of the underlying content, not of the JSON object.)  # noqa: E501

        :param updated_time: The updated_time of this DrsObject.
        :type updated_time: datetime
        """

        self._updated_time = updated_time

    @property
    def version(self):
        """Gets the version of this DrsObject.

        A string representing a version. (Some systems may use checksum, a RFC3339 timestamp, or an incrementing version number.)  # noqa: E501

        :return: The version of this DrsObject.
        :rtype: str
        """
        return self._version

    @version.setter
    def version(self, version):
        """Sets the version of this DrsObject.

        A string representing a version. (Some systems may use checksum, a RFC3339 timestamp, or an incrementing version number.)  # noqa: E501

        :param version: The version of this DrsObject.
        :type version: str
        """

        self._version = version

    @property
    def mime_type(self):
        """Gets the mime_type of this DrsObject.

        A string providing the mime-type of the `DrsObject`.  # noqa: E501

        :return: The mime_type of this DrsObject.
        :rtype: str
        """
        return self._mime_type

    @mime_type.setter
    def mime_type(self, mime_type):
        """Sets the mime_type of this DrsObject.

        A string providing the mime-type of the `DrsObject`.  # noqa: E501

        :param mime_type: The mime_type of this DrsObject.
        :type mime_type: str
        """

        self._mime_type = mime_type

    @property
    def checksums(self):
        """Gets the checksums of this DrsObject.

        The checksum of the `DrsObject`. At least one checksum must be provided. For blobs, the checksum is computed over the bytes in the blob.  For bundles, the checksum is computed over a sorted concatenation of the checksums of its top-level contained objects (not recursive, names not included). The list of checksums is sorted alphabetically (hex-code) before concatenation and a further checksum is performed on the concatenated checksum value.  For example, if a bundle contains blobs with the following checksums: md5(blob1) = 72794b6d md5(blob2) = 5e089d29  Then the checksum of the bundle is: md5( concat( sort( md5(blob1), md5(blob2) ) ) ) = md5( concat( sort( 72794b6d, 5e089d29 ) ) ) = md5( concat( 5e089d29, 72794b6d ) ) = md5( 5e089d2972794b6d ) = f7a29a04  # noqa: E501

        :return: The checksums of this DrsObject.
        :rtype: List[Checksum]
        """
        return self._checksums

    @checksums.setter
    def checksums(self, checksums):
        """Sets the checksums of this DrsObject.

        The checksum of the `DrsObject`. At least one checksum must be provided. For blobs, the checksum is computed over the bytes in the blob.  For bundles, the checksum is computed over a sorted concatenation of the checksums of its top-level contained objects (not recursive, names not included). The list of checksums is sorted alphabetically (hex-code) before concatenation and a further checksum is performed on the concatenated checksum value.  For example, if a bundle contains blobs with the following checksums: md5(blob1) = 72794b6d md5(blob2) = 5e089d29  Then the checksum of the bundle is: md5( concat( sort( md5(blob1), md5(blob2) ) ) ) = md5( concat( sort( 72794b6d, 5e089d29 ) ) ) = md5( concat( 5e089d29, 72794b6d ) ) = md5( 5e089d2972794b6d ) = f7a29a04  # noqa: E501

        :param checksums: The checksums of this DrsObject.
        :type checksums: List[Checksum]
        """
        if checksums is None:
            raise ValueError("Invalid value for `checksums`, must not be `None`")  # noqa: E501
        if checksums is not None and len(checksums) < 1:
            raise ValueError("Invalid value for `checksums`, number of items must be greater than or equal to `1`")  # noqa: E501

        self._checksums = checksums

    @property
    def access_methods(self):
        """Gets the access_methods of this DrsObject.

        The list of access methods that can be used to fetch the `DrsObject`. Required for single blobs; optional for bundles.  # noqa: E501

        :return: The access_methods of this DrsObject.
        :rtype: List[AccessMethod]
        """
        return self._access_methods

    @access_methods.setter
    def access_methods(self, access_methods):
        """Sets the access_methods of this DrsObject.

        The list of access methods that can be used to fetch the `DrsObject`. Required for single blobs; optional for bundles.  # noqa: E501

        :param access_methods: The access_methods of this DrsObject.
        :type access_methods: List[AccessMethod]
        """
        if access_methods is not None and len(access_methods) < 1:
            raise ValueError("Invalid value for `access_methods`, number of items must be greater than or equal to `1`")  # noqa: E501

        self._access_methods = access_methods

    @property
    def contents(self):
        """Gets the contents of this DrsObject.

        If not set, this `DrsObject` is a single blob. If set, this `DrsObject` is a bundle containing the listed `ContentsObject` s (some of which may be further nested).  # noqa: E501

        :return: The contents of this DrsObject.
        :rtype: List[ContentsObject]
        """
        return self._contents

    @contents.setter
    def contents(self, contents):
        """Sets the contents of this DrsObject.

        If not set, this `DrsObject` is a single blob. If set, this `DrsObject` is a bundle containing the listed `ContentsObject` s (some of which may be further nested).  # noqa: E501

        :param contents: The contents of this DrsObject.
        :type contents: List[ContentsObject]
        """

        self._contents = contents

    @property
    def description(self):
        """Gets the description of this DrsObject.

        A human readable description of the `DrsObject`.  # noqa: E501

        :return: The description of this DrsObject.
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this DrsObject.

        A human readable description of the `DrsObject`.  # noqa: E501

        :param description: The description of this DrsObject.
        :type description: str
        """

        self._description = description

    @property
    def aliases(self):
        """Gets the aliases of this DrsObject.

        A list of strings that can be used to find other metadata about this `DrsObject` from external metadata sources. These aliases can be used to represent secondary accession numbers or external GUIDs.  # noqa: E501

        :return: The aliases of this DrsObject.
        :rtype: List[str]
        """
        return self._aliases

    @aliases.setter
    def aliases(self, aliases):
        """Sets the aliases of this DrsObject.

        A list of strings that can be used to find other metadata about this `DrsObject` from external metadata sources. These aliases can be used to represent secondary accession numbers or external GUIDs.  # noqa: E501

        :param aliases: The aliases of this DrsObject.
        :type aliases: List[str]
        """

        self._aliases = aliases
