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

"""
paypalserversdk

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


class VaultTokenRequest(object):

    """Implementation of the 'Vault Token Request' model.

    The Tokenized Payment Source representing a Request to Vault a Token.

    Attributes:
        id (str): The PayPal-generated ID for the token.
        mtype (TokenRequestType): The tokenization method that generated the
            ID.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'id',
        "mtype": 'type'
    }

    def __init__(self,
                 id=None,
                 mtype=None):
        """Constructor for the VaultTokenRequest class"""

        # Initialize members of the class
        self.id = id 
        self.mtype = mtype 

    @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 dictionary is None:
            return None

        # Extract variables from the dictionary
        id = dictionary.get("id") if dictionary.get("id") else None
        mtype = dictionary.get("type") if dictionary.get("type") else None
        # Return an object of this model
        return cls(id,
                   mtype)
