# coding: utf-8

"""
    Hydrogen Proton API

    Financial engineering module of Hydrogen Atom  # noqa: E501

    OpenAPI spec version: 1.8.0
    Contact: info@hydrogenplatform.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class CardTransactionAuthorizationRequest(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 = {
        'merchant': 'str',
        'partial_auth': 'bool',
        '_date': 'datetime',
        'merchant_category_code': 'int',
        'cleanse_data': 'bool',
        'auth_type': 'list[str]',
        'amount': 'float',
        'transaction_type': 'str',
        'currency_code': 'str',
        'description': 'str',
        'card_id': 'str',
        'merchant_category': 'str'
    }

    attribute_map = {
        'merchant': 'merchant',
        'partial_auth': 'partial_auth',
        '_date': 'date',
        'merchant_category_code': 'merchant_category_code',
        'cleanse_data': 'cleanse_data',
        'auth_type': 'auth_type',
        'amount': 'amount',
        'transaction_type': 'transaction_type',
        'currency_code': 'currency_code',
        'description': 'description',
        'card_id': 'card_id',
        'merchant_category': 'merchant_category'
    }

    def __init__(self, merchant='null', partial_auth=False, _date=None, merchant_category_code=None, cleanse_data=False, auth_type=None, amount=None, transaction_type=None, currency_code=None, description='null', card_id=None, merchant_category='null'):  # noqa: E501
        """CardTransactionAuthorizationRequest - a model defined in Swagger"""  # noqa: E501

        self._merchant = None
        self._partial_auth = None
        self.__date = None
        self._merchant_category_code = None
        self._cleanse_data = None
        self._auth_type = None
        self._amount = None
        self._transaction_type = None
        self._currency_code = None
        self._description = None
        self._card_id = None
        self._merchant_category = None
        self.discriminator = None

        if merchant is not None:
            self.merchant = merchant
        if partial_auth is not None:
            self.partial_auth = partial_auth
        self._date = _date
        if merchant_category_code is not None:
            self.merchant_category_code = merchant_category_code
        if cleanse_data is not None:
            self.cleanse_data = cleanse_data
        self.auth_type = auth_type
        self.amount = amount
        self.transaction_type = transaction_type
        self.currency_code = currency_code
        if description is not None:
            self.description = description
        self.card_id = card_id
        if merchant_category is not None:
            self.merchant_category = merchant_category

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


        :return: The merchant of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: str
        """
        return self._merchant

    @merchant.setter
    def merchant(self, merchant):
        """Sets the merchant of this CardTransactionAuthorizationRequest.


        :param merchant: The merchant of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: str
        """

        self._merchant = merchant

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


        :return: The partial_auth of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: bool
        """
        return self._partial_auth

    @partial_auth.setter
    def partial_auth(self, partial_auth):
        """Sets the partial_auth of this CardTransactionAuthorizationRequest.


        :param partial_auth: The partial_auth of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: bool
        """

        self._partial_auth = partial_auth

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


        :return: The _date of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: datetime
        """
        return self.__date

    @_date.setter
    def _date(self, _date):
        """Sets the _date of this CardTransactionAuthorizationRequest.


        :param _date: The _date of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: datetime
        """
        if _date is None:
            raise ValueError("Invalid value for `_date`, must not be `None`")  # noqa: E501

        self.__date = _date

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


        :return: The merchant_category_code of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: int
        """
        return self._merchant_category_code

    @merchant_category_code.setter
    def merchant_category_code(self, merchant_category_code):
        """Sets the merchant_category_code of this CardTransactionAuthorizationRequest.


        :param merchant_category_code: The merchant_category_code of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: int
        """

        self._merchant_category_code = merchant_category_code

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


        :return: The cleanse_data of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: bool
        """
        return self._cleanse_data

    @cleanse_data.setter
    def cleanse_data(self, cleanse_data):
        """Sets the cleanse_data of this CardTransactionAuthorizationRequest.


        :param cleanse_data: The cleanse_data of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: bool
        """

        self._cleanse_data = cleanse_data

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


        :return: The auth_type of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: list[str]
        """
        return self._auth_type

    @auth_type.setter
    def auth_type(self, auth_type):
        """Sets the auth_type of this CardTransactionAuthorizationRequest.


        :param auth_type: The auth_type of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: list[str]
        """
        if auth_type is None:
            raise ValueError("Invalid value for `auth_type`, must not be `None`")  # noqa: E501
        allowed_values = ["balance", "spending_control"]  # noqa: E501
        if not set(auth_type).issubset(set(allowed_values)):
            raise ValueError(
                "Invalid values for `auth_type` [{0}], must be a subset of [{1}]"  # noqa: E501
                .format(", ".join(map(str, set(auth_type) - set(allowed_values))),  # noqa: E501
                        ", ".join(map(str, allowed_values)))
            )

        self._auth_type = auth_type

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


        :return: The amount of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: float
        """
        return self._amount

    @amount.setter
    def amount(self, amount):
        """Sets the amount of this CardTransactionAuthorizationRequest.


        :param amount: The amount of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: float
        """
        if amount is None:
            raise ValueError("Invalid value for `amount`, must not be `None`")  # noqa: E501

        self._amount = amount

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


        :return: The transaction_type of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: str
        """
        return self._transaction_type

    @transaction_type.setter
    def transaction_type(self, transaction_type):
        """Sets the transaction_type of this CardTransactionAuthorizationRequest.


        :param transaction_type: The transaction_type of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: str
        """
        if transaction_type is None:
            raise ValueError("Invalid value for `transaction_type`, must not be `None`")  # noqa: E501
        allowed_values = ["atm_withdrawal", "purchase"]  # noqa: E501
        if transaction_type not in allowed_values:
            raise ValueError(
                "Invalid value for `transaction_type` ({0}), must be one of {1}"  # noqa: E501
                .format(transaction_type, allowed_values)
            )

        self._transaction_type = transaction_type

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


        :return: The currency_code of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: str
        """
        return self._currency_code

    @currency_code.setter
    def currency_code(self, currency_code):
        """Sets the currency_code of this CardTransactionAuthorizationRequest.


        :param currency_code: The currency_code of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: str
        """
        if currency_code is None:
            raise ValueError("Invalid value for `currency_code`, must not be `None`")  # noqa: E501

        self._currency_code = currency_code

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


        :return: The description of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this CardTransactionAuthorizationRequest.


        :param description: The description of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: str
        """

        self._description = description

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


        :return: The card_id of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: str
        """
        return self._card_id

    @card_id.setter
    def card_id(self, card_id):
        """Sets the card_id of this CardTransactionAuthorizationRequest.


        :param card_id: The card_id of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: str
        """
        if card_id is None:
            raise ValueError("Invalid value for `card_id`, must not be `None`")  # noqa: E501

        self._card_id = card_id

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


        :return: The merchant_category of this CardTransactionAuthorizationRequest.  # noqa: E501
        :rtype: str
        """
        return self._merchant_category

    @merchant_category.setter
    def merchant_category(self, merchant_category):
        """Sets the merchant_category of this CardTransactionAuthorizationRequest.


        :param merchant_category: The merchant_category of this CardTransactionAuthorizationRequest.  # noqa: E501
        :type: str
        """

        self._merchant_category = merchant_category

    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(CardTransactionAuthorizationRequest, 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, CardTransactionAuthorizationRequest):
            return False

        return self.__dict__ == other.__dict__

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