# coding: utf-8

"""
    The Selling Partner API for Amazon External Fulfillment Shipments Processing

    You can use the External Fulfillment Shipments API to retrieve, manage, and track shipments processed through Amazon's external fulfillment network. Use this API to get shipment details, monitor status changes, and access fulfillment requirements.

    The version of the OpenAPI document: 2024-09-11
    Contact: marketplaceapitest@amazon.com
    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 Charge(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 = {
        'base_charge': 'ChargeBreakup',
        'tax_breakup': 'List[Tax]',
        'charge_type': 'str',
        'total_charge': 'ChargeBreakup',
        'total_tax': 'Tax',
    }

    attribute_map = {
        'base_charge': 'baseCharge',
        'tax_breakup': 'taxBreakup',
        'charge_type': 'chargeType',
        'total_charge': 'totalCharge',
        'total_tax': 'totalTax',
    }

    def __init__(self, base_charge=None, tax_breakup=None, charge_type=None, total_charge=None, total_tax=None, _configuration=None):  # noqa: E501
        """Charge - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._base_charge = None
        self._tax_breakup = None
        self._charge_type = None
        self._total_charge = None
        self._total_tax = None
        self.discriminator = None

        self.base_charge = base_charge
        if tax_breakup is not None:
            self.tax_breakup = tax_breakup
        self.charge_type = charge_type
        self.total_charge = total_charge
        self.total_tax = total_tax

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


        :return: The base_charge of this Charge.  # noqa: E501
        :rtype: ChargeBreakup
        """
        return self._base_charge

    @base_charge.setter
    def base_charge(self, base_charge):
        """Sets the base_charge of this Charge.


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

        self._base_charge = base_charge

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

        The tax charge details.  # noqa: E501

        :return: The tax_breakup of this Charge.  # noqa: E501
        :rtype: List[Tax]
        """
        return self._tax_breakup

    @tax_breakup.setter
    def tax_breakup(self, tax_breakup):
        """Sets the tax_breakup of this Charge.

        The tax charge details.  # noqa: E501

        :param tax_breakup: The tax_breakup of this Charge.  # noqa: E501
        :type: List[Tax]
        """
        if (self._configuration.client_side_validation and
                tax_breakup is not None and len(tax_breakup) < 1):
            raise ValueError("Invalid value for `tax_breakup`, number of items must be greater than or equal to `1`")  # noqa: E501

        self._tax_breakup = tax_breakup

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

        The type of charge.  # noqa: E501

        :return: The charge_type of this Charge.  # noqa: E501
        :rtype: str
        """
        return self._charge_type

    @charge_type.setter
    def charge_type(self, charge_type):
        """Sets the charge_type of this Charge.

        The type of charge.  # noqa: E501

        :param charge_type: The charge_type of this Charge.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and charge_type is None:
            raise ValueError("Invalid value for `charge_type`, must not be `None`")  # noqa: E501
        allowed_values = ["PRODUCT", "SHIPPING", "GIFT_WRAP", "TOTAL", "OTHER"]  # noqa: E501
        if (self._configuration.client_side_validation and
                charge_type not in allowed_values):
            raise ValueError(
                "Invalid value for `charge_type` ({0}), must be one of {1}"  # noqa: E501
                .format(charge_type, allowed_values)
            )

        self._charge_type = charge_type

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


        :return: The total_charge of this Charge.  # noqa: E501
        :rtype: ChargeBreakup
        """
        return self._total_charge

    @total_charge.setter
    def total_charge(self, total_charge):
        """Sets the total_charge of this Charge.


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

        self._total_charge = total_charge

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


        :return: The total_tax of this Charge.  # noqa: E501
        :rtype: Tax
        """
        return self._total_tax

    @total_tax.setter
    def total_tax(self, total_tax):
        """Sets the total_tax of this Charge.


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

        self._total_tax = total_tax

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

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