"""visaacceptancemergedspec.

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

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


class BuyerInformation6(object):
    """Implementation of the 'BuyerInformation6' 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.  #### SEPA/BACS Required for Create Mandate and Import Mandate  ####
            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.
        date_of_birth (str): Recipient’s date of birth. **Format**: `YYYYMMDD`.  This
            field is a `pass-through`, which means that Visa Acceptance ensures that
            the value is eight numeric characters but otherwise does not verify the
            value or modify it in any way before sending it to the processor. If the
            field is not required for the transaction, Visa Acceptance does not
            forward it to the processor.
        gender (str): Customer's gender. Possible values are F (female), M (male), O
            (other).
        language (str): language setting of the user
        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",
        "date_of_birth": "dateOfBirth",
        "gender": "gender",
        "language": "language",
    }

    _optionals = [
        "merchant_customer_id",
        "date_of_birth",
        "gender",
        "language",
    ]

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

        # 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
        date_of_birth =\
            dictionary.get("dateOfBirth")\
            if dictionary.get("dateOfBirth")\
                else APIHelper.SKIP
        gender =\
            dictionary.get("gender")\
            if dictionary.get("gender")\
                else APIHelper.SKIP
        language =\
            dictionary.get("language")\
            if dictionary.get("language")\
                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,
                   date_of_birth,
                   gender,
                   language,
                   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
        )
        _date_of_birth=(
            self.date_of_birth
            if hasattr(self, "date_of_birth")
            else None
        )
        _gender=(
            self.gender
            if hasattr(self, "gender")
            else None
        )
        _language=(
            self.language
            if hasattr(self, "language")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"merchant_customer_id={_merchant_customer_id!r}, "
            f"date_of_birth={_date_of_birth!r}, "
            f"gender={_gender!r}, "
            f"language={_language!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
        )
        _date_of_birth=(
            self.date_of_birth
            if hasattr(self, "date_of_birth")
            else None
        )
        _gender=(
            self.gender
            if hasattr(self, "gender")
            else None
        )
        _language=(
            self.language
            if hasattr(self, "language")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"merchant_customer_id={_merchant_customer_id!s}, "
            f"date_of_birth={_date_of_birth!s}, "
            f"gender={_gender!s}, "
            f"language={_language!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
