# coding: utf-8

"""
    Cyclos 4.11.5 API

    The REST API for Cyclos 4.11.5  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from swagger_client.configuration import Configuration


class OrderView(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 = {
        'buyer': 'User',
        'seller': 'User',
        'delivery_address': 'Address',
        'delivery_method_name': 'str',
        'delivery_price': 'BigDecimal',
        'delivery_time': 'TimeInterval',
        'payment_type': 'TransferType',
        'items': 'list[OrderItem]',
        'remarks': 'str',
        'sale': 'bool'
    }

    attribute_map = {
        'buyer': 'buyer',
        'seller': 'seller',
        'delivery_address': 'deliveryAddress',
        'delivery_method_name': 'deliveryMethodName',
        'delivery_price': 'deliveryPrice',
        'delivery_time': 'deliveryTime',
        'payment_type': 'paymentType',
        'items': 'items',
        'remarks': 'remarks',
        'sale': 'sale'
    }

    def __init__(self, buyer=None, seller=None, delivery_address=None, delivery_method_name=None, delivery_price=None, delivery_time=None, payment_type=None, items=None, remarks=None, sale=None, _configuration=None):  # noqa: E501
        """OrderView - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._buyer = None
        self._seller = None
        self._delivery_address = None
        self._delivery_method_name = None
        self._delivery_price = None
        self._delivery_time = None
        self._payment_type = None
        self._items = None
        self._remarks = None
        self._sale = None
        self.discriminator = None

        if buyer is not None:
            self.buyer = buyer
        if seller is not None:
            self.seller = seller
        if delivery_address is not None:
            self.delivery_address = delivery_address
        if delivery_method_name is not None:
            self.delivery_method_name = delivery_method_name
        if delivery_price is not None:
            self.delivery_price = delivery_price
        if delivery_time is not None:
            self.delivery_time = delivery_time
        if payment_type is not None:
            self.payment_type = payment_type
        if items is not None:
            self.items = items
        if remarks is not None:
            self.remarks = remarks
        if sale is not None:
            self.sale = sale

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

        The buyer of the order.  # noqa: E501

        :return: The buyer of this OrderView.  # noqa: E501
        :rtype: User
        """
        return self._buyer

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

        The buyer of the order.  # noqa: E501

        :param buyer: The buyer of this OrderView.  # noqa: E501
        :type: User
        """

        self._buyer = buyer

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

        The seller of the order.  # noqa: E501

        :return: The seller of this OrderView.  # noqa: E501
        :rtype: User
        """
        return self._seller

    @seller.setter
    def seller(self, seller):
        """Sets the seller of this OrderView.

        The seller of the order.  # noqa: E501

        :param seller: The seller of this OrderView.  # noqa: E501
        :type: User
        """

        self._seller = seller

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


        :return: The delivery_address of this OrderView.  # noqa: E501
        :rtype: Address
        """
        return self._delivery_address

    @delivery_address.setter
    def delivery_address(self, delivery_address):
        """Sets the delivery_address of this OrderView.


        :param delivery_address: The delivery_address of this OrderView.  # noqa: E501
        :type: Address
        """

        self._delivery_address = delivery_address

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

        The delivery method name.  # noqa: E501

        :return: The delivery_method_name of this OrderView.  # noqa: E501
        :rtype: str
        """
        return self._delivery_method_name

    @delivery_method_name.setter
    def delivery_method_name(self, delivery_method_name):
        """Sets the delivery_method_name of this OrderView.

        The delivery method name.  # noqa: E501

        :param delivery_method_name: The delivery_method_name of this OrderView.  # noqa: E501
        :type: str
        """

        self._delivery_method_name = delivery_method_name

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

        The delivery method price.  # noqa: E501

        :return: The delivery_price of this OrderView.  # noqa: E501
        :rtype: BigDecimal
        """
        return self._delivery_price

    @delivery_price.setter
    def delivery_price(self, delivery_price):
        """Sets the delivery_price of this OrderView.

        The delivery method price.  # noqa: E501

        :param delivery_price: The delivery_price of this OrderView.  # noqa: E501
        :type: BigDecimal
        """

        self._delivery_price = delivery_price

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


        :return: The delivery_time of this OrderView.  # noqa: E501
        :rtype: TimeInterval
        """
        return self._delivery_time

    @delivery_time.setter
    def delivery_time(self, delivery_time):
        """Sets the delivery_time of this OrderView.


        :param delivery_time: The delivery_time of this OrderView.  # noqa: E501
        :type: TimeInterval
        """

        self._delivery_time = delivery_time

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


        :return: The payment_type of this OrderView.  # noqa: E501
        :rtype: TransferType
        """
        return self._payment_type

    @payment_type.setter
    def payment_type(self, payment_type):
        """Sets the payment_type of this OrderView.


        :param payment_type: The payment_type of this OrderView.  # noqa: E501
        :type: TransferType
        """

        self._payment_type = payment_type

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

        The order items  # noqa: E501

        :return: The items of this OrderView.  # noqa: E501
        :rtype: list[OrderItem]
        """
        return self._items

    @items.setter
    def items(self, items):
        """Sets the items of this OrderView.

        The order items  # noqa: E501

        :param items: The items of this OrderView.  # noqa: E501
        :type: list[OrderItem]
        """

        self._items = items

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

        The current order remarks (i.e those for check-out, accept  or reject).    # noqa: E501

        :return: The remarks of this OrderView.  # noqa: E501
        :rtype: str
        """
        return self._remarks

    @remarks.setter
    def remarks(self, remarks):
        """Sets the remarks of this OrderView.

        The current order remarks (i.e those for check-out, accept  or reject).    # noqa: E501

        :param remarks: The remarks of this OrderView.  # noqa: E501
        :type: str
        """

        self._remarks = remarks

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

        Is it a sale?  # noqa: E501

        :return: The sale of this OrderView.  # noqa: E501
        :rtype: bool
        """
        return self._sale

    @sale.setter
    def sale(self, sale):
        """Sets the sale of this OrderView.

        Is it a sale?  # noqa: E501

        :param sale: The sale of this OrderView.  # noqa: E501
        :type: bool
        """

        self._sale = sale

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

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