# -*- 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.entity import Entity


class ActivitiesObject(object):

    """Implementation of the 'ActivitiesObject' model.

    TODO: type model description here.

    Attributes:
        description (string): TODO: type description here.
        display_type (string): TODO: type description here.
        entity (Entity): TODO: type description here.
        id (int): TODO: type description here.
        resource_id (string): TODO: type description here.
        site_id (int): TODO: type description here.
        site_name (string): TODO: type description here.
        timestamp (string): TODO: type description here.
        mtype (int): TODO: type description here.
        user_id (string): TODO: type description here.
        user_name (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "description": 'description',
        "display_type": 'display_type',
        "entity": 'entity',
        "id": 'id',
        "resource_id": 'resource_id',
        "site_id": 'site_id',
        "site_name": 'site_name',
        "timestamp": 'timestamp',
        "mtype": 'type',
        "user_id": 'user_id',
        "user_name": 'user_name'
    }

    _optionals = [
        'description',
        'display_type',
        'entity',
        'id',
        'resource_id',
        'site_id',
        'site_name',
        'timestamp',
        'mtype',
        'user_id',
        'user_name',
    ]

    def __init__(self,
                 description=APIHelper.SKIP,
                 display_type=APIHelper.SKIP,
                 entity=APIHelper.SKIP,
                 id=APIHelper.SKIP,
                 resource_id=APIHelper.SKIP,
                 site_id=APIHelper.SKIP,
                 site_name=APIHelper.SKIP,
                 timestamp=APIHelper.SKIP,
                 mtype=APIHelper.SKIP,
                 user_id=APIHelper.SKIP,
                 user_name=APIHelper.SKIP):
        """Constructor for the ActivitiesObject class"""

        # Initialize members of the class
        if description is not APIHelper.SKIP:
            self.description = description 
        if display_type is not APIHelper.SKIP:
            self.display_type = display_type 
        if entity is not APIHelper.SKIP:
            self.entity = entity 
        if id is not APIHelper.SKIP:
            self.id = id 
        if resource_id is not APIHelper.SKIP:
            self.resource_id = resource_id 
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id 
        if site_name is not APIHelper.SKIP:
            self.site_name = site_name 
        if timestamp is not APIHelper.SKIP:
            self.timestamp = timestamp 
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype 
        if user_id is not APIHelper.SKIP:
            self.user_id = user_id 
        if user_name is not APIHelper.SKIP:
            self.user_name = user_name 

    @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
        display_type = dictionary.get("display_type") if dictionary.get("display_type") else APIHelper.SKIP
        entity = Entity.from_dictionary(dictionary.get('entity')) if 'entity' in dictionary.keys() else APIHelper.SKIP
        id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP
        resource_id = dictionary.get("resource_id") if dictionary.get("resource_id") else APIHelper.SKIP
        site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP
        site_name = dictionary.get("site_name") if dictionary.get("site_name") else APIHelper.SKIP
        timestamp = dictionary.get("timestamp") if dictionary.get("timestamp") else APIHelper.SKIP
        mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP
        user_id = dictionary.get("user_id") if dictionary.get("user_id") else APIHelper.SKIP
        user_name = dictionary.get("user_name") if dictionary.get("user_name") else APIHelper.SKIP
        # Return an object of this model
        return cls(description,
                   display_type,
                   entity,
                   id,
                   resource_id,
                   site_id,
                   site_name,
                   timestamp,
                   mtype,
                   user_id,
                   user_name)
