# 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 OrderStatus(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',
        'purchase_order_status': 'str',
        'purchase_order_date': 'datetime',
        'last_updated_date': 'datetime',
        'selling_party': 'PartyIdentification',
        'ship_to_party': 'PartyIdentification',
        'item_status': 'List[OrderItemStatus]',
    }

    attribute_map = {
        'purchase_order_number': 'purchaseOrderNumber',
        'purchase_order_status': 'purchaseOrderStatus',
        'purchase_order_date': 'purchaseOrderDate',
        'last_updated_date': 'lastUpdatedDate',
        'selling_party': 'sellingParty',
        'ship_to_party': 'shipToParty',
        'item_status': 'itemStatus',
    }

    def __init__(self, purchase_order_number=None, purchase_order_status=None, purchase_order_date=None, last_updated_date=None, selling_party=None, ship_to_party=None, item_status=None, _configuration=None):  # noqa: E501
        """OrderStatus - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._purchase_order_number = None
        self._purchase_order_status = None
        self._purchase_order_date = None
        self._last_updated_date = None
        self._selling_party = None
        self._ship_to_party = None
        self._item_status = None
        self.discriminator = None

        self.purchase_order_number = purchase_order_number
        self.purchase_order_status = purchase_order_status
        self.purchase_order_date = purchase_order_date
        if last_updated_date is not None:
            self.last_updated_date = last_updated_date
        self.selling_party = selling_party
        self.ship_to_party = ship_to_party
        self.item_status = item_status

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

        The buyer's purchase order number for this order. Formatting Notes: 8-character alpha-numeric code.  # noqa: E501

        :return: The purchase_order_number of this OrderStatus.  # 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 OrderStatus.

        The buyer's purchase order number for this order. Formatting Notes: 8-character alpha-numeric code.  # noqa: E501

        :param purchase_order_number: The purchase_order_number of this OrderStatus.  # 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

        self._purchase_order_number = purchase_order_number

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

        The status of the buyer's purchase order for this order.  # noqa: E501

        :return: The purchase_order_status of this OrderStatus.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_status

    @purchase_order_status.setter
    def purchase_order_status(self, purchase_order_status):
        """Sets the purchase_order_status of this OrderStatus.

        The status of the buyer's purchase order for this order.  # noqa: E501

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

        self._purchase_order_status = purchase_order_status

    @property
    def purchase_order_date(self):
        """Gets the purchase_order_date of this OrderStatus.  # 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 OrderStatus.  # 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 OrderStatus.

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

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

        :return: The last_updated_date of this OrderStatus.  # noqa: E501
        :rtype: datetime
        """
        return self._last_updated_date

    @last_updated_date.setter
    def last_updated_date(self, last_updated_date):
        """Sets the last_updated_date of this OrderStatus.

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

        :param last_updated_date: The last_updated_date of this OrderStatus.  # noqa: E501
        :type: datetime
        """

        self._last_updated_date = last_updated_date

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


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

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


        :param selling_party: The selling_party of this OrderStatus.  # 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_to_party(self):
        """Gets the ship_to_party of this OrderStatus.  # noqa: E501


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


        :param ship_to_party: The ship_to_party of this OrderStatus.  # 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 item_status(self):
        """Gets the item_status of this OrderStatus.  # noqa: E501

        Detailed description of items order status.  # noqa: E501

        :return: The item_status of this OrderStatus.  # noqa: E501
        :rtype: List[OrderItemStatus]
        """
        return self._item_status

    @item_status.setter
    def item_status(self, item_status):
        """Sets the item_status of this OrderStatus.

        Detailed description of items order status.  # noqa: E501

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

        self._item_status = item_status

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

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