# coding: utf-8

"""
    The Selling Partner API for FBA inbound operations.

    The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability with the Send-to-Amazon user interface.

    The version of the OpenAPI document: 2024-03-20
    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 WeightRange(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 = {
        'maximum': 'float',
        'minimum': 'float',
        'unit': 'UnitOfWeight',
    }

    attribute_map = {
        'maximum': 'maximum',
        'minimum': 'minimum',
        'unit': 'unit',
    }

    def __init__(self, maximum=None, minimum=None, unit=None, _configuration=None):  # noqa: E501
        """WeightRange - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._maximum = None
        self._minimum = None
        self._unit = None
        self.discriminator = None

        self.maximum = maximum
        self.minimum = minimum
        self.unit = unit

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

        Maximum allowed weight.  # noqa: E501

        :return: The maximum of this WeightRange.  # noqa: E501
        :rtype: float
        """
        return self._maximum

    @maximum.setter
    def maximum(self, maximum):
        """Sets the maximum of this WeightRange.

        Maximum allowed weight.  # noqa: E501

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

        self._maximum = maximum

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

        Minimum allowed weight.  # noqa: E501

        :return: The minimum of this WeightRange.  # noqa: E501
        :rtype: float
        """
        return self._minimum

    @minimum.setter
    def minimum(self, minimum):
        """Sets the minimum of this WeightRange.

        Minimum allowed weight.  # noqa: E501

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

        self._minimum = minimum

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


        :return: The unit of this WeightRange.  # noqa: E501
        :rtype: UnitOfWeight
        """
        return self._unit

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


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

        self._unit = unit

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

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