# coding: utf-8

"""
    Tator REST API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 1.6.5
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from ..configuration import Configuration


class Media(object):
    """
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'archive_state': 'str',
        'archive_status_date': 'datetime',
        'attributes': 'dict(str, object)',
        'codec': 'str',
        'created_by': 'int',
        'created_datetime': 'str',
        'effective_permission': 'int',
        'elemental_id': 'str',
        'fps': 'float',
        'gid': 'str',
        'height': 'int',
        'id': 'int',
        'incident': 'int',
        'last_edit_end': 'datetime',
        'last_edit_start': 'datetime',
        'master_section': 'int',
        'md5': 'str',
        'media_files': 'MediaFiles',
        'modified_by': 'int',
        'modified_datetime': 'str',
        'name': 'str',
        'num_frames': 'int',
        'primary_section': 'int',
        'project': 'int',
        'summary_level': 'int',
        'type': 'int',
        'uid': 'str',
        'width': 'int'
    }

    attribute_map = {
        'archive_state': 'archive_state',
        'archive_status_date': 'archive_status_date',
        'attributes': 'attributes',
        'codec': 'codec',
        'created_by': 'created_by',
        'created_datetime': 'created_datetime',
        'effective_permission': 'effective_permission',
        'elemental_id': 'elemental_id',
        'fps': 'fps',
        'gid': 'gid',
        'height': 'height',
        'id': 'id',
        'incident': 'incident',
        'last_edit_end': 'last_edit_end',
        'last_edit_start': 'last_edit_start',
        'master_section': 'master_section',
        'md5': 'md5',
        'media_files': 'media_files',
        'modified_by': 'modified_by',
        'modified_datetime': 'modified_datetime',
        'name': 'name',
        'num_frames': 'num_frames',
        'primary_section': 'primary_section',
        'project': 'project',
        'summary_level': 'summary_level',
        'type': 'type',
        'uid': 'uid',
        'width': 'width'
    }

    def __init__(self, archive_state=None, archive_status_date=None, attributes=None, codec=None, created_by=None, created_datetime=None, effective_permission=None, elemental_id=None, fps=None, gid=None, height=None, id=None, incident=None, last_edit_end=None, last_edit_start=None, master_section=None, md5=None, media_files=None, modified_by=None, modified_datetime=None, name=None, num_frames=None, primary_section=None, project=None, summary_level=None, type=None, uid=None, width=None, local_vars_configuration=None):  # noqa: E501
        """Media - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._archive_state = None
        self._archive_status_date = None
        self._attributes = None
        self._codec = None
        self._created_by = None
        self._created_datetime = None
        self._effective_permission = None
        self._elemental_id = None
        self._fps = None
        self._gid = None
        self._height = None
        self._id = None
        self._incident = None
        self._last_edit_end = None
        self._last_edit_start = None
        self._master_section = None
        self._md5 = None
        self._media_files = None
        self._modified_by = None
        self._modified_datetime = None
        self._name = None
        self._num_frames = None
        self._primary_section = None
        self._project = None
        self._summary_level = None
        self._type = None
        self._uid = None
        self._width = None
        self.discriminator = None

        if archive_state is not None:
            self.archive_state = archive_state
        if archive_status_date is not None:
            self.archive_status_date = archive_status_date
        if attributes is not None:
            self.attributes = attributes
        if codec is not None:
            self.codec = codec
        if created_by is not None:
            self.created_by = created_by
        if created_datetime is not None:
            self.created_datetime = created_datetime
        self.effective_permission = effective_permission
        self.elemental_id = elemental_id
        if fps is not None:
            self.fps = fps
        if gid is not None:
            self.gid = gid
        if height is not None:
            self.height = height
        if id is not None:
            self.id = id
        self.incident = incident
        if last_edit_end is not None:
            self.last_edit_end = last_edit_end
        if last_edit_start is not None:
            self.last_edit_start = last_edit_start
        if master_section is not None:
            self.master_section = master_section
        if md5 is not None:
            self.md5 = md5
        if media_files is not None:
            self.media_files = media_files
        if modified_by is not None:
            self.modified_by = modified_by
        if modified_datetime is not None:
            self.modified_datetime = modified_datetime
        if name is not None:
            self.name = name
        if num_frames is not None:
            self.num_frames = num_frames
        if primary_section is not None:
            self.primary_section = primary_section
        if project is not None:
            self.project = project
        if summary_level is not None:
            self.summary_level = summary_level
        if type is not None:
            self.type = type
        if uid is not None:
            self.uid = uid
        if width is not None:
            self.width = width

    @property
    def archive_state(self):
        """
        The current archival state of the media.

        :return: The archive_state of this Media. 
        :rtype: str
        """
        return self._archive_state

    @archive_state.setter
    def archive_state(self, archive_state):
        """
        The current archival state of the media.

        :param archive_state: The archive_state of this Media.
        :type: str
        """
        allowed_values = ["archived", "to_archive", "live", "to_live"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and archive_state not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `archive_state` ({0}), must be one of {1}"  # noqa: E501
                .format(archive_state, allowed_values)
            )

        self._archive_state = archive_state

    @property
    def archive_status_date(self):
        """
        Datetime of the last change to the `archive_state` field.

        :return: The archive_status_date of this Media. 
        :rtype: datetime
        """
        return self._archive_status_date

    @archive_status_date.setter
    def archive_status_date(self, archive_status_date):
        """
        Datetime of the last change to the `archive_state` field.

        :param archive_status_date: The archive_status_date of this Media.
        :type: datetime
        """

        self._archive_status_date = archive_status_date

    @property
    def attributes(self):
        """
        Object containing attribute values.

        :return: The attributes of this Media. 
        :rtype: dict(str, object)
        """
        return self._attributes

    @attributes.setter
    def attributes(self, attributes):
        """
        Object containing attribute values.

        :param attributes: The attributes of this Media.
        :type: dict(str, object)
        """

        self._attributes = attributes

    @property
    def codec(self):
        """
        Codec for videos.

        :return: The codec of this Media. 
        :rtype: str
        """
        return self._codec

    @codec.setter
    def codec(self, codec):
        """
        Codec for videos.

        :param codec: The codec of this Media.
        :type: str
        """

        self._codec = codec

    @property
    def created_by(self):
        """
        Unique integer identifying user who created this media.

        :return: The created_by of this Media. 
        :rtype: int
        """
        return self._created_by

    @created_by.setter
    def created_by(self, created_by):
        """
        Unique integer identifying user who created this media.

        :param created_by: The created_by of this Media.
        :type: int
        """

        self._created_by = created_by

    @property
    def created_datetime(self):
        """
        Datetime when this media was created.

        :return: The created_datetime of this Media. 
        :rtype: str
        """
        return self._created_datetime

    @created_datetime.setter
    def created_datetime(self, created_datetime):
        """
        Datetime when this media was created.

        :param created_datetime: The created_datetime of this Media.
        :type: str
        """

        self._created_datetime = created_datetime

    @property
    def effective_permission(self):
        """
        Calculated permission for this value

        :return: The effective_permission of this Media. 
        :rtype: int
        """
        return self._effective_permission

    @effective_permission.setter
    def effective_permission(self, effective_permission):
        """
        Calculated permission for this value

        :param effective_permission: The effective_permission of this Media.
        :type: int
        """

        self._effective_permission = effective_permission

    @property
    def elemental_id(self):
        """
        The elemental ID of the object.

        :return: The elemental_id of this Media. 
        :rtype: str
        """
        return self._elemental_id

    @elemental_id.setter
    def elemental_id(self, elemental_id):
        """
        The elemental ID of the object.

        :param elemental_id: The elemental_id of this Media.
        :type: str
        """

        self._elemental_id = elemental_id

    @property
    def fps(self):
        """
        Frame rate for videos.

        :return: The fps of this Media. 
        :rtype: float
        """
        return self._fps

    @fps.setter
    def fps(self, fps):
        """
        Frame rate for videos.

        :param fps: The fps of this Media.
        :type: float
        """

        self._fps = fps

    @property
    def gid(self):
        """
        Group ID for the upload group of this media.

        :return: The gid of this Media. 
        :rtype: str
        """
        return self._gid

    @gid.setter
    def gid(self, gid):
        """
        Group ID for the upload group of this media.

        :param gid: The gid of this Media.
        :type: str
        """

        self._gid = gid

    @property
    def height(self):
        """
        Vertical resolution in pixels.

        :return: The height of this Media. 
        :rtype: int
        """
        return self._height

    @height.setter
    def height(self, height):
        """
        Vertical resolution in pixels.

        :param height: The height of this Media.
        :type: int
        """

        self._height = height

    @property
    def id(self):
        """
        Unique integer identifying this media.

        :return: The id of this Media. 
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Unique integer identifying this media.

        :param id: The id of this Media.
        :type: int
        """

        self._id = id

    @property
    def incident(self):
        """
        If doing a related search, will contain the number of matching metadata hits in this media.

        :return: The incident of this Media. 
        :rtype: int
        """
        return self._incident

    @incident.setter
    def incident(self, incident):
        """
        If doing a related search, will contain the number of matching metadata hits in this media.

        :param incident: The incident of this Media.
        :type: int
        """

        self._incident = incident

    @property
    def last_edit_end(self):
        """
        Datetime of the end of the session when this media or its annotations were last edited.

        :return: The last_edit_end of this Media. 
        :rtype: datetime
        """
        return self._last_edit_end

    @last_edit_end.setter
    def last_edit_end(self, last_edit_end):
        """
        Datetime of the end of the session when this media or its annotations were last edited.

        :param last_edit_end: The last_edit_end of this Media.
        :type: datetime
        """

        self._last_edit_end = last_edit_end

    @property
    def last_edit_start(self):
        """
        Datetime of the start of the session when this media or its annotations were last edited.

        :return: The last_edit_start of this Media. 
        :rtype: datetime
        """
        return self._last_edit_start

    @last_edit_start.setter
    def last_edit_start(self, last_edit_start):
        """
        Datetime of the start of the session when this media or its annotations were last edited.

        :param last_edit_start: The last_edit_start of this Media.
        :type: datetime
        """

        self._last_edit_start = last_edit_start

    @property
    def master_section(self):
        """
        Unique ID to define the ACL origin of this object. If not set defaults to the master section of the primary_section.

        :return: The master_section of this Media. 
        :rtype: int
        """
        return self._master_section

    @master_section.setter
    def master_section(self, master_section):
        """
        Unique ID to define the ACL origin of this object. If not set defaults to the master section of the primary_section.

        :param master_section: The master_section of this Media.
        :type: int
        """

        self._master_section = master_section

    @property
    def md5(self):
        """
        MD5 checksum of the media file.

        :return: The md5 of this Media. 
        :rtype: str
        """
        return self._md5

    @md5.setter
    def md5(self, md5):
        """
        MD5 checksum of the media file.

        :param md5: The md5 of this Media.
        :type: str
        """

        self._md5 = md5

    @property
    def media_files(self):
        """

        :return: The media_files of this Media. 
        :rtype: MediaFiles
        """
        return self._media_files

    @media_files.setter
    def media_files(self, media_files):
        """

        :param media_files: The media_files of this Media.
        :type: MediaFiles
        """

        self._media_files = media_files

    @property
    def modified_by(self):
        """
        Unique integer identifying user who last modified this media.

        :return: The modified_by of this Media. 
        :rtype: int
        """
        return self._modified_by

    @modified_by.setter
    def modified_by(self, modified_by):
        """
        Unique integer identifying user who last modified this media.

        :param modified_by: The modified_by of this Media.
        :type: int
        """

        self._modified_by = modified_by

    @property
    def modified_datetime(self):
        """
        Datetime when this media was last modified.

        :return: The modified_datetime of this Media. 
        :rtype: str
        """
        return self._modified_datetime

    @modified_datetime.setter
    def modified_datetime(self, modified_datetime):
        """
        Datetime when this media was last modified.

        :param modified_datetime: The modified_datetime of this Media.
        :type: str
        """

        self._modified_datetime = modified_datetime

    @property
    def name(self):
        """
        Name of the media.

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

    @name.setter
    def name(self, name):
        """
        Name of the media.

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

        self._name = name

    @property
    def num_frames(self):
        """
        Number of frames for videos.

        :return: The num_frames of this Media. 
        :rtype: int
        """
        return self._num_frames

    @num_frames.setter
    def num_frames(self, num_frames):
        """
        Number of frames for videos.

        :param num_frames: The num_frames of this Media.
        :type: int
        """

        self._num_frames = num_frames

    @property
    def primary_section(self):
        """
        Unique ID for folder section containing this media, if any. When patching, use -1 to indicate no section.

        :return: The primary_section of this Media. 
        :rtype: int
        """
        return self._primary_section

    @primary_section.setter
    def primary_section(self, primary_section):
        """
        Unique ID for folder section containing this media, if any. When patching, use -1 to indicate no section.

        :param primary_section: The primary_section of this Media.
        :type: int
        """

        self._primary_section = primary_section

    @property
    def project(self):
        """
        Unique integer identifying project of this media.

        :return: The project of this Media. 
        :rtype: int
        """
        return self._project

    @project.setter
    def project(self, project):
        """
        Unique integer identifying project of this media.

        :param project: The project of this Media.
        :type: int
        """

        self._project = project

    @property
    def summary_level(self):
        """
        If supplied, this video is best summarized at this frame interval

        :return: The summary_level of this Media. 
        :rtype: int
        """
        return self._summary_level

    @summary_level.setter
    def summary_level(self, summary_level):
        """
        If supplied, this video is best summarized at this frame interval

        :param summary_level: The summary_level of this Media.
        :type: int
        """

        self._summary_level = summary_level

    @property
    def type(self):
        """
        Unique integer identifying entity type of this media.

        :return: The type of this Media. 
        :rtype: int
        """
        return self._type

    @type.setter
    def type(self, type):
        """
        Unique integer identifying entity type of this media.

        :param type: The type of this Media.
        :type: int
        """

        self._type = type

    @property
    def uid(self):
        """
        Unique ID for the upload of this media.

        :return: The uid of this Media. 
        :rtype: str
        """
        return self._uid

    @uid.setter
    def uid(self, uid):
        """
        Unique ID for the upload of this media.

        :param uid: The uid of this Media.
        :type: str
        """

        self._uid = uid

    @property
    def width(self):
        """
        Horizontal resolution in pixels.

        :return: The width of this Media. 
        :rtype: int
        """
        return self._width

    @width.setter
    def width(self, width):
        """
        Horizontal resolution in pixels.

        :param width: The width of this Media.
        :type: int
        """

        self._width = width

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_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

        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, Media):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, Media):
            return True

        return self.to_dict() != other.to_dict()
