# coding: utf-8

"""
    Order API

    The Order API provides interfaces that let shoppers pay for items (for both eBay guest and eBay member buyers). It also returns payment and shipping status of the order. It enables eBay partners to use accept payment without being <a href=\"https://www.pcisecuritystandards.org/\">PCI compliant</a> and use the <a href=\"/api-docs/buy/static/api-order.html#Post\">Post Order API</a> for returns and cancellations for eBay member buyers.   <p>The Order API has the following resources:  </p>  <ul>  <li><b>checkout_session:</b> Lets eBay members purchase items using PayPal or a credit card.</li>  <li><b>guest_checkout_session:</b> Lets eBay guests purchase items using a credit card or the <a href=\"/api-docs/buy/static/api-order.html#spb-checkout\">PayPal Smart Button</a>.</li>   <li><b>proxy_guest_checkout_session:</b> Lets eBay guests purchase items through a <a href=\"/api-docs/buy/static/api-order.html#vsp-checkout\">vault service provider</a> (VSP). &nbsp;&nbsp;<b>*Note:* </b>Due to the requirement of having a VSP, this resource is not available in the eBay <a href=\"https://developer.ebay.com/my/api_test_tool?index=0\">API Explorer</a>.</li>  <li><b>guest_purchase_order</b> and <b>purchase_order:</b> Lets eBay partners track the payment status and show the buyers their purchase order. </li> </ul>  # noqa: E501

    OpenAPI spec version: v1_beta.29.1
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class PurchaseOrder(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 = {
        'applied_coupons': 'list[Coupon]',
        'line_items': 'list[OrderLineItem]',
        'payment_instrument': 'PaymentInstrument',
        'pricing_summary': 'PricingSummary',
        'purchase_order_creation_date': 'str',
        'purchase_order_id': 'str',
        'purchase_order_payment_status': 'str',
        'purchase_order_status': 'str',
        'purchase_order_web_url': 'str',
        'refunded_amount': 'Amount',
        'shipping_address': 'ShippingAddress',
        'shipping_fulfillments': 'list[ShippingFulfillment]',
        'warnings': 'list[Error]'
    }

    attribute_map = {
        'applied_coupons': 'appliedCoupons',
        'line_items': 'lineItems',
        'payment_instrument': 'paymentInstrument',
        'pricing_summary': 'pricingSummary',
        'purchase_order_creation_date': 'purchaseOrderCreationDate',
        'purchase_order_id': 'purchaseOrderId',
        'purchase_order_payment_status': 'purchaseOrderPaymentStatus',
        'purchase_order_status': 'purchaseOrderStatus',
        'purchase_order_web_url': 'purchaseOrderWebUrl',
        'refunded_amount': 'refundedAmount',
        'shipping_address': 'shippingAddress',
        'shipping_fulfillments': 'shippingFulfillments',
        'warnings': 'warnings'
    }

    def __init__(self, applied_coupons=None, line_items=None, payment_instrument=None, pricing_summary=None, purchase_order_creation_date=None, purchase_order_id=None, purchase_order_payment_status=None, purchase_order_status=None, purchase_order_web_url=None, refunded_amount=None, shipping_address=None, shipping_fulfillments=None, warnings=None):  # noqa: E501
        """PurchaseOrder - a model defined in Swagger"""  # noqa: E501
        self._applied_coupons = None
        self._line_items = None
        self._payment_instrument = None
        self._pricing_summary = None
        self._purchase_order_creation_date = None
        self._purchase_order_id = None
        self._purchase_order_payment_status = None
        self._purchase_order_status = None
        self._purchase_order_web_url = None
        self._refunded_amount = None
        self._shipping_address = None
        self._shipping_fulfillments = None
        self._warnings = None
        self.discriminator = None
        if applied_coupons is not None:
            self.applied_coupons = applied_coupons
        if line_items is not None:
            self.line_items = line_items
        if payment_instrument is not None:
            self.payment_instrument = payment_instrument
        if pricing_summary is not None:
            self.pricing_summary = pricing_summary
        if purchase_order_creation_date is not None:
            self.purchase_order_creation_date = purchase_order_creation_date
        if purchase_order_id is not None:
            self.purchase_order_id = purchase_order_id
        if purchase_order_payment_status is not None:
            self.purchase_order_payment_status = purchase_order_payment_status
        if purchase_order_status is not None:
            self.purchase_order_status = purchase_order_status
        if purchase_order_web_url is not None:
            self.purchase_order_web_url = purchase_order_web_url
        if refunded_amount is not None:
            self.refunded_amount = refunded_amount
        if shipping_address is not None:
            self.shipping_address = shipping_address
        if shipping_fulfillments is not None:
            self.shipping_fulfillments = shipping_fulfillments
        if warnings is not None:
            self.warnings = warnings

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

        The container that returns the information for the coupons that were applied in the order. Note: This container is not returned for the getPurchaseOrder and getGuestPurchaseOrder methods.  # noqa: E501

        :return: The applied_coupons of this PurchaseOrder.  # noqa: E501
        :rtype: list[Coupon]
        """
        return self._applied_coupons

    @applied_coupons.setter
    def applied_coupons(self, applied_coupons):
        """Sets the applied_coupons of this PurchaseOrder.

        The container that returns the information for the coupons that were applied in the order. Note: This container is not returned for the getPurchaseOrder and getGuestPurchaseOrder methods.  # noqa: E501

        :param applied_coupons: The applied_coupons of this PurchaseOrder.  # noqa: E501
        :type: list[Coupon]
        """

        self._applied_coupons = applied_coupons

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

        An array of line items in the purchase order.  # noqa: E501

        :return: The line_items of this PurchaseOrder.  # noqa: E501
        :rtype: list[OrderLineItem]
        """
        return self._line_items

    @line_items.setter
    def line_items(self, line_items):
        """Sets the line_items of this PurchaseOrder.

        An array of line items in the purchase order.  # noqa: E501

        :param line_items: The line_items of this PurchaseOrder.  # noqa: E501
        :type: list[OrderLineItem]
        """

        self._line_items = line_items

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


        :return: The payment_instrument of this PurchaseOrder.  # noqa: E501
        :rtype: PaymentInstrument
        """
        return self._payment_instrument

    @payment_instrument.setter
    def payment_instrument(self, payment_instrument):
        """Sets the payment_instrument of this PurchaseOrder.


        :param payment_instrument: The payment_instrument of this PurchaseOrder.  # noqa: E501
        :type: PaymentInstrument
        """

        self._payment_instrument = payment_instrument

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


        :return: The pricing_summary of this PurchaseOrder.  # noqa: E501
        :rtype: PricingSummary
        """
        return self._pricing_summary

    @pricing_summary.setter
    def pricing_summary(self, pricing_summary):
        """Sets the pricing_summary of this PurchaseOrder.


        :param pricing_summary: The pricing_summary of this PurchaseOrder.  # noqa: E501
        :type: PricingSummary
        """

        self._pricing_summary = pricing_summary

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

        The timestamp of when the purchase order was created.  # noqa: E501

        :return: The purchase_order_creation_date of this PurchaseOrder.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_creation_date

    @purchase_order_creation_date.setter
    def purchase_order_creation_date(self, purchase_order_creation_date):
        """Sets the purchase_order_creation_date of this PurchaseOrder.

        The timestamp of when the purchase order was created.  # noqa: E501

        :param purchase_order_creation_date: The purchase_order_creation_date of this PurchaseOrder.  # noqa: E501
        :type: str
        """

        self._purchase_order_creation_date = purchase_order_creation_date

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

        The unique identifier of the purchase order. This value was returned in the purchaseOrderId field by the placeOrder method.  # noqa: E501

        :return: The purchase_order_id of this PurchaseOrder.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_id

    @purchase_order_id.setter
    def purchase_order_id(self, purchase_order_id):
        """Sets the purchase_order_id of this PurchaseOrder.

        The unique identifier of the purchase order. This value was returned in the purchaseOrderId field by the placeOrder method.  # noqa: E501

        :param purchase_order_id: The purchase_order_id of this PurchaseOrder.  # noqa: E501
        :type: str
        """

        self._purchase_order_id = purchase_order_id

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

        An enumeration value that indicates the status of the payment for the purchase order. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/buy/order/types/gct:PurchaseOrderPaymentStatusEnum'>eBay API documentation</a>  # noqa: E501

        :return: The purchase_order_payment_status of this PurchaseOrder.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_payment_status

    @purchase_order_payment_status.setter
    def purchase_order_payment_status(self, purchase_order_payment_status):
        """Sets the purchase_order_payment_status of this PurchaseOrder.

        An enumeration value that indicates the status of the payment for the purchase order. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/buy/order/types/gct:PurchaseOrderPaymentStatusEnum'>eBay API documentation</a>  # noqa: E501

        :param purchase_order_payment_status: The purchase_order_payment_status of this PurchaseOrder.  # noqa: E501
        :type: str
        """

        self._purchase_order_payment_status = purchase_order_payment_status

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

        The container for the current status of the buyer's payment and any refund that applies to the purchase order. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/buy/order/types/gct:PurchaseOrderStatusEnum'>eBay API documentation</a>  # noqa: E501

        :return: The purchase_order_status of this PurchaseOrder.  # 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 PurchaseOrder.

        The container for the current status of the buyer's payment and any refund that applies to the purchase order. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/buy/order/types/gct:PurchaseOrderStatusEnum'>eBay API documentation</a>  # noqa: E501

        :param purchase_order_status: The purchase_order_status of this PurchaseOrder.  # noqa: E501
        :type: str
        """

        self._purchase_order_status = purchase_order_status

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

        The URL to the Order Details page on eBay.  # noqa: E501

        :return: The purchase_order_web_url of this PurchaseOrder.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_web_url

    @purchase_order_web_url.setter
    def purchase_order_web_url(self, purchase_order_web_url):
        """Sets the purchase_order_web_url of this PurchaseOrder.

        The URL to the Order Details page on eBay.  # noqa: E501

        :param purchase_order_web_url: The purchase_order_web_url of this PurchaseOrder.  # noqa: E501
        :type: str
        """

        self._purchase_order_web_url = purchase_order_web_url

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


        :return: The refunded_amount of this PurchaseOrder.  # noqa: E501
        :rtype: Amount
        """
        return self._refunded_amount

    @refunded_amount.setter
    def refunded_amount(self, refunded_amount):
        """Sets the refunded_amount of this PurchaseOrder.


        :param refunded_amount: The refunded_amount of this PurchaseOrder.  # noqa: E501
        :type: Amount
        """

        self._refunded_amount = refunded_amount

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


        :return: The shipping_address of this PurchaseOrder.  # noqa: E501
        :rtype: ShippingAddress
        """
        return self._shipping_address

    @shipping_address.setter
    def shipping_address(self, shipping_address):
        """Sets the shipping_address of this PurchaseOrder.


        :param shipping_address: The shipping_address of this PurchaseOrder.  # noqa: E501
        :type: ShippingAddress
        """

        self._shipping_address = shipping_address

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

        An array of the shipping providers and the purchase order delivery details.  # noqa: E501

        :return: The shipping_fulfillments of this PurchaseOrder.  # noqa: E501
        :rtype: list[ShippingFulfillment]
        """
        return self._shipping_fulfillments

    @shipping_fulfillments.setter
    def shipping_fulfillments(self, shipping_fulfillments):
        """Sets the shipping_fulfillments of this PurchaseOrder.

        An array of the shipping providers and the purchase order delivery details.  # noqa: E501

        :param shipping_fulfillments: The shipping_fulfillments of this PurchaseOrder.  # noqa: E501
        :type: list[ShippingFulfillment]
        """

        self._shipping_fulfillments = shipping_fulfillments

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

        An array of warning messages. These type of errors do not prevent the call from executing but should be checked.  # noqa: E501

        :return: The warnings of this PurchaseOrder.  # noqa: E501
        :rtype: list[Error]
        """
        return self._warnings

    @warnings.setter
    def warnings(self, warnings):
        """Sets the warnings of this PurchaseOrder.

        An array of warning messages. These type of errors do not prevent the call from executing but should be checked.  # noqa: E501

        :param warnings: The warnings of this PurchaseOrder.  # noqa: E501
        :type: list[Error]
        """

        self._warnings = warnings

    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(PurchaseOrder, 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, PurchaseOrder):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
