# coding: utf-8

"""
    Selling Partner API for Services

    With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources.

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

    Do not edit the class manually.
"""  # noqa: E501


import pprint
import re  # noqa: F401

import six

from spapi.configuration import Configuration


class ServiceUploadDocument(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 = {
        'content_type': 'str',
        'content_length': 'float',
        'content_md5': 'str',
    }

    attribute_map = {
        'content_type': 'contentType',
        'content_length': 'contentLength',
        'content_md5': 'contentMD5',
    }

    def __init__(self, content_type=None, content_length=None, content_md5=None, _configuration=None):  # noqa: E501
        """ServiceUploadDocument - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._content_type = None
        self._content_length = None
        self._content_md5 = None
        self.discriminator = None

        self.content_type = content_type
        self.content_length = content_length
        if content_md5 is not None:
            self.content_md5 = content_md5

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

        The content type of the to-be-uploaded file  # noqa: E501

        :return: The content_type of this ServiceUploadDocument.  # noqa: E501
        :rtype: str
        """
        return self._content_type

    @content_type.setter
    def content_type(self, content_type):
        """Sets the content_type of this ServiceUploadDocument.

        The content type of the to-be-uploaded file  # noqa: E501

        :param content_type: The content_type of this ServiceUploadDocument.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and content_type is None:
            raise ValueError("Invalid value for `content_type`, must not be `None`")  # noqa: E501
        allowed_values = ["TIFF", "JPG", "PNG", "JPEG", "GIF", "PDF"]  # noqa: E501
        if (self._configuration.client_side_validation and
                content_type not in allowed_values):
            raise ValueError(
                "Invalid value for `content_type` ({0}), must be one of {1}"  # noqa: E501
                .format(content_type, allowed_values)
            )

        self._content_type = content_type

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

        The content length of the to-be-uploaded file  # noqa: E501

        :return: The content_length of this ServiceUploadDocument.  # noqa: E501
        :rtype: float
        """
        return self._content_length

    @content_length.setter
    def content_length(self, content_length):
        """Sets the content_length of this ServiceUploadDocument.

        The content length of the to-be-uploaded file  # noqa: E501

        :param content_length: The content_length of this ServiceUploadDocument.  # noqa: E501
        :type: float
        """
        if self._configuration.client_side_validation and content_length is None:
            raise ValueError("Invalid value for `content_length`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                content_length is not None and content_length > 5.24288E+6):  # noqa: E501
            raise ValueError("Invalid value for `content_length`, must be a value less than or equal to `5.24288E+6`")  # noqa: E501
        if (self._configuration.client_side_validation and
                content_length is not None and content_length < 1):  # noqa: E501
            raise ValueError("Invalid value for `content_length`, must be a value greater than or equal to `1`")  # noqa: E501

        self._content_length = content_length

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

        An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit.  # noqa: E501

        :return: The content_md5 of this ServiceUploadDocument.  # noqa: E501
        :rtype: str
        """
        return self._content_md5

    @content_md5.setter
    def content_md5(self, content_md5):
        """Sets the content_md5 of this ServiceUploadDocument.

        An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit.  # noqa: E501

        :param content_md5: The content_md5 of this ServiceUploadDocument.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                content_md5 is not None and not re.search(r'^[A-Za-z0-9\\+\/]{22}={2}$', content_md5)):  # noqa: E501
            raise ValueError(r"Invalid value for `content_md5`, must be a follow pattern or equal to `/^[A-Za-z0-9\\+\/]{22}={2}$/`")  # noqa: E501

        self._content_md5 = content_md5

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

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