"""visaacceptancemergedspec.

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

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


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

    Attributes:
        name (str): This field contains the issuer name.
        country (str): This field contains [2-character ISO Country Codes]( for the
            issuer.
        bin_length (str): This field contains the length of the BIN.
        phone_number (str): This field contains the customer service phone number for
            the issuer.
        transaction_information (str): In a Mastercard Transaction, this field
            contains the unique identifier (Transaction Link ID) for the first
            transaction in a transaction life cycle.  This ID is crucial for
            maintaining continuity and linking subsequent operations to the original
            transaction.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "name": "name",
        "country": "country",
        "bin_length": "binLength",
        "phone_number": "phoneNumber",
        "transaction_information": "transactionInformation",
    }

    _optionals = [
        "name",
        "country",
        "bin_length",
        "phone_number",
        "transaction_information",
    ]

    def __init__(
        self,
        name=APIHelper.SKIP,
        country=APIHelper.SKIP,
        bin_length=APIHelper.SKIP,
        phone_number=APIHelper.SKIP,
        transaction_information=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a IssuerInformation30 instance."""
        # Initialize members of the class
        if name is not APIHelper.SKIP:
            self.name = name
        if country is not APIHelper.SKIP:
            self.country = country
        if bin_length is not APIHelper.SKIP:
            self.bin_length = bin_length
        if phone_number is not APIHelper.SKIP:
            self.phone_number = phone_number
        if transaction_information is not APIHelper.SKIP:
            self.transaction_information = transaction_information

        # 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
        name =\
            dictionary.get("name")\
            if dictionary.get("name")\
                else APIHelper.SKIP
        country =\
            dictionary.get("country")\
            if dictionary.get("country")\
                else APIHelper.SKIP
        bin_length =\
            dictionary.get("binLength")\
            if dictionary.get("binLength")\
                else APIHelper.SKIP
        phone_number =\
            dictionary.get("phoneNumber")\
            if dictionary.get("phoneNumber")\
                else APIHelper.SKIP
        transaction_information =\
            dictionary.get("transactionInformation")\
            if dictionary.get("transactionInformation")\
                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(name,
                   country,
                   bin_length,
                   phone_number,
                   transaction_information,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _bin_length=(
            self.bin_length
            if hasattr(self, "bin_length")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _transaction_information=(
            self.transaction_information
            if hasattr(self, "transaction_information")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"name={_name!r}, "
            f"country={_country!r}, "
            f"bin_length={_bin_length!r}, "
            f"phone_number={_phone_number!r}, "
            f"transaction_information={_transaction_information!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _bin_length=(
            self.bin_length
            if hasattr(self, "bin_length")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _transaction_information=(
            self.transaction_information
            if hasattr(self, "transaction_information")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"name={_name!s}, "
            f"country={_country!s}, "
            f"bin_length={_bin_length!s}, "
            f"phone_number={_phone_number!s}, "
            f"transaction_information={_transaction_information!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
