"""visaacceptancemergedspec.

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

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


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

    Attributes:
        customer_id (str): Unique identifier for the customer's card and billing
            information.  When you use Payment Tokenization or Recurring Billing and
            you include this value in your request, many of the fields that are
            normally required for an authorization or credit become optional.
            **NOTE** When you use Payment Tokenization or Recurring Billing, the
            value for the Customer ID is actually the Visa Acceptance payment token
            for a customer. This token stores information such as the consumer’s card
            number so it can be applied towards bill payments, recurring payments, or
            one-time payments. By using this token in a payment API request, the
            merchant doesn't need to pass in data such as the card number or
            expiration date in the request itself.
        id (str): Unique identifier for the Customer token that was created as part
            of a bundled TOKEN_CREATE action.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "customer_id": "customerId",
        "id": "id",
    }

    _optionals = [
        "customer_id",
        "id",
    ]

    def __init__(
        self,
        customer_id=APIHelper.SKIP,
        id=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a Customer42 instance."""
        # Initialize members of the class
        if customer_id is not APIHelper.SKIP:
            self.customer_id = customer_id
        if id is not APIHelper.SKIP:
            self.id = 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
        customer_id =\
            dictionary.get("customerId")\
            if dictionary.get("customerId")\
                else APIHelper.SKIP
        id =\
            dictionary.get("id")\
            if dictionary.get("id")\
                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_id,
                   id,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _customer_id=(
            self.customer_id
            if hasattr(self, "customer_id")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"customer_id={_customer_id!r}, "
            f"id={_id!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _customer_id=(
            self.customer_id
            if hasattr(self, "customer_id")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"customer_id={_customer_id!s}, "
            f"id={_id!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
