# coding: utf-8

"""
    Files

    Upload and manage files.  # noqa: E501

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


try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint
import re  # noqa: F401
import six

from hubspot.files.configuration import Configuration


class SignedUrl(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 = {"extension": "str", "size": "int", "name": "str", "width": "int", "type": "str", "url": "str", "expires_at": "datetime", "height": "int"}

    attribute_map = {"extension": "extension", "size": "size", "name": "name", "width": "width", "type": "type", "url": "url", "expires_at": "expiresAt", "height": "height"}

    def __init__(self, extension=None, size=None, name=None, width=None, type=None, url=None, expires_at=None, height=None, local_vars_configuration=None):  # noqa: E501
        """SignedUrl - 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._extension = None
        self._size = None
        self._name = None
        self._width = None
        self._type = None
        self._url = None
        self._expires_at = None
        self._height = None
        self.discriminator = None

        self.extension = extension
        self.size = size
        self.name = name
        if width is not None:
            self.width = width
        self.type = type
        self.url = url
        self.expires_at = expires_at
        if height is not None:
            self.height = height

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

        Extension of the requested file.  # noqa: E501

        :return: The extension of this SignedUrl.  # noqa: E501
        :rtype: str
        """
        return self._extension

    @extension.setter
    def extension(self, extension):
        """Sets the extension of this SignedUrl.

        Extension of the requested file.  # noqa: E501

        :param extension: The extension of this SignedUrl.  # noqa: E501
        :type extension: str
        """
        if self.local_vars_configuration.client_side_validation and extension is None:  # noqa: E501
            raise ValueError("Invalid value for `extension`, must not be `None`")  # noqa: E501

        self._extension = extension

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

        Size in bytes of the requested file.  # noqa: E501

        :return: The size of this SignedUrl.  # noqa: E501
        :rtype: int
        """
        return self._size

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

        Size in bytes of the requested file.  # noqa: E501

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

        self._size = size

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

        Name of the requested file.  # noqa: E501

        :return: The name of this SignedUrl.  # noqa: E501
        :rtype: str
        """
        return self._name

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

        Name of the requested file.  # noqa: E501

        :param name: The name of this SignedUrl.  # noqa: E501
        :type name: str
        """
        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

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

        For image and video files. The width of the file.  # noqa: E501

        :return: The width of this SignedUrl.  # noqa: E501
        :rtype: int
        """
        return self._width

    @width.setter
    def width(self, width):
        """Sets the width of this SignedUrl.

        For image and video files. The width of the file.  # noqa: E501

        :param width: The width of this SignedUrl.  # noqa: E501
        :type width: int
        """

        self._width = width

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

        Type of the file. Can be IMG, DOCUMENT, AUDIO, MOVIE, or OTHER.  # noqa: E501

        :return: The type of this SignedUrl.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this SignedUrl.

        Type of the file. Can be IMG, DOCUMENT, AUDIO, MOVIE, or OTHER.  # noqa: E501

        :param type: The type of this SignedUrl.  # noqa: E501
        :type type: str
        """
        if self.local_vars_configuration.client_side_validation and type is None:  # noqa: E501
            raise ValueError("Invalid value for `type`, must not be `None`")  # noqa: E501

        self._type = type

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

        Signed URL with access to the specified file. Anyone with this URL will be able to access the file until it expires.  # noqa: E501

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

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

        Signed URL with access to the specified file. Anyone with this URL will be able to access the file until it expires.  # noqa: E501

        :param url: The url of this SignedUrl.  # noqa: E501
        :type url: str
        """
        if self.local_vars_configuration.client_side_validation and url is None:  # noqa: E501
            raise ValueError("Invalid value for `url`, must not be `None`")  # noqa: E501

        self._url = url

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

        Timestamp of when the URL will no longer grant access to the file.  # noqa: E501

        :return: The expires_at of this SignedUrl.  # noqa: E501
        :rtype: datetime
        """
        return self._expires_at

    @expires_at.setter
    def expires_at(self, expires_at):
        """Sets the expires_at of this SignedUrl.

        Timestamp of when the URL will no longer grant access to the file.  # noqa: E501

        :param expires_at: The expires_at of this SignedUrl.  # noqa: E501
        :type expires_at: datetime
        """
        if self.local_vars_configuration.client_side_validation and expires_at is None:  # noqa: E501
            raise ValueError("Invalid value for `expires_at`, must not be `None`")  # noqa: E501

        self._expires_at = expires_at

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

        For image and video files. The height of the file.  # noqa: E501

        :return: The height of this SignedUrl.  # noqa: E501
        :rtype: int
        """
        return self._height

    @height.setter
    def height(self, height):
        """Sets the height of this SignedUrl.

        For image and video files. The height of the file.  # noqa: E501

        :param height: The height of this SignedUrl.  # noqa: E501
        :type height: int
        """

        self._height = height

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

        def convert(x):
            if hasattr(x, "to_dict"):
                args = getfullargspec(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, SignedUrl):
            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, SignedUrl):
            return True

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