# -*- 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.actionable import Actionable
from ctddocumentation.models.actionable_asset import ActionableAsset
from ctddocumentation.models.actionable_cap import ActionableCap
from ctddocumentation.models.actionable_information import ActionableInformation
from ctddocumentation.models.actionable_policy import ActionablePolicy
from ctddocumentation.models.indicators import Indicators
from ctddocumentation.models.network import Network


class Alert(object):

    """Implementation of the 'Alert' model.

    TODO: type model description here.

    Attributes:
        resource_id (string): TODO: type description here.
        id (int): TODO: type description here.
        site_id (int): TODO: type description here.
        is_qualified (bool): TODO: type description here.
        actionable_diffs (list of Actionable): TODO: type description here.
        actionable_suspicious_files (list of Actionable): TODO: type
            description here.
        actionable_information (list of ActionableInformation): TODO: type
            description here.
        actionable_policies (list of ActionablePolicy): TODO: type description
            here.
        actionable_assets (list of ActionableAsset): TODO: type description
            here.
        actionable_caps (list of ActionableCap): TODO: type description here.
        significant_indicators (list of Indicators): TODO: type description
            here.
        alert_indicators (list of Indicators): TODO: type description here.
        threat_type (int): TODO: type description here.
        category_number (int): TODO: type description here.
        category_name (string): TODO: type description here.
        description (string): TODO: type description here.
        network (Network): TODO: type description here.
        score (int): TODO: type description here.
        severity_number (int): TODO: type description here.
        severity_name (string): TODO: type description here.
        resolution_number (int): TODO: type description here.
        resolution_name (string): TODO: type description here.
        resolved (bool): TODO: type description here.
        relevant (bool): TODO: type description here.
        protocol (string): TODO: type description here.
        network_id (int): TODO: type description here.
        story_id (int): TODO: type description here.
        actionable_virtual_zones_names (list of string): TODO: type
            description here.
        story_group_name (list of string): TODO: type description here.
        timestamp (string): TODO: type description here.
        last_updated (string): TODO: type description here.
        type_number (int): TODO: type description here.
        type_name (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "resource_id": 'resource_id',
        "id": 'id',
        "site_id": 'site_id',
        "is_qualified": 'is_qualified',
        "actionable_diffs": 'actionable_diffs',
        "actionable_suspicious_files": 'actionable_suspicious_files',
        "actionable_information": 'actionable_information',
        "actionable_policies": 'actionable_policies',
        "actionable_assets": 'actionable_assets',
        "actionable_caps": 'actionable_caps',
        "significant_indicators": 'significant_indicators',
        "alert_indicators": 'alert_indicators',
        "threat_type": 'threat_type',
        "category_number": 'category_number',
        "category_name": 'category_name',
        "description": 'description',
        "network": 'network',
        "score": 'score',
        "severity_number": 'severity_number',
        "severity_name": 'severity_name',
        "resolution_number": 'resolution_number',
        "resolution_name": 'resolution_name',
        "resolved": 'resolved',
        "relevant": 'relevant',
        "protocol": 'protocol',
        "network_id": 'network_id',
        "story_id": 'story_id',
        "actionable_virtual_zones_names": 'actionable_virtual_zones_names',
        "story_group_name": 'story_group_name',
        "timestamp": 'timestamp',
        "last_updated": 'last_updated',
        "type_number": 'type_number',
        "type_name": 'type_name'
    }

    _optionals = [
        'resource_id',
        'id',
        'site_id',
        'is_qualified',
        'actionable_diffs',
        'actionable_suspicious_files',
        'actionable_information',
        'actionable_policies',
        'actionable_assets',
        'actionable_caps',
        'significant_indicators',
        'alert_indicators',
        'threat_type',
        'category_number',
        'category_name',
        'description',
        'network',
        'score',
        'severity_number',
        'severity_name',
        'resolution_number',
        'resolution_name',
        'resolved',
        'relevant',
        'protocol',
        'network_id',
        'story_id',
        'actionable_virtual_zones_names',
        'story_group_name',
        'timestamp',
        'last_updated',
        'type_number',
        'type_name',
    ]

    def __init__(self,
                 resource_id=APIHelper.SKIP,
                 id=APIHelper.SKIP,
                 site_id=APIHelper.SKIP,
                 is_qualified=APIHelper.SKIP,
                 actionable_diffs=APIHelper.SKIP,
                 actionable_suspicious_files=APIHelper.SKIP,
                 actionable_information=APIHelper.SKIP,
                 actionable_policies=APIHelper.SKIP,
                 actionable_assets=APIHelper.SKIP,
                 actionable_caps=APIHelper.SKIP,
                 significant_indicators=APIHelper.SKIP,
                 alert_indicators=APIHelper.SKIP,
                 threat_type=APIHelper.SKIP,
                 category_number=APIHelper.SKIP,
                 category_name=APIHelper.SKIP,
                 description=APIHelper.SKIP,
                 network=APIHelper.SKIP,
                 score=APIHelper.SKIP,
                 severity_number=APIHelper.SKIP,
                 severity_name=APIHelper.SKIP,
                 resolution_number=APIHelper.SKIP,
                 resolution_name=APIHelper.SKIP,
                 resolved=APIHelper.SKIP,
                 relevant=APIHelper.SKIP,
                 protocol=APIHelper.SKIP,
                 network_id=APIHelper.SKIP,
                 story_id=APIHelper.SKIP,
                 actionable_virtual_zones_names=APIHelper.SKIP,
                 story_group_name=APIHelper.SKIP,
                 timestamp=APIHelper.SKIP,
                 last_updated=APIHelper.SKIP,
                 type_number=APIHelper.SKIP,
                 type_name=APIHelper.SKIP):
        """Constructor for the Alert class"""

        # Initialize members of the class
        if resource_id is not APIHelper.SKIP:
            self.resource_id = resource_id 
        if id is not APIHelper.SKIP:
            self.id = id 
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id 
        if is_qualified is not APIHelper.SKIP:
            self.is_qualified = is_qualified 
        if actionable_diffs is not APIHelper.SKIP:
            self.actionable_diffs = actionable_diffs 
        if actionable_suspicious_files is not APIHelper.SKIP:
            self.actionable_suspicious_files = actionable_suspicious_files 
        if actionable_information is not APIHelper.SKIP:
            self.actionable_information = actionable_information 
        if actionable_policies is not APIHelper.SKIP:
            self.actionable_policies = actionable_policies 
        if actionable_assets is not APIHelper.SKIP:
            self.actionable_assets = actionable_assets 
        if actionable_caps is not APIHelper.SKIP:
            self.actionable_caps = actionable_caps 
        if significant_indicators is not APIHelper.SKIP:
            self.significant_indicators = significant_indicators 
        if alert_indicators is not APIHelper.SKIP:
            self.alert_indicators = alert_indicators 
        if threat_type is not APIHelper.SKIP:
            self.threat_type = threat_type 
        if category_number is not APIHelper.SKIP:
            self.category_number = category_number 
        if category_name is not APIHelper.SKIP:
            self.category_name = category_name 
        if description is not APIHelper.SKIP:
            self.description = description 
        if network is not APIHelper.SKIP:
            self.network = network 
        if score is not APIHelper.SKIP:
            self.score = score 
        if severity_number is not APIHelper.SKIP:
            self.severity_number = severity_number 
        if severity_name is not APIHelper.SKIP:
            self.severity_name = severity_name 
        if resolution_number is not APIHelper.SKIP:
            self.resolution_number = resolution_number 
        if resolution_name is not APIHelper.SKIP:
            self.resolution_name = resolution_name 
        if resolved is not APIHelper.SKIP:
            self.resolved = resolved 
        if relevant is not APIHelper.SKIP:
            self.relevant = relevant 
        if protocol is not APIHelper.SKIP:
            self.protocol = protocol 
        if network_id is not APIHelper.SKIP:
            self.network_id = network_id 
        if story_id is not APIHelper.SKIP:
            self.story_id = story_id 
        if actionable_virtual_zones_names is not APIHelper.SKIP:
            self.actionable_virtual_zones_names = actionable_virtual_zones_names 
        if story_group_name is not APIHelper.SKIP:
            self.story_group_name = story_group_name 
        if timestamp is not APIHelper.SKIP:
            self.timestamp = timestamp 
        if last_updated is not APIHelper.SKIP:
            self.last_updated = last_updated 
        if type_number is not APIHelper.SKIP:
            self.type_number = type_number 
        if type_name is not APIHelper.SKIP:
            self.type_name = type_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

        resource_id = dictionary.get("resource_id") if dictionary.get("resource_id") else APIHelper.SKIP
        id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP
        site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP
        is_qualified = dictionary.get("is_qualified") if "is_qualified" in dictionary.keys() else APIHelper.SKIP
        actionable_diffs = None
        if dictionary.get('actionable_diffs') is not None:
            actionable_diffs = [Actionable.from_dictionary(x) for x in dictionary.get('actionable_diffs')]
        else:
            actionable_diffs = APIHelper.SKIP
        actionable_suspicious_files = None
        if dictionary.get('actionable_suspicious_files') is not None:
            actionable_suspicious_files = [Actionable.from_dictionary(x) for x in dictionary.get('actionable_suspicious_files')]
        else:
            actionable_suspicious_files = APIHelper.SKIP
        actionable_information = None
        if dictionary.get('actionable_information') is not None:
            actionable_information = [ActionableInformation.from_dictionary(x) for x in dictionary.get('actionable_information')]
        else:
            actionable_information = APIHelper.SKIP
        actionable_policies = None
        if dictionary.get('actionable_policies') is not None:
            actionable_policies = [ActionablePolicy.from_dictionary(x) for x in dictionary.get('actionable_policies')]
        else:
            actionable_policies = APIHelper.SKIP
        actionable_assets = None
        if dictionary.get('actionable_assets') is not None:
            actionable_assets = [ActionableAsset.from_dictionary(x) for x in dictionary.get('actionable_assets')]
        else:
            actionable_assets = APIHelper.SKIP
        actionable_caps = None
        if dictionary.get('actionable_caps') is not None:
            actionable_caps = [ActionableCap.from_dictionary(x) for x in dictionary.get('actionable_caps')]
        else:
            actionable_caps = APIHelper.SKIP
        significant_indicators = None
        if dictionary.get('significant_indicators') is not None:
            significant_indicators = [Indicators.from_dictionary(x) for x in dictionary.get('significant_indicators')]
        else:
            significant_indicators = APIHelper.SKIP
        alert_indicators = None
        if dictionary.get('alert_indicators') is not None:
            alert_indicators = [Indicators.from_dictionary(x) for x in dictionary.get('alert_indicators')]
        else:
            alert_indicators = APIHelper.SKIP
        threat_type = dictionary.get("threat_type") if dictionary.get("threat_type") else APIHelper.SKIP
        category_number = dictionary.get("category_number") if dictionary.get("category_number") else APIHelper.SKIP
        category_name = dictionary.get("category_name") if dictionary.get("category_name") else APIHelper.SKIP
        description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP
        network = Network.from_dictionary(dictionary.get('network')) if 'network' in dictionary.keys() else APIHelper.SKIP
        score = dictionary.get("score") if dictionary.get("score") else APIHelper.SKIP
        severity_number = dictionary.get("severity_number") if dictionary.get("severity_number") else APIHelper.SKIP
        severity_name = dictionary.get("severity_name") if dictionary.get("severity_name") else APIHelper.SKIP
        resolution_number = dictionary.get("resolution_number") if dictionary.get("resolution_number") else APIHelper.SKIP
        resolution_name = dictionary.get("resolution_name") if dictionary.get("resolution_name") else APIHelper.SKIP
        resolved = dictionary.get("resolved") if "resolved" in dictionary.keys() else APIHelper.SKIP
        relevant = dictionary.get("relevant") if "relevant" in dictionary.keys() else APIHelper.SKIP
        protocol = dictionary.get("protocol") if dictionary.get("protocol") else APIHelper.SKIP
        network_id = dictionary.get("network_id") if dictionary.get("network_id") else APIHelper.SKIP
        story_id = dictionary.get("story_id") if dictionary.get("story_id") else APIHelper.SKIP
        actionable_virtual_zones_names = dictionary.get("actionable_virtual_zones_names") if dictionary.get("actionable_virtual_zones_names") else APIHelper.SKIP
        story_group_name = dictionary.get("story_group_name") if dictionary.get("story_group_name") else APIHelper.SKIP
        timestamp = dictionary.get("timestamp") if dictionary.get("timestamp") else APIHelper.SKIP
        last_updated = dictionary.get("last_updated") if dictionary.get("last_updated") else APIHelper.SKIP
        type_number = dictionary.get("type_number") if dictionary.get("type_number") else APIHelper.SKIP
        type_name = dictionary.get("type_name") if dictionary.get("type_name") else APIHelper.SKIP
        # Return an object of this model
        return cls(resource_id,
                   id,
                   site_id,
                   is_qualified,
                   actionable_diffs,
                   actionable_suspicious_files,
                   actionable_information,
                   actionable_policies,
                   actionable_assets,
                   actionable_caps,
                   significant_indicators,
                   alert_indicators,
                   threat_type,
                   category_number,
                   category_name,
                   description,
                   network,
                   score,
                   severity_number,
                   severity_name,
                   resolution_number,
                   resolution_name,
                   resolved,
                   relevant,
                   protocol,
                   network_id,
                   story_id,
                   actionable_virtual_zones_names,
                   story_group_name,
                   timestamp,
                   last_updated,
                   type_number,
                   type_name)
