# coding: utf-8

"""
    ChannelEngine Channel API

    ChannelEngine API for channels  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from channelengine_channel_api_client.configuration import Configuration


class ChannelOrderRequest(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 = {
        'billing_address': 'ChannelAddressRequest',
        'shipping_address': 'ChannelAddressRequest',
        'channel_order_no': 'str',
        'is_business_order': 'bool',
        'key_is_merchant_product_no': 'bool',
        'lines': 'list[ChannelOrderLineRequest]',
        'phone': 'str',
        'email': 'str',
        'company_registration_no': 'str',
        'vat_no': 'str',
        'payment_method': 'str',
        'payment_reference_no': 'str',
        'shipping_costs_incl_vat': 'float',
        'currency_code': 'str',
        'order_date': 'datetime',
        'channel_customer_no': 'str',
        'extra_data': 'dict(str, str)'
    }

    attribute_map = {
        'billing_address': 'BillingAddress',
        'shipping_address': 'ShippingAddress',
        'channel_order_no': 'ChannelOrderNo',
        'is_business_order': 'IsBusinessOrder',
        'key_is_merchant_product_no': 'KeyIsMerchantProductNo',
        'lines': 'Lines',
        'phone': 'Phone',
        'email': 'Email',
        'company_registration_no': 'CompanyRegistrationNo',
        'vat_no': 'VatNo',
        'payment_method': 'PaymentMethod',
        'payment_reference_no': 'PaymentReferenceNo',
        'shipping_costs_incl_vat': 'ShippingCostsInclVat',
        'currency_code': 'CurrencyCode',
        'order_date': 'OrderDate',
        'channel_customer_no': 'ChannelCustomerNo',
        'extra_data': 'ExtraData'
    }

    def __init__(self, billing_address=None, shipping_address=None, channel_order_no=None, is_business_order=None, key_is_merchant_product_no=None, lines=None, phone=None, email=None, company_registration_no=None, vat_no=None, payment_method=None, payment_reference_no=None, shipping_costs_incl_vat=None, currency_code=None, order_date=None, channel_customer_no=None, extra_data=None, local_vars_configuration=None):  # noqa: E501
        """ChannelOrderRequest - 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._billing_address = None
        self._shipping_address = None
        self._channel_order_no = None
        self._is_business_order = None
        self._key_is_merchant_product_no = None
        self._lines = None
        self._phone = None
        self._email = None
        self._company_registration_no = None
        self._vat_no = None
        self._payment_method = None
        self._payment_reference_no = None
        self._shipping_costs_incl_vat = None
        self._currency_code = None
        self._order_date = None
        self._channel_customer_no = None
        self._extra_data = None
        self.discriminator = None

        self.billing_address = billing_address
        self.shipping_address = shipping_address
        self.channel_order_no = channel_order_no
        self.is_business_order = is_business_order
        if key_is_merchant_product_no is not None:
            self.key_is_merchant_product_no = key_is_merchant_product_no
        self.lines = lines
        self.phone = phone
        self.email = email
        self.company_registration_no = company_registration_no
        self.vat_no = vat_no
        self.payment_method = payment_method
        self.payment_reference_no = payment_reference_no
        self.shipping_costs_incl_vat = shipping_costs_incl_vat
        self.currency_code = currency_code
        self.order_date = order_date
        self.channel_customer_no = channel_customer_no
        self.extra_data = extra_data

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

        The billing or invoice address.  # noqa: E501

        :return: The billing_address of this ChannelOrderRequest.  # noqa: E501
        :rtype: ChannelAddressRequest
        """
        return self._billing_address

    @billing_address.setter
    def billing_address(self, billing_address):
        """Sets the billing_address of this ChannelOrderRequest.

        The billing or invoice address.  # noqa: E501

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

        self._billing_address = billing_address

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

        The shipping address.  # noqa: E501

        :return: The shipping_address of this ChannelOrderRequest.  # noqa: E501
        :rtype: ChannelAddressRequest
        """
        return self._shipping_address

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

        The shipping address.  # noqa: E501

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

        self._shipping_address = shipping_address

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

        The unique order reference used by the Channel.  # noqa: E501

        :return: The channel_order_no of this ChannelOrderRequest.  # noqa: E501
        :rtype: str
        """
        return self._channel_order_no

    @channel_order_no.setter
    def channel_order_no(self, channel_order_no):
        """Sets the channel_order_no of this ChannelOrderRequest.

        The unique order reference used by the Channel.  # noqa: E501

        :param channel_order_no: The channel_order_no of this ChannelOrderRequest.  # noqa: E501
        :type channel_order_no: str
        """
        if self.local_vars_configuration.client_side_validation and channel_order_no is None:  # noqa: E501
            raise ValueError("Invalid value for `channel_order_no`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                channel_order_no is not None and len(channel_order_no) > 60):
            raise ValueError("Invalid value for `channel_order_no`, length must be less than or equal to `60`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                channel_order_no is not None and len(channel_order_no) < 0):
            raise ValueError("Invalid value for `channel_order_no`, length must be greater than or equal to `0`")  # noqa: E501

        self._channel_order_no = channel_order_no

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

        Optional. Is a business order (default value is false).  If not provided the VAT Number will be checked. If a VAT Number is found, IsBusinessOrder will be set to true.  No VAT will be calculated when set to true.  # noqa: E501

        :return: The is_business_order of this ChannelOrderRequest.  # noqa: E501
        :rtype: bool
        """
        return self._is_business_order

    @is_business_order.setter
    def is_business_order(self, is_business_order):
        """Sets the is_business_order of this ChannelOrderRequest.

        Optional. Is a business order (default value is false).  If not provided the VAT Number will be checked. If a VAT Number is found, IsBusinessOrder will be set to true.  No VAT will be calculated when set to true.  # noqa: E501

        :param is_business_order: The is_business_order of this ChannelOrderRequest.  # noqa: E501
        :type is_business_order: bool
        """

        self._is_business_order = is_business_order

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

        Optional. Is the MPN used as key for the product (default value is false).  # noqa: E501

        :return: The key_is_merchant_product_no of this ChannelOrderRequest.  # noqa: E501
        :rtype: bool
        """
        return self._key_is_merchant_product_no

    @key_is_merchant_product_no.setter
    def key_is_merchant_product_no(self, key_is_merchant_product_no):
        """Sets the key_is_merchant_product_no of this ChannelOrderRequest.

        Optional. Is the MPN used as key for the product (default value is false).  # noqa: E501

        :param key_is_merchant_product_no: The key_is_merchant_product_no of this ChannelOrderRequest.  # noqa: E501
        :type key_is_merchant_product_no: bool
        """

        self._key_is_merchant_product_no = key_is_merchant_product_no

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

        The order lines.  # noqa: E501

        :return: The lines of this ChannelOrderRequest.  # noqa: E501
        :rtype: list[ChannelOrderLineRequest]
        """
        return self._lines

    @lines.setter
    def lines(self, lines):
        """Sets the lines of this ChannelOrderRequest.

        The order lines.  # noqa: E501

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

        self._lines = lines

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

        The customer's telephone number.  # noqa: E501

        :return: The phone of this ChannelOrderRequest.  # noqa: E501
        :rtype: str
        """
        return self._phone

    @phone.setter
    def phone(self, phone):
        """Sets the phone of this ChannelOrderRequest.

        The customer's telephone number.  # noqa: E501

        :param phone: The phone of this ChannelOrderRequest.  # noqa: E501
        :type phone: str
        """
        if (self.local_vars_configuration.client_side_validation and
                phone is not None and len(phone) > 50):
            raise ValueError("Invalid value for `phone`, length must be less than or equal to `50`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                phone is not None and len(phone) < 0):
            raise ValueError("Invalid value for `phone`, length must be greater than or equal to `0`")  # noqa: E501

        self._phone = phone

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

        The customer's email.  # noqa: E501

        :return: The email of this ChannelOrderRequest.  # noqa: E501
        :rtype: str
        """
        return self._email

    @email.setter
    def email(self, email):
        """Sets the email of this ChannelOrderRequest.

        The customer's email.  # noqa: E501

        :param email: The email of this ChannelOrderRequest.  # noqa: E501
        :type email: str
        """
        if self.local_vars_configuration.client_side_validation and email is None:  # noqa: E501
            raise ValueError("Invalid value for `email`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                email is not None and len(email) > 250):
            raise ValueError("Invalid value for `email`, length must be less than or equal to `250`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                email is not None and len(email) < 0):
            raise ValueError("Invalid value for `email`, length must be greater than or equal to `0`")  # noqa: E501

        self._email = email

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

        Optional. A company's chamber of commerce number.  # noqa: E501

        :return: The company_registration_no of this ChannelOrderRequest.  # noqa: E501
        :rtype: str
        """
        return self._company_registration_no

    @company_registration_no.setter
    def company_registration_no(self, company_registration_no):
        """Sets the company_registration_no of this ChannelOrderRequest.

        Optional. A company's chamber of commerce number.  # noqa: E501

        :param company_registration_no: The company_registration_no of this ChannelOrderRequest.  # noqa: E501
        :type company_registration_no: str
        """
        if (self.local_vars_configuration.client_side_validation and
                company_registration_no is not None and len(company_registration_no) > 50):
            raise ValueError("Invalid value for `company_registration_no`, length must be less than or equal to `50`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                company_registration_no is not None and len(company_registration_no) < 0):
            raise ValueError("Invalid value for `company_registration_no`, length must be greater than or equal to `0`")  # noqa: E501

        self._company_registration_no = company_registration_no

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

        Optional. A company's VAT number.  # noqa: E501

        :return: The vat_no of this ChannelOrderRequest.  # noqa: E501
        :rtype: str
        """
        return self._vat_no

    @vat_no.setter
    def vat_no(self, vat_no):
        """Sets the vat_no of this ChannelOrderRequest.

        Optional. A company's VAT number.  # noqa: E501

        :param vat_no: The vat_no of this ChannelOrderRequest.  # noqa: E501
        :type vat_no: str
        """
        if (self.local_vars_configuration.client_side_validation and
                vat_no is not None and len(vat_no) > 50):
            raise ValueError("Invalid value for `vat_no`, length must be less than or equal to `50`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                vat_no is not None and len(vat_no) < 0):
            raise ValueError("Invalid value for `vat_no`, length must be greater than or equal to `0`")  # noqa: E501

        self._vat_no = vat_no

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

        The payment method used on the order.  # noqa: E501

        :return: The payment_method of this ChannelOrderRequest.  # noqa: E501
        :rtype: str
        """
        return self._payment_method

    @payment_method.setter
    def payment_method(self, payment_method):
        """Sets the payment_method of this ChannelOrderRequest.

        The payment method used on the order.  # noqa: E501

        :param payment_method: The payment_method of this ChannelOrderRequest.  # noqa: E501
        :type payment_method: str
        """
        if (self.local_vars_configuration.client_side_validation and
                payment_method is not None and len(payment_method) > 50):
            raise ValueError("Invalid value for `payment_method`, length must be less than or equal to `50`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                payment_method is not None and len(payment_method) < 0):
            raise ValueError("Invalid value for `payment_method`, length must be greater than or equal to `0`")  # noqa: E501

        self._payment_method = payment_method

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

        Reference or transaction id for the payment  # noqa: E501

        :return: The payment_reference_no of this ChannelOrderRequest.  # noqa: E501
        :rtype: str
        """
        return self._payment_reference_no

    @payment_reference_no.setter
    def payment_reference_no(self, payment_reference_no):
        """Sets the payment_reference_no of this ChannelOrderRequest.

        Reference or transaction id for the payment  # noqa: E501

        :param payment_reference_no: The payment_reference_no of this ChannelOrderRequest.  # noqa: E501
        :type payment_reference_no: str
        """
        if (self.local_vars_configuration.client_side_validation and
                payment_reference_no is not None and len(payment_reference_no) > 250):
            raise ValueError("Invalid value for `payment_reference_no`, length must be less than or equal to `250`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                payment_reference_no is not None and len(payment_reference_no) < 0):
            raise ValueError("Invalid value for `payment_reference_no`, length must be greater than or equal to `0`")  # noqa: E501

        self._payment_reference_no = payment_reference_no

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

        The shipping fee including VAT  (in the shop's base currency calculated using the exchange rate at the time of ordering).  # noqa: E501

        :return: The shipping_costs_incl_vat of this ChannelOrderRequest.  # noqa: E501
        :rtype: float
        """
        return self._shipping_costs_incl_vat

    @shipping_costs_incl_vat.setter
    def shipping_costs_incl_vat(self, shipping_costs_incl_vat):
        """Sets the shipping_costs_incl_vat of this ChannelOrderRequest.

        The shipping fee including VAT  (in the shop's base currency calculated using the exchange rate at the time of ordering).  # noqa: E501

        :param shipping_costs_incl_vat: The shipping_costs_incl_vat of this ChannelOrderRequest.  # noqa: E501
        :type shipping_costs_incl_vat: float
        """
        if self.local_vars_configuration.client_side_validation and shipping_costs_incl_vat is None:  # noqa: E501
            raise ValueError("Invalid value for `shipping_costs_incl_vat`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                shipping_costs_incl_vat is not None and shipping_costs_incl_vat < 0):  # noqa: E501
            raise ValueError("Invalid value for `shipping_costs_incl_vat`, must be a value greater than or equal to `0`")  # noqa: E501

        self._shipping_costs_incl_vat = shipping_costs_incl_vat

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

        The currency code for the amounts of the order.  # noqa: E501

        :return: The currency_code of this ChannelOrderRequest.  # noqa: E501
        :rtype: str
        """
        return self._currency_code

    @currency_code.setter
    def currency_code(self, currency_code):
        """Sets the currency_code of this ChannelOrderRequest.

        The currency code for the amounts of the order.  # noqa: E501

        :param currency_code: The currency_code of this ChannelOrderRequest.  # noqa: E501
        :type currency_code: str
        """
        if self.local_vars_configuration.client_side_validation and currency_code is None:  # noqa: E501
            raise ValueError("Invalid value for `currency_code`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                currency_code is not None and len(currency_code) > 3):
            raise ValueError("Invalid value for `currency_code`, length must be less than or equal to `3`")  # noqa: E501

        self._currency_code = currency_code

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

        The date the order was created at the channel.  # noqa: E501

        :return: The order_date of this ChannelOrderRequest.  # noqa: E501
        :rtype: datetime
        """
        return self._order_date

    @order_date.setter
    def order_date(self, order_date):
        """Sets the order_date of this ChannelOrderRequest.

        The date the order was created at the channel.  # noqa: E501

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

        self._order_date = order_date

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

        The unique customer reference used by the channel.  # noqa: E501

        :return: The channel_customer_no of this ChannelOrderRequest.  # noqa: E501
        :rtype: str
        """
        return self._channel_customer_no

    @channel_customer_no.setter
    def channel_customer_no(self, channel_customer_no):
        """Sets the channel_customer_no of this ChannelOrderRequest.

        The unique customer reference used by the channel.  # noqa: E501

        :param channel_customer_no: The channel_customer_no of this ChannelOrderRequest.  # noqa: E501
        :type channel_customer_no: str
        """
        if (self.local_vars_configuration.client_side_validation and
                channel_customer_no is not None and len(channel_customer_no) > 50):
            raise ValueError("Invalid value for `channel_customer_no`, length must be less than or equal to `50`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                channel_customer_no is not None and len(channel_customer_no) < 0):
            raise ValueError("Invalid value for `channel_customer_no`, length must be greater than or equal to `0`")  # noqa: E501

        self._channel_customer_no = channel_customer_no

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

        Extra data on the order.  # noqa: E501

        :return: The extra_data of this ChannelOrderRequest.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._extra_data

    @extra_data.setter
    def extra_data(self, extra_data):
        """Sets the extra_data of this ChannelOrderRequest.

        Extra data on the order.  # noqa: E501

        :param extra_data: The extra_data of this ChannelOrderRequest.  # noqa: E501
        :type extra_data: dict(str, str)
        """

        self._extra_data = extra_data

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

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