"""visaacceptancemergedspec.

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

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


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

    Attributes:
        acquirer_bin (str): Acquirer bank ID number that  corresponds to a
            certificate that Visa Acceptance already has.This ID has this format.
            4XXXXX for Visa and 5XXXXX for Mastercard.
        country (str): Issuers need to be aware of the Acquirer's Country Code when
            the Acquirer country differs from the Merchant country and the Acquirer
            is in the EEA (European Economic Area).
        password (str): Registered password for the Visa directory server.
        merchant_id (str): Username for the visa directory server that is created
            when your acquirer sets up your account. This ID might be the same as
            your merchant ID. the username can be 15 or 23 characters.
        acquirer_merchant_id (str): Acquirer assigned merchant id. Check if your
            processor supports this field.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "acquirer_bin": "acquirerBin",
        "country": "country",
        "password": "password",
        "merchant_id": "merchantId",
        "acquirer_merchant_id": "acquirerMerchantId",
    }

    _optionals = [
        "acquirer_bin",
        "country",
        "password",
        "merchant_id",
        "acquirer_merchant_id",
    ]

    def __init__(
        self,
        acquirer_bin=APIHelper.SKIP,
        country=APIHelper.SKIP,
        password=APIHelper.SKIP,
        merchant_id=APIHelper.SKIP,
        acquirer_merchant_id=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a AcquirerInformation instance."""
        # Initialize members of the class
        if acquirer_bin is not APIHelper.SKIP:
            self.acquirer_bin = acquirer_bin
        if country is not APIHelper.SKIP:
            self.country = country
        if password is not APIHelper.SKIP:
            self.password = password
        if merchant_id is not APIHelper.SKIP:
            self.merchant_id = merchant_id
        if acquirer_merchant_id is not APIHelper.SKIP:
            self.acquirer_merchant_id = acquirer_merchant_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
        acquirer_bin =\
            dictionary.get("acquirerBin")\
            if dictionary.get("acquirerBin")\
                else APIHelper.SKIP
        country =\
            dictionary.get("country")\
            if dictionary.get("country")\
                else APIHelper.SKIP
        password =\
            dictionary.get("password")\
            if dictionary.get("password")\
                else APIHelper.SKIP
        merchant_id =\
            dictionary.get("merchantId")\
            if dictionary.get("merchantId")\
                else APIHelper.SKIP
        acquirer_merchant_id =\
            dictionary.get("acquirerMerchantId")\
            if dictionary.get("acquirerMerchantId")\
                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(acquirer_bin,
                   country,
                   password,
                   merchant_id,
                   acquirer_merchant_id,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _acquirer_bin=(
            self.acquirer_bin
            if hasattr(self, "acquirer_bin")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _password=(
            self.password
            if hasattr(self, "password")
            else None
        )
        _merchant_id=(
            self.merchant_id
            if hasattr(self, "merchant_id")
            else None
        )
        _acquirer_merchant_id=(
            self.acquirer_merchant_id
            if hasattr(self, "acquirer_merchant_id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"acquirer_bin={_acquirer_bin!r}, "
            f"country={_country!r}, "
            f"password={_password!r}, "
            f"merchant_id={_merchant_id!r}, "
            f"acquirer_merchant_id={_acquirer_merchant_id!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _acquirer_bin=(
            self.acquirer_bin
            if hasattr(self, "acquirer_bin")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _password=(
            self.password
            if hasattr(self, "password")
            else None
        )
        _merchant_id=(
            self.merchant_id
            if hasattr(self, "merchant_id")
            else None
        )
        _acquirer_merchant_id=(
            self.acquirer_merchant_id
            if hasattr(self, "acquirer_merchant_id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"acquirer_bin={_acquirer_bin!s}, "
            f"country={_country!s}, "
            f"password={_password!s}, "
            f"merchant_id={_merchant_id!s}, "
            f"acquirer_merchant_id={_acquirer_merchant_id!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
