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

"""
ctddocumentation

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


class Entity(object):

    """Implementation of the 'Entity' model.

    TODO: type model description here.

    Attributes:
        user_id (string): TODO: type description here.
        mtype (string): TODO: type description here.
        object (object): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "user_id": 'user_id',
        "mtype": 'type',
        "object": 'object'
    }

    _optionals = [
        'user_id',
        'mtype',
        'object',
    ]

    def __init__(self,
                 user_id=APIHelper.SKIP,
                 mtype=APIHelper.SKIP,
                 object=APIHelper.SKIP):
        """Constructor for the Entity class"""

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

    @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_id = dictionary.get("user_id") if dictionary.get("user_id") else APIHelper.SKIP
        mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP
        object = Object.from_dictionary(dictionary.get('object')) if 'object' in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(user_id,
                   mtype,
                   object)
