"""visaacceptancemergedspec.

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

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)
from visaacceptancemergedspec.models.card_5 import (
    Card5,
)
from visaacceptancemergedspec.models.links_22 import (
    Links22,
)
from visaacceptancemergedspec.models.metadata_36 import (
    Metadata36,
)
from visaacceptancemergedspec.models.passcode_2 import (
    Passcode2,
)


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

    Attributes:
        links (Links22): The model property of type Links22.
        id (str): The Id of the Tokenized Card.
        object (str): The type. Possible Values: - tokenizedCard
        account_reference_id (str): An identifier provided by the issuer for the
            account.
        consumer_id (str): Identifier of the consumer within the wallet. Maximum 24
            characters for VTS.
        create_instrument_identifier (bool): Specifies whether the InstrumentId
            should be created (true) or not (false). Possible Values: - `true`: The
            InstrumentId should be created. - `false`: The InstrumentId should be
            created.
        source (str): Source of the payment instrument. Possible Values: - ONFILE -
            TOKEN - ISSUER
        state (str): State of the network token or network token provision. Possible
            Values:   ACTIVE : Network token is active.   SUSPENDED : Network token
            is suspended. This state can change back to ACTIVE.   DELETED : This is a
            final state for a network token instance.   UNPROVISIONED : A previous
            network token.
        reason (str): Issuers state for the network token Possible Values: -
            INVALID_REQUEST : The network token provision request contained invalid
            data. - CARD_VERIFICATION_FAILED : The network token provision request
            contained data that could not be verified. - CARD_NOT_ELIGIBLE : Card can
            currently not be used with issuer for tokenization. - CARD_NOT_ALLOWED :
            Card can currently not be used with card association for tokenization. -
            DECLINED : Card can currently not be used with issuer for tokenization. -
            SERVICE_UNAVAILABLE : The network token service was unavailable or timed
            out. - SYSTEM_ERROR : An unexpected error occurred with network token
            service, check configuration.
        number (str): The token requestor's network token for the provided PAN and
            consumer Id, if available.
        expiration_month (str): Two-digit month in which the network token expires.
            Format: `MM`. Possible Values: `01` through `12`.
        expiration_year (str): Four-digit year in which the network token expires.
            Format: `YYYY`.
        mtype (str): The type of card (Card Network). Possible Values: - visa -
            mastercard - americanexpress
        cryptogram (str): Value generated by the card association to be used
            alongside the network token for processing a payment.
        security_code (str): 4-digit number generated by the card association to be
            used alogside the network token for processing a payment. Only supported
            for Amex and SCOF.
        eci (str): Raw Electronic Commerce Indicator provided by the card association
            with the result of the cardholder authentication.
        requestor_id (str): 11-digit identifier that uniquely identifies the Token
            Requestor.
        enrollment_id (str): Unique id to identify this PAN/ enrollment.
        token_reference_id (str): Unique ID for netwrok token.
        payment_account_reference (str): Payment account reference.
        card (Card5): The model property of type Card5.
        passcode (Passcode2): The model property of type Passcode2.
        metadata (Metadata36): The model property of type Metadata36.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "links": "_links",
        "id": "id",
        "object": "object",
        "account_reference_id": "accountReferenceId",
        "consumer_id": "consumerId",
        "create_instrument_identifier": "createInstrumentIdentifier",
        "source": "source",
        "state": "state",
        "reason": "reason",
        "number": "number",
        "expiration_month": "expirationMonth",
        "expiration_year": "expirationYear",
        "mtype": "type",
        "cryptogram": "cryptogram",
        "security_code": "securityCode",
        "eci": "eci",
        "requestor_id": "requestorId",
        "enrollment_id": "enrollmentId",
        "token_reference_id": "tokenReferenceId",
        "payment_account_reference": "paymentAccountReference",
        "card": "card",
        "passcode": "passcode",
        "metadata": "metadata",
    }

    _optionals = [
        "links",
        "id",
        "object",
        "account_reference_id",
        "consumer_id",
        "create_instrument_identifier",
        "source",
        "state",
        "reason",
        "number",
        "expiration_month",
        "expiration_year",
        "mtype",
        "cryptogram",
        "security_code",
        "eci",
        "requestor_id",
        "enrollment_id",
        "token_reference_id",
        "payment_account_reference",
        "card",
        "passcode",
        "metadata",
    ]

    def __init__(
        self,
        links=APIHelper.SKIP,
        id=APIHelper.SKIP,
        object=APIHelper.SKIP,
        account_reference_id=APIHelper.SKIP,
        consumer_id=APIHelper.SKIP,
        create_instrument_identifier=APIHelper.SKIP,
        source=APIHelper.SKIP,
        state=APIHelper.SKIP,
        reason=APIHelper.SKIP,
        number=APIHelper.SKIP,
        expiration_month=APIHelper.SKIP,
        expiration_year=APIHelper.SKIP,
        mtype=APIHelper.SKIP,
        cryptogram=APIHelper.SKIP,
        security_code=APIHelper.SKIP,
        eci=APIHelper.SKIP,
        requestor_id=APIHelper.SKIP,
        enrollment_id=APIHelper.SKIP,
        token_reference_id=APIHelper.SKIP,
        payment_account_reference=APIHelper.SKIP,
        card=APIHelper.SKIP,
        passcode=APIHelper.SKIP,
        metadata=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PostTokenizedCardResponse instance."""
        # Initialize members of the class
        if links is not APIHelper.SKIP:
            self.links = links
        if id is not APIHelper.SKIP:
            self.id = id
        if object is not APIHelper.SKIP:
            self.object = object
        if account_reference_id is not APIHelper.SKIP:
            self.account_reference_id = account_reference_id
        if consumer_id is not APIHelper.SKIP:
            self.consumer_id = consumer_id
        if create_instrument_identifier is not APIHelper.SKIP:
            self.create_instrument_identifier = create_instrument_identifier
        if source is not APIHelper.SKIP:
            self.source = source
        if state is not APIHelper.SKIP:
            self.state = state
        if reason is not APIHelper.SKIP:
            self.reason = reason
        if number is not APIHelper.SKIP:
            self.number = number
        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 mtype is not APIHelper.SKIP:
            self.mtype = mtype
        if cryptogram is not APIHelper.SKIP:
            self.cryptogram = cryptogram
        if security_code is not APIHelper.SKIP:
            self.security_code = security_code
        if eci is not APIHelper.SKIP:
            self.eci = eci
        if requestor_id is not APIHelper.SKIP:
            self.requestor_id = requestor_id
        if enrollment_id is not APIHelper.SKIP:
            self.enrollment_id = enrollment_id
        if token_reference_id is not APIHelper.SKIP:
            self.token_reference_id = token_reference_id
        if payment_account_reference is not APIHelper.SKIP:
            self.payment_account_reference = payment_account_reference
        if card is not APIHelper.SKIP:
            self.card = card
        if passcode is not APIHelper.SKIP:
            self.passcode = passcode
        if metadata is not APIHelper.SKIP:
            self.metadata = metadata

        # 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
        links =\
            Links22.from_dictionary(
                dictionary.get("_links"))\
                if "_links" in dictionary.keys()\
                else APIHelper.SKIP
        id =\
            dictionary.get("id")\
            if dictionary.get("id")\
                else APIHelper.SKIP
        object =\
            dictionary.get("object")\
            if dictionary.get("object")\
                else APIHelper.SKIP
        account_reference_id =\
            dictionary.get("accountReferenceId")\
            if dictionary.get("accountReferenceId")\
                else APIHelper.SKIP
        consumer_id =\
            dictionary.get("consumerId")\
            if dictionary.get("consumerId")\
                else APIHelper.SKIP
        create_instrument_identifier =\
            dictionary.get("createInstrumentIdentifier")\
            if "createInstrumentIdentifier" in dictionary.keys()\
                else APIHelper.SKIP
        source =\
            dictionary.get("source")\
            if dictionary.get("source")\
                else APIHelper.SKIP
        state =\
            dictionary.get("state")\
            if dictionary.get("state")\
                else APIHelper.SKIP
        reason =\
            dictionary.get("reason")\
            if dictionary.get("reason")\
                else APIHelper.SKIP
        number =\
            dictionary.get("number")\
            if dictionary.get("number")\
                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
        mtype =\
            dictionary.get("type")\
            if dictionary.get("type")\
                else APIHelper.SKIP
        cryptogram =\
            dictionary.get("cryptogram")\
            if dictionary.get("cryptogram")\
                else APIHelper.SKIP
        security_code =\
            dictionary.get("securityCode")\
            if dictionary.get("securityCode")\
                else APIHelper.SKIP
        eci =\
            dictionary.get("eci")\
            if dictionary.get("eci")\
                else APIHelper.SKIP
        requestor_id =\
            dictionary.get("requestorId")\
            if dictionary.get("requestorId")\
                else APIHelper.SKIP
        enrollment_id =\
            dictionary.get("enrollmentId")\
            if dictionary.get("enrollmentId")\
                else APIHelper.SKIP
        token_reference_id =\
            dictionary.get("tokenReferenceId")\
            if dictionary.get("tokenReferenceId")\
                else APIHelper.SKIP
        payment_account_reference =\
            dictionary.get("paymentAccountReference")\
            if dictionary.get("paymentAccountReference")\
                else APIHelper.SKIP
        card =\
            Card5.from_dictionary(
                dictionary.get("card"))\
                if "card" in dictionary.keys()\
                else APIHelper.SKIP
        passcode =\
            Passcode2.from_dictionary(
                dictionary.get("passcode"))\
                if "passcode" in dictionary.keys()\
                else APIHelper.SKIP
        metadata =\
            Metadata36.from_dictionary(
                dictionary.get("metadata"))\
                if "metadata" in dictionary.keys()\
                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(links,
                   id,
                   object,
                   account_reference_id,
                   consumer_id,
                   create_instrument_identifier,
                   source,
                   state,
                   reason,
                   number,
                   expiration_month,
                   expiration_year,
                   mtype,
                   cryptogram,
                   security_code,
                   eci,
                   requestor_id,
                   enrollment_id,
                   token_reference_id,
                   payment_account_reference,
                   card,
                   passcode,
                   metadata,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _links=(
            self.links
            if hasattr(self, "links")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _object=(
            self.object
            if hasattr(self, "object")
            else None
        )
        _account_reference_id=(
            self.account_reference_id
            if hasattr(self, "account_reference_id")
            else None
        )
        _consumer_id=(
            self.consumer_id
            if hasattr(self, "consumer_id")
            else None
        )
        _create_instrument_identifier=(
            self.create_instrument_identifier
            if hasattr(self, "create_instrument_identifier")
            else None
        )
        _source=(
            self.source
            if hasattr(self, "source")
            else None
        )
        _state=(
            self.state
            if hasattr(self, "state")
            else None
        )
        _reason=(
            self.reason
            if hasattr(self, "reason")
            else None
        )
        _number=(
            self.number
            if hasattr(self, "number")
            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
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _cryptogram=(
            self.cryptogram
            if hasattr(self, "cryptogram")
            else None
        )
        _security_code=(
            self.security_code
            if hasattr(self, "security_code")
            else None
        )
        _eci=(
            self.eci
            if hasattr(self, "eci")
            else None
        )
        _requestor_id=(
            self.requestor_id
            if hasattr(self, "requestor_id")
            else None
        )
        _enrollment_id=(
            self.enrollment_id
            if hasattr(self, "enrollment_id")
            else None
        )
        _token_reference_id=(
            self.token_reference_id
            if hasattr(self, "token_reference_id")
            else None
        )
        _payment_account_reference=(
            self.payment_account_reference
            if hasattr(self, "payment_account_reference")
            else None
        )
        _card=(
            self.card
            if hasattr(self, "card")
            else None
        )
        _passcode=(
            self.passcode
            if hasattr(self, "passcode")
            else None
        )
        _metadata=(
            self.metadata
            if hasattr(self, "metadata")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"links={_links!r}, "
            f"id={_id!r}, "
            f"object={_object!r}, "
            f"account_reference_id={_account_reference_id!r}, "
            f"consumer_id={_consumer_id!r}, "
            f"create_instrument_identifier={_create_instrument_identifier!r}, "
            f"source={_source!r}, "
            f"state={_state!r}, "
            f"reason={_reason!r}, "
            f"number={_number!r}, "
            f"expiration_month={_expiration_month!r}, "
            f"expiration_year={_expiration_year!r}, "
            f"mtype={_mtype!r}, "
            f"cryptogram={_cryptogram!r}, "
            f"security_code={_security_code!r}, "
            f"eci={_eci!r}, "
            f"requestor_id={_requestor_id!r}, "
            f"enrollment_id={_enrollment_id!r}, "
            f"token_reference_id={_token_reference_id!r}, "
            f"payment_account_reference={_payment_account_reference!r}, "
            f"card={_card!r}, "
            f"passcode={_passcode!r}, "
            f"metadata={_metadata!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _links=(
            self.links
            if hasattr(self, "links")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _object=(
            self.object
            if hasattr(self, "object")
            else None
        )
        _account_reference_id=(
            self.account_reference_id
            if hasattr(self, "account_reference_id")
            else None
        )
        _consumer_id=(
            self.consumer_id
            if hasattr(self, "consumer_id")
            else None
        )
        _create_instrument_identifier=(
            self.create_instrument_identifier
            if hasattr(self, "create_instrument_identifier")
            else None
        )
        _source=(
            self.source
            if hasattr(self, "source")
            else None
        )
        _state=(
            self.state
            if hasattr(self, "state")
            else None
        )
        _reason=(
            self.reason
            if hasattr(self, "reason")
            else None
        )
        _number=(
            self.number
            if hasattr(self, "number")
            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
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _cryptogram=(
            self.cryptogram
            if hasattr(self, "cryptogram")
            else None
        )
        _security_code=(
            self.security_code
            if hasattr(self, "security_code")
            else None
        )
        _eci=(
            self.eci
            if hasattr(self, "eci")
            else None
        )
        _requestor_id=(
            self.requestor_id
            if hasattr(self, "requestor_id")
            else None
        )
        _enrollment_id=(
            self.enrollment_id
            if hasattr(self, "enrollment_id")
            else None
        )
        _token_reference_id=(
            self.token_reference_id
            if hasattr(self, "token_reference_id")
            else None
        )
        _payment_account_reference=(
            self.payment_account_reference
            if hasattr(self, "payment_account_reference")
            else None
        )
        _card=(
            self.card
            if hasattr(self, "card")
            else None
        )
        _passcode=(
            self.passcode
            if hasattr(self, "passcode")
            else None
        )
        _metadata=(
            self.metadata
            if hasattr(self, "metadata")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"links={_links!s}, "
            f"id={_id!s}, "
            f"object={_object!s}, "
            f"account_reference_id={_account_reference_id!s}, "
            f"consumer_id={_consumer_id!s}, "
            f"create_instrument_identifier={_create_instrument_identifier!s}, "
            f"source={_source!s}, "
            f"state={_state!s}, "
            f"reason={_reason!s}, "
            f"number={_number!s}, "
            f"expiration_month={_expiration_month!s}, "
            f"expiration_year={_expiration_year!s}, "
            f"mtype={_mtype!s}, "
            f"cryptogram={_cryptogram!s}, "
            f"security_code={_security_code!s}, "
            f"eci={_eci!s}, "
            f"requestor_id={_requestor_id!s}, "
            f"enrollment_id={_enrollment_id!s}, "
            f"token_reference_id={_token_reference_id!s}, "
            f"payment_account_reference={_payment_account_reference!s}, "
            f"card={_card!s}, "
            f"passcode={_passcode!s}, "
            f"metadata={_metadata!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
