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

"""
zypev1

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


class OAuthRefreshRequest(object):

    """Implementation of the 'OAuthRefreshRequest' model.

    TODO: type model description here.

    Attributes:
        client_id (string): The client ID for your Zype application
        client_secret (string): The client secret for your Zype application
        refresh_token (string): Token to use to refresh
        grant_type (string): Use `refresh_token`. Required for access token
            refresh.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "client_id": 'client_id',
        "client_secret": 'client_secret',
        "refresh_token": 'refresh_token',
        "grant_type": 'grant_type'
    }

    def __init__(self,
                 client_id=None,
                 client_secret=None,
                 refresh_token=None,
                 grant_type=None):
        """Constructor for the OAuthRefreshRequest class"""

        # Initialize members of the class
        self.client_id = client_id
        self.client_secret = client_secret
        self.refresh_token = refresh_token
        self.grant_type = grant_type

    @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
        client_id = dictionary.get('client_id')
        client_secret = dictionary.get('client_secret')
        refresh_token = dictionary.get('refresh_token')
        grant_type = dictionary.get('grant_type')

        # Return an object of this model
        return cls(client_id,
                   client_secret,
                   refresh_token,
                   grant_type)
