"""paypalserversdk.

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

# ruff: noqa: E501
from paypalserversdk.api_helper import APIHelper


class BlikOneClickPaymentObject(object):
    """Implementation of the 'BLIK One-Click Payment Object' model.

    Information used to pay using BLIK one-click flow.

    Attributes:
        consumer_reference (str): The merchant generated, unique reference serving as
            a primary identifier for accounts connected between Blik and a merchant.

    """

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

    _optionals = [
        "consumer_reference",
    ]

    def __init__(
        self,
        consumer_reference=APIHelper.SKIP):
        """Initialize a BlikOneClickPaymentObject instance."""
        # Initialize members of the class
        if consumer_reference is not APIHelper.SKIP:
            self.consumer_reference = consumer_reference

    @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
        consumer_reference =\
            dictionary.get("consumer_reference")\
            if dictionary.get("consumer_reference")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(consumer_reference)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _consumer_reference=(
            self.consumer_reference
            if hasattr(self, "consumer_reference")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"consumer_reference={_consumer_reference!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _consumer_reference=(
            self.consumer_reference
            if hasattr(self, "consumer_reference")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"consumer_reference={_consumer_reference!s}, "
            f")"
        )
