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

"""
zypev1

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from zypev1.models.application import Application


class OAuthStatus(object):

    """Implementation of the 'OAuthStatus' model.

    TODO: type model description here.

    Attributes:
        resource_owner_id (string): TODO: type description here.
        scopes (list of string): TODO: type description here.
        expires_in_seconds (float): TODO: type description here.
        application (Application): TODO: type description here.
        created_at (float): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "resource_owner_id": 'resource_owner_id',
        "scopes": 'scopes',
        "expires_in_seconds": 'expires_in_seconds',
        "application": 'application',
        "created_at": 'created_at'
    }

    def __init__(self,
                 resource_owner_id=None,
                 scopes=None,
                 expires_in_seconds=None,
                 application=None,
                 created_at=None):
        """Constructor for the OAuthStatus class"""

        # Initialize members of the class
        self.resource_owner_id = resource_owner_id
        self.scopes = scopes
        self.expires_in_seconds = expires_in_seconds
        self.application = application
        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
        resource_owner_id = dictionary.get('resource_owner_id')
        scopes = dictionary.get('scopes')
        expires_in_seconds = dictionary.get('expires_in_seconds')
        application = Application.from_dictionary(dictionary.get('application')) if dictionary.get('application') else None
        created_at = dictionary.get('created_at')

        # Return an object of this model
        return cls(resource_owner_id,
                   scopes,
                   expires_in_seconds,
                   application,
                   created_at)
