"""visaacceptancemergedspec.

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

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


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

    Attributes:
        personal_id_result (str): Personal identifier result. This field is supported
            only for Redecard in Brazil for Visa Acceptance Latin American
            Processing. If you included
            `buyerInformation.personalIdentification[].ID` in the request, this value
            indicates whether or not `buyerInformation.personalIdentification[].ID`
            matched a value in a record on file. Returned only when the personal ID
            result is returned by the processor.  Possible values:   - `Y`: Match  -
            `N`: No match  - `K`: Not supported  - `U`: Unknown  - `Z`: No response
            returned **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.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "personal_id_result": "personalIdResult",
    }

    _optionals = [
        "personal_id_result",
    ]

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

        # 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
        personal_id_result =\
            dictionary.get("personalIdResult")\
            if dictionary.get("personalIdResult")\
                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(personal_id_result,
                   additional_properties)

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

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