"""paypalserversdk.

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

# ruff: noqa: E501
from paypalserversdk.api_helper import APIHelper
from paypalserversdk.models.vaulted_digital_wallet_shipping_details import (
    VaultedDigitalWalletShippingDetails,
)
from paypalserversdk.models.venmo_experience_context import (
    VenmoExperienceContext,
)


class VaultVenmoRequest(object):
    """Implementation of the 'Vault Venmo Request' model.

    A resource representing a request to vault Venmo.

    Attributes:
        description (str): The description displayed to the consumer on the approval
            flow for a digital wallet, as well as on the merchant view of the payment
            token management experience. exp: PayPal.com.
        usage_pattern (UsagePattern): Expected business/charge model for the billing
            agreement.
        shipping (VaultedDigitalWalletShippingDetails): The shipping details.
        permit_multiple_payment_tokens (bool): Create multiple payment tokens for the
            same payer, merchant/platform combination. Use this when the customer has
            not logged in at merchant/platform. The payment token thus generated, can
            then also be used to create the customer account at merchant/platform.
            Use this also when multiple payment tokens are required for the same
            payer, different customer at merchant/platform. This helps to identify
            customers distinctly even though they may share the same PayPal account.
            This only applies to PayPal payment source.
        usage_type (PaypalPaymentTokenUsageType): The usage type associated with a
            digital wallet payment token.
        customer_type (PaypalPaymentTokenCustomerType): The customer type associated
            with a digital wallet payment token. This is to indicate whether the
            customer acting on the merchant / platform is either a business or a
            consumer.
        experience_context (VenmoExperienceContext): A resource representing an
            experience context of vault a venmo account.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "description": "description",
        "usage_pattern": "usage_pattern",
        "shipping": "shipping",
        "permit_multiple_payment_tokens": "permit_multiple_payment_tokens",
        "usage_type": "usage_type",
        "customer_type": "customer_type",
        "experience_context": "experience_context",
    }

    _optionals = [
        "description",
        "usage_pattern",
        "shipping",
        "permit_multiple_payment_tokens",
        "usage_type",
        "customer_type",
        "experience_context",
    ]

    def __init__(
        self,
        description=APIHelper.SKIP,
        usage_pattern=APIHelper.SKIP,
        shipping=APIHelper.SKIP,
        permit_multiple_payment_tokens=False,
        usage_type=APIHelper.SKIP,
        customer_type=APIHelper.SKIP,
        experience_context=APIHelper.SKIP):
        """Initialize a VaultVenmoRequest instance."""
        # Initialize members of the class
        if description is not APIHelper.SKIP:
            self.description = description
        if usage_pattern is not APIHelper.SKIP:
            self.usage_pattern = usage_pattern
        if shipping is not APIHelper.SKIP:
            self.shipping = shipping
        self.permit_multiple_payment_tokens = permit_multiple_payment_tokens
        if usage_type is not APIHelper.SKIP:
            self.usage_type = usage_type
        if customer_type is not APIHelper.SKIP:
            self.customer_type = customer_type
        if experience_context is not APIHelper.SKIP:
            self.experience_context = experience_context

    @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
        description =\
            dictionary.get("description")\
            if dictionary.get("description")\
                else APIHelper.SKIP
        usage_pattern =\
            dictionary.get("usage_pattern")\
            if dictionary.get("usage_pattern")\
                else APIHelper.SKIP
        shipping =\
            VaultedDigitalWalletShippingDetails.from_dictionary(
                dictionary.get("shipping"))\
                if "shipping" in dictionary.keys()\
                else APIHelper.SKIP
        permit_multiple_payment_tokens =\
            dictionary.get("permit_multiple_payment_tokens")\
            if dictionary.get("permit_multiple_payment_tokens")\
                else False
        usage_type =\
            dictionary.get("usage_type")\
            if dictionary.get("usage_type")\
                else APIHelper.SKIP
        customer_type =\
            dictionary.get("customer_type")\
            if dictionary.get("customer_type")\
                else APIHelper.SKIP
        experience_context =\
            VenmoExperienceContext.from_dictionary(
                dictionary.get("experience_context"))\
                if "experience_context" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(description,
                   usage_pattern,
                   shipping,
                   permit_multiple_payment_tokens,
                   usage_type,
                   customer_type,
                   experience_context)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _description=(
            self.description
            if hasattr(self, "description")
            else None
        )
        _usage_pattern=(
            self.usage_pattern
            if hasattr(self, "usage_pattern")
            else None
        )
        _shipping=(
            self.shipping
            if hasattr(self, "shipping")
            else None
        )
        _permit_multiple_payment_tokens=(
            self.permit_multiple_payment_tokens
            if hasattr(self, "permit_multiple_payment_tokens")
            else None
        )
        _usage_type=(
            self.usage_type
            if hasattr(self, "usage_type")
            else None
        )
        _customer_type=(
            self.customer_type
            if hasattr(self, "customer_type")
            else None
        )
        _experience_context=(
            self.experience_context
            if hasattr(self, "experience_context")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"description={_description!r}, "
            f"usage_pattern={_usage_pattern!r}, "
            f"shipping={_shipping!r}, "
            f"permit_multiple_payment_tokens={_permit_multiple_payment_tokens!r}, "
            f"usage_type={_usage_type!r}, "
            f"customer_type={_customer_type!r}, "
            f"experience_context={_experience_context!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _description=(
            self.description
            if hasattr(self, "description")
            else None
        )
        _usage_pattern=(
            self.usage_pattern
            if hasattr(self, "usage_pattern")
            else None
        )
        _shipping=(
            self.shipping
            if hasattr(self, "shipping")
            else None
        )
        _permit_multiple_payment_tokens=(
            self.permit_multiple_payment_tokens
            if hasattr(self, "permit_multiple_payment_tokens")
            else None
        )
        _usage_type=(
            self.usage_type
            if hasattr(self, "usage_type")
            else None
        )
        _customer_type=(
            self.customer_type
            if hasattr(self, "customer_type")
            else None
        )
        _experience_context=(
            self.experience_context
            if hasattr(self, "experience_context")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"description={_description!s}, "
            f"usage_pattern={_usage_pattern!s}, "
            f"shipping={_shipping!s}, "
            f"permit_multiple_payment_tokens={_permit_multiple_payment_tokens!s}, "
            f"usage_type={_usage_type!s}, "
            f"customer_type={_customer_type!s}, "
            f"experience_context={_experience_context!s}, "
            f")"
        )
