# 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 Box(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 = {
        'box_id': 'str',
        'content_information_source': 'BoxContentInformationSource',
        'destination_region': 'Region',
        'dimensions': 'Dimensions',
        'external_container_identifier': 'str',
        'external_container_identifier_type': 'str',
        'items': 'List[Item]',
        'package_id': 'str',
        'quantity': 'int',
        'template_name': 'str',
        'weight': 'Weight',
    }

    attribute_map = {
        'box_id': 'boxId',
        'content_information_source': 'contentInformationSource',
        'destination_region': 'destinationRegion',
        'dimensions': 'dimensions',
        'external_container_identifier': 'externalContainerIdentifier',
        'external_container_identifier_type': 'externalContainerIdentifierType',
        'items': 'items',
        'package_id': 'packageId',
        'quantity': 'quantity',
        'template_name': 'templateName',
        'weight': 'weight',
    }

    def __init__(self, box_id=None, content_information_source=None, destination_region=None, dimensions=None, external_container_identifier=None, external_container_identifier_type=None, items=None, package_id=None, quantity=None, template_name=None, weight=None, _configuration=None):  # noqa: E501
        """Box - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._box_id = None
        self._content_information_source = None
        self._destination_region = None
        self._dimensions = None
        self._external_container_identifier = None
        self._external_container_identifier_type = None
        self._items = None
        self._package_id = None
        self._quantity = None
        self._template_name = None
        self._weight = None
        self.discriminator = None

        if box_id is not None:
            self.box_id = box_id
        if content_information_source is not None:
            self.content_information_source = content_information_source
        if destination_region is not None:
            self.destination_region = destination_region
        if dimensions is not None:
            self.dimensions = dimensions
        if external_container_identifier is not None:
            self.external_container_identifier = external_container_identifier
        if external_container_identifier_type is not None:
            self.external_container_identifier_type = external_container_identifier_type
        if items is not None:
            self.items = items
        self.package_id = package_id
        if quantity is not None:
            self.quantity = quantity
        if template_name is not None:
            self.template_name = template_name
        if weight is not None:
            self.weight = weight

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

        The ID provided by Amazon that identifies a given box. This ID is comprised of the external shipment ID (which is generated after transportation has been confirmed) and the index of the box.  # noqa: E501

        :return: The box_id of this Box.  # noqa: E501
        :rtype: str
        """
        return self._box_id

    @box_id.setter
    def box_id(self, box_id):
        """Sets the box_id of this Box.

        The ID provided by Amazon that identifies a given box. This ID is comprised of the external shipment ID (which is generated after transportation has been confirmed) and the index of the box.  # noqa: E501

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

        self._box_id = box_id

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


        :return: The content_information_source of this Box.  # noqa: E501
        :rtype: BoxContentInformationSource
        """
        return self._content_information_source

    @content_information_source.setter
    def content_information_source(self, content_information_source):
        """Sets the content_information_source of this Box.


        :param content_information_source: The content_information_source of this Box.  # noqa: E501
        :type: BoxContentInformationSource
        """

        self._content_information_source = content_information_source

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


        :return: The destination_region of this Box.  # noqa: E501
        :rtype: Region
        """
        return self._destination_region

    @destination_region.setter
    def destination_region(self, destination_region):
        """Sets the destination_region of this Box.


        :param destination_region: The destination_region of this Box.  # noqa: E501
        :type: Region
        """

        self._destination_region = destination_region

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


        :return: The dimensions of this Box.  # noqa: E501
        :rtype: Dimensions
        """
        return self._dimensions

    @dimensions.setter
    def dimensions(self, dimensions):
        """Sets the dimensions of this Box.


        :param dimensions: The dimensions of this Box.  # noqa: E501
        :type: Dimensions
        """

        self._dimensions = dimensions

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

        The external identifier for this container / box.  # noqa: E501

        :return: The external_container_identifier of this Box.  # noqa: E501
        :rtype: str
        """
        return self._external_container_identifier

    @external_container_identifier.setter
    def external_container_identifier(self, external_container_identifier):
        """Sets the external_container_identifier of this Box.

        The external identifier for this container / box.  # noqa: E501

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

        self._external_container_identifier = external_container_identifier

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

        Type of the external identifier used. Can be: `AMAZON`, `SSCC`.  # noqa: E501

        :return: The external_container_identifier_type of this Box.  # noqa: E501
        :rtype: str
        """
        return self._external_container_identifier_type

    @external_container_identifier_type.setter
    def external_container_identifier_type(self, external_container_identifier_type):
        """Sets the external_container_identifier_type of this Box.

        Type of the external identifier used. Can be: `AMAZON`, `SSCC`.  # noqa: E501

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

        self._external_container_identifier_type = external_container_identifier_type

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

        Items contained within the box.  # noqa: E501

        :return: The items of this Box.  # noqa: E501
        :rtype: List[Item]
        """
        return self._items

    @items.setter
    def items(self, items):
        """Sets the items of this Box.

        Items contained within the box.  # noqa: E501

        :param items: The items of this Box.  # noqa: E501
        :type: List[Item]
        """

        self._items = items

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

        Primary key to uniquely identify a Package (Box or Pallet).  # noqa: E501

        :return: The package_id of this Box.  # noqa: E501
        :rtype: str
        """
        return self._package_id

    @package_id.setter
    def package_id(self, package_id):
        """Sets the package_id of this Box.

        Primary key to uniquely identify a Package (Box or Pallet).  # noqa: E501

        :param package_id: The package_id of this Box.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and package_id is None:
            raise ValueError("Invalid value for `package_id`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                package_id is not None and len(package_id) > 38):
            raise ValueError("Invalid value for `package_id`, length must be less than or equal to `38`")  # noqa: E501
        if (self._configuration.client_side_validation and
                package_id is not None and len(package_id) < 38):
            raise ValueError("Invalid value for `package_id`, length must be greater than or equal to `38`")  # noqa: E501
        if (self._configuration.client_side_validation and
                package_id is not None and not re.search(r'^[a-zA-Z0-9-]*$', package_id)):  # noqa: E501
            raise ValueError(r"Invalid value for `package_id`, must be a follow pattern or equal to `/^[a-zA-Z0-9-]*$/`")  # noqa: E501

        self._package_id = package_id

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

        The number of containers where all other properties like weight or dimensions are identical.  # noqa: E501

        :return: The quantity of this Box.  # noqa: E501
        :rtype: int
        """
        return self._quantity

    @quantity.setter
    def quantity(self, quantity):
        """Sets the quantity of this Box.

        The number of containers where all other properties like weight or dimensions are identical.  # noqa: E501

        :param quantity: The quantity of this Box.  # noqa: E501
        :type: int
        """
        if (self._configuration.client_side_validation and
                quantity is not None and quantity > 10000):  # noqa: E501
            raise ValueError("Invalid value for `quantity`, must be a value less than or equal to `10000`")  # noqa: E501
        if (self._configuration.client_side_validation and
                quantity is not None and quantity < 1):  # noqa: E501
            raise ValueError("Invalid value for `quantity`, must be a value greater than or equal to `1`")  # noqa: E501

        self._quantity = quantity

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

        Template name of the box.  # noqa: E501

        :return: The template_name of this Box.  # noqa: E501
        :rtype: str
        """
        return self._template_name

    @template_name.setter
    def template_name(self, template_name):
        """Sets the template_name of this Box.

        Template name of the box.  # noqa: E501

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

        self._template_name = template_name

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


        :return: The weight of this Box.  # noqa: E501
        :rtype: Weight
        """
        return self._weight

    @weight.setter
    def weight(self, weight):
        """Sets the weight of this Box.


        :param weight: The weight of this Box.  # noqa: E501
        :type: Weight
        """

        self._weight = weight

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

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