"""visaacceptancemergedspec.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)


class TokenizedCard1(object):
    """Implementation of the 'TokenizedCard1' model.

    Attributes:
        prefix (str): First six digits of token. Visa Acceptance includes this field
            in the reply message when it decrypts the payment blob for the tokenized
            transaction.
        suffix (str): Last four digits of token. Visa Acceptance includes this field
            in the reply message when it decrypts the payment blob for the tokenized
            transaction.  For details, see `token_suffix` field description in
            [Google Pay Using the SCMP API.] (
        mtype (str): Three-digit value that indicates the card type.  **IMPORTANT**
            It is strongly recommended that you include the card type field in
            request messages even if it is optional for your processor and card type.
            Omitting the card type can cause the transaction to be processed with the
            wrong card type.  Possible values: - `001`: Visa. Use card type value
            `001` for Visa Electron. - `002`: Mastercard, Eurocard[^1], which is a
            European regional brand of Mastercard. - `003`: American Express - `004`:
            Discover - `005`: Diners Club - `006`: Carte Blanche[^1] - `007`: JCB[^1]
            - `008`: Optima - `009`: GE Private Label - `010`: Beneficial Private
            Label - `011`: Twinpay Credit Card - `012`: Twinpay Debit Card - `013`:
            WalMart - `014`: Enroute[^1] - `015`: Lowe's Consumer - `016`: Home Depot
            Consumer - `017`: MBNA - `018`: Dick's Sportswear - `019`: Casual Corner
            - `020`: Sears - `021`: JAL[^1] - `023`: Disney Card - `024`: Maestro (UK
            Domestic)[^1] - `025`: Sam's Club Consumer - `026`: Sam's Club Business -
            `027`: Nico's - `028`: Paymentech Bill Me Later - `029`: Bebe - `030`:
            Restoration Hardware - `031`: Delta Online - `032`: Solo - `033`: Visa
            Electron[^1]. Do not use this value. Use `001` for all Visa card types. -
            `034`: Dankort[^1] - `035`: Laser - `036`: Cartes Bancaires[^1,4] -
            `037`: Carta Si[^1] - `038`: Pinless Debit - `039`: Encoded account
            number[^1] - `040`: UATP[^1] - `041`: HOUSEHOLD - `042`: Maestro
            (International)[^1] - `043`: GE MONEY - `044`: Korean Cards - `045`:
            Style Cards - `046`: JCrew - `047`: Payeasecn eWallet - `048`: Payeasecn
            Bank Transfer - `049`: Meijer - `050`: Hipercard[^2,3] - `051`: Aura -
            `052`: Redecard - `053`: Orico card - `054`: Elo[^3] - `055`: Capitol One
            Private Label - `056`: Carnet - `057`: Costco Private Label - `058`:
            Carnet - `059`: ValueLink - `060`: MADA - `061`: RuPay - `062`: China
            UnionPay - `063`: Falabella Private Label - `064`: Prompt Card - `065`:
            Korean Domestic - `066`: Banricompras - `067`: MEEZA - `068`: PayPak -
            `070`: EFTPOS - `071`: Codensa - `072`: Olimpica - `073`: Colsubsidio -
            `074`: Tuya - `075`: Sodexo - `076`: Naranja - `077`: Cabal - `078`:
            DINELCO - `079`: PANAL - `080`: EPM - `081`: Jaywan  [^1]: For this card
            type, you must include the `paymentInformation.card.type` or
            `paymentInformation.tokenizedCard.type` field in your request for an
            authorization or a stand-alone credit. [^2]: For this card type on Cielo
            3.0, you must include the `paymentInformation.card.type` or
            `paymentInformation.tokenizedCard.type` field in a request for an
            authorization or a stand-alone credit. This card type is not supported on
            Cielo 1.5. [^3]: For this card type on Getnet and Rede, you must include
            the `paymentInformation.card.type` or
            `paymentInformation.tokenizedCard.type` field in a request for an
            authorization or a stand-alone credit. [^4]: For this card type, you must
            include the `paymentInformation.card.type` in your request for any payer
            authentication services.  #### Used by **Authorization** Required for
            Carte Blanche and JCB. Optional for all other card types.  #### Card
            Present reply This field is included in the reply message when the client
            software that is installed on the POS terminal uses the token management
            service (TMS) to retrieve tokenized payment details. You must contact
            customer support to have your account enabled to receive these fields in
            the credit reply message.  Returned by the Credit service.  This reply
            field is only supported by the following processors: - American Express
            Direct - Credit Mutuel-CIC - FDC Nashville Global - OmniPay Direct - SIX
            #### Google Pay transactions For PAN-based Google Pay transactions, this
            field is returned in the API response.  #### GPX This field only supports
            transactions from the following card types: - Visa - Mastercard - AMEX -
            Discover - Diners - JCB - Union Pay International
        assurance_level (str): Confidence level of the tokenization. This value is
            assigned by the token service provider.  **Note** This field is supported
            only for **Visa Acceptance through VisaNet** and **FDC Nashville
            Global**.  Returned by PIN debit credit or PIN debit purchase.  **Note**
            Merchants supported for **Visa Acceptance through VisaNet**/**Visa
            Platform Connect** are advised not to use this field.
        expiration_month (str): One of two possible meanings: - The two-digit month
            in which a token expires. - The two-digit month in which a card expires.
            Format: `MM` Possible values: `01` through `12`  **NOTE** The meaning of
            this field is dependent on the payment processor that is returning the
            value in an authorization reply. Please see the processor-specific
            details below.  #### Barclays and Streamline For Maestro (UK Domestic)
            and Maestro (International) cards on Barclays and Streamline, this must
            be a valid value (`01` through `12`) but is not required to be a valid
            expiration date. In other words, an expiration date that is in the past
            does not cause Visa Acceptance to reject your request. However, an
            invalid expiration date might cause the issuer to reject your request.
            #### Encoded Account Numbers For encoded account numbers
            (`card_type=039`), if there is no expiration date on the card, use `12`.\
            **Important** It is your responsibility to determine whether a field is
            required for the transaction you are requesting.  #### Samsung Pay and
            Apple Pay Month in which the token expires. Visa Acceptance includes this
            field in the reply message when it decrypts the payment blob for the
            tokenized transaction.
        expiration_year (str): One of two possible meanings: - The four-digit year in
            which a token expires. - The four-digit year in which a card expires.
            Format: `YYYY` Possible values: `1900` through `3000` Data type:
            Non-negative integer  **NOTE** The meaning of this field is dependent on
            the payment processor that is returning the value in an authorization
            reply. Please see the processor-specific details below.  #### Barclays
            and Streamline For Maestro (UK Domestic) and Maestro (International)
            cards on Barclays and Streamline, this must be a valid value (1900
            through 3000) but is not required to be a valid expiration date. In other
            words, an expiration date that is in the past does not cause Visa
            Acceptance to reject your request. However, an invalid expiration date
            might cause the issuer to reject your request.  #### Encoded Account
            Numbers For encoded account numbers (`card_ type=039`), if there is no
            expiration date on the card, use `2021`.  #### FDC Nashville Global and
            FDMS South You can send in 2 digits or 4 digits. When you send in 2
            digits, they must be the last 2 digits of the year.  #### Samsung Pay and
            Apple Pay Year in which the token expires. Visa Acceptance includes this
            field in the reply message when it decrypts the payment blob for the
            tokenized transaction.  **Important** It is your responsibility to
            determine whether a field is required for the transaction you are
            requesting.
        requestor_id (str): Value that identifies your business and indicates that
            the cardholder’s account number is tokenized. This value is assigned by
            the token service provider and is unique within the token service
            provider’s database.  **Note** This field is supported only for **Visa
            Acceptance through VisaNet** and **FDC Nashville Global**.  #### PIN
            debit Optional field for PIN debit credit or PIN debit purchase
            transactions that use payment network tokens; otherwise, not used.
        assurance_method (str): Confidence level of the tokenization. This value is
            assigned by the token service provider.  **Note** This field is supported
            only for **Visa Platform Connect**
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "prefix": "prefix",
        "suffix": "suffix",
        "mtype": "type",
        "assurance_level": "assuranceLevel",
        "expiration_month": "expirationMonth",
        "expiration_year": "expirationYear",
        "requestor_id": "requestorId",
        "assurance_method": "assuranceMethod",
    }

    _optionals = [
        "prefix",
        "suffix",
        "mtype",
        "assurance_level",
        "expiration_month",
        "expiration_year",
        "requestor_id",
        "assurance_method",
    ]

    def __init__(
        self,
        prefix=APIHelper.SKIP,
        suffix=APIHelper.SKIP,
        mtype=APIHelper.SKIP,
        assurance_level=APIHelper.SKIP,
        expiration_month=APIHelper.SKIP,
        expiration_year=APIHelper.SKIP,
        requestor_id=APIHelper.SKIP,
        assurance_method=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a TokenizedCard1 instance."""
        # Initialize members of the class
        if prefix is not APIHelper.SKIP:
            self.prefix = prefix
        if suffix is not APIHelper.SKIP:
            self.suffix = suffix
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype
        if assurance_level is not APIHelper.SKIP:
            self.assurance_level = assurance_level
        if expiration_month is not APIHelper.SKIP:
            self.expiration_month = expiration_month
        if expiration_year is not APIHelper.SKIP:
            self.expiration_year = expiration_year
        if requestor_id is not APIHelper.SKIP:
            self.requestor_id = requestor_id
        if assurance_method is not APIHelper.SKIP:
            self.assurance_method = assurance_method

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        prefix =\
            dictionary.get("prefix")\
            if dictionary.get("prefix")\
                else APIHelper.SKIP
        suffix =\
            dictionary.get("suffix")\
            if dictionary.get("suffix")\
                else APIHelper.SKIP
        mtype =\
            dictionary.get("type")\
            if dictionary.get("type")\
                else APIHelper.SKIP
        assurance_level =\
            dictionary.get("assuranceLevel")\
            if dictionary.get("assuranceLevel")\
                else APIHelper.SKIP
        expiration_month =\
            dictionary.get("expirationMonth")\
            if dictionary.get("expirationMonth")\
                else APIHelper.SKIP
        expiration_year =\
            dictionary.get("expirationYear")\
            if dictionary.get("expirationYear")\
                else APIHelper.SKIP
        requestor_id =\
            dictionary.get("requestorId")\
            if dictionary.get("requestorId")\
                else APIHelper.SKIP
        assurance_method =\
            dictionary.get("assuranceMethod")\
            if dictionary.get("assuranceMethod")\
                else APIHelper.SKIP

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(prefix,
                   suffix,
                   mtype,
                   assurance_level,
                   expiration_month,
                   expiration_year,
                   requestor_id,
                   assurance_method,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _prefix=(
            self.prefix
            if hasattr(self, "prefix")
            else None
        )
        _suffix=(
            self.suffix
            if hasattr(self, "suffix")
            else None
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _assurance_level=(
            self.assurance_level
            if hasattr(self, "assurance_level")
            else None
        )
        _expiration_month=(
            self.expiration_month
            if hasattr(self, "expiration_month")
            else None
        )
        _expiration_year=(
            self.expiration_year
            if hasattr(self, "expiration_year")
            else None
        )
        _requestor_id=(
            self.requestor_id
            if hasattr(self, "requestor_id")
            else None
        )
        _assurance_method=(
            self.assurance_method
            if hasattr(self, "assurance_method")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"prefix={_prefix!r}, "
            f"suffix={_suffix!r}, "
            f"mtype={_mtype!r}, "
            f"assurance_level={_assurance_level!r}, "
            f"expiration_month={_expiration_month!r}, "
            f"expiration_year={_expiration_year!r}, "
            f"requestor_id={_requestor_id!r}, "
            f"assurance_method={_assurance_method!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _prefix=(
            self.prefix
            if hasattr(self, "prefix")
            else None
        )
        _suffix=(
            self.suffix
            if hasattr(self, "suffix")
            else None
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _assurance_level=(
            self.assurance_level
            if hasattr(self, "assurance_level")
            else None
        )
        _expiration_month=(
            self.expiration_month
            if hasattr(self, "expiration_month")
            else None
        )
        _expiration_year=(
            self.expiration_year
            if hasattr(self, "expiration_year")
            else None
        )
        _requestor_id=(
            self.requestor_id
            if hasattr(self, "requestor_id")
            else None
        )
        _assurance_method=(
            self.assurance_method
            if hasattr(self, "assurance_method")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"prefix={_prefix!s}, "
            f"suffix={_suffix!s}, "
            f"mtype={_mtype!s}, "
            f"assurance_level={_assurance_level!s}, "
            f"expiration_month={_expiration_month!s}, "
            f"expiration_year={_expiration_year!s}, "
            f"requestor_id={_requestor_id!s}, "
            f"assurance_method={_assurance_method!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
