# coding: utf-8

"""
    Tator REST API

    Interface to the Tator backend.  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from ..configuration import Configuration


class MediaStats(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 = {
        'count': 'int',
        'download_size': 'int',
        'duration': 'float',
        'total_size': 'int'
    }

    attribute_map = {
        'count': 'count',
        'download_size': 'download_size',
        'duration': 'duration',
        'total_size': 'total_size'
    }

    def __init__(self, count=None, download_size=None, duration=None, total_size=None, local_vars_configuration=None):  # noqa: E501
        """MediaStats - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._count = None
        self._download_size = None
        self._duration = None
        self._total_size = None
        self.discriminator = None

        if count is not None:
            self.count = count
        if download_size is not None:
            self.download_size = download_size
        if duration is not None:
            self.duration = duration
        if total_size is not None:
            self.total_size = total_size

    @property
    def count(self):
        """

        :return: The count of this MediaStats. 
        :rtype: int
        """
        return self._count

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

        :param count: The count of this MediaStats.
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                count is not None and count < 0):  # noqa: E501
            raise ValueError("Invalid value for `count`, must be a value greater than or equal to `0`")  # noqa: E501

        self._count = count

    @property
    def download_size(self):
        """

        :return: The download_size of this MediaStats. 
        :rtype: int
        """
        return self._download_size

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

        :param download_size: The download_size of this MediaStats.
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                download_size is not None and download_size < 0):  # noqa: E501
            raise ValueError("Invalid value for `download_size`, must be a value greater than or equal to `0`")  # noqa: E501

        self._download_size = download_size

    @property
    def duration(self):
        """

        :return: The duration of this MediaStats. 
        :rtype: float
        """
        return self._duration

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

        :param duration: The duration of this MediaStats.
        :type: float
        """
        if (self.local_vars_configuration.client_side_validation and
                duration is not None and duration < 0):  # noqa: E501
            raise ValueError("Invalid value for `duration`, must be a value greater than or equal to `0`")  # noqa: E501

        self._duration = duration

    @property
    def total_size(self):
        """

        :return: The total_size of this MediaStats. 
        :rtype: int
        """
        return self._total_size

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

        :param total_size: The total_size of this MediaStats.
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                total_size is not None and total_size < 0):  # noqa: E501
            raise ValueError("Invalid value for `total_size`, must be a value greater than or equal to `0`")  # noqa: E501

        self._total_size = total_size

    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, MediaStats):
            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, MediaStats):
            return True

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