# coding: utf-8

"""
    Selling Partner API for Retail Procurement Orders

    The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.

    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 OrderDetails(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_date': 'datetime',
        'purchase_order_changed_date': 'datetime',
        'purchase_order_state_changed_date': 'datetime',
        'purchase_order_type': 'str',
        'import_details': 'ImportDetails',
        'deal_code': 'str',
        'payment_method': 'str',
        'buying_party': 'PartyIdentification',
        'selling_party': 'PartyIdentification',
        'ship_to_party': 'PartyIdentification',
        'bill_to_party': 'PartyIdentification',
        'ship_window': 'str',
        'delivery_window': 'str',
        'items': 'List[OrderItem]',
    }

    attribute_map = {
        'purchase_order_date': 'purchaseOrderDate',
        'purchase_order_changed_date': 'purchaseOrderChangedDate',
        'purchase_order_state_changed_date': 'purchaseOrderStateChangedDate',
        'purchase_order_type': 'purchaseOrderType',
        'import_details': 'importDetails',
        'deal_code': 'dealCode',
        'payment_method': 'paymentMethod',
        'buying_party': 'buyingParty',
        'selling_party': 'sellingParty',
        'ship_to_party': 'shipToParty',
        'bill_to_party': 'billToParty',
        'ship_window': 'shipWindow',
        'delivery_window': 'deliveryWindow',
        'items': 'items',
    }

    def __init__(self, purchase_order_date=None, purchase_order_changed_date=None, purchase_order_state_changed_date=None, purchase_order_type=None, import_details=None, deal_code=None, payment_method=None, buying_party=None, selling_party=None, ship_to_party=None, bill_to_party=None, ship_window=None, delivery_window=None, items=None, _configuration=None):  # noqa: E501
        """OrderDetails - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._purchase_order_date = None
        self._purchase_order_changed_date = None
        self._purchase_order_state_changed_date = None
        self._purchase_order_type = None
        self._import_details = None
        self._deal_code = None
        self._payment_method = None
        self._buying_party = None
        self._selling_party = None
        self._ship_to_party = None
        self._bill_to_party = None
        self._ship_window = None
        self._delivery_window = None
        self._items = None
        self.discriminator = None

        self.purchase_order_date = purchase_order_date
        if purchase_order_changed_date is not None:
            self.purchase_order_changed_date = purchase_order_changed_date
        self.purchase_order_state_changed_date = purchase_order_state_changed_date
        if purchase_order_type is not None:
            self.purchase_order_type = purchase_order_type
        if import_details is not None:
            self.import_details = import_details
        if deal_code is not None:
            self.deal_code = deal_code
        if payment_method is not None:
            self.payment_method = payment_method
        if buying_party is not None:
            self.buying_party = buying_party
        if selling_party is not None:
            self.selling_party = selling_party
        if ship_to_party is not None:
            self.ship_to_party = ship_to_party
        if bill_to_party is not None:
            self.bill_to_party = bill_to_party
        if ship_window is not None:
            self.ship_window = ship_window
        if delivery_window is not None:
            self.delivery_window = delivery_window
        self.items = items

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

        The date the purchase order was placed. Must be in ISO-8601 date/time format.  # noqa: E501

        :return: The purchase_order_date of this OrderDetails.  # noqa: E501
        :rtype: datetime
        """
        return self._purchase_order_date

    @purchase_order_date.setter
    def purchase_order_date(self, purchase_order_date):
        """Sets the purchase_order_date of this OrderDetails.

        The date the purchase order was placed. Must be in ISO-8601 date/time format.  # noqa: E501

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

        self._purchase_order_date = purchase_order_date

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

        The date when purchase order was last changed by Amazon after the order was placed. This date will be greater than 'purchaseOrderDate'. This means the PO data was changed on that date and vendors are required to fulfill the  updated PO. The PO changes can be related to Item Quantity, Ship to Location, Ship Window etc. This field will not be present in orders that have not changed after creation. Must be in ISO-8601 date/time format.  # noqa: E501

        :return: The purchase_order_changed_date of this OrderDetails.  # noqa: E501
        :rtype: datetime
        """
        return self._purchase_order_changed_date

    @purchase_order_changed_date.setter
    def purchase_order_changed_date(self, purchase_order_changed_date):
        """Sets the purchase_order_changed_date of this OrderDetails.

        The date when purchase order was last changed by Amazon after the order was placed. This date will be greater than 'purchaseOrderDate'. This means the PO data was changed on that date and vendors are required to fulfill the  updated PO. The PO changes can be related to Item Quantity, Ship to Location, Ship Window etc. This field will not be present in orders that have not changed after creation. Must be in ISO-8601 date/time format.  # noqa: E501

        :param purchase_order_changed_date: The purchase_order_changed_date of this OrderDetails.  # noqa: E501
        :type: datetime
        """

        self._purchase_order_changed_date = purchase_order_changed_date

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

        The date when current purchase order state was changed. Current purchase order state is available in the field 'purchaseOrderState'. Must be in ISO-8601 date/time format.  # noqa: E501

        :return: The purchase_order_state_changed_date of this OrderDetails.  # noqa: E501
        :rtype: datetime
        """
        return self._purchase_order_state_changed_date

    @purchase_order_state_changed_date.setter
    def purchase_order_state_changed_date(self, purchase_order_state_changed_date):
        """Sets the purchase_order_state_changed_date of this OrderDetails.

        The date when current purchase order state was changed. Current purchase order state is available in the field 'purchaseOrderState'. Must be in ISO-8601 date/time format.  # noqa: E501

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

        self._purchase_order_state_changed_date = purchase_order_state_changed_date

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

        Type of purchase order.  # noqa: E501

        :return: The purchase_order_type of this OrderDetails.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_type

    @purchase_order_type.setter
    def purchase_order_type(self, purchase_order_type):
        """Sets the purchase_order_type of this OrderDetails.

        Type of purchase order.  # noqa: E501

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

        self._purchase_order_type = purchase_order_type

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


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

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


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

        self._import_details = import_details

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

        If requested by the recipient, this field will contain a promotional/deal number. The discount code line is optional. It is used to obtain a price discount on items on the order.  # noqa: E501

        :return: The deal_code of this OrderDetails.  # noqa: E501
        :rtype: str
        """
        return self._deal_code

    @deal_code.setter
    def deal_code(self, deal_code):
        """Sets the deal_code of this OrderDetails.

        If requested by the recipient, this field will contain a promotional/deal number. The discount code line is optional. It is used to obtain a price discount on items on the order.  # noqa: E501

        :param deal_code: The deal_code of this OrderDetails.  # noqa: E501
        :type: str
        """

        self._deal_code = deal_code

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

        Payment method used.  # noqa: E501

        :return: The payment_method of this OrderDetails.  # noqa: E501
        :rtype: str
        """
        return self._payment_method

    @payment_method.setter
    def payment_method(self, payment_method):
        """Sets the payment_method of this OrderDetails.

        Payment method used.  # noqa: E501

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

        self._payment_method = payment_method

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


        :return: The buying_party of this OrderDetails.  # noqa: E501
        :rtype: PartyIdentification
        """
        return self._buying_party

    @buying_party.setter
    def buying_party(self, buying_party):
        """Sets the buying_party of this OrderDetails.


        :param buying_party: The buying_party of this OrderDetails.  # noqa: E501
        :type: PartyIdentification
        """

        self._buying_party = buying_party

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


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

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


        :param selling_party: The selling_party of this OrderDetails.  # noqa: E501
        :type: PartyIdentification
        """

        self._selling_party = selling_party

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


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


        :param ship_to_party: The ship_to_party of this OrderDetails.  # noqa: E501
        :type: PartyIdentification
        """

        self._ship_to_party = ship_to_party

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


        :return: The bill_to_party of this OrderDetails.  # noqa: E501
        :rtype: PartyIdentification
        """
        return self._bill_to_party

    @bill_to_party.setter
    def bill_to_party(self, bill_to_party):
        """Sets the bill_to_party of this OrderDetails.


        :param bill_to_party: The bill_to_party of this OrderDetails.  # noqa: E501
        :type: PartyIdentification
        """

        self._bill_to_party = bill_to_party

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

        Defines a date time interval according to ISO8601. Interval is separated by double hyphen (--).  # noqa: E501

        :return: The ship_window of this OrderDetails.  # noqa: E501
        :rtype: str
        """
        return self._ship_window

    @ship_window.setter
    def ship_window(self, ship_window):
        """Sets the ship_window of this OrderDetails.

        Defines a date time interval according to ISO8601. Interval is separated by double hyphen (--).  # noqa: E501

        :param ship_window: The ship_window of this OrderDetails.  # noqa: E501
        :type: str
        """

        self._ship_window = ship_window

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

        Defines a date time interval according to ISO8601. Interval is separated by double hyphen (--).  # noqa: E501

        :return: The delivery_window of this OrderDetails.  # noqa: E501
        :rtype: str
        """
        return self._delivery_window

    @delivery_window.setter
    def delivery_window(self, delivery_window):
        """Sets the delivery_window of this OrderDetails.

        Defines a date time interval according to ISO8601. Interval is separated by double hyphen (--).  # noqa: E501

        :param delivery_window: The delivery_window of this OrderDetails.  # noqa: E501
        :type: str
        """

        self._delivery_window = delivery_window

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

        A list of items in this purchase order.  # noqa: E501

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

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

        A list of items in this purchase order.  # noqa: E501

        :param items: The items of this OrderDetails.  # noqa: E501
        :type: List[OrderItem]
        """
        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(OrderDetails, 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, OrderDetails):
            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, OrderDetails):
            return True

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