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

"""
zypev1

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


class OAuth(object):

    """Implementation of the 'OAuth' model.

    TODO: type model description here.

    Attributes:
        access_token (string): TODO: type description here.
        token_type (string): TODO: type description here.
        expires_in (float): TODO: type description here.
        refresh_token (string): TODO: type description here.
        scope (string): TODO: type description here.
        created_at (float): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "access_token": 'access_token',
        "token_type": 'token_type',
        "expires_in": 'expires_in',
        "refresh_token": 'refresh_token',
        "scope": 'scope',
        "created_at": 'created_at'
    }

    def __init__(self,
                 access_token=None,
                 token_type=None,
                 expires_in=None,
                 refresh_token=None,
                 scope=None,
                 created_at=None):
        """Constructor for the OAuth class"""

        # Initialize members of the class
        self.access_token = access_token
        self.token_type = token_type
        self.expires_in = expires_in
        self.refresh_token = refresh_token
        self.scope = scope
        self.created_at = created_at

    @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
        access_token = dictionary.get('access_token')
        token_type = dictionary.get('token_type')
        expires_in = dictionary.get('expires_in')
        refresh_token = dictionary.get('refresh_token')
        scope = dictionary.get('scope')
        created_at = dictionary.get('created_at')

        # Return an object of this model
        return cls(access_token,
                   token_type,
                   expires_in,
                   refresh_token,
                   scope,
                   created_at)
