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

"""
restapisdk

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


class ApiRestV2SessionGettokenRequest(object):

    """Implementation of the 'Api Rest V2 Session Gettoken Request' model.

    TODO: type model description here.

    Attributes:
        user_name (string): Username of the user account
        password (string): The password of the user account
        token_expiry_duration (string): Provide duration in seconds after
            which the token should expire

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "user_name": 'userName',
        "password": 'password',
        "token_expiry_duration": 'tokenExpiryDuration'
    }

    def __init__(self,
                 user_name=None,
                 password=None,
                 token_expiry_duration=None):
        """Constructor for the ApiRestV2SessionGettokenRequest class"""

        # Initialize members of the class
        self.user_name = user_name
        self.password = password
        self.token_expiry_duration = token_expiry_duration

    @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
        user_name = dictionary.get('userName')
        password = dictionary.get('password')
        token_expiry_duration = dictionary.get('tokenExpiryDuration')

        # Return an object of this model
        return cls(user_name,
                   password,
                   token_expiry_duration)
