# coding: utf-8

"""
    Selling Partner API for Retail Procurement Payments

    The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments 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 TaxDetails(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 = {
        'tax_type': 'str',
        'tax_rate': 'str',
        'tax_amount': 'Money',
        'taxable_amount': 'Money',
    }

    attribute_map = {
        'tax_type': 'taxType',
        'tax_rate': 'taxRate',
        'tax_amount': 'taxAmount',
        'taxable_amount': 'taxableAmount',
    }

    def __init__(self, tax_type=None, tax_rate=None, tax_amount=None, taxable_amount=None, _configuration=None):  # noqa: E501
        """TaxDetails - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._tax_type = None
        self._tax_rate = None
        self._tax_amount = None
        self._taxable_amount = None
        self.discriminator = None

        self.tax_type = tax_type
        if tax_rate is not None:
            self.tax_rate = tax_rate
        self.tax_amount = tax_amount
        if taxable_amount is not None:
            self.taxable_amount = taxable_amount

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

        Type of the tax applied.  # noqa: E501

        :return: The tax_type of this TaxDetails.  # noqa: E501
        :rtype: str
        """
        return self._tax_type

    @tax_type.setter
    def tax_type(self, tax_type):
        """Sets the tax_type of this TaxDetails.

        Type of the tax applied.  # noqa: E501

        :param tax_type: The tax_type of this TaxDetails.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and tax_type is None:
            raise ValueError("Invalid value for `tax_type`, must not be `None`")  # noqa: E501
        allowed_values = ["CGST", "SGST", "CESS", "UTGST", "IGST", "MwSt.", "PST", "TVA", "VAT", "GST", "ST", "Consumption", "MutuallyDefined", "DomesticVAT"]  # noqa: E501
        if (self._configuration.client_side_validation and
                tax_type not in allowed_values):
            raise ValueError(
                "Invalid value for `tax_type` ({0}), must be one of {1}"  # noqa: E501
                .format(tax_type, allowed_values)
            )

        self._tax_type = tax_type

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

        A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`.  # noqa: E501

        :return: The tax_rate of this TaxDetails.  # noqa: E501
        :rtype: str
        """
        return self._tax_rate

    @tax_rate.setter
    def tax_rate(self, tax_rate):
        """Sets the tax_rate of this TaxDetails.

        A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`.  # noqa: E501

        :param tax_rate: The tax_rate of this TaxDetails.  # noqa: E501
        :type: str
        """

        self._tax_rate = tax_rate

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


        :return: The tax_amount of this TaxDetails.  # noqa: E501
        :rtype: Money
        """
        return self._tax_amount

    @tax_amount.setter
    def tax_amount(self, tax_amount):
        """Sets the tax_amount of this TaxDetails.


        :param tax_amount: The tax_amount of this TaxDetails.  # noqa: E501
        :type: Money
        """
        if self._configuration.client_side_validation and tax_amount is None:
            raise ValueError("Invalid value for `tax_amount`, must not be `None`")  # noqa: E501

        self._tax_amount = tax_amount

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


        :return: The taxable_amount of this TaxDetails.  # noqa: E501
        :rtype: Money
        """
        return self._taxable_amount

    @taxable_amount.setter
    def taxable_amount(self, taxable_amount):
        """Sets the taxable_amount of this TaxDetails.


        :param taxable_amount: The taxable_amount of this TaxDetails.  # noqa: E501
        :type: Money
        """

        self._taxable_amount = taxable_amount

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

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