# coding: utf-8

"""
    Selling Partner API for Direct Fulfillment Orders

    The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order 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 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 = {
        'customer_order_number': 'str',
        'order_date': 'datetime',
        'order_status': 'str',
        'shipment_details': 'ShipmentDetails',
        'tax_total': 'TaxItemDetails',
        'selling_party': 'PartyIdentification',
        'ship_from_party': 'PartyIdentification',
        'ship_to_party': 'Address',
        'bill_to_party': 'PartyIdentification',
        'has_customizable_items': 'bool',
        'items': 'List[OrderItem]',
    }

    attribute_map = {
        'customer_order_number': 'customerOrderNumber',
        'order_date': 'orderDate',
        'order_status': 'orderStatus',
        'shipment_details': 'shipmentDetails',
        'tax_total': 'taxTotal',
        'selling_party': 'sellingParty',
        'ship_from_party': 'shipFromParty',
        'ship_to_party': 'shipToParty',
        'bill_to_party': 'billToParty',
        'has_customizable_items': 'hasCustomizableItems',
        'items': 'items',
    }

    def __init__(self, customer_order_number=None, order_date=None, order_status=None, shipment_details=None, tax_total=None, selling_party=None, ship_from_party=None, ship_to_party=None, bill_to_party=None, has_customizable_items=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._customer_order_number = None
        self._order_date = None
        self._order_status = None
        self._shipment_details = None
        self._tax_total = None
        self._selling_party = None
        self._ship_from_party = None
        self._ship_to_party = None
        self._bill_to_party = None
        self._has_customizable_items = None
        self._items = None
        self.discriminator = None

        self.customer_order_number = customer_order_number
        self.order_date = order_date
        if order_status is not None:
            self.order_status = order_status
        self.shipment_details = shipment_details
        if tax_total is not None:
            self.tax_total = tax_total
        self.selling_party = selling_party
        self.ship_from_party = ship_from_party
        self.ship_to_party = ship_to_party
        self.bill_to_party = bill_to_party
        if has_customizable_items is not None:
            self.has_customizable_items = has_customizable_items
        self.items = items

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

        The customer order number.  # noqa: E501

        :return: The customer_order_number of this OrderDetails.  # noqa: E501
        :rtype: str
        """
        return self._customer_order_number

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

        The customer order number.  # noqa: E501

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

        self._customer_order_number = customer_order_number

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

        The date the order was placed. This  field is expected to be in ISO-8601 date/time format, for example:2018-07-16T23:00:00Z/ 2018-07-16T23:00:00-05:00 /2018-07-16T23:00:00-08:00. If no time zone is specified, UTC should be assumed.  # noqa: E501

        :return: The order_date of this OrderDetails.  # noqa: E501
        :rtype: datetime
        """
        return self._order_date

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

        The date the order was placed. This  field is expected to be in ISO-8601 date/time format, for example:2018-07-16T23:00:00Z/ 2018-07-16T23:00:00-05:00 /2018-07-16T23:00:00-08:00. If no time zone is specified, UTC should be assumed.  # noqa: E501

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

        self._order_date = order_date

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

        Current status of the order.  # noqa: E501

        :return: The order_status of this OrderDetails.  # noqa: E501
        :rtype: str
        """
        return self._order_status

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

        Current status of the order.  # noqa: E501

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

        self._order_status = order_status

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


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

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


        :param shipment_details: The shipment_details of this OrderDetails.  # 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 tax_total(self):
        """Gets the tax_total of this OrderDetails.  # noqa: E501


        :return: The tax_total of this OrderDetails.  # noqa: E501
        :rtype: TaxItemDetails
        """
        return self._tax_total

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


        :param tax_total: The tax_total of this OrderDetails.  # noqa: E501
        :type: TaxItemDetails
        """

        self._tax_total = tax_total

    @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
        """
        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 OrderDetails.  # noqa: E501


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


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


        :return: The ship_to_party of this OrderDetails.  # noqa: E501
        :rtype: Address
        """
        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: Address
        """
        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 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
        """
        if self._configuration.client_side_validation and bill_to_party is None:
            raise ValueError("Invalid value for `bill_to_party`, must not be `None`")  # noqa: E501

        self._bill_to_party = bill_to_party

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

        When `true`, the order contains customizable items.  # noqa: E501

        :return: The has_customizable_items of this OrderDetails.  # noqa: E501
        :rtype: bool
        """
        return self._has_customizable_items

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

        When `true`, the order contains customizable items.  # noqa: E501

        :param has_customizable_items: The has_customizable_items of this OrderDetails.  # noqa: E501
        :type: bool
        """

        self._has_customizable_items = has_customizable_items

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