# 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 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 = {
        'vendor_shipment_identifier': 'str',
        'transaction_type': 'str',
        'buyer_reference_number': 'str',
        'transaction_date': 'datetime',
        'current_shipment_status': 'str',
        'currentshipment_status_date': 'datetime',
        'shipment_status_details': 'List[ShipmentStatusDetails]',
        'shipment_create_date': 'datetime',
        'shipment_confirm_date': 'datetime',
        'package_label_create_date': 'datetime',
        'shipment_freight_term': 'str',
        'selling_party': 'PartyIdentification',
        'ship_from_party': 'PartyIdentification',
        'ship_to_party': 'PartyIdentification',
        'shipment_measurements': 'TransportShipmentMeasurements',
        'collect_freight_pickup_details': 'CollectFreightPickupDetails',
        'purchase_orders': 'List[PurchaseOrders]',
        'import_details': 'ImportDetails',
        'containers': 'List[Containers]',
        'transportation_details': 'TransportationDetails',
    }

    attribute_map = {
        'vendor_shipment_identifier': 'vendorShipmentIdentifier',
        'transaction_type': 'transactionType',
        'buyer_reference_number': 'buyerReferenceNumber',
        'transaction_date': 'transactionDate',
        'current_shipment_status': 'currentShipmentStatus',
        'currentshipment_status_date': 'currentshipmentStatusDate',
        'shipment_status_details': 'shipmentStatusDetails',
        'shipment_create_date': 'shipmentCreateDate',
        'shipment_confirm_date': 'shipmentConfirmDate',
        'package_label_create_date': 'packageLabelCreateDate',
        'shipment_freight_term': 'shipmentFreightTerm',
        'selling_party': 'sellingParty',
        'ship_from_party': 'shipFromParty',
        'ship_to_party': 'shipToParty',
        'shipment_measurements': 'shipmentMeasurements',
        'collect_freight_pickup_details': 'collectFreightPickupDetails',
        'purchase_orders': 'purchaseOrders',
        'import_details': 'importDetails',
        'containers': 'containers',
        'transportation_details': 'transportationDetails',
    }

    def __init__(self, vendor_shipment_identifier=None, transaction_type=None, buyer_reference_number=None, transaction_date=None, current_shipment_status=None, currentshipment_status_date=None, shipment_status_details=None, shipment_create_date=None, shipment_confirm_date=None, package_label_create_date=None, shipment_freight_term=None, selling_party=None, ship_from_party=None, ship_to_party=None, shipment_measurements=None, collect_freight_pickup_details=None, purchase_orders=None, import_details=None, containers=None, transportation_details=None, _configuration=None):  # noqa: E501
        """Shipment - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._vendor_shipment_identifier = None
        self._transaction_type = None
        self._buyer_reference_number = None
        self._transaction_date = None
        self._current_shipment_status = None
        self._currentshipment_status_date = None
        self._shipment_status_details = None
        self._shipment_create_date = None
        self._shipment_confirm_date = None
        self._package_label_create_date = None
        self._shipment_freight_term = None
        self._selling_party = None
        self._ship_from_party = None
        self._ship_to_party = None
        self._shipment_measurements = None
        self._collect_freight_pickup_details = None
        self._purchase_orders = None
        self._import_details = None
        self._containers = None
        self._transportation_details = None
        self.discriminator = None

        self.vendor_shipment_identifier = vendor_shipment_identifier
        self.transaction_type = transaction_type
        if buyer_reference_number is not None:
            self.buyer_reference_number = buyer_reference_number
        self.transaction_date = transaction_date
        if current_shipment_status is not None:
            self.current_shipment_status = current_shipment_status
        if currentshipment_status_date is not None:
            self.currentshipment_status_date = currentshipment_status_date
        if shipment_status_details is not None:
            self.shipment_status_details = shipment_status_details
        if shipment_create_date is not None:
            self.shipment_create_date = shipment_create_date
        if shipment_confirm_date is not None:
            self.shipment_confirm_date = shipment_confirm_date
        if package_label_create_date is not None:
            self.package_label_create_date = package_label_create_date
        if shipment_freight_term is not None:
            self.shipment_freight_term = shipment_freight_term
        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 collect_freight_pickup_details is not None:
            self.collect_freight_pickup_details = collect_freight_pickup_details
        if purchase_orders is not None:
            self.purchase_orders = purchase_orders
        if import_details is not None:
            self.import_details = import_details
        if containers is not None:
            self.containers = containers
        if transportation_details is not None:
            self.transportation_details = transportation_details

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

        Unique Transportation ID created by Vendor (Should not be used over the last 365 days).  # noqa: E501

        :return: The vendor_shipment_identifier of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._vendor_shipment_identifier

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

        Unique Transportation ID created by Vendor (Should not be used over the last 365 days).  # noqa: E501

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

        self._vendor_shipment_identifier = vendor_shipment_identifier

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

        Indicates the type of transportation request (for example, `New` or `Cancel`). Each `transactionType` has a unique set of operations and there are corresponding details to be populated for each operation.  # noqa: E501

        :return: The transaction_type of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._transaction_type

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

        Indicates the type of transportation request (for example, `New` or `Cancel`). Each `transactionType` has a unique set of operations and there are corresponding details to be populated for each operation.  # noqa: E501

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

        self._transaction_type = transaction_type

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

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

        :return: The buyer_reference_number of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._buyer_reference_number

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

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

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

        self._buyer_reference_number = buyer_reference_number

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

        Date on which the transportation request was submitted.  # noqa: E501

        :return: The transaction_date of this Shipment.  # noqa: E501
        :rtype: datetime
        """
        return self._transaction_date

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

        Date on which the transportation request was submitted.  # noqa: E501

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

        self._transaction_date = transaction_date

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

        Indicates the current shipment status.  # noqa: E501

        :return: The current_shipment_status of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._current_shipment_status

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

        Indicates the current shipment status.  # noqa: E501

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

        self._current_shipment_status = current_shipment_status

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

        Date and time when the last status was updated.  # noqa: E501

        :return: The currentshipment_status_date of this Shipment.  # noqa: E501
        :rtype: datetime
        """
        return self._currentshipment_status_date

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

        Date and time when the last status was updated.  # noqa: E501

        :param currentshipment_status_date: The currentshipment_status_date of this Shipment.  # noqa: E501
        :type: datetime
        """

        self._currentshipment_status_date = currentshipment_status_date

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

        Indicates the list of current shipment status details and when the last update was received from carrier this is available on shipment Details response.  # noqa: E501

        :return: The shipment_status_details of this Shipment.  # noqa: E501
        :rtype: List[ShipmentStatusDetails]
        """
        return self._shipment_status_details

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

        Indicates the list of current shipment status details and when the last update was received from carrier this is available on shipment Details response.  # noqa: E501

        :param shipment_status_details: The shipment_status_details of this Shipment.  # noqa: E501
        :type: List[ShipmentStatusDetails]
        """

        self._shipment_status_details = shipment_status_details

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

        The date and time of the shipment request created by vendor.  # noqa: E501

        :return: The shipment_create_date of this Shipment.  # noqa: E501
        :rtype: datetime
        """
        return self._shipment_create_date

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

        The date and time of the shipment request created by vendor.  # noqa: E501

        :param shipment_create_date: The shipment_create_date of this Shipment.  # noqa: E501
        :type: datetime
        """

        self._shipment_create_date = shipment_create_date

    @property
    def shipment_confirm_date(self):
        """Gets the shipment_confirm_date of this Shipment.  # 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 shipment_confirm_date of this Shipment.  # noqa: E501
        :rtype: datetime
        """
        return self._shipment_confirm_date

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

        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 shipment_confirm_date: The shipment_confirm_date of this Shipment.  # noqa: E501
        :type: datetime
        """

        self._shipment_confirm_date = shipment_confirm_date

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

        The date and time of the package label created for the shipment by buyer.  # noqa: E501

        :return: The package_label_create_date of this Shipment.  # noqa: E501
        :rtype: datetime
        """
        return self._package_label_create_date

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

        The date and time of the package label created for the shipment by buyer.  # noqa: E501

        :param package_label_create_date: The package_label_create_date of this Shipment.  # noqa: E501
        :type: datetime
        """

        self._package_label_create_date = package_label_create_date

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

        Specifies if payment is Collect (WePay) or Prepaid (TheyPay). Required.  # noqa: E501

        :return: The shipment_freight_term of this Shipment.  # noqa: E501
        :rtype: str
        """
        return self._shipment_freight_term

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

        Specifies if payment is Collect (WePay) or Prepaid (TheyPay). Required.  # noqa: E501

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

        self._shipment_freight_term = shipment_freight_term

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


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

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


        :param selling_party: The selling_party of this Shipment.  # 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 Shipment.  # noqa: E501


        :return: The ship_from_party of this Shipment.  # 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 Shipment.


        :param ship_from_party: The ship_from_party of this Shipment.  # 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 Shipment.  # noqa: E501


        :return: The ship_to_party of this Shipment.  # 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 Shipment.


        :param ship_to_party: The ship_to_party of this Shipment.  # 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 Shipment.  # noqa: E501


        :return: The shipment_measurements of this Shipment.  # noqa: E501
        :rtype: TransportShipmentMeasurements
        """
        return self._shipment_measurements

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


        :param shipment_measurements: The shipment_measurements of this Shipment.  # noqa: E501
        :type: TransportShipmentMeasurements
        """

        self._shipment_measurements = shipment_measurements

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


        :return: The collect_freight_pickup_details of this Shipment.  # noqa: E501
        :rtype: CollectFreightPickupDetails
        """
        return self._collect_freight_pickup_details

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


        :param collect_freight_pickup_details: The collect_freight_pickup_details of this Shipment.  # noqa: E501
        :type: CollectFreightPickupDetails
        """

        self._collect_freight_pickup_details = collect_freight_pickup_details

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

        Indicates the purchase orders involved for the transportation request. This group is an array create 1 for each PO and list their corresponding items. This information is used for deciding the route,truck allocation and storage efficiently. This is a mandatory information for Buyer performing transportation from vendor warehouse (WePay/Collect)  # noqa: E501

        :return: The purchase_orders of this Shipment.  # noqa: E501
        :rtype: List[PurchaseOrders]
        """
        return self._purchase_orders

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

        Indicates the purchase orders involved for the transportation request. This group is an array create 1 for each PO and list their corresponding items. This information is used for deciding the route,truck allocation and storage efficiently. This is a mandatory information for Buyer performing transportation from vendor warehouse (WePay/Collect)  # noqa: E501

        :param purchase_orders: The purchase_orders of this Shipment.  # noqa: E501
        :type: List[PurchaseOrders]
        """

        self._purchase_orders = purchase_orders

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


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

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


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

        self._import_details = import_details

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

        A list of the items in this transportation and their associated inner container 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 containers of this Shipment.  # noqa: E501
        :rtype: List[Containers]
        """
        return self._containers

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

        A list of the items in this transportation and their associated inner container 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 containers: The containers of this Shipment.  # noqa: E501
        :type: List[Containers]
        """

        self._containers = containers

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


        :return: The transportation_details of this Shipment.  # noqa: E501
        :rtype: TransportationDetails
        """
        return self._transportation_details

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


        :param transportation_details: The transportation_details of this Shipment.  # noqa: E501
        :type: TransportationDetails
        """

        self._transportation_details = transportation_details

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