# coding: utf-8

"""
    Amazon Shipping API

    The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.

    The version of the OpenAPI document: v2
    Contact: swa-api-core@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 = {
        'dimensions': 'Dimensions',
        'weight': 'Weight',
        'insured_value': 'Currency',
        'is_hazmat': 'bool',
        'seller_display_name': 'str',
        'charges': 'List[ChargeComponent]',
        'package_client_reference_id': 'str',
        'items': 'List[Item]',
    }

    attribute_map = {
        'dimensions': 'dimensions',
        'weight': 'weight',
        'insured_value': 'insuredValue',
        'is_hazmat': 'isHazmat',
        'seller_display_name': 'sellerDisplayName',
        'charges': 'charges',
        'package_client_reference_id': 'packageClientReferenceId',
        'items': 'items',
    }

    def __init__(self, dimensions=None, weight=None, insured_value=None, is_hazmat=None, seller_display_name=None, charges=None, package_client_reference_id=None, items=None, _configuration=None):  # noqa: E501
        """Package - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._dimensions = None
        self._weight = None
        self._insured_value = None
        self._is_hazmat = None
        self._seller_display_name = None
        self._charges = None
        self._package_client_reference_id = None
        self._items = None
        self.discriminator = None

        self.dimensions = dimensions
        self.weight = weight
        self.insured_value = insured_value
        if is_hazmat is not None:
            self.is_hazmat = is_hazmat
        if seller_display_name is not None:
            self.seller_display_name = seller_display_name
        if charges is not None:
            self.charges = charges
        self.package_client_reference_id = package_client_reference_id
        self.items = items

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


        :return: The dimensions of this Package.  # noqa: E501
        :rtype: Dimensions
        """
        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: Dimensions
        """
        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 insured_value(self):
        """Gets the insured_value of this Package.  # noqa: E501


        :return: The insured_value of this Package.  # noqa: E501
        :rtype: Currency
        """
        return self._insured_value

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


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

        self._insured_value = insured_value

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

        When true, the package contains hazardous materials. Defaults to false.  # noqa: E501

        :return: The is_hazmat of this Package.  # noqa: E501
        :rtype: bool
        """
        return self._is_hazmat

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

        When true, the package contains hazardous materials. Defaults to false.  # noqa: E501

        :param is_hazmat: The is_hazmat of this Package.  # noqa: E501
        :type: bool
        """

        self._is_hazmat = is_hazmat

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

        The seller name displayed on the label.  # noqa: E501

        :return: The seller_display_name of this Package.  # noqa: E501
        :rtype: str
        """
        return self._seller_display_name

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

        The seller name displayed on the label.  # noqa: E501

        :param seller_display_name: The seller_display_name of this Package.  # noqa: E501
        :type: str
        """

        self._seller_display_name = seller_display_name

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

        A list of charges based on the shipping service charges applied on a package.  # noqa: E501

        :return: The charges of this Package.  # noqa: E501
        :rtype: List[ChargeComponent]
        """
        return self._charges

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

        A list of charges based on the shipping service charges applied on a package.  # noqa: E501

        :param charges: The charges of this Package.  # noqa: E501
        :type: List[ChargeComponent]
        """

        self._charges = charges

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

        A client provided unique identifier for a package being shipped. This value should be saved by the client to pass as a parameter to the getShipmentDocuments operation.  # noqa: E501

        :return: The package_client_reference_id of this Package.  # noqa: E501
        :rtype: str
        """
        return self._package_client_reference_id

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

        A client provided unique identifier for a package being shipped. This value should be saved by the client to pass as a parameter to the getShipmentDocuments operation.  # noqa: E501

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

        self._package_client_reference_id = package_client_reference_id

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

        A list of items.  # noqa: E501

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

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

        A list of items.  # noqa: E501

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

        self._items = items

    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()
