# 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 V1Tender(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, id=None, type=None, name=None, employee_id=None, receipt_url=None, card_brand=None, pan_suffix=None, entry_method=None, payment_note=None, total_money=None, tendered_money=None, tendered_at=None, settled_at=None, change_back_money=None, refunded_money=None, is_exchange=None):
        """
        V1Tender - 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 = {
            'id': 'str',
            'type': 'str',
            'name': 'str',
            'employee_id': 'str',
            'receipt_url': 'str',
            'card_brand': 'str',
            'pan_suffix': 'str',
            'entry_method': 'str',
            'payment_note': 'str',
            'total_money': 'V1Money',
            'tendered_money': 'V1Money',
            'tendered_at': 'str',
            'settled_at': 'str',
            'change_back_money': 'V1Money',
            'refunded_money': 'V1Money',
            'is_exchange': 'bool'
        }

        self.attribute_map = {
            'id': 'id',
            'type': 'type',
            'name': 'name',
            'employee_id': 'employee_id',
            'receipt_url': 'receipt_url',
            'card_brand': 'card_brand',
            'pan_suffix': 'pan_suffix',
            'entry_method': 'entry_method',
            'payment_note': 'payment_note',
            'total_money': 'total_money',
            'tendered_money': 'tendered_money',
            'tendered_at': 'tendered_at',
            'settled_at': 'settled_at',
            'change_back_money': 'change_back_money',
            'refunded_money': 'refunded_money',
            'is_exchange': 'is_exchange'
        }

        self._id = id
        self._type = type
        self._name = name
        self._employee_id = employee_id
        self._receipt_url = receipt_url
        self._card_brand = card_brand
        self._pan_suffix = pan_suffix
        self._entry_method = entry_method
        self._payment_note = payment_note
        self._total_money = total_money
        self._tendered_money = tendered_money
        self._tendered_at = tendered_at
        self._settled_at = settled_at
        self._change_back_money = change_back_money
        self._refunded_money = refunded_money
        self._is_exchange = is_exchange

    @property
    def id(self):
        """
        Gets the id of this V1Tender.
        The tender's unique ID.

        :return: The id of this V1Tender.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this V1Tender.
        The tender's unique ID.

        :param id: The id of this V1Tender.
        :type: str
        """

        self._id = id

    @property
    def type(self):
        """
        Gets the type of this V1Tender.
        The type of tender. See [V1TenderType](#type-v1tendertype) for possible values

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

    @type.setter
    def type(self, type):
        """
        Sets the type of this V1Tender.
        The type of tender. See [V1TenderType](#type-v1tendertype) for possible values

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

        self._type = type

    @property
    def name(self):
        """
        Gets the name of this V1Tender.
        A human-readable description of the tender.

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

    @name.setter
    def name(self, name):
        """
        Sets the name of this V1Tender.
        A human-readable description of the tender.

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

        self._name = name

    @property
    def employee_id(self):
        """
        Gets the employee_id of this V1Tender.
        The ID of the employee that processed the tender.

        :return: The employee_id of this V1Tender.
        :rtype: str
        """
        return self._employee_id

    @employee_id.setter
    def employee_id(self, employee_id):
        """
        Sets the employee_id of this V1Tender.
        The ID of the employee that processed the tender.

        :param employee_id: The employee_id of this V1Tender.
        :type: str
        """

        self._employee_id = employee_id

    @property
    def receipt_url(self):
        """
        Gets the receipt_url of this V1Tender.
        The URL of the receipt for the tender.

        :return: The receipt_url of this V1Tender.
        :rtype: str
        """
        return self._receipt_url

    @receipt_url.setter
    def receipt_url(self, receipt_url):
        """
        Sets the receipt_url of this V1Tender.
        The URL of the receipt for the tender.

        :param receipt_url: The receipt_url of this V1Tender.
        :type: str
        """

        self._receipt_url = receipt_url

    @property
    def card_brand(self):
        """
        Gets the card_brand of this V1Tender.
        The brand of credit card provided. See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values

        :return: The card_brand of this V1Tender.
        :rtype: str
        """
        return self._card_brand

    @card_brand.setter
    def card_brand(self, card_brand):
        """
        Sets the card_brand of this V1Tender.
        The brand of credit card provided. See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values

        :param card_brand: The card_brand of this V1Tender.
        :type: str
        """

        self._card_brand = card_brand

    @property
    def pan_suffix(self):
        """
        Gets the pan_suffix of this V1Tender.
        The last four digits of the provided credit card's account number.

        :return: The pan_suffix of this V1Tender.
        :rtype: str
        """
        return self._pan_suffix

    @pan_suffix.setter
    def pan_suffix(self, pan_suffix):
        """
        Sets the pan_suffix of this V1Tender.
        The last four digits of the provided credit card's account number.

        :param pan_suffix: The pan_suffix of this V1Tender.
        :type: str
        """

        self._pan_suffix = pan_suffix

    @property
    def entry_method(self):
        """
        Gets the entry_method of this V1Tender.
        The tender's unique ID. See [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible values

        :return: The entry_method of this V1Tender.
        :rtype: str
        """
        return self._entry_method

    @entry_method.setter
    def entry_method(self, entry_method):
        """
        Sets the entry_method of this V1Tender.
        The tender's unique ID. See [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible values

        :param entry_method: The entry_method of this V1Tender.
        :type: str
        """

        self._entry_method = entry_method

    @property
    def payment_note(self):
        """
        Gets the payment_note of this V1Tender.
        Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER.

        :return: The payment_note of this V1Tender.
        :rtype: str
        """
        return self._payment_note

    @payment_note.setter
    def payment_note(self, payment_note):
        """
        Sets the payment_note of this V1Tender.
        Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER.

        :param payment_note: The payment_note of this V1Tender.
        :type: str
        """

        self._payment_note = payment_note

    @property
    def total_money(self):
        """
        Gets the total_money of this V1Tender.
        The total amount of money provided in this form of tender.

        :return: The total_money of this V1Tender.
        :rtype: V1Money
        """
        return self._total_money

    @total_money.setter
    def total_money(self, total_money):
        """
        Sets the total_money of this V1Tender.
        The total amount of money provided in this form of tender.

        :param total_money: The total_money of this V1Tender.
        :type: V1Money
        """

        self._total_money = total_money

    @property
    def tendered_money(self):
        """
        Gets the tendered_money of this V1Tender.
        The amount of total_money applied to the payment.

        :return: The tendered_money of this V1Tender.
        :rtype: V1Money
        """
        return self._tendered_money

    @tendered_money.setter
    def tendered_money(self, tendered_money):
        """
        Sets the tendered_money of this V1Tender.
        The amount of total_money applied to the payment.

        :param tendered_money: The tendered_money of this V1Tender.
        :type: V1Money
        """

        self._tendered_money = tendered_money

    @property
    def tendered_at(self):
        """
        Gets the tendered_at of this V1Tender.
        The time when the tender was created, in ISO 8601 format.

        :return: The tendered_at of this V1Tender.
        :rtype: str
        """
        return self._tendered_at

    @tendered_at.setter
    def tendered_at(self, tendered_at):
        """
        Sets the tendered_at of this V1Tender.
        The time when the tender was created, in ISO 8601 format.

        :param tendered_at: The tendered_at of this V1Tender.
        :type: str
        """

        self._tendered_at = tendered_at

    @property
    def settled_at(self):
        """
        Gets the settled_at of this V1Tender.
        The time when the tender was settled, in ISO 8601 format.

        :return: The settled_at of this V1Tender.
        :rtype: str
        """
        return self._settled_at

    @settled_at.setter
    def settled_at(self, settled_at):
        """
        Sets the settled_at of this V1Tender.
        The time when the tender was settled, in ISO 8601 format.

        :param settled_at: The settled_at of this V1Tender.
        :type: str
        """

        self._settled_at = settled_at

    @property
    def change_back_money(self):
        """
        Gets the change_back_money of this V1Tender.
        The amount of total_money returned to the buyer as change.

        :return: The change_back_money of this V1Tender.
        :rtype: V1Money
        """
        return self._change_back_money

    @change_back_money.setter
    def change_back_money(self, change_back_money):
        """
        Sets the change_back_money of this V1Tender.
        The amount of total_money returned to the buyer as change.

        :param change_back_money: The change_back_money of this V1Tender.
        :type: V1Money
        """

        self._change_back_money = change_back_money

    @property
    def refunded_money(self):
        """
        Gets the refunded_money of this V1Tender.
        The total of all refunds applied to this tender. This amount is always negative or zero.

        :return: The refunded_money of this V1Tender.
        :rtype: V1Money
        """
        return self._refunded_money

    @refunded_money.setter
    def refunded_money(self, refunded_money):
        """
        Sets the refunded_money of this V1Tender.
        The total of all refunds applied to this tender. This amount is always negative or zero.

        :param refunded_money: The refunded_money of this V1Tender.
        :type: V1Money
        """

        self._refunded_money = refunded_money

    @property
    def is_exchange(self):
        """
        Gets the is_exchange of this V1Tender.
        Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange.

        :return: The is_exchange of this V1Tender.
        :rtype: bool
        """
        return self._is_exchange

    @is_exchange.setter
    def is_exchange(self, is_exchange):
        """
        Sets the is_exchange of this V1Tender.
        Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange.

        :param is_exchange: The is_exchange of this V1Tender.
        :type: bool
        """

        self._is_exchange = is_exchange

    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
