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

"""
ctddocumentation

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


class Object(object):

    """Implementation of the 'Object' model.

    TODO: type model description here.

    Attributes:
        description (string): TODO: type description here.
        user_id (string): TODO: type description here.
        resolved (bool): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "description": 'description',
        "user_id": 'user_id',
        "resolved": 'resolved'
    }

    _optionals = [
        'description',
        'user_id',
        'resolved',
    ]

    def __init__(self,
                 description=APIHelper.SKIP,
                 user_id=APIHelper.SKIP,
                 resolved=APIHelper.SKIP):
        """Constructor for the Object class"""

        # Initialize members of the class
        if description is not APIHelper.SKIP:
            self.description = description 
        if user_id is not APIHelper.SKIP:
            self.user_id = user_id 
        if resolved is not APIHelper.SKIP:
            self.resolved = resolved 

    @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

        description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP
        user_id = dictionary.get("user_id") if dictionary.get("user_id") else APIHelper.SKIP
        resolved = dictionary.get("resolved") if "resolved" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(description,
                   user_id,
                   resolved)
