# 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 Order(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_state': 'str',
        'order_details': 'OrderDetails',
    }

    attribute_map = {
        'purchase_order_number': 'purchaseOrderNumber',
        'purchase_order_state': 'purchaseOrderState',
        'order_details': 'orderDetails',
    }

    def __init__(self, purchase_order_number=None, purchase_order_state=None, order_details=None, _configuration=None):  # noqa: E501
        """Order - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._purchase_order_number = None
        self._purchase_order_state = None
        self._order_details = None
        self.discriminator = None

        self.purchase_order_number = purchase_order_number
        self.purchase_order_state = purchase_order_state
        if order_details is not None:
            self.order_details = order_details

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

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

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

        The 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 Order.  # 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_state(self):
        """Gets the purchase_order_state of this Order.  # noqa: E501

        This field will contain the current state of the purchase order.  # noqa: E501

        :return: The purchase_order_state of this Order.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_state

    @purchase_order_state.setter
    def purchase_order_state(self, purchase_order_state):
        """Sets the purchase_order_state of this Order.

        This field will contain the current state of the purchase order.  # noqa: E501

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

        self._purchase_order_state = purchase_order_state

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


        :return: The order_details of this Order.  # noqa: E501
        :rtype: OrderDetails
        """
        return self._order_details

    @order_details.setter
    def order_details(self, order_details):
        """Sets the order_details of this Order.


        :param order_details: The order_details of this Order.  # noqa: E501
        :type: OrderDetails
        """

        self._order_details = order_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(Order, 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, Order):
            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, Order):
            return True

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