# 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 Shipment(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',
        'location_id': 'str',
        'marketplace_attributes': 'MarketplaceAttributes',
        'shipment_info': 'ShipmentInfo',
        'invoice_info': 'InvoiceInfo',
        'party_info_list': 'List[PartyIdentificationInfo]',
        'shipment_requirements': 'ShipmentRequirements',
        'charges': 'List[Charge]',
        'status': 'str',
        'sub_status': 'str',
        'line_items': 'List[ShipmentLineItem]',
        'shipping_info': 'ShippingInfo',
        'packages': 'List[Package]',
        'creation_date_time': 'str',
        'last_updated_date_time': 'str',
        'earliest_pack_date_time': 'str',
    }

    attribute_map = {
        'id': 'id',
        'location_id': 'locationId',
        'marketplace_attributes': 'marketplaceAttributes',
        'shipment_info': 'shipmentInfo',
        'invoice_info': 'invoiceInfo',
        'party_info_list': 'partyInfoList',
        'shipment_requirements': 'shipmentRequirements',
        'charges': 'charges',
        'status': 'status',
        'sub_status': 'subStatus',
        'line_items': 'lineItems',
        'shipping_info': 'shippingInfo',
        'packages': 'packages',
        'creation_date_time': 'creationDateTime',
        'last_updated_date_time': 'lastUpdatedDateTime',
        'earliest_pack_date_time': 'earliestPackDateTime',
    }

    def __init__(self, id=None, location_id=None, marketplace_attributes=None, shipment_info=None, invoice_info=None, party_info_list=None, shipment_requirements=None, charges=None, status=None, sub_status=None, line_items=None, shipping_info=None, packages=None, creation_date_time=None, last_updated_date_time=None, earliest_pack_date_time=None, _configuration=None):  # noqa: E501
        """Shipment - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._location_id = None
        self._marketplace_attributes = None
        self._shipment_info = None
        self._invoice_info = None
        self._party_info_list = None
        self._shipment_requirements = None
        self._charges = None
        self._status = None
        self._sub_status = None
        self._line_items = None
        self._shipping_info = None
        self._packages = None
        self._creation_date_time = None
        self._last_updated_date_time = None
        self._earliest_pack_date_time = None
        self.discriminator = None

        self.id = id
        self.location_id = location_id
        self.marketplace_attributes = marketplace_attributes
        self.shipment_info = shipment_info
        if invoice_info is not None:
            self.invoice_info = invoice_info
        if party_info_list is not None:
            self.party_info_list = party_info_list
        self.shipment_requirements = shipment_requirements
        self.charges = charges
        self.status = status
        if sub_status is not None:
            self.sub_status = sub_status
        self.line_items = line_items
        self.shipping_info = shipping_info
        if packages is not None:
            self.packages = packages
        self.creation_date_time = creation_date_time
        self.last_updated_date_time = last_updated_date_time
        if earliest_pack_date_time is not None:
            self.earliest_pack_date_time = earliest_pack_date_time

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

        The shipment's ID.  # noqa: E501

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

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

        The shipment's ID.  # noqa: E501

        :param id: The id of this Shipment.  # 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 location_id(self):
        """Gets the location_id of this Shipment.  # noqa: E501

        The location identifier of the seller's location in the marketplace channel to which the shipment has been created for fulfillment.  # noqa: E501

        :return: The location_id of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._location_id

    @location_id.setter
    def location_id(self, location_id):
        """Sets the location_id of this Shipment.

        The location identifier of the seller's location in the marketplace channel to which the shipment has been created for fulfillment.  # noqa: E501

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

        self._location_id = location_id

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


        :return: The marketplace_attributes of this Shipment.  # noqa: E501
        :rtype: MarketplaceAttributes
        """
        return self._marketplace_attributes

    @marketplace_attributes.setter
    def marketplace_attributes(self, marketplace_attributes):
        """Sets the marketplace_attributes of this Shipment.


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

        self._marketplace_attributes = marketplace_attributes

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


        :return: The shipment_info of this Shipment.  # noqa: E501
        :rtype: ShipmentInfo
        """
        return self._shipment_info

    @shipment_info.setter
    def shipment_info(self, shipment_info):
        """Sets the shipment_info of this Shipment.


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

        self._shipment_info = shipment_info

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


        :return: The invoice_info of this Shipment.  # noqa: E501
        :rtype: InvoiceInfo
        """
        return self._invoice_info

    @invoice_info.setter
    def invoice_info(self, invoice_info):
        """Sets the invoice_info of this Shipment.


        :param invoice_info: The invoice_info of this Shipment.  # noqa: E501
        :type: InvoiceInfo
        """

        self._invoice_info = invoice_info

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

        All involved party identification and metadata for the vendor, buyer, and seller. Applicable for direct-fulfillment sellers.  # noqa: E501

        :return: The party_info_list of this Shipment.  # noqa: E501
        :rtype: List[PartyIdentificationInfo]
        """
        return self._party_info_list

    @party_info_list.setter
    def party_info_list(self, party_info_list):
        """Sets the party_info_list of this Shipment.

        All involved party identification and metadata for the vendor, buyer, and seller. Applicable for direct-fulfillment sellers.  # noqa: E501

        :param party_info_list: The party_info_list of this Shipment.  # noqa: E501
        :type: List[PartyIdentificationInfo]
        """

        self._party_info_list = party_info_list

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


        :return: The shipment_requirements of this Shipment.  # noqa: E501
        :rtype: ShipmentRequirements
        """
        return self._shipment_requirements

    @shipment_requirements.setter
    def shipment_requirements(self, shipment_requirements):
        """Sets the shipment_requirements of this Shipment.


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

        self._shipment_requirements = shipment_requirements

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

        The charges associated with the shipment.  # noqa: E501

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

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

        The charges associated with the shipment.  # noqa: E501

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

        self._charges = charges

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

        The current status of the shipment.  # noqa: E501

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

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

        The current status of the shipment.  # noqa: E501

        :param status: The status of this Shipment.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and status is None:
            raise ValueError("Invalid value for `status`, must not be `None`")  # noqa: E501
        allowed_values = ["CREATED", "ACCEPTED", "CONFIRMED", "PACKAGE_CREATED", "PICKUP_SLOT_RETRIEVED", "INVOICE_GENERATED", "SHIPLABEL_GENERATED", "CANCELLED", "SHIPPED", "DELIVERED"]  # 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 sub_status(self):
        """Gets the sub_status of this Shipment.  # noqa: E501

        The sub status of the shipment.  # noqa: E501

        :return: The sub_status of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._sub_status

    @sub_status.setter
    def sub_status(self, sub_status):
        """Sets the sub_status of this Shipment.

        The sub status of the shipment.  # noqa: E501

        :param sub_status: The sub_status of this Shipment.  # noqa: E501
        :type: str
        """
        allowed_values = ["PENDING_SCHEDULE", "PENDING_PICKUP", "PENDING_DROP_OFF", "LABEL_CANCELED", "PICKED_UP", "DROPPED_OFF", "AT_ORIGIN_FC", "AT_DESTINATION_FC", "DELIVERED", "NOT_DELIVERED", "UNDELIVERABLE", "LOST", "OUT_FOR_DELIVERY", "DAMAGED"]  # noqa: E501
        if (self._configuration.client_side_validation and
                sub_status not in allowed_values):
            raise ValueError(
                "Invalid value for `sub_status` ({0}), must be one of {1}"  # noqa: E501
                .format(sub_status, allowed_values)
            )

        self._sub_status = sub_status

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

        The line items in the shipment.  # noqa: E501

        :return: The line_items of this Shipment.  # noqa: E501
        :rtype: List[ShipmentLineItem]
        """
        return self._line_items

    @line_items.setter
    def line_items(self, line_items):
        """Sets the line_items of this Shipment.

        The line items in the shipment.  # noqa: E501

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

        self._line_items = line_items

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


        :return: The shipping_info of this Shipment.  # noqa: E501
        :rtype: ShippingInfo
        """
        return self._shipping_info

    @shipping_info.setter
    def shipping_info(self, shipping_info):
        """Sets the shipping_info of this Shipment.


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

        self._shipping_info = shipping_info

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

        The list of packages in the shipment.  # noqa: E501

        :return: The packages of this Shipment.  # noqa: E501
        :rtype: List[Package]
        """
        return self._packages

    @packages.setter
    def packages(self, packages):
        """Sets the packages of this Shipment.

        The list of packages in the shipment.  # noqa: E501

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

        self._packages = packages

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

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

        :return: The creation_date_time of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._creation_date_time

    @creation_date_time.setter
    def creation_date_time(self, creation_date_time):
        """Sets the creation_date_time of this Shipment.

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

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

        self._creation_date_time = creation_date_time

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

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

        :return: The last_updated_date_time of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._last_updated_date_time

    @last_updated_date_time.setter
    def last_updated_date_time(self, last_updated_date_time):
        """Sets the last_updated_date_time of this Shipment.

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

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

        self._last_updated_date_time = last_updated_date_time

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

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

        :return: The earliest_pack_date_time of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._earliest_pack_date_time

    @earliest_pack_date_time.setter
    def earliest_pack_date_time(self, earliest_pack_date_time):
        """Sets the earliest_pack_date_time of this Shipment.

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

        :param earliest_pack_date_time: The earliest_pack_date_time of this Shipment.  # noqa: E501
        :type: str
        """

        self._earliest_pack_date_time = earliest_pack_date_time

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

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