"""visaacceptancemergedspec.

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

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


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

    Attributes:
        merchant_customer_id (str): Your identifier for the customer.  When a
            subscription or customer profile is being created, the maximum length for
            this field for most processors is 30. Otherwise, the maximum length is
            100.  #### Comercio Latino For recurring payments in Mexico, the value is
            the customer’s contract number. Note Before you request the
            authorization, you must inform the issuer of the customer contract
            numbers that will be used for recurring transactions.  #### Worldpay VAP
            For a follow-on credit with Worldpay VAP, Visa Acceptance checks the
            following locations, in the order given, for a customer account ID value
            and uses the first value it finds: 1. `customer_account_id` value in the
            follow-on credit request 2. Customer account ID value that was used for
            the capture that is being credited 3. Customer account ID value that was
            used for the original authorization If a customer account ID value cannot
            be found in any of these locations, then no value is used.
        hashed_password (str): The merchant's password that Visa Acceptance hashes
            and stores as a hashed password.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "merchant_customer_id": "merchantCustomerId",
        "hashed_password": "hashedPassword",
    }

    _optionals = [
        "merchant_customer_id",
        "hashed_password",
    ]

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

        # 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
        merchant_customer_id =\
            dictionary.get("merchantCustomerId")\
            if dictionary.get("merchantCustomerId")\
                else APIHelper.SKIP
        hashed_password =\
            dictionary.get("hashedPassword")\
            if dictionary.get("hashedPassword")\
                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(merchant_customer_id,
                   hashed_password,
                   additional_properties)

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

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