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

"""
ctddocumentation

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


class Event(object):

    """Implementation of the 'Event' 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.
        timestamp (string): TODO: type description here.
        last_updated (string): TODO: type description here.
        type_number (int): 0: eNewAsset | 1: eAssetConflict | 2:
            eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5:
            eProtocolSpecific  6: eBaselineDown | 8:
            eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow |
            10: eFTPData  11: eBaselineRule | 12: eHighArpActivity | 13:
            eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 
            16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19:
            ePortScan | 20: eDenialOfService
        description (string): TODO: type description here.
        alert_id (int): TODO: type description here.
        status (string): 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',
        "timestamp": 'timestamp',
        "last_updated": 'last_updated',
        "type_number": 'type_number',
        "description": 'description',
        "alert_id": 'alert_id',
        "status": 'status',
        "type_name": 'type_name'
    }

    _optionals = [
        'resource_id',
        'id',
        'site_id',
        'timestamp',
        'last_updated',
        'type_number',
        'description',
        'alert_id',
        'status',
        'type_name',
    ]

    def __init__(self,
                 resource_id=APIHelper.SKIP,
                 id=APIHelper.SKIP,
                 site_id=APIHelper.SKIP,
                 timestamp=APIHelper.SKIP,
                 last_updated=APIHelper.SKIP,
                 type_number=APIHelper.SKIP,
                 description=APIHelper.SKIP,
                 alert_id=APIHelper.SKIP,
                 status=APIHelper.SKIP,
                 type_name=APIHelper.SKIP):
        """Constructor for the Event 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 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 description is not APIHelper.SKIP:
            self.description = description 
        if alert_id is not APIHelper.SKIP:
            self.alert_id = alert_id 
        if status is not APIHelper.SKIP:
            self.status = status 
        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
        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
        description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP
        alert_id = dictionary.get("alert_id") if dictionary.get("alert_id") else APIHelper.SKIP
        status = dictionary.get("status") if dictionary.get("status") 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,
                   timestamp,
                   last_updated,
                   type_number,
                   description,
                   alert_id,
                   status,
                   type_name)
