"""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.address import Address
from paypalserversdk.models.name import Name
from paypalserversdk.models.paypal_wallet_attributes_response import (
    PaypalWalletAttributesResponse,
)
from paypalserversdk.models.paypal_wallet_stored_credential import (
    PaypalWalletStoredCredential,
)
from paypalserversdk.models.phone_number import (
    PhoneNumber,
)
from paypalserversdk.models.tax_info import (
    TaxInfo,
)


class PaypalWalletResponse(object):
    """Implementation of the 'PayPal Wallet Response' model.

    The PayPal Wallet response.

    Attributes:
        email_address (str): The internationalized email address. Note: Up to 64
            characters are allowed before and 255 characters are allowed after the @
            sign. However, the generally accepted maximum length for an email address
            is 254 characters. The pattern verifies that an unquoted @ sign exists.
        account_id (str): The PayPal payer ID, which is a masked version of the
            PayPal account number intended for use with third parties. The account
            number is reversibly encrypted and a proprietary variant of Base32 is
            used to encode the result.
        account_status (PaypalWalletAccountVerificationStatus): The account status
            indicates whether the buyer has verified the financial details associated
            with their PayPal account.
        name (Name): The name of the party.
        phone_type (PhoneType): The phone type.
        phone_number (PhoneNumber): The phone number in its canonical international
            [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en).
        birth_date (str): The stand-alone date, in [Internet date and time
            format](https://tools.ietf.org/html/rfc3339#section-5.6). To represent
            special legal values, such as a date of birth, you should use dates with
            no associated time or time-zone data. Whenever possible, use the standard
            `date_time` type. This regular expression does not validate all dates.
            For example, February 31 is valid and nothing is known about leap years.
        business_name (str): The business name of the PayPal account holder
            (populated for business accounts only)
        tax_info (TaxInfo): The tax ID of the customer. The customer is also known as
            the payer. Both `tax_id` and `tax_id_type` are required.
        address (Address): The portable international postal address. Maps to
            [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/
            wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls:
            the autocomplete
            attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co
            ntrols-the-autocomplete-attribute).
        attributes (PaypalWalletAttributesResponse): Additional attributes associated
            with the use of a PayPal Wallet.
        stored_credential (PaypalWalletStoredCredential): Provides additional details
            to process a payment using the PayPal wallet billing agreement or a
            vaulted payment method that has been stored or is intended to be stored.
        experience_status (ExperienceStatus): This field indicates the status of
            PayPal's Checkout experience throughout the order lifecycle. The values
            reflect the current stage of the checkout process.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "email_address": "email_address",
        "account_id": "account_id",
        "account_status": "account_status",
        "name": "name",
        "phone_type": "phone_type",
        "phone_number": "phone_number",
        "birth_date": "birth_date",
        "business_name": "business_name",
        "tax_info": "tax_info",
        "address": "address",
        "attributes": "attributes",
        "stored_credential": "stored_credential",
        "experience_status": "experience_status",
    }

    _optionals = [
        "email_address",
        "account_id",
        "account_status",
        "name",
        "phone_type",
        "phone_number",
        "birth_date",
        "business_name",
        "tax_info",
        "address",
        "attributes",
        "stored_credential",
        "experience_status",
    ]

    def __init__(
        self,
        email_address=APIHelper.SKIP,
        account_id=APIHelper.SKIP,
        account_status=APIHelper.SKIP,
        name=APIHelper.SKIP,
        phone_type=APIHelper.SKIP,
        phone_number=APIHelper.SKIP,
        birth_date=APIHelper.SKIP,
        business_name=APIHelper.SKIP,
        tax_info=APIHelper.SKIP,
        address=APIHelper.SKIP,
        attributes=APIHelper.SKIP,
        stored_credential=APIHelper.SKIP,
        experience_status=APIHelper.SKIP):
        """Initialize a PaypalWalletResponse instance."""
        # Initialize members of the class
        if email_address is not APIHelper.SKIP:
            self.email_address = email_address
        if account_id is not APIHelper.SKIP:
            self.account_id = account_id
        if account_status is not APIHelper.SKIP:
            self.account_status = account_status
        if name is not APIHelper.SKIP:
            self.name = name
        if phone_type is not APIHelper.SKIP:
            self.phone_type = phone_type
        if phone_number is not APIHelper.SKIP:
            self.phone_number = phone_number
        if birth_date is not APIHelper.SKIP:
            self.birth_date = birth_date
        if business_name is not APIHelper.SKIP:
            self.business_name = business_name
        if tax_info is not APIHelper.SKIP:
            self.tax_info = tax_info
        if address is not APIHelper.SKIP:
            self.address = address
        if attributes is not APIHelper.SKIP:
            self.attributes = attributes
        if stored_credential is not APIHelper.SKIP:
            self.stored_credential = stored_credential
        if experience_status is not APIHelper.SKIP:
            self.experience_status = experience_status

    @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
        email_address =\
            dictionary.get("email_address")\
            if dictionary.get("email_address")\
                else APIHelper.SKIP
        account_id =\
            dictionary.get("account_id")\
            if dictionary.get("account_id")\
                else APIHelper.SKIP
        account_status =\
            dictionary.get("account_status")\
            if dictionary.get("account_status")\
                else APIHelper.SKIP
        name =\
            Name.from_dictionary(
                dictionary.get("name"))\
                if "name" in dictionary.keys()\
                else APIHelper.SKIP
        phone_type =\
            dictionary.get("phone_type")\
            if dictionary.get("phone_type")\
                else APIHelper.SKIP
        phone_number =\
            PhoneNumber.from_dictionary(
                dictionary.get("phone_number"))\
                if "phone_number" in dictionary.keys()\
                else APIHelper.SKIP
        birth_date =\
            dictionary.get("birth_date")\
            if dictionary.get("birth_date")\
                else APIHelper.SKIP
        business_name =\
            dictionary.get("business_name")\
            if dictionary.get("business_name")\
                else APIHelper.SKIP
        tax_info =\
            TaxInfo.from_dictionary(
                dictionary.get("tax_info"))\
                if "tax_info" in dictionary.keys()\
                else APIHelper.SKIP
        address =\
            Address.from_dictionary(
                dictionary.get("address"))\
                if "address" in dictionary.keys()\
                else APIHelper.SKIP
        attributes =\
            PaypalWalletAttributesResponse.from_dictionary(
                dictionary.get("attributes"))\
                if "attributes" in dictionary.keys()\
                else APIHelper.SKIP
        stored_credential =\
            PaypalWalletStoredCredential.from_dictionary(
                dictionary.get("stored_credential"))\
                if "stored_credential" in dictionary.keys()\
                else APIHelper.SKIP
        experience_status =\
            dictionary.get("experience_status")\
            if dictionary.get("experience_status")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(email_address,
                   account_id,
                   account_status,
                   name,
                   phone_type,
                   phone_number,
                   birth_date,
                   business_name,
                   tax_info,
                   address,
                   attributes,
                   stored_credential,
                   experience_status)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _email_address=(
            self.email_address
            if hasattr(self, "email_address")
            else None
        )
        _account_id=(
            self.account_id
            if hasattr(self, "account_id")
            else None
        )
        _account_status=(
            self.account_status
            if hasattr(self, "account_status")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _phone_type=(
            self.phone_type
            if hasattr(self, "phone_type")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _birth_date=(
            self.birth_date
            if hasattr(self, "birth_date")
            else None
        )
        _business_name=(
            self.business_name
            if hasattr(self, "business_name")
            else None
        )
        _tax_info=(
            self.tax_info
            if hasattr(self, "tax_info")
            else None
        )
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _attributes=(
            self.attributes
            if hasattr(self, "attributes")
            else None
        )
        _stored_credential=(
            self.stored_credential
            if hasattr(self, "stored_credential")
            else None
        )
        _experience_status=(
            self.experience_status
            if hasattr(self, "experience_status")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"email_address={_email_address!r}, "
            f"account_id={_account_id!r}, "
            f"account_status={_account_status!r}, "
            f"name={_name!r}, "
            f"phone_type={_phone_type!r}, "
            f"phone_number={_phone_number!r}, "
            f"birth_date={_birth_date!r}, "
            f"business_name={_business_name!r}, "
            f"tax_info={_tax_info!r}, "
            f"address={_address!r}, "
            f"attributes={_attributes!r}, "
            f"stored_credential={_stored_credential!r}, "
            f"experience_status={_experience_status!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _email_address=(
            self.email_address
            if hasattr(self, "email_address")
            else None
        )
        _account_id=(
            self.account_id
            if hasattr(self, "account_id")
            else None
        )
        _account_status=(
            self.account_status
            if hasattr(self, "account_status")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _phone_type=(
            self.phone_type
            if hasattr(self, "phone_type")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _birth_date=(
            self.birth_date
            if hasattr(self, "birth_date")
            else None
        )
        _business_name=(
            self.business_name
            if hasattr(self, "business_name")
            else None
        )
        _tax_info=(
            self.tax_info
            if hasattr(self, "tax_info")
            else None
        )
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _attributes=(
            self.attributes
            if hasattr(self, "attributes")
            else None
        )
        _stored_credential=(
            self.stored_credential
            if hasattr(self, "stored_credential")
            else None
        )
        _experience_status=(
            self.experience_status
            if hasattr(self, "experience_status")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"email_address={_email_address!s}, "
            f"account_id={_account_id!s}, "
            f"account_status={_account_status!s}, "
            f"name={_name!s}, "
            f"phone_type={_phone_type!s}, "
            f"phone_number={_phone_number!s}, "
            f"birth_date={_birth_date!s}, "
            f"business_name={_business_name!s}, "
            f"tax_info={_tax_info!s}, "
            f"address={_address!s}, "
            f"attributes={_attributes!s}, "
            f"stored_credential={_stored_credential!s}, "
            f"experience_status={_experience_status!s}, "
            f")"
        )
