"""visaacceptancemergedspec.

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

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


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

    Attributes:
        mtype (str): The type of the identification.  Possible values:   - `NATIONAL`
            - `CPF`   - `CPNJ`   - `CURP`   - `SSN`   - `DRIVER_LICENSE`   -
            `PASSPORT_NUMBER`   - `PERSONAL_ID`   - `TAX_ID`   - `BR_CPF`     The
            individual tax ID type, typically is 11 characters long   - `BR_CNPJ`
            The business tax ID type, typically is 14 characters long.  This field is
            supported only on the following processors.  #### ComercioLatino Set this
            field to the Cadastro de Pessoas Fisicas (CPF).  #### Visa Acceptance
            Latin American Processing Supported for Redecard in Brazil. Set this
            field to the Cadastro de Pessoas Fisicas (CPF), which is required for AVS
            for Redecard in Brazil. **Note** Visa Acceptance Latin American
            Processing is the name of a specific processing connection that Visa
            Acceptance supports. In the Visa Acceptance API documentation, Visa
            Acceptance Latin American Processing does not refer to the general topic
            of processing in Latin America. The information in this field description
            is for the specific processing connection called Visa Acceptance Latin
            American Processing. It is not for any other Latin American processors
            that Visa Acceptance supports.
        id (str): The value of the identification type. This field is supported only
            on the following processors.  #### ComercioLatino Set this field to the
            Cadastro de Pessoas Fisicas (CPF).  #### Visa Acceptance Latin American
            Processing Supported for Redecard in Brazil. Set this field to the
            Cadastro de Pessoas Fisicas (CPF), which is required for AVS for Redecard
            in Brazil. **Note** Visa Acceptance Latin American Processing is the name
            of a specific processing connection that Visa Acceptance supports. In the
            Visa Acceptance API documentation, Visa Acceptance Latin American
            Processing does not refer to the general topic of processing in Latin
            America. The information in this field description is for the specific
            processing connection called Visa Acceptance Latin American Processing.
            It is not for any other Latin American processors that Visa Acceptance
            supports.               If `type = PASSPORT`, this is the cardholder's
            passport number. Recommended for Discover ProtectBuy.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "mtype": "type",
        "id": "id",
    }

    _optionals = [
        "mtype",
        "id",
    ]

    def __init__(
        self,
        mtype=APIHelper.SKIP,
        id=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PersonalIdentification6 instance."""
        # Initialize members of the class
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype
        if id is not APIHelper.SKIP:
            self.id = id

        # 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
        mtype =\
            dictionary.get("type")\
            if dictionary.get("type")\
                else APIHelper.SKIP
        id =\
            dictionary.get("id")\
            if dictionary.get("id")\
                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(mtype,
                   id,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"mtype={_mtype!r}, "
            f"id={_id!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"mtype={_mtype!s}, "
            f"id={_id!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
