# coding: utf-8

"""
    Allegro REST API

    https://developer.allegro.pl/about  # noqa: E501

    The version of the OpenAPI document: 2020.03.10
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from allegro_api.configuration import Configuration


class CheckoutForm(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'id': 'str',
        'message_to_seller': 'str',
        'buyer': 'CheckoutFormBuyerReference',
        'payment': 'CheckoutFormPaymentReference',
        'status': 'CheckoutFormStatus',
        'fulfillment': 'CheckoutFormFulfillment',
        'delivery': 'CheckoutFormDeliveryReference',
        'invoice': 'CheckoutFormInvoiceInfo',
        'line_items': 'list[CheckoutFormLineItem]',
        'surcharges': 'list[CheckoutFormPaymentReference]',
        'discounts': 'list[CheckoutFormDiscount]',
        'summary': 'CheckoutFormSummary',
        'updated_at': 'str'
    }

    attribute_map = {
        'id': 'id',
        'message_to_seller': 'messageToSeller',
        'buyer': 'buyer',
        'payment': 'payment',
        'status': 'status',
        'fulfillment': 'fulfillment',
        'delivery': 'delivery',
        'invoice': 'invoice',
        'line_items': 'lineItems',
        'surcharges': 'surcharges',
        'discounts': 'discounts',
        'summary': 'summary',
        'updated_at': 'updatedAt'
    }

    def __init__(self, id=None, message_to_seller=None, buyer=None, payment=None, status=None, fulfillment=None, delivery=None, invoice=None, line_items=None, surcharges=None, discounts=None, summary=None, updated_at=None, local_vars_configuration=None):  # noqa: E501
        """CheckoutForm - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._message_to_seller = None
        self._buyer = None
        self._payment = None
        self._status = None
        self._fulfillment = None
        self._delivery = None
        self._invoice = None
        self._line_items = None
        self._surcharges = None
        self._discounts = None
        self._summary = None
        self._updated_at = None
        self.discriminator = None

        self.id = id
        if message_to_seller is not None:
            self.message_to_seller = message_to_seller
        self.buyer = buyer
        if payment is not None:
            self.payment = payment
        self.status = status
        if fulfillment is not None:
            self.fulfillment = fulfillment
        if delivery is not None:
            self.delivery = delivery
        if invoice is not None:
            self.invoice = invoice
        self.line_items = line_items
        self.surcharges = surcharges
        self.discounts = discounts
        self.summary = summary
        if updated_at is not None:
            self.updated_at = updated_at

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

        Checkout form id  # noqa: E501

        :return: The id of this CheckoutForm.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this CheckoutForm.

        Checkout form id  # noqa: E501

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

        self._id = id

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

        Message from buyer to seller  # noqa: E501

        :return: The message_to_seller of this CheckoutForm.  # noqa: E501
        :rtype: str
        """
        return self._message_to_seller

    @message_to_seller.setter
    def message_to_seller(self, message_to_seller):
        """Sets the message_to_seller of this CheckoutForm.

        Message from buyer to seller  # noqa: E501

        :param message_to_seller: The message_to_seller of this CheckoutForm.  # noqa: E501
        :type: str
        """

        self._message_to_seller = message_to_seller

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


        :return: The buyer of this CheckoutForm.  # noqa: E501
        :rtype: CheckoutFormBuyerReference
        """
        return self._buyer

    @buyer.setter
    def buyer(self, buyer):
        """Sets the buyer of this CheckoutForm.


        :param buyer: The buyer of this CheckoutForm.  # noqa: E501
        :type: CheckoutFormBuyerReference
        """
        if self.local_vars_configuration.client_side_validation and buyer is None:  # noqa: E501
            raise ValueError("Invalid value for `buyer`, must not be `None`")  # noqa: E501

        self._buyer = buyer

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


        :return: The payment of this CheckoutForm.  # noqa: E501
        :rtype: CheckoutFormPaymentReference
        """
        return self._payment

    @payment.setter
    def payment(self, payment):
        """Sets the payment of this CheckoutForm.


        :param payment: The payment of this CheckoutForm.  # noqa: E501
        :type: CheckoutFormPaymentReference
        """

        self._payment = payment

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


        :return: The status of this CheckoutForm.  # noqa: E501
        :rtype: CheckoutFormStatus
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this CheckoutForm.


        :param status: The status of this CheckoutForm.  # noqa: E501
        :type: CheckoutFormStatus
        """
        if self.local_vars_configuration.client_side_validation and status is None:  # noqa: E501
            raise ValueError("Invalid value for `status`, must not be `None`")  # noqa: E501

        self._status = status

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


        :return: The fulfillment of this CheckoutForm.  # noqa: E501
        :rtype: CheckoutFormFulfillment
        """
        return self._fulfillment

    @fulfillment.setter
    def fulfillment(self, fulfillment):
        """Sets the fulfillment of this CheckoutForm.


        :param fulfillment: The fulfillment of this CheckoutForm.  # noqa: E501
        :type: CheckoutFormFulfillment
        """

        self._fulfillment = fulfillment

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


        :return: The delivery of this CheckoutForm.  # noqa: E501
        :rtype: CheckoutFormDeliveryReference
        """
        return self._delivery

    @delivery.setter
    def delivery(self, delivery):
        """Sets the delivery of this CheckoutForm.


        :param delivery: The delivery of this CheckoutForm.  # noqa: E501
        :type: CheckoutFormDeliveryReference
        """

        self._delivery = delivery

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


        :return: The invoice of this CheckoutForm.  # noqa: E501
        :rtype: CheckoutFormInvoiceInfo
        """
        return self._invoice

    @invoice.setter
    def invoice(self, invoice):
        """Sets the invoice of this CheckoutForm.


        :param invoice: The invoice of this CheckoutForm.  # noqa: E501
        :type: CheckoutFormInvoiceInfo
        """

        self._invoice = invoice

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


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

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


        :param line_items: The line_items of this CheckoutForm.  # noqa: E501
        :type: list[CheckoutFormLineItem]
        """
        if self.local_vars_configuration.client_side_validation and line_items is None:  # noqa: E501
            raise ValueError("Invalid value for `line_items`, must not be `None`")  # noqa: E501

        self._line_items = line_items

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


        :return: The surcharges of this CheckoutForm.  # noqa: E501
        :rtype: list[CheckoutFormPaymentReference]
        """
        return self._surcharges

    @surcharges.setter
    def surcharges(self, surcharges):
        """Sets the surcharges of this CheckoutForm.


        :param surcharges: The surcharges of this CheckoutForm.  # noqa: E501
        :type: list[CheckoutFormPaymentReference]
        """
        if self.local_vars_configuration.client_side_validation and surcharges is None:  # noqa: E501
            raise ValueError("Invalid value for `surcharges`, must not be `None`")  # noqa: E501

        self._surcharges = surcharges

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


        :return: The discounts of this CheckoutForm.  # noqa: E501
        :rtype: list[CheckoutFormDiscount]
        """
        return self._discounts

    @discounts.setter
    def discounts(self, discounts):
        """Sets the discounts of this CheckoutForm.


        :param discounts: The discounts of this CheckoutForm.  # noqa: E501
        :type: list[CheckoutFormDiscount]
        """
        if self.local_vars_configuration.client_side_validation and discounts is None:  # noqa: E501
            raise ValueError("Invalid value for `discounts`, must not be `None`")  # noqa: E501

        self._discounts = discounts

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


        :return: The summary of this CheckoutForm.  # noqa: E501
        :rtype: CheckoutFormSummary
        """
        return self._summary

    @summary.setter
    def summary(self, summary):
        """Sets the summary of this CheckoutForm.


        :param summary: The summary of this CheckoutForm.  # noqa: E501
        :type: CheckoutFormSummary
        """
        if self.local_vars_configuration.client_side_validation and summary is None:  # noqa: E501
            raise ValueError("Invalid value for `summary`, must not be `None`")  # noqa: E501

        self._summary = summary

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

        Provided in [ISO 8601 format](link: https://en.wikipedia.org/wiki/ISO_8601).  # noqa: E501

        :return: The updated_at of this CheckoutForm.  # noqa: E501
        :rtype: str
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        """Sets the updated_at of this CheckoutForm.

        Provided in [ISO 8601 format](link: https://en.wikipedia.org/wiki/ISO_8601).  # noqa: E501

        :param updated_at: The updated_at of this CheckoutForm.  # noqa: E501
        :type: str
        """

        self._updated_at = updated_at

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_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

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

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