"""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.bank_account_1 import (
    BankAccount1,
)
from visaacceptancemergedspec.models.bill_to_3 import (
    BillTo3,
)
from visaacceptancemergedspec.models.card_2 import (
    Card2,
)
from visaacceptancemergedspec.models.embedded_2 import (
    Embedded2,
)
from visaacceptancemergedspec.models.issuer_4 import (
    Issuer4,
)
from visaacceptancemergedspec.models.links_21 import (
    Links21,
)
from visaacceptancemergedspec.models.metadata_3 import (
    Metadata3,
)
from visaacceptancemergedspec.models.processing_information_28 import (
    ProcessingInformation28,
)
from visaacceptancemergedspec.models.tmsv_2_tokenized_card import (
    Tmsv2TokenizedCard,
)
from visaacceptancemergedspec.models.token_provisioning_information import (
    TokenProvisioningInformation,
)


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

    Attributes:
        links (Links21): The model property of type Links21.
        id (str): The Id of the Instrument Identifier Token.
        object (str): The type.  Possible Values: - instrumentIdentifier
        state (str): Issuers state for the card number. Possible Values: - ACTIVE -
            CLOSED : The account has been closed.
        mtype (str): The type of Instrument Identifier. Possible Values: - enrollable
            card - enrollable token
        token_provisioning_information (TokenProvisioningInformation): The model
            property of type TokenProvisioningInformation.
        card (Card2): The model property of type Card2.
        bank_account (BankAccount1): The model property of type BankAccount1.
        tokenized_card (Tmsv2TokenizedCard): The model property of type
            Tmsv2TokenizedCard.
        issuer (Issuer4): The model property of type Issuer4.
        processing_information (ProcessingInformation28): The model property of type
            ProcessingInformation28.
        bill_to (BillTo3): The model property of type BillTo3.
        metadata (Metadata3): The model property of type Metadata3.
        embedded (Embedded2): The model property of type Embedded2.
        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",
        "state": "state",
        "mtype": "type",
        "token_provisioning_information": "tokenProvisioningInformation",
        "card": "card",
        "bank_account": "bankAccount",
        "tokenized_card": "tokenizedCard",
        "issuer": "issuer",
        "processing_information": "processingInformation",
        "bill_to": "billTo",
        "metadata": "metadata",
        "embedded": "_embedded",
    }

    _optionals = [
        "links",
        "id",
        "object",
        "state",
        "mtype",
        "token_provisioning_information",
        "card",
        "bank_account",
        "tokenized_card",
        "issuer",
        "processing_information",
        "bill_to",
        "metadata",
        "embedded",
    ]

    def __init__(
        self,
        links=APIHelper.SKIP,
        id=APIHelper.SKIP,
        object=APIHelper.SKIP,
        state=APIHelper.SKIP,
        mtype=APIHelper.SKIP,
        token_provisioning_information=APIHelper.SKIP,
        card=APIHelper.SKIP,
        bank_account=APIHelper.SKIP,
        tokenized_card=APIHelper.SKIP,
        issuer=APIHelper.SKIP,
        processing_information=APIHelper.SKIP,
        bill_to=APIHelper.SKIP,
        metadata=APIHelper.SKIP,
        embedded=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a GetInstrumentIdentifierResponse 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 state is not APIHelper.SKIP:
            self.state = state
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype
        if token_provisioning_information is not APIHelper.SKIP:
            self.token_provisioning_information = token_provisioning_information
        if card is not APIHelper.SKIP:
            self.card = card
        if bank_account is not APIHelper.SKIP:
            self.bank_account = bank_account
        if tokenized_card is not APIHelper.SKIP:
            self.tokenized_card = tokenized_card
        if issuer is not APIHelper.SKIP:
            self.issuer = issuer
        if processing_information is not APIHelper.SKIP:
            self.processing_information = processing_information
        if bill_to is not APIHelper.SKIP:
            self.bill_to = bill_to
        if metadata is not APIHelper.SKIP:
            self.metadata = metadata
        if embedded is not APIHelper.SKIP:
            self.embedded = embedded

        # 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 =\
            Links21.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
        state =\
            dictionary.get("state")\
            if dictionary.get("state")\
                else APIHelper.SKIP
        mtype =\
            dictionary.get("type")\
            if dictionary.get("type")\
                else APIHelper.SKIP
        token_provisioning_information =\
            TokenProvisioningInformation.from_dictionary(
                dictionary.get("tokenProvisioningInformation"))\
                if "tokenProvisioningInformation" in dictionary.keys()\
                else APIHelper.SKIP
        card =\
            Card2.from_dictionary(
                dictionary.get("card"))\
                if "card" in dictionary.keys()\
                else APIHelper.SKIP
        bank_account =\
            BankAccount1.from_dictionary(
                dictionary.get("bankAccount"))\
                if "bankAccount" in dictionary.keys()\
                else APIHelper.SKIP
        tokenized_card =\
            Tmsv2TokenizedCard.from_dictionary(
                dictionary.get("tokenizedCard"))\
                if "tokenizedCard" in dictionary.keys()\
                else APIHelper.SKIP
        issuer =\
            Issuer4.from_dictionary(
                dictionary.get("issuer"))\
                if "issuer" in dictionary.keys()\
                else APIHelper.SKIP
        processing_information =\
            ProcessingInformation28.from_dictionary(
                dictionary.get("processingInformation"))\
                if "processingInformation" in dictionary.keys()\
                else APIHelper.SKIP
        bill_to =\
            BillTo3.from_dictionary(
                dictionary.get("billTo"))\
                if "billTo" in dictionary.keys()\
                else APIHelper.SKIP
        metadata =\
            Metadata3.from_dictionary(
                dictionary.get("metadata"))\
                if "metadata" in dictionary.keys()\
                else APIHelper.SKIP
        embedded =\
            Embedded2.from_dictionary(
                dictionary.get("_embedded"))\
                if "_embedded" 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,
                   state,
                   mtype,
                   token_provisioning_information,
                   card,
                   bank_account,
                   tokenized_card,
                   issuer,
                   processing_information,
                   bill_to,
                   metadata,
                   embedded,
                   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
        )
        _state=(
            self.state
            if hasattr(self, "state")
            else None
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _token_provisioning_information=(
            self.token_provisioning_information
            if hasattr(self, "token_provisioning_information")
            else None
        )
        _card=(
            self.card
            if hasattr(self, "card")
            else None
        )
        _bank_account=(
            self.bank_account
            if hasattr(self, "bank_account")
            else None
        )
        _tokenized_card=(
            self.tokenized_card
            if hasattr(self, "tokenized_card")
            else None
        )
        _issuer=(
            self.issuer
            if hasattr(self, "issuer")
            else None
        )
        _processing_information=(
            self.processing_information
            if hasattr(self, "processing_information")
            else None
        )
        _bill_to=(
            self.bill_to
            if hasattr(self, "bill_to")
            else None
        )
        _metadata=(
            self.metadata
            if hasattr(self, "metadata")
            else None
        )
        _embedded=(
            self.embedded
            if hasattr(self, "embedded")
            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"state={_state!r}, "
            f"mtype={_mtype!r}, "
            f"token_provisioning_information={_token_provisioning_information!r}, "
            f"card={_card!r}, "
            f"bank_account={_bank_account!r}, "
            f"tokenized_card={_tokenized_card!r}, "
            f"issuer={_issuer!r}, "
            f"processing_information={_processing_information!r}, "
            f"bill_to={_bill_to!r}, "
            f"metadata={_metadata!r}, "
            f"embedded={_embedded!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
        )
        _state=(
            self.state
            if hasattr(self, "state")
            else None
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _token_provisioning_information=(
            self.token_provisioning_information
            if hasattr(self, "token_provisioning_information")
            else None
        )
        _card=(
            self.card
            if hasattr(self, "card")
            else None
        )
        _bank_account=(
            self.bank_account
            if hasattr(self, "bank_account")
            else None
        )
        _tokenized_card=(
            self.tokenized_card
            if hasattr(self, "tokenized_card")
            else None
        )
        _issuer=(
            self.issuer
            if hasattr(self, "issuer")
            else None
        )
        _processing_information=(
            self.processing_information
            if hasattr(self, "processing_information")
            else None
        )
        _bill_to=(
            self.bill_to
            if hasattr(self, "bill_to")
            else None
        )
        _metadata=(
            self.metadata
            if hasattr(self, "metadata")
            else None
        )
        _embedded=(
            self.embedded
            if hasattr(self, "embedded")
            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"state={_state!s}, "
            f"mtype={_mtype!s}, "
            f"token_provisioning_information={_token_provisioning_information!s}, "
            f"card={_card!s}, "
            f"bank_account={_bank_account!s}, "
            f"tokenized_card={_tokenized_card!s}, "
            f"issuer={_issuer!s}, "
            f"processing_information={_processing_information!s}, "
            f"bill_to={_bill_to!s}, "
            f"metadata={_metadata!s}, "
            f"embedded={_embedded!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
