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

"""
ctddocumentation

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from ctddocumentation.api_helper import APIHelper


class CTDLoginResponse(object):

    """Implementation of the 'CTDLoginResponse' model.

    TODO: type model description here.

    Attributes:
        id (int): TODO: type description here.
        first_name (string): TODO: type description here.
        last_name (string): TODO: type description here.
        token (string): TODO: type description here.
        password_expired (bool): TODO: type description here.
        mail (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'id',
        "first_name": 'first_name',
        "last_name": 'last_name',
        "token": 'token',
        "password_expired": 'password_expired',
        "mail": 'mail'
    }

    _optionals = [
        'id',
        'first_name',
        'last_name',
        'token',
        'password_expired',
        'mail',
    ]

    def __init__(self,
                 id=APIHelper.SKIP,
                 first_name=APIHelper.SKIP,
                 last_name=APIHelper.SKIP,
                 token=APIHelper.SKIP,
                 password_expired=APIHelper.SKIP,
                 mail=APIHelper.SKIP):
        """Constructor for the CTDLoginResponse class"""

        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id 
        if first_name is not APIHelper.SKIP:
            self.first_name = first_name 
        if last_name is not APIHelper.SKIP:
            self.last_name = last_name 
        if token is not APIHelper.SKIP:
            self.token = token 
        if password_expired is not APIHelper.SKIP:
            self.password_expired = password_expired 
        if mail is not APIHelper.SKIP:
            self.mail = mail 

    @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 APIHelper.SKIP
        first_name = dictionary.get("first_name") if dictionary.get("first_name") else APIHelper.SKIP
        last_name = dictionary.get("last_name") if dictionary.get("last_name") else APIHelper.SKIP
        token = dictionary.get("token") if dictionary.get("token") else APIHelper.SKIP
        password_expired = dictionary.get("password_expired") if "password_expired" in dictionary.keys() else APIHelper.SKIP
        mail = dictionary.get("mail") if dictionary.get("mail") else APIHelper.SKIP
        # Return an object of this model
        return cls(id,
                   first_name,
                   last_name,
                   token,
                   password_expired,
                   mail)
