# -*- 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.indicator_info import IndicatorInfo


class Indicators(object):

    """Implementation of the 'Indicators' model.

    TODO: type model description here.

    Attributes:
        id (int): TODO: type description here.
        alert_id (int): TODO: type description here.
        indicator_id (int): TODO: type description here.
        indicator_result (bool): TODO: type description here.
        parent_indicator_id (int): TODO: type description here.
        site_id (int): TODO: type description here.
        indicator_info (IndicatorInfo): TODO: type description here.
        icon (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'id',
        "alert_id": 'alert_id',
        "indicator_id": 'indicator_id',
        "indicator_result": 'indicator_result',
        "parent_indicator_id": 'parent_indicator_id',
        "site_id": 'site_id',
        "indicator_info": 'indicator_info',
        "icon": 'icon'
    }

    _optionals = [
        'id',
        'alert_id',
        'indicator_id',
        'indicator_result',
        'parent_indicator_id',
        'site_id',
        'indicator_info',
        'icon',
    ]

    def __init__(self,
                 id=APIHelper.SKIP,
                 alert_id=APIHelper.SKIP,
                 indicator_id=APIHelper.SKIP,
                 indicator_result=APIHelper.SKIP,
                 parent_indicator_id=APIHelper.SKIP,
                 site_id=APIHelper.SKIP,
                 indicator_info=APIHelper.SKIP,
                 icon=APIHelper.SKIP):
        """Constructor for the Indicators class"""

        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id 
        if alert_id is not APIHelper.SKIP:
            self.alert_id = alert_id 
        if indicator_id is not APIHelper.SKIP:
            self.indicator_id = indicator_id 
        if indicator_result is not APIHelper.SKIP:
            self.indicator_result = indicator_result 
        if parent_indicator_id is not APIHelper.SKIP:
            self.parent_indicator_id = parent_indicator_id 
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id 
        if indicator_info is not APIHelper.SKIP:
            self.indicator_info = indicator_info 
        if icon is not APIHelper.SKIP:
            self.icon = icon 

    @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
        alert_id = dictionary.get("alert_id") if dictionary.get("alert_id") else APIHelper.SKIP
        indicator_id = dictionary.get("indicator_id") if dictionary.get("indicator_id") else APIHelper.SKIP
        indicator_result = dictionary.get("indicator_result") if "indicator_result" in dictionary.keys() else APIHelper.SKIP
        parent_indicator_id = dictionary.get("parent_indicator_id") if dictionary.get("parent_indicator_id") else APIHelper.SKIP
        site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP
        indicator_info = IndicatorInfo.from_dictionary(dictionary.get('indicator_info')) if 'indicator_info' in dictionary.keys() else APIHelper.SKIP
        icon = dictionary.get("icon") if dictionary.get("icon") else APIHelper.SKIP
        # Return an object of this model
        return cls(id,
                   alert_id,
                   indicator_id,
                   indicator_result,
                   parent_indicator_id,
                   site_id,
                   indicator_info,
                   icon)
