# coding: utf-8

"""
Copyright 2017 Square, Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""


from pprint import pformat
from six import iteritems
import re


class V1PaymentSurcharge(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, name=None, applied_money=None, rate=None, amount_money=None, type=None, taxable=None, taxes=None, surcharge_id=None):
        """
        V1PaymentSurcharge - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'name': 'str',
            'applied_money': 'V1Money',
            'rate': 'str',
            'amount_money': 'V1Money',
            'type': 'str',
            'taxable': 'bool',
            'taxes': 'list[V1PaymentTax]',
            'surcharge_id': 'str'
        }

        self.attribute_map = {
            'name': 'name',
            'applied_money': 'applied_money',
            'rate': 'rate',
            'amount_money': 'amount_money',
            'type': 'type',
            'taxable': 'taxable',
            'taxes': 'taxes',
            'surcharge_id': 'surcharge_id'
        }

        self._name = name
        self._applied_money = applied_money
        self._rate = rate
        self._amount_money = amount_money
        self._type = type
        self._taxable = taxable
        self._taxes = taxes
        self._surcharge_id = surcharge_id

    @property
    def name(self):
        """
        Gets the name of this V1PaymentSurcharge.
        The name of the surcharge.

        :return: The name of this V1PaymentSurcharge.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this V1PaymentSurcharge.
        The name of the surcharge.

        :param name: The name of this V1PaymentSurcharge.
        :type: str
        """

        self._name = name

    @property
    def applied_money(self):
        """
        Gets the applied_money of this V1PaymentSurcharge.
        The amount of money applied to the order as a result of the surcharge.

        :return: The applied_money of this V1PaymentSurcharge.
        :rtype: V1Money
        """
        return self._applied_money

    @applied_money.setter
    def applied_money(self, applied_money):
        """
        Sets the applied_money of this V1PaymentSurcharge.
        The amount of money applied to the order as a result of the surcharge.

        :param applied_money: The applied_money of this V1PaymentSurcharge.
        :type: V1Money
        """

        self._applied_money = applied_money

    @property
    def rate(self):
        """
        Gets the rate of this V1PaymentSurcharge.
        The amount of the surcharge as a percentage. The percentage is provided as a string representing the decimal equivalent of the percentage. For example, \"0.7\" corresponds to a 7% surcharge. Exactly one of rate or amount_money should be set.

        :return: The rate of this V1PaymentSurcharge.
        :rtype: str
        """
        return self._rate

    @rate.setter
    def rate(self, rate):
        """
        Sets the rate of this V1PaymentSurcharge.
        The amount of the surcharge as a percentage. The percentage is provided as a string representing the decimal equivalent of the percentage. For example, \"0.7\" corresponds to a 7% surcharge. Exactly one of rate or amount_money should be set.

        :param rate: The rate of this V1PaymentSurcharge.
        :type: str
        """

        self._rate = rate

    @property
    def amount_money(self):
        """
        Gets the amount_money of this V1PaymentSurcharge.
        The amount of the surcharge as a Money object. Exactly one of rate or amount_money should be set.

        :return: The amount_money of this V1PaymentSurcharge.
        :rtype: V1Money
        """
        return self._amount_money

    @amount_money.setter
    def amount_money(self, amount_money):
        """
        Sets the amount_money of this V1PaymentSurcharge.
        The amount of the surcharge as a Money object. Exactly one of rate or amount_money should be set.

        :param amount_money: The amount_money of this V1PaymentSurcharge.
        :type: V1Money
        """

        self._amount_money = amount_money

    @property
    def type(self):
        """
        Gets the type of this V1PaymentSurcharge.
        Indicates the source of the surcharge. For example, if it was applied as an automatic gratuity for a large group. See [V1PaymentSurchargeType](#type-v1paymentsurchargetype) for possible values

        :return: The type of this V1PaymentSurcharge.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """
        Sets the type of this V1PaymentSurcharge.
        Indicates the source of the surcharge. For example, if it was applied as an automatic gratuity for a large group. See [V1PaymentSurchargeType](#type-v1paymentsurchargetype) for possible values

        :param type: The type of this V1PaymentSurcharge.
        :type: str
        """

        self._type = type

    @property
    def taxable(self):
        """
        Gets the taxable of this V1PaymentSurcharge.
        Indicates whether the surcharge is taxable.

        :return: The taxable of this V1PaymentSurcharge.
        :rtype: bool
        """
        return self._taxable

    @taxable.setter
    def taxable(self, taxable):
        """
        Sets the taxable of this V1PaymentSurcharge.
        Indicates whether the surcharge is taxable.

        :param taxable: The taxable of this V1PaymentSurcharge.
        :type: bool
        """

        self._taxable = taxable

    @property
    def taxes(self):
        """
        Gets the taxes of this V1PaymentSurcharge.
        The list of taxes that should be applied to the surcharge.

        :return: The taxes of this V1PaymentSurcharge.
        :rtype: list[V1PaymentTax]
        """
        return self._taxes

    @taxes.setter
    def taxes(self, taxes):
        """
        Sets the taxes of this V1PaymentSurcharge.
        The list of taxes that should be applied to the surcharge.

        :param taxes: The taxes of this V1PaymentSurcharge.
        :type: list[V1PaymentTax]
        """

        self._taxes = taxes

    @property
    def surcharge_id(self):
        """
        Gets the surcharge_id of this V1PaymentSurcharge.
        A Square-issued unique identifier associated with the surcharge.

        :return: The surcharge_id of this V1PaymentSurcharge.
        :rtype: str
        """
        return self._surcharge_id

    @surcharge_id.setter
    def surcharge_id(self, surcharge_id):
        """
        Sets the surcharge_id of this V1PaymentSurcharge.
        A Square-issued unique identifier associated with the surcharge.

        :param surcharge_id: The surcharge_id of this V1PaymentSurcharge.
        :type: str
        """

        self._surcharge_id = surcharge_id

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

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other
