# coding: utf-8

"""
    The Selling Partner API for Amazon External Fulfillment Shipments Processing

    You can use the External Fulfillment Shipments API to retrieve, manage, and track shipments processed through Amazon's external fulfillment network. Use this API to get shipment details, monitor status changes, and access fulfillment requirements.

    The version of the OpenAPI document: 2024-09-11
    Contact: marketplaceapitest@amazon.com
    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 Package(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 = {
        'id': 'str',
        'dimensions': 'PackageDimensions',
        'weight': 'Weight',
        'hazmat_labels': 'List[str]',
        'package_line_items': 'List[PackageLineItem]',
        'status': 'str',
        'package_handling_requirements': 'str',
    }

    attribute_map = {
        'id': 'id',
        'dimensions': 'dimensions',
        'weight': 'weight',
        'hazmat_labels': 'hazmatLabels',
        'package_line_items': 'packageLineItems',
        'status': 'status',
        'package_handling_requirements': 'packageHandlingRequirements',
    }

    def __init__(self, id=None, dimensions=None, weight=None, hazmat_labels=None, package_line_items=None, status=None, package_handling_requirements=None, _configuration=None):  # noqa: E501
        """Package - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._dimensions = None
        self._weight = None
        self._hazmat_labels = None
        self._package_line_items = None
        self._status = None
        self._package_handling_requirements = None
        self.discriminator = None

        self.id = id
        self.dimensions = dimensions
        self.weight = weight
        if hazmat_labels is not None:
            self.hazmat_labels = hazmat_labels
        self.package_line_items = package_line_items
        if status is not None:
            self.status = status
        if package_handling_requirements is not None:
            self.package_handling_requirements = package_handling_requirements

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

        An ID that uniquely identifies a package within a shipment.  # noqa: E501

        :return: The id of this Package.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Package.

        An ID that uniquely identifies a package within a shipment.  # noqa: E501

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

        self._id = id

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


        :return: The dimensions of this Package.  # noqa: E501
        :rtype: PackageDimensions
        """
        return self._dimensions

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


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

        self._dimensions = dimensions

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


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

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


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

        self._weight = weight

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

        The optional list of HAZMAT labels applied to the package.  # noqa: E501

        :return: The hazmat_labels of this Package.  # noqa: E501
        :rtype: List[str]
        """
        return self._hazmat_labels

    @hazmat_labels.setter
    def hazmat_labels(self, hazmat_labels):
        """Sets the hazmat_labels of this Package.

        The optional list of HAZMAT labels applied to the package.  # noqa: E501

        :param hazmat_labels: The hazmat_labels of this Package.  # noqa: E501
        :type: List[str]
        """
        if (self._configuration.client_side_validation and
                hazmat_labels is not None and len(hazmat_labels) < 0):
            raise ValueError("Invalid value for `hazmat_labels`, number of items must be greater than or equal to `0`")  # noqa: E501

        self._hazmat_labels = hazmat_labels

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

        The list of line items in a package.  # noqa: E501

        :return: The package_line_items of this Package.  # noqa: E501
        :rtype: List[PackageLineItem]
        """
        return self._package_line_items

    @package_line_items.setter
    def package_line_items(self, package_line_items):
        """Sets the package_line_items of this Package.

        The list of line items in a package.  # noqa: E501

        :param package_line_items: The package_line_items of this Package.  # noqa: E501
        :type: List[PackageLineItem]
        """
        if self._configuration.client_side_validation and package_line_items is None:
            raise ValueError("Invalid value for `package_line_items`, must not be `None`")  # noqa: E501

        self._package_line_items = package_line_items

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

        The current status of the package.  # noqa: E501

        :return: The status of this Package.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this Package.

        The current status of the package.  # noqa: E501

        :param status: The status of this Package.  # noqa: E501
        :type: str
        """
        allowed_values = ["CREATED", "PICKUP_SLOT_RETRIEVED", "INVOICE_GENERATED", "SHIPLABEL_GENERATED", "SHIPPED", "DELIVERED", "CANCELLED"]  # noqa: E501
        if (self._configuration.client_side_validation and
                status not in allowed_values):
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )

        self._status = status

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

        Whether the package requires standard handling or extra care.  # noqa: E501

        :return: The package_handling_requirements of this Package.  # noqa: E501
        :rtype: str
        """
        return self._package_handling_requirements

    @package_handling_requirements.setter
    def package_handling_requirements(self, package_handling_requirements):
        """Sets the package_handling_requirements of this Package.

        Whether the package requires standard handling or extra care.  # noqa: E501

        :param package_handling_requirements: The package_handling_requirements of this Package.  # noqa: E501
        :type: str
        """
        allowed_values = ["NORMAL", "FRAGILE"]  # noqa: E501
        if (self._configuration.client_side_validation and
                package_handling_requirements not in allowed_values):
            raise ValueError(
                "Invalid value for `package_handling_requirements` ({0}), must be one of {1}"  # noqa: E501
                .format(package_handling_requirements, allowed_values)
            )

        self._package_handling_requirements = package_handling_requirements

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

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