# coding: utf-8

"""
    The Selling Partner API for Amazon Warehousing and Distribution

    The Selling Partner API for Amazon Warehousing and Distribution (AWD) provides programmatic access to information about AWD shipments and inventory.

    The version of the OpenAPI document: 2024-05-09
    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 PackageDimensions(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 = {
        'height': 'float',
        'length': 'float',
        'unit_of_measurement': 'DimensionUnitOfMeasurement',
        'width': 'float',
    }

    attribute_map = {
        'height': 'height',
        'length': 'length',
        'unit_of_measurement': 'unitOfMeasurement',
        'width': 'width',
    }

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

        self._height = None
        self._length = None
        self._unit_of_measurement = None
        self._width = None
        self.discriminator = None

        self.height = height
        self.length = length
        self.unit_of_measurement = unit_of_measurement
        self.width = width

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

        Height of the package.  # noqa: E501

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

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

        Height of the package.  # noqa: E501

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

        self._height = height

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

        Length of the package.  # noqa: E501

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

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

        Length of the package.  # noqa: E501

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

        self._length = length

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


        :return: The unit_of_measurement of this PackageDimensions.  # noqa: E501
        :rtype: DimensionUnitOfMeasurement
        """
        return self._unit_of_measurement

    @unit_of_measurement.setter
    def unit_of_measurement(self, unit_of_measurement):
        """Sets the unit_of_measurement of this PackageDimensions.


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

        self._unit_of_measurement = unit_of_measurement

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

        Width of the package.  # noqa: E501

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

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

        Width of the package.  # noqa: E501

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

        self._width = width

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

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