# coding: utf-8

"""
    Selling Partner API for Retail Procurement Shipments

    The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.

    The version of the OpenAPI document: v1
    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 ShipmentConfirmation(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 = {
        'shipment_identifier': 'str',
        'shipment_confirmation_type': 'str',
        'shipment_type': 'str',
        'shipment_structure': 'str',
        'transportation_details': 'TransportationDetailsForShipmentConfirmation',
        'amazon_reference_number': 'str',
        'shipment_confirmation_date': 'datetime',
        'shipped_date': 'datetime',
        'estimated_delivery_date': 'datetime',
        'selling_party': 'PartyIdentification',
        'ship_from_party': 'PartyIdentification',
        'ship_to_party': 'PartyIdentification',
        'shipment_measurements': 'ShipmentMeasurements',
        'import_details': 'ImportDetails',
        'shipped_items': 'List[Item]',
        'cartons': 'List[Carton]',
        'pallets': 'List[Pallet]',
    }

    attribute_map = {
        'shipment_identifier': 'shipmentIdentifier',
        'shipment_confirmation_type': 'shipmentConfirmationType',
        'shipment_type': 'shipmentType',
        'shipment_structure': 'shipmentStructure',
        'transportation_details': 'transportationDetails',
        'amazon_reference_number': 'amazonReferenceNumber',
        'shipment_confirmation_date': 'shipmentConfirmationDate',
        'shipped_date': 'shippedDate',
        'estimated_delivery_date': 'estimatedDeliveryDate',
        'selling_party': 'sellingParty',
        'ship_from_party': 'shipFromParty',
        'ship_to_party': 'shipToParty',
        'shipment_measurements': 'shipmentMeasurements',
        'import_details': 'importDetails',
        'shipped_items': 'shippedItems',
        'cartons': 'cartons',
        'pallets': 'pallets',
    }

    def __init__(self, shipment_identifier=None, shipment_confirmation_type=None, shipment_type=None, shipment_structure=None, transportation_details=None, amazon_reference_number=None, shipment_confirmation_date=None, shipped_date=None, estimated_delivery_date=None, selling_party=None, ship_from_party=None, ship_to_party=None, shipment_measurements=None, import_details=None, shipped_items=None, cartons=None, pallets=None, _configuration=None):  # noqa: E501
        """ShipmentConfirmation - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._shipment_identifier = None
        self._shipment_confirmation_type = None
        self._shipment_type = None
        self._shipment_structure = None
        self._transportation_details = None
        self._amazon_reference_number = None
        self._shipment_confirmation_date = None
        self._shipped_date = None
        self._estimated_delivery_date = None
        self._selling_party = None
        self._ship_from_party = None
        self._ship_to_party = None
        self._shipment_measurements = None
        self._import_details = None
        self._shipped_items = None
        self._cartons = None
        self._pallets = None
        self.discriminator = None

        self.shipment_identifier = shipment_identifier
        self.shipment_confirmation_type = shipment_confirmation_type
        if shipment_type is not None:
            self.shipment_type = shipment_type
        if shipment_structure is not None:
            self.shipment_structure = shipment_structure
        if transportation_details is not None:
            self.transportation_details = transportation_details
        if amazon_reference_number is not None:
            self.amazon_reference_number = amazon_reference_number
        self.shipment_confirmation_date = shipment_confirmation_date
        if shipped_date is not None:
            self.shipped_date = shipped_date
        if estimated_delivery_date is not None:
            self.estimated_delivery_date = estimated_delivery_date
        self.selling_party = selling_party
        self.ship_from_party = ship_from_party
        self.ship_to_party = ship_to_party
        if shipment_measurements is not None:
            self.shipment_measurements = shipment_measurements
        if import_details is not None:
            self.import_details = import_details
        self.shipped_items = shipped_items
        if cartons is not None:
            self.cartons = cartons
        if pallets is not None:
            self.pallets = pallets

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

        Unique shipment ID (not used over the last 365 days).  # noqa: E501

        :return: The shipment_identifier of this ShipmentConfirmation.  # noqa: E501
        :rtype: str
        """
        return self._shipment_identifier

    @shipment_identifier.setter
    def shipment_identifier(self, shipment_identifier):
        """Sets the shipment_identifier of this ShipmentConfirmation.

        Unique shipment ID (not used over the last 365 days).  # noqa: E501

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

        self._shipment_identifier = shipment_identifier

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

        Indicates if this shipment confirmation is the initial confirmation, or intended to replace an already posted shipment confirmation. If replacing an existing shipment confirmation, be sure to provide the identical shipmentIdentifier and sellingParty information as in the previous confirmation.  # noqa: E501

        :return: The shipment_confirmation_type of this ShipmentConfirmation.  # noqa: E501
        :rtype: str
        """
        return self._shipment_confirmation_type

    @shipment_confirmation_type.setter
    def shipment_confirmation_type(self, shipment_confirmation_type):
        """Sets the shipment_confirmation_type of this ShipmentConfirmation.

        Indicates if this shipment confirmation is the initial confirmation, or intended to replace an already posted shipment confirmation. If replacing an existing shipment confirmation, be sure to provide the identical shipmentIdentifier and sellingParty information as in the previous confirmation.  # noqa: E501

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

        self._shipment_confirmation_type = shipment_confirmation_type

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

        The type of shipment.  # noqa: E501

        :return: The shipment_type of this ShipmentConfirmation.  # noqa: E501
        :rtype: str
        """
        return self._shipment_type

    @shipment_type.setter
    def shipment_type(self, shipment_type):
        """Sets the shipment_type of this ShipmentConfirmation.

        The type of shipment.  # noqa: E501

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

        self._shipment_type = shipment_type

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

        Shipment hierarchical structure.  # noqa: E501

        :return: The shipment_structure of this ShipmentConfirmation.  # noqa: E501
        :rtype: str
        """
        return self._shipment_structure

    @shipment_structure.setter
    def shipment_structure(self, shipment_structure):
        """Sets the shipment_structure of this ShipmentConfirmation.

        Shipment hierarchical structure.  # noqa: E501

        :param shipment_structure: The shipment_structure of this ShipmentConfirmation.  # noqa: E501
        :type: str
        """
        allowed_values = ["PalletizedAssortmentCase", "LooseAssortmentCase", "PalletOfItems", "PalletizedStandardCase", "LooseStandardCase", "MasterPallet", "MasterCase"]  # noqa: E501
        if (self._configuration.client_side_validation and
                shipment_structure not in allowed_values):
            raise ValueError(
                "Invalid value for `shipment_structure` ({0}), must be one of {1}"  # noqa: E501
                .format(shipment_structure, allowed_values)
            )

        self._shipment_structure = shipment_structure

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


        :return: The transportation_details of this ShipmentConfirmation.  # noqa: E501
        :rtype: TransportationDetailsForShipmentConfirmation
        """
        return self._transportation_details

    @transportation_details.setter
    def transportation_details(self, transportation_details):
        """Sets the transportation_details of this ShipmentConfirmation.


        :param transportation_details: The transportation_details of this ShipmentConfirmation.  # noqa: E501
        :type: TransportationDetailsForShipmentConfirmation
        """

        self._transportation_details = transportation_details

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

        The Amazon Reference Number is a unique identifier generated by Amazon for all Collect/WePay shipments when you submit  a routing request. This field is mandatory for Collect/WePay shipments.  # noqa: E501

        :return: The amazon_reference_number of this ShipmentConfirmation.  # noqa: E501
        :rtype: str
        """
        return self._amazon_reference_number

    @amazon_reference_number.setter
    def amazon_reference_number(self, amazon_reference_number):
        """Sets the amazon_reference_number of this ShipmentConfirmation.

        The Amazon Reference Number is a unique identifier generated by Amazon for all Collect/WePay shipments when you submit  a routing request. This field is mandatory for Collect/WePay shipments.  # noqa: E501

        :param amazon_reference_number: The amazon_reference_number of this ShipmentConfirmation.  # noqa: E501
        :type: str
        """

        self._amazon_reference_number = amazon_reference_number

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

        Date on which the shipment confirmation was submitted.  # noqa: E501

        :return: The shipment_confirmation_date of this ShipmentConfirmation.  # noqa: E501
        :rtype: datetime
        """
        return self._shipment_confirmation_date

    @shipment_confirmation_date.setter
    def shipment_confirmation_date(self, shipment_confirmation_date):
        """Sets the shipment_confirmation_date of this ShipmentConfirmation.

        Date on which the shipment confirmation was submitted.  # noqa: E501

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

        self._shipment_confirmation_date = shipment_confirmation_date

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

        The date and time of the departure of the shipment from the vendor's location. Vendors are requested to send ASNs within 30 minutes of departure from their warehouse/distribution center or at least 6 hours prior to the appointment time at the buyer destination warehouse, whichever is sooner. Shipped date mentioned in the shipment confirmation should not be in the future.  # noqa: E501

        :return: The shipped_date of this ShipmentConfirmation.  # noqa: E501
        :rtype: datetime
        """
        return self._shipped_date

    @shipped_date.setter
    def shipped_date(self, shipped_date):
        """Sets the shipped_date of this ShipmentConfirmation.

        The date and time of the departure of the shipment from the vendor's location. Vendors are requested to send ASNs within 30 minutes of departure from their warehouse/distribution center or at least 6 hours prior to the appointment time at the buyer destination warehouse, whichever is sooner. Shipped date mentioned in the shipment confirmation should not be in the future.  # noqa: E501

        :param shipped_date: The shipped_date of this ShipmentConfirmation.  # noqa: E501
        :type: datetime
        """

        self._shipped_date = shipped_date

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

        The date and time on which the shipment is estimated to reach buyer's warehouse. It needs to be an estimate based on the average transit time between ship from location and the destination. The exact appointment time will be provided by the buyer and is potentially not known when creating the shipment confirmation.  # noqa: E501

        :return: The estimated_delivery_date of this ShipmentConfirmation.  # noqa: E501
        :rtype: datetime
        """
        return self._estimated_delivery_date

    @estimated_delivery_date.setter
    def estimated_delivery_date(self, estimated_delivery_date):
        """Sets the estimated_delivery_date of this ShipmentConfirmation.

        The date and time on which the shipment is estimated to reach buyer's warehouse. It needs to be an estimate based on the average transit time between ship from location and the destination. The exact appointment time will be provided by the buyer and is potentially not known when creating the shipment confirmation.  # noqa: E501

        :param estimated_delivery_date: The estimated_delivery_date of this ShipmentConfirmation.  # noqa: E501
        :type: datetime
        """

        self._estimated_delivery_date = estimated_delivery_date

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


        :return: The selling_party of this ShipmentConfirmation.  # noqa: E501
        :rtype: PartyIdentification
        """
        return self._selling_party

    @selling_party.setter
    def selling_party(self, selling_party):
        """Sets the selling_party of this ShipmentConfirmation.


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

        self._selling_party = selling_party

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


        :return: The ship_from_party of this ShipmentConfirmation.  # noqa: E501
        :rtype: PartyIdentification
        """
        return self._ship_from_party

    @ship_from_party.setter
    def ship_from_party(self, ship_from_party):
        """Sets the ship_from_party of this ShipmentConfirmation.


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

        self._ship_from_party = ship_from_party

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


        :return: The ship_to_party of this ShipmentConfirmation.  # noqa: E501
        :rtype: PartyIdentification
        """
        return self._ship_to_party

    @ship_to_party.setter
    def ship_to_party(self, ship_to_party):
        """Sets the ship_to_party of this ShipmentConfirmation.


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

        self._ship_to_party = ship_to_party

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


        :return: The shipment_measurements of this ShipmentConfirmation.  # noqa: E501
        :rtype: ShipmentMeasurements
        """
        return self._shipment_measurements

    @shipment_measurements.setter
    def shipment_measurements(self, shipment_measurements):
        """Sets the shipment_measurements of this ShipmentConfirmation.


        :param shipment_measurements: The shipment_measurements of this ShipmentConfirmation.  # noqa: E501
        :type: ShipmentMeasurements
        """

        self._shipment_measurements = shipment_measurements

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


        :return: The import_details of this ShipmentConfirmation.  # noqa: E501
        :rtype: ImportDetails
        """
        return self._import_details

    @import_details.setter
    def import_details(self, import_details):
        """Sets the import_details of this ShipmentConfirmation.


        :param import_details: The import_details of this ShipmentConfirmation.  # noqa: E501
        :type: ImportDetails
        """

        self._import_details = import_details

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

        A list of the items in this shipment and their associated details. If any of the item detail fields are common at a carton or a pallet level, provide them at the corresponding carton or pallet level.  # noqa: E501

        :return: The shipped_items of this ShipmentConfirmation.  # noqa: E501
        :rtype: List[Item]
        """
        return self._shipped_items

    @shipped_items.setter
    def shipped_items(self, shipped_items):
        """Sets the shipped_items of this ShipmentConfirmation.

        A list of the items in this shipment and their associated details. If any of the item detail fields are common at a carton or a pallet level, provide them at the corresponding carton or pallet level.  # noqa: E501

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

        self._shipped_items = shipped_items

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

        A list of the cartons in this shipment.  # noqa: E501

        :return: The cartons of this ShipmentConfirmation.  # noqa: E501
        :rtype: List[Carton]
        """
        return self._cartons

    @cartons.setter
    def cartons(self, cartons):
        """Sets the cartons of this ShipmentConfirmation.

        A list of the cartons in this shipment.  # noqa: E501

        :param cartons: The cartons of this ShipmentConfirmation.  # noqa: E501
        :type: List[Carton]
        """

        self._cartons = cartons

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

        A list of the pallets in this shipment.  # noqa: E501

        :return: The pallets of this ShipmentConfirmation.  # noqa: E501
        :rtype: List[Pallet]
        """
        return self._pallets

    @pallets.setter
    def pallets(self, pallets):
        """Sets the pallets of this ShipmentConfirmation.

        A list of the pallets in this shipment.  # noqa: E501

        :param pallets: The pallets of this ShipmentConfirmation.  # noqa: E501
        :type: List[Pallet]
        """

        self._pallets = pallets

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

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