# coding: utf-8

"""
    Mux API

    Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.  # noqa: E501

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


import inspect
import pprint
import re  # noqa: F401
import six

from mux_python.configuration import Configuration


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

    Do not edit the class manually.
    """

    """
    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 = {
        'id': 'str',
        'timeout': 'int',
        'status': 'str',
        'new_asset_settings': 'Asset',
        'asset_id': 'str',
        'error': 'UploadError',
        'cors_origin': 'str',
        'url': 'str',
        'test': 'bool'
    }

    attribute_map = {
        'id': 'id',
        'timeout': 'timeout',
        'status': 'status',
        'new_asset_settings': 'new_asset_settings',
        'asset_id': 'asset_id',
        'error': 'error',
        'cors_origin': 'cors_origin',
        'url': 'url',
        'test': 'test'
    }

    def __init__(self, id=None, timeout=3600, status=None, new_asset_settings=None, asset_id=None, error=None, cors_origin=None, url=None, test=None, local_vars_configuration=None):  # noqa: E501
        """Upload - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._timeout = None
        self._status = None
        self._new_asset_settings = None
        self._asset_id = None
        self._error = None
        self._cors_origin = None
        self._url = None
        self._test = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if timeout is not None:
            self.timeout = timeout
        if status is not None:
            self.status = status
        if new_asset_settings is not None:
            self.new_asset_settings = new_asset_settings
        if asset_id is not None:
            self.asset_id = asset_id
        if error is not None:
            self.error = error
        if cors_origin is not None:
            self.cors_origin = cors_origin
        if url is not None:
            self.url = url
        if test is not None:
            self.test = test

    @property
    def id(self):
        """Gets the id of this Upload.  # noqa: E501

        Unique identifier for the Direct Upload.  # noqa: E501

        :return: The id of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._id

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

        Unique identifier for the Direct Upload.  # noqa: E501

        :param id: The id of this Upload.  # noqa: E501
        :type id: str
        """

        self._id = id

    @property
    def timeout(self):
        """Gets the timeout of this Upload.  # noqa: E501

        Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out`  # noqa: E501

        :return: The timeout of this Upload.  # noqa: E501
        :rtype: int
        """
        return self._timeout

    @timeout.setter
    def timeout(self, timeout):
        """Sets the timeout of this Upload.

        Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out`  # noqa: E501

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

        self._timeout = timeout

    @property
    def status(self):
        """Gets the status of this Upload.  # noqa: E501


        :return: The status of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this Upload.


        :param status: The status of this Upload.  # noqa: E501
        :type status: str
        """
        allowed_values = ["waiting", "asset_created", "errored", "cancelled", "timed_out"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and status not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )

        self._status = status

    @property
    def new_asset_settings(self):
        """Gets the new_asset_settings of this Upload.  # noqa: E501


        :return: The new_asset_settings of this Upload.  # noqa: E501
        :rtype: Asset
        """
        return self._new_asset_settings

    @new_asset_settings.setter
    def new_asset_settings(self, new_asset_settings):
        """Sets the new_asset_settings of this Upload.


        :param new_asset_settings: The new_asset_settings of this Upload.  # noqa: E501
        :type new_asset_settings: Asset
        """

        self._new_asset_settings = new_asset_settings

    @property
    def asset_id(self):
        """Gets the asset_id of this Upload.  # noqa: E501

        Only set once the upload is in the `asset_created` state.  # noqa: E501

        :return: The asset_id of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._asset_id

    @asset_id.setter
    def asset_id(self, asset_id):
        """Sets the asset_id of this Upload.

        Only set once the upload is in the `asset_created` state.  # noqa: E501

        :param asset_id: The asset_id of this Upload.  # noqa: E501
        :type asset_id: str
        """

        self._asset_id = asset_id

    @property
    def error(self):
        """Gets the error of this Upload.  # noqa: E501


        :return: The error of this Upload.  # noqa: E501
        :rtype: UploadError
        """
        return self._error

    @error.setter
    def error(self, error):
        """Sets the error of this Upload.


        :param error: The error of this Upload.  # noqa: E501
        :type error: UploadError
        """

        self._error = error

    @property
    def cors_origin(self):
        """Gets the cors_origin of this Upload.  # noqa: E501

        If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers.  # noqa: E501

        :return: The cors_origin of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._cors_origin

    @cors_origin.setter
    def cors_origin(self, cors_origin):
        """Sets the cors_origin of this Upload.

        If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers.  # noqa: E501

        :param cors_origin: The cors_origin of this Upload.  # noqa: E501
        :type cors_origin: str
        """

        self._cors_origin = cors_origin

    @property
    def url(self):
        """Gets the url of this Upload.  # noqa: E501

        The URL to upload the associated source media to.  # noqa: E501

        :return: The url of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """Sets the url of this Upload.

        The URL to upload the associated source media to.  # noqa: E501

        :param url: The url of this Upload.  # noqa: E501
        :type url: str
        """

        self._url = url

    @property
    def test(self):
        """Gets the test of this Upload.  # noqa: E501

        Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset.  # noqa: E501

        :return: The test of this Upload.  # noqa: E501
        :rtype: bool
        """
        return self._test

    @test.setter
    def test(self, test):
        """Sets the test of this Upload.

        Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset.  # noqa: E501

        :param test: The test of this Upload.  # noqa: E501
        :type test: bool
        """

        self._test = test

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

        def convert(x):
            if hasattr(x, "to_dict"):
                args = inspect.getargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(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, Upload):
            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, Upload):
            return True

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

# coding: utf-8

"""
    Mux API

    Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.  # noqa: E501

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


import inspect
import pprint
import re  # noqa: F401
import six

from mux_python.configuration import Configuration


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

    Do not edit the class manually.
    """

    """
    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 = {
        'id': 'str',
        'timeout': 'int',
        'status': 'str',
        'new_asset_settings': 'Asset',
        'asset_id': 'str',
        'error': 'UploadError',
        'cors_origin': 'str',
        'url': 'str',
        'test': 'bool'
    }

    attribute_map = {
        'id': 'id',
        'timeout': 'timeout',
        'status': 'status',
        'new_asset_settings': 'new_asset_settings',
        'asset_id': 'asset_id',
        'error': 'error',
        'cors_origin': 'cors_origin',
        'url': 'url',
        'test': 'test'
    }

    def __init__(self, id=None, timeout=3600, status=None, new_asset_settings=None, asset_id=None, error=None, cors_origin=None, url=None, test=None, local_vars_configuration=None):  # noqa: E501
        """Upload - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._timeout = None
        self._status = None
        self._new_asset_settings = None
        self._asset_id = None
        self._error = None
        self._cors_origin = None
        self._url = None
        self._test = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if timeout is not None:
            self.timeout = timeout
        if status is not None:
            self.status = status
        if new_asset_settings is not None:
            self.new_asset_settings = new_asset_settings
        if asset_id is not None:
            self.asset_id = asset_id
        if error is not None:
            self.error = error
        if cors_origin is not None:
            self.cors_origin = cors_origin
        if url is not None:
            self.url = url
        if test is not None:
            self.test = test

    @property
    def id(self):
        """Gets the id of this Upload.  # noqa: E501

        Unique identifier for the Direct Upload.  # noqa: E501

        :return: The id of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._id

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

        Unique identifier for the Direct Upload.  # noqa: E501

        :param id: The id of this Upload.  # noqa: E501
        :type id: str
        """

        self._id = id

    @property
    def timeout(self):
        """Gets the timeout of this Upload.  # noqa: E501

        Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out`  # noqa: E501

        :return: The timeout of this Upload.  # noqa: E501
        :rtype: int
        """
        return self._timeout

    @timeout.setter
    def timeout(self, timeout):
        """Sets the timeout of this Upload.

        Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out`  # noqa: E501

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

        self._timeout = timeout

    @property
    def status(self):
        """Gets the status of this Upload.  # noqa: E501


        :return: The status of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this Upload.


        :param status: The status of this Upload.  # noqa: E501
        :type status: str
        """
        allowed_values = ["waiting", "asset_created", "errored", "cancelled", "timed_out"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and status not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )

        self._status = status

    @property
    def new_asset_settings(self):
        """Gets the new_asset_settings of this Upload.  # noqa: E501


        :return: The new_asset_settings of this Upload.  # noqa: E501
        :rtype: Asset
        """
        return self._new_asset_settings

    @new_asset_settings.setter
    def new_asset_settings(self, new_asset_settings):
        """Sets the new_asset_settings of this Upload.


        :param new_asset_settings: The new_asset_settings of this Upload.  # noqa: E501
        :type new_asset_settings: Asset
        """

        self._new_asset_settings = new_asset_settings

    @property
    def asset_id(self):
        """Gets the asset_id of this Upload.  # noqa: E501

        Only set once the upload is in the `asset_created` state.  # noqa: E501

        :return: The asset_id of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._asset_id

    @asset_id.setter
    def asset_id(self, asset_id):
        """Sets the asset_id of this Upload.

        Only set once the upload is in the `asset_created` state.  # noqa: E501

        :param asset_id: The asset_id of this Upload.  # noqa: E501
        :type asset_id: str
        """

        self._asset_id = asset_id

    @property
    def error(self):
        """Gets the error of this Upload.  # noqa: E501


        :return: The error of this Upload.  # noqa: E501
        :rtype: UploadError
        """
        return self._error

    @error.setter
    def error(self, error):
        """Sets the error of this Upload.


        :param error: The error of this Upload.  # noqa: E501
        :type error: UploadError
        """

        self._error = error

    @property
    def cors_origin(self):
        """Gets the cors_origin of this Upload.  # noqa: E501

        If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers.  # noqa: E501

        :return: The cors_origin of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._cors_origin

    @cors_origin.setter
    def cors_origin(self, cors_origin):
        """Sets the cors_origin of this Upload.

        If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers.  # noqa: E501

        :param cors_origin: The cors_origin of this Upload.  # noqa: E501
        :type cors_origin: str
        """

        self._cors_origin = cors_origin

    @property
    def url(self):
        """Gets the url of this Upload.  # noqa: E501

        The URL to upload the associated source media to.  # noqa: E501

        :return: The url of this Upload.  # noqa: E501
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """Sets the url of this Upload.

        The URL to upload the associated source media to.  # noqa: E501

        :param url: The url of this Upload.  # noqa: E501
        :type url: str
        """

        self._url = url

    @property
    def test(self):
        """Gets the test of this Upload.  # noqa: E501

        Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset.  # noqa: E501

        :return: The test of this Upload.  # noqa: E501
        :rtype: bool
        """
        return self._test

    @test.setter
    def test(self, test):
        """Sets the test of this Upload.

        Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset.  # noqa: E501

        :param test: The test of this Upload.  # noqa: E501
        :type test: bool
        """

        self._test = test

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

        def convert(x):
            if hasattr(x, "to_dict"):
                args = inspect.getargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(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, Upload):
            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, Upload):
            return True

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

# coding: utf-8 Mux API      Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.  # noqa: E501      The version of the OpenAPI document: v1     Contact: <EMAIL>     Generated by: https://openapi-generator.tech # noqa: F401 NOTE: This class is auto generated by OpenAPI Generator.     Ref: https://openapi-generator.tech      Do not edit the class manually. 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. # noqa: E501 Upload - a model defined in OpenAPI # noqa: E501 Gets the id of this Upload.  # noqa: E501          Unique identifier for the Direct Upload.  # noqa: E501          :return: The id of this Upload.  # noqa: E501         :rtype: str Sets the id of this Upload.          Unique identifier for the Direct Upload.  # noqa: E501          :param id: The id of this Upload.  # noqa: E501         :type id: str Gets the timeout of this Upload.  # noqa: E501          Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out`  # noqa: E501          :return: The timeout of this Upload.  # noqa: E501         :rtype: int Sets the timeout of this Upload.          Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out`  # noqa: E501          :param timeout: The timeout of this Upload.  # noqa: E501         :type timeout: int # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 Gets the status of this Upload.  # noqa: E501           :return: The status of this Upload.  # noqa: E501         :rtype: str Sets the status of this Upload.           :param status: The status of this Upload.  # noqa: E501         :type status: str # noqa: E501 # noqa: E501 # noqa: E501 Gets the new_asset_settings of this Upload.  # noqa: E501           :return: The new_asset_settings of this Upload.  # noqa: E501         :rtype: Asset Sets the new_asset_settings of this Upload.           :param new_asset_settings: The new_asset_settings of this Upload.  # noqa: E501         :type new_asset_settings: Asset Gets the asset_id of this Upload.  # noqa: E501          Only set once the upload is in the `asset_created` state.  # noqa: E501          :return: The asset_id of this Upload.  # noqa: E501         :rtype: str Sets the asset_id of this Upload.          Only set once the upload is in the `asset_created` state.  # noqa: E501          :param asset_id: The asset_id of this Upload.  # noqa: E501         :type asset_id: str Gets the error of this Upload.  # noqa: E501           :return: The error of this Upload.  # noqa: E501         :rtype: UploadError Sets the error of this Upload.           :param error: The error of this Upload.  # noqa: E501         :type error: UploadError Gets the cors_origin of this Upload.  # noqa: E501          If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers.  # noqa: E501          :return: The cors_origin of this Upload.  # noqa: E501         :rtype: str Sets the cors_origin of this Upload.          If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers.  # noqa: E501          :param cors_origin: The cors_origin of this Upload.  # noqa: E501         :type cors_origin: str Gets the url of this Upload.  # noqa: E501          The URL to upload the associated source media to.  # noqa: E501          :return: The url of this Upload.  # noqa: E501         :rtype: str Sets the url of this Upload.          The URL to upload the associated source media to.  # noqa: E501          :param url: The url of this Upload.  # noqa: E501         :type url: str Gets the test of this Upload.  # noqa: E501          Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset.  # noqa: E501          :return: The test of this Upload.  # noqa: E501         :rtype: bool Sets the test of this Upload.          Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset.  # noqa: E501          :param test: The test of this Upload.  # noqa: E501         :type test: bool Returns the model properties as a dict Returns the string representation of the model For `print` and `pprint` Returns true if both objects are equal Returns true if both objects are not equal