# coding: utf-8

"""
    Selling Partner API for Easy Ship

    Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).

    The version of the OpenAPI document: 2022-03-23
    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 Dimensions(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 = {
        'length': 'float',
        'width': 'float',
        'height': 'float',
        'unit': 'UnitOfLength',
        'identifier': 'str',
    }

    attribute_map = {
        'length': 'length',
        'width': 'width',
        'height': 'height',
        'unit': 'unit',
        'identifier': 'identifier',
    }

    def __init__(self, length=None, width=None, height=None, unit=None, identifier=None, _configuration=None):  # noqa: E501
        """Dimensions - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._length = None
        self._width = None
        self._height = None
        self._unit = None
        self._identifier = None
        self.discriminator = None

        if length is not None:
            self.length = length
        if width is not None:
            self.width = width
        if height is not None:
            self.height = height
        if unit is not None:
            self.unit = unit
        if identifier is not None:
            self.identifier = identifier

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

        The numerical value of the specified dimension.  # noqa: E501

        :return: The length of this Dimensions.  # noqa: E501
        :rtype: float
        """
        return self._length

    @length.setter
    def length(self, length):
        """Sets the length of this Dimensions.

        The numerical value of the specified dimension.  # noqa: E501

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

        self._length = length

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

        The numerical value of the specified dimension.  # noqa: E501

        :return: The width of this Dimensions.  # noqa: E501
        :rtype: float
        """
        return self._width

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

        The numerical value of the specified dimension.  # noqa: E501

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

        self._width = width

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

        The numerical value of the specified dimension.  # noqa: E501

        :return: The height of this Dimensions.  # noqa: E501
        :rtype: float
        """
        return self._height

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

        The numerical value of the specified dimension.  # noqa: E501

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

        self._height = height

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


        :return: The unit of this Dimensions.  # noqa: E501
        :rtype: UnitOfLength
        """
        return self._unit

    @unit.setter
    def unit(self, unit):
        """Sets the unit of this Dimensions.


        :param unit: The unit of this Dimensions.  # noqa: E501
        :type: UnitOfLength
        """

        self._unit = unit

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

        A string of up to 255 characters.  # noqa: E501

        :return: The identifier of this Dimensions.  # noqa: E501
        :rtype: str
        """
        return self._identifier

    @identifier.setter
    def identifier(self, identifier):
        """Sets the identifier of this Dimensions.

        A string of up to 255 characters.  # noqa: E501

        :param identifier: The identifier of this Dimensions.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                identifier is not None and len(identifier) > 255):
            raise ValueError("Invalid value for `identifier`, length must be less than or equal to `255`")  # noqa: E501
        if (self._configuration.client_side_validation and
                identifier is not None and len(identifier) < 1):
            raise ValueError("Invalid value for `identifier`, length must be greater than or equal to `1`")  # noqa: E501

        self._identifier = identifier

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

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