"""paypalserversdk.

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

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


class VenmoExperienceContext(object):
    """Implementation of the 'Venmo Experience Context' model.

    A resource representing an experience context of vault a venmo account.

    Attributes:
        brand_name (str): The label that overrides the business name in the PayPal
            account on the PayPal site. The pattern is defined by an external party
            and supports Unicode.
        shipping_preference (ExperienceContextShippingPreference): The shipping
            preference. This only applies to PayPal payment source.
        vault_instruction (VaultInstructionAction): DEPRECATED. Vault Instruction on
            action to be performed after a successful payer approval.
        user_action (VaultUserAction): User Action on action to be performed after a
            successful payer approval.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "brand_name": "brand_name",
        "shipping_preference": "shipping_preference",
        "vault_instruction": "vault_instruction",
        "user_action": "user_action",
    }

    _optionals = [
        "brand_name",
        "shipping_preference",
        "vault_instruction",
        "user_action",
    ]

    def __init__(
        self,
        brand_name=APIHelper.SKIP,
        shipping_preference="GET_FROM_FILE",
        vault_instruction=APIHelper.SKIP,
        user_action="CONTINUE"):
        """Initialize a VenmoExperienceContext instance."""
        # Initialize members of the class
        if brand_name is not APIHelper.SKIP:
            self.brand_name = brand_name
        self.shipping_preference = shipping_preference
        if vault_instruction is not APIHelper.SKIP:
            self.vault_instruction = vault_instruction
        self.user_action = user_action

    @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
        brand_name =\
            dictionary.get("brand_name")\
            if dictionary.get("brand_name")\
                else APIHelper.SKIP
        shipping_preference =\
            dictionary.get("shipping_preference")\
            if dictionary.get("shipping_preference")\
                else "GET_FROM_FILE"
        vault_instruction =\
            dictionary.get("vault_instruction")\
            if dictionary.get("vault_instruction")\
                else APIHelper.SKIP
        user_action =\
            dictionary.get("user_action")\
            if dictionary.get("user_action")\
                else "CONTINUE"

        # Return an object of this model
        return cls(brand_name,
                   shipping_preference,
                   vault_instruction,
                   user_action)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _brand_name=(
            self.brand_name
            if hasattr(self, "brand_name")
            else None
        )
        _shipping_preference=(
            self.shipping_preference
            if hasattr(self, "shipping_preference")
            else None
        )
        _vault_instruction=(
            self.vault_instruction
            if hasattr(self, "vault_instruction")
            else None
        )
        _user_action=(
            self.user_action
            if hasattr(self, "user_action")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"brand_name={_brand_name!r}, "
            f"shipping_preference={_shipping_preference!r}, "
            f"vault_instruction={_vault_instruction!r}, "
            f"user_action={_user_action!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _brand_name=(
            self.brand_name
            if hasattr(self, "brand_name")
            else None
        )
        _shipping_preference=(
            self.shipping_preference
            if hasattr(self, "shipping_preference")
            else None
        )
        _vault_instruction=(
            self.vault_instruction
            if hasattr(self, "vault_instruction")
            else None
        )
        _user_action=(
            self.user_action
            if hasattr(self, "user_action")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"brand_name={_brand_name!s}, "
            f"shipping_preference={_shipping_preference!s}, "
            f"vault_instruction={_vault_instruction!s}, "
            f"user_action={_user_action!s}, "
            f")"
        )
