# coding: utf-8

"""
    Selling Partner API for Direct Fulfillment Shipping

    Use the Selling Partner API for Direct Fulfillment Shipping to access a direct fulfillment vendor's shipping data.

    The version of the OpenAPI document: 2021-12-28
    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 = {
        'purchase_order_number': 'str',
        'shipment_details': 'ShipmentDetails',
        'selling_party': 'PartyIdentification',
        'ship_from_party': 'PartyIdentification',
        'items': 'List[Item]',
        'containers': 'List[Container]',
    }

    attribute_map = {
        'purchase_order_number': 'purchaseOrderNumber',
        'shipment_details': 'shipmentDetails',
        'selling_party': 'sellingParty',
        'ship_from_party': 'shipFromParty',
        'items': 'items',
        'containers': 'containers',
    }

    def __init__(self, purchase_order_number=None, shipment_details=None, selling_party=None, ship_from_party=None, items=None, containers=None, _configuration=None):  # noqa: E501
        """ShipmentConfirmation - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._purchase_order_number = None
        self._shipment_details = None
        self._selling_party = None
        self._ship_from_party = None
        self._items = None
        self._containers = None
        self.discriminator = None

        self.purchase_order_number = purchase_order_number
        self.shipment_details = shipment_details
        self.selling_party = selling_party
        self.ship_from_party = ship_from_party
        self.items = items
        if containers is not None:
            self.containers = containers

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

        Purchase order number corresponding to the shipment.  # noqa: E501

        :return: The purchase_order_number of this ShipmentConfirmation.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_number

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

        Purchase order number corresponding to the shipment.  # noqa: E501

        :param purchase_order_number: The purchase_order_number of this ShipmentConfirmation.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and purchase_order_number is None:
            raise ValueError("Invalid value for `purchase_order_number`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                purchase_order_number is not None and not re.search(r'^[a-zA-Z0-9]+$', purchase_order_number)):  # noqa: E501
            raise ValueError(r"Invalid value for `purchase_order_number`, must be a follow pattern or equal to `/^[a-zA-Z0-9]+$/`")  # noqa: E501

        self._purchase_order_number = purchase_order_number

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


        :return: The shipment_details of this ShipmentConfirmation.  # noqa: E501
        :rtype: ShipmentDetails
        """
        return self._shipment_details

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


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

        self._shipment_details = shipment_details

    @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 items(self):
        """Gets the items of this ShipmentConfirmation.  # noqa: E501

        Provide the details of the items in this shipment. If any of the item details field is common at a package or a pallet level, then provide them at the corresponding package.  # noqa: E501

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

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

        Provide the details of the items in this shipment. If any of the item details field is common at a package or a pallet level, then provide them at the corresponding package.  # noqa: E501

        :param items: The items of this ShipmentConfirmation.  # 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

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

        Provide the details of the items in this shipment. If any of the item details field is common at a package or a pallet level, then provide them at the corresponding package.  # noqa: E501

        :return: The containers of this ShipmentConfirmation.  # noqa: E501
        :rtype: List[Container]
        """
        return self._containers

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

        Provide the details of the items in this shipment. If any of the item details field is common at a package or a pallet level, then provide them at the corresponding package.  # noqa: E501

        :param containers: The containers of this ShipmentConfirmation.  # noqa: E501
        :type: List[Container]
        """

        self._containers = containers

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