# -*- coding: utf-8 -*-

"""
paypalserversdk

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from paypalserversdk.api_helper import APIHelper
from paypalserversdk.models.sepa_debit_experience_context import SepaDebitExperienceContext


class SepaDebitRequest(object):

    """Implementation of the 'SEPA Debit Request' model.

    An API resource denoting a request to securely store a SEPA Debit.

    Attributes:
        experience_context (SepaDebitExperienceContext): Customizes the payer
            experience during the approval process for the SEPA Debit payment.

    """

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

    _optionals = [
        'experience_context',
    ]

    def __init__(self,
                 experience_context=APIHelper.SKIP):
        """Constructor for the SepaDebitRequest class"""

        # Initialize members of the class
        if experience_context is not APIHelper.SKIP:
            self.experience_context = experience_context 

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates 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
        experience_context = SepaDebitExperienceContext.from_dictionary(dictionary.get('experience_context')) if 'experience_context' in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(experience_context)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'experience_context={(self.experience_context if hasattr(self, "experience_context") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'experience_context={(self.experience_context if hasattr(self, "experience_context") else None)!s})')
