"""visaacceptancemergedspec.

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

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)
from visaacceptancemergedspec.models.customer_10 import (
    Customer10,
)
from visaacceptancemergedspec.models.payment_type_11 import (
    PaymentType11,
)


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

    Attributes:
        customer (Customer10): The model property of type Customer10.
        payment_type (PaymentType11): The model property of type PaymentType11.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "customer": "customer",
        "payment_type": "paymentType",
    }

    _optionals = [
        "customer",
        "payment_type",
    ]

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

        # 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
        customer =\
            Customer10.from_dictionary(
                dictionary.get("customer"))\
                if "customer" in dictionary.keys()\
                else APIHelper.SKIP
        payment_type =\
            PaymentType11.from_dictionary(
                dictionary.get("paymentType"))\
                if "paymentType" in dictionary.keys()\
                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(customer,
                   payment_type,
                   additional_properties)

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

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