# 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 CreateCustomerCardRequest(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, card_nonce=None, billing_address=None, cardholder_name=None):
        """
        CreateCustomerCardRequest - 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 = {
            'card_nonce': 'str',
            'billing_address': 'Address',
            'cardholder_name': 'str'
        }

        self.attribute_map = {
            'card_nonce': 'card_nonce',
            'billing_address': 'billing_address',
            'cardholder_name': 'cardholder_name'
        }

        self._card_nonce = card_nonce
        self._billing_address = billing_address
        self._cardholder_name = cardholder_name

    @property
    def card_nonce(self):
        """
        Gets the card_nonce of this CreateCustomerCardRequest.
        A card nonce representing the credit card to link to the customer.  Card nonces are generated by the `SqPaymentForm` that buyers enter their card information into. See [Embedding the payment form](/payments/sqpaymentform/overview) for more information.  __Note:__ Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card.

        :return: The card_nonce of this CreateCustomerCardRequest.
        :rtype: str
        """
        return self._card_nonce

    @card_nonce.setter
    def card_nonce(self, card_nonce):
        """
        Sets the card_nonce of this CreateCustomerCardRequest.
        A card nonce representing the credit card to link to the customer.  Card nonces are generated by the `SqPaymentForm` that buyers enter their card information into. See [Embedding the payment form](/payments/sqpaymentform/overview) for more information.  __Note:__ Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card.

        :param card_nonce: The card_nonce of this CreateCustomerCardRequest.
        :type: str
        """

        self._card_nonce = card_nonce

    @property
    def billing_address(self):
        """
        Gets the billing_address of this CreateCustomerCardRequest.
        Address information for the card on file. Only the `postal_code` field is required for payments in the US and Canada.

        :return: The billing_address of this CreateCustomerCardRequest.
        :rtype: Address
        """
        return self._billing_address

    @billing_address.setter
    def billing_address(self, billing_address):
        """
        Sets the billing_address of this CreateCustomerCardRequest.
        Address information for the card on file. Only the `postal_code` field is required for payments in the US and Canada.

        :param billing_address: The billing_address of this CreateCustomerCardRequest.
        :type: Address
        """

        self._billing_address = billing_address

    @property
    def cardholder_name(self):
        """
        Gets the cardholder_name of this CreateCustomerCardRequest.
        The cardholder's name.

        :return: The cardholder_name of this CreateCustomerCardRequest.
        :rtype: str
        """
        return self._cardholder_name

    @cardholder_name.setter
    def cardholder_name(self, cardholder_name):
        """
        Sets the cardholder_name of this CreateCustomerCardRequest.
        The cardholder's name.

        :param cardholder_name: The cardholder_name of this CreateCustomerCardRequest.
        :type: str
        """

        self._cardholder_name = cardholder_name

    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
