# -*- 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.code_sections import CodeSections
from ctddocumentation.models.network import Network
from ctddocumentation.models.object import Object


class Asset(object):

    """Implementation of the 'Asset' 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.
        approved (bool): TODO: type description here.
        asset_type_number (int): TODO: type description here.
        asset_type_name (string): TODO: type description here.
        class_type (string): TODO: type description here.
        criticality_number (int): TODO: type description here.
        criticality_name (string): TODO: type description here.
        display_name (string): TODO: type description here.
        first_seen (string): TODO: type description here.
        last_seen (string): TODO: type description here.
        last_updated (string): TODO: type description here.
        ghost (bool): TODO: type description here.
        hostname (string): TODO: type description here.
        installed_programs_count (int): TODO: type description here.
        mac (list of string): TODO: type description here.
        name (string): TODO: type description here.
        network_id (int): TODO: type description here.
        num_alerts (int): TODO: type description here.
        patch_count (int): TODO: type description here.
        parsed (bool): TODO: type description here.
        protocol (list of string): TODO: type description here.
        purdue_level (float): TODO: type description here.
        risk_level (int): TODO: type description here.
        site_name (string): TODO: type description here.
        special_hint (int): TODO: type description here.
        special_hint_name (string): TODO: type description here.
        vlan (list of string): TODO: type description here.
        virtual_zone_id (int): TODO: type description here.
        virtual_zone_name (string): TODO: type description here.
        vendor (string): TODO: type description here.
        valid (bool): TODO: type description here.
        subnet_id (int): TODO: type description here.
        usb_devices_count (int): TODO: type description here.
        timestamp (string): TODO: type description here.
        network (Network): TODO: type description here.
        active_queries_names (list of string): TODO: type description here.
        active_scans_names (list of string): TODO: type description here.
        children (list of object): TODO: type description here.
        custom_attributes (list of object): TODO: type description here.
        custom_informations (list of object): TODO: type description here.
        insight_names (list of string): TODO: type description here.
        code_sections (list of CodeSections): 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',
        "approved": 'approved',
        "asset_type_number": 'asset_type_number',
        "asset_type_name": 'asset_type_name',
        "class_type": 'class_type',
        "criticality_number": 'criticality_number',
        "criticality_name": 'criticality_name',
        "display_name": 'display_name',
        "first_seen": 'first_seen',
        "last_seen": 'last_seen',
        "last_updated": 'last_updated',
        "ghost": 'ghost',
        "hostname": 'hostname',
        "installed_programs_count": 'installed_programs_count',
        "mac": 'mac',
        "name": 'name',
        "network_id": 'network_id',
        "num_alerts": 'num_alerts',
        "patch_count": 'patch_count',
        "parsed": 'parsed',
        "protocol": 'protocol',
        "purdue_level": 'purdue_level',
        "risk_level": 'risk_level',
        "site_name": 'site_name',
        "special_hint": 'special_hint_',
        "special_hint_name": 'special_hint_name',
        "vlan": 'vlan',
        "virtual_zone_id": 'virtual_zone_id',
        "virtual_zone_name": 'virtual_zone_name',
        "vendor": 'vendor',
        "valid": 'valid',
        "subnet_id": 'subnet_id',
        "usb_devices_count": 'usb_devices_count',
        "timestamp": 'timestamp',
        "network": 'network',
        "active_queries_names": 'active_queries_names',
        "active_scans_names": 'active_scans_names',
        "children": 'children',
        "custom_attributes": 'custom_attributes',
        "custom_informations": 'custom_informations',
        "insight_names": 'insight_names',
        "code_sections": 'code_sections'
    }

    _optionals = [
        'resource_id',
        'id',
        'site_id',
        'approved',
        'asset_type_number',
        'asset_type_name',
        'class_type',
        'criticality_number',
        'criticality_name',
        'display_name',
        'first_seen',
        'last_seen',
        'last_updated',
        'ghost',
        'hostname',
        'installed_programs_count',
        'mac',
        'name',
        'network_id',
        'num_alerts',
        'patch_count',
        'parsed',
        'protocol',
        'purdue_level',
        'risk_level',
        'site_name',
        'special_hint',
        'special_hint_name',
        'vlan',
        'virtual_zone_id',
        'virtual_zone_name',
        'vendor',
        'valid',
        'subnet_id',
        'usb_devices_count',
        'timestamp',
        'network',
        'active_queries_names',
        'active_scans_names',
        'children',
        'custom_attributes',
        'custom_informations',
        'insight_names',
        'code_sections',
    ]

    def __init__(self,
                 resource_id=APIHelper.SKIP,
                 id=APIHelper.SKIP,
                 site_id=APIHelper.SKIP,
                 approved=APIHelper.SKIP,
                 asset_type_number=APIHelper.SKIP,
                 asset_type_name=APIHelper.SKIP,
                 class_type=APIHelper.SKIP,
                 criticality_number=APIHelper.SKIP,
                 criticality_name=APIHelper.SKIP,
                 display_name=APIHelper.SKIP,
                 first_seen=APIHelper.SKIP,
                 last_seen=APIHelper.SKIP,
                 last_updated=APIHelper.SKIP,
                 ghost=APIHelper.SKIP,
                 hostname=APIHelper.SKIP,
                 installed_programs_count=APIHelper.SKIP,
                 mac=APIHelper.SKIP,
                 name=APIHelper.SKIP,
                 network_id=APIHelper.SKIP,
                 num_alerts=APIHelper.SKIP,
                 patch_count=APIHelper.SKIP,
                 parsed=APIHelper.SKIP,
                 protocol=APIHelper.SKIP,
                 purdue_level=3,
                 risk_level=APIHelper.SKIP,
                 site_name=APIHelper.SKIP,
                 special_hint=APIHelper.SKIP,
                 special_hint_name=APIHelper.SKIP,
                 vlan=APIHelper.SKIP,
                 virtual_zone_id=APIHelper.SKIP,
                 virtual_zone_name=APIHelper.SKIP,
                 vendor=APIHelper.SKIP,
                 valid=APIHelper.SKIP,
                 subnet_id=APIHelper.SKIP,
                 usb_devices_count=APIHelper.SKIP,
                 timestamp=APIHelper.SKIP,
                 network=APIHelper.SKIP,
                 active_queries_names=APIHelper.SKIP,
                 active_scans_names=APIHelper.SKIP,
                 children=APIHelper.SKIP,
                 custom_attributes=APIHelper.SKIP,
                 custom_informations=APIHelper.SKIP,
                 insight_names=APIHelper.SKIP,
                 code_sections=APIHelper.SKIP):
        """Constructor for the Asset 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 approved is not APIHelper.SKIP:
            self.approved = approved 
        if asset_type_number is not APIHelper.SKIP:
            self.asset_type_number = asset_type_number 
        if asset_type_name is not APIHelper.SKIP:
            self.asset_type_name = asset_type_name 
        if class_type is not APIHelper.SKIP:
            self.class_type = class_type 
        if criticality_number is not APIHelper.SKIP:
            self.criticality_number = criticality_number 
        if criticality_name is not APIHelper.SKIP:
            self.criticality_name = criticality_name 
        if display_name is not APIHelper.SKIP:
            self.display_name = display_name 
        if first_seen is not APIHelper.SKIP:
            self.first_seen = first_seen 
        if last_seen is not APIHelper.SKIP:
            self.last_seen = last_seen 
        if last_updated is not APIHelper.SKIP:
            self.last_updated = last_updated 
        if ghost is not APIHelper.SKIP:
            self.ghost = ghost 
        if hostname is not APIHelper.SKIP:
            self.hostname = hostname 
        if installed_programs_count is not APIHelper.SKIP:
            self.installed_programs_count = installed_programs_count 
        if mac is not APIHelper.SKIP:
            self.mac = mac 
        if name is not APIHelper.SKIP:
            self.name = name 
        if network_id is not APIHelper.SKIP:
            self.network_id = network_id 
        if num_alerts is not APIHelper.SKIP:
            self.num_alerts = num_alerts 
        if patch_count is not APIHelper.SKIP:
            self.patch_count = patch_count 
        if parsed is not APIHelper.SKIP:
            self.parsed = parsed 
        if protocol is not APIHelper.SKIP:
            self.protocol = protocol 
        self.purdue_level = purdue_level 
        if risk_level is not APIHelper.SKIP:
            self.risk_level = risk_level 
        if site_name is not APIHelper.SKIP:
            self.site_name = site_name 
        if special_hint is not APIHelper.SKIP:
            self.special_hint = special_hint 
        if special_hint_name is not APIHelper.SKIP:
            self.special_hint_name = special_hint_name 
        if vlan is not APIHelper.SKIP:
            self.vlan = vlan 
        if virtual_zone_id is not APIHelper.SKIP:
            self.virtual_zone_id = virtual_zone_id 
        if virtual_zone_name is not APIHelper.SKIP:
            self.virtual_zone_name = virtual_zone_name 
        if vendor is not APIHelper.SKIP:
            self.vendor = vendor 
        if valid is not APIHelper.SKIP:
            self.valid = valid 
        if subnet_id is not APIHelper.SKIP:
            self.subnet_id = subnet_id 
        if usb_devices_count is not APIHelper.SKIP:
            self.usb_devices_count = usb_devices_count 
        if timestamp is not APIHelper.SKIP:
            self.timestamp = timestamp 
        if network is not APIHelper.SKIP:
            self.network = network 
        if active_queries_names is not APIHelper.SKIP:
            self.active_queries_names = active_queries_names 
        if active_scans_names is not APIHelper.SKIP:
            self.active_scans_names = active_scans_names 
        if children is not APIHelper.SKIP:
            self.children = children 
        if custom_attributes is not APIHelper.SKIP:
            self.custom_attributes = custom_attributes 
        if custom_informations is not APIHelper.SKIP:
            self.custom_informations = custom_informations 
        if insight_names is not APIHelper.SKIP:
            self.insight_names = insight_names 
        if code_sections is not APIHelper.SKIP:
            self.code_sections = code_sections 

    @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
        approved = dictionary.get("approved") if "approved" in dictionary.keys() else APIHelper.SKIP
        asset_type_number = dictionary.get("asset_type_number") if dictionary.get("asset_type_number") else APIHelper.SKIP
        asset_type_name = dictionary.get("asset_type_name") if dictionary.get("asset_type_name") else APIHelper.SKIP
        class_type = dictionary.get("class_type") if dictionary.get("class_type") else APIHelper.SKIP
        criticality_number = dictionary.get("criticality_number") if dictionary.get("criticality_number") else APIHelper.SKIP
        criticality_name = dictionary.get("criticality_name") if dictionary.get("criticality_name") else APIHelper.SKIP
        display_name = dictionary.get("display_name") if dictionary.get("display_name") else APIHelper.SKIP
        first_seen = dictionary.get("first_seen") if dictionary.get("first_seen") else APIHelper.SKIP
        last_seen = dictionary.get("last_seen") if dictionary.get("last_seen") else APIHelper.SKIP
        last_updated = dictionary.get("last_updated") if dictionary.get("last_updated") else APIHelper.SKIP
        ghost = dictionary.get("ghost") if "ghost" in dictionary.keys() else APIHelper.SKIP
        hostname = dictionary.get("hostname") if dictionary.get("hostname") else APIHelper.SKIP
        installed_programs_count = dictionary.get("installed_programs_count") if dictionary.get("installed_programs_count") else APIHelper.SKIP
        mac = dictionary.get("mac") if dictionary.get("mac") else APIHelper.SKIP
        name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP
        network_id = dictionary.get("network_id") if dictionary.get("network_id") else APIHelper.SKIP
        num_alerts = dictionary.get("num_alerts") if dictionary.get("num_alerts") else APIHelper.SKIP
        patch_count = dictionary.get("patch_count") if dictionary.get("patch_count") else APIHelper.SKIP
        parsed = dictionary.get("parsed") if "parsed" in dictionary.keys() else APIHelper.SKIP
        protocol = dictionary.get("protocol") if dictionary.get("protocol") else APIHelper.SKIP
        purdue_level = dictionary.get("purdue_level") if dictionary.get("purdue_level") else 3
        risk_level = dictionary.get("risk_level") if dictionary.get("risk_level") else APIHelper.SKIP
        site_name = dictionary.get("site_name") if dictionary.get("site_name") else APIHelper.SKIP
        special_hint = dictionary.get("special_hint_") if dictionary.get("special_hint_") else APIHelper.SKIP
        special_hint_name = dictionary.get("special_hint_name") if dictionary.get("special_hint_name") else APIHelper.SKIP
        vlan = dictionary.get("vlan") if dictionary.get("vlan") else APIHelper.SKIP
        virtual_zone_id = dictionary.get("virtual_zone_id") if dictionary.get("virtual_zone_id") else APIHelper.SKIP
        virtual_zone_name = dictionary.get("virtual_zone_name") if dictionary.get("virtual_zone_name") else APIHelper.SKIP
        vendor = dictionary.get("vendor") if dictionary.get("vendor") else APIHelper.SKIP
        valid = dictionary.get("valid") if "valid" in dictionary.keys() else APIHelper.SKIP
        subnet_id = dictionary.get("subnet_id") if dictionary.get("subnet_id") else APIHelper.SKIP
        usb_devices_count = dictionary.get("usb_devices_count") if dictionary.get("usb_devices_count") else APIHelper.SKIP
        timestamp = dictionary.get("timestamp") if dictionary.get("timestamp") else APIHelper.SKIP
        network = Network.from_dictionary(dictionary.get('network')) if 'network' in dictionary.keys() else APIHelper.SKIP
        active_queries_names = dictionary.get("active_queries_names") if dictionary.get("active_queries_names") else APIHelper.SKIP
        active_scans_names = dictionary.get("active_scans_names") if dictionary.get("active_scans_names") else APIHelper.SKIP
        children = None
        if dictionary.get('children') is not None:
            children = [Object.from_dictionary(x) for x in dictionary.get('children')]
        else:
            children = APIHelper.SKIP
        custom_attributes = None
        if dictionary.get('custom_attributes') is not None:
            custom_attributes = [Object.from_dictionary(x) for x in dictionary.get('custom_attributes')]
        else:
            custom_attributes = APIHelper.SKIP
        custom_informations = None
        if dictionary.get('custom_informations') is not None:
            custom_informations = [Object.from_dictionary(x) for x in dictionary.get('custom_informations')]
        else:
            custom_informations = APIHelper.SKIP
        insight_names = dictionary.get("insight_names") if dictionary.get("insight_names") else APIHelper.SKIP
        code_sections = None
        if dictionary.get('code_sections') is not None:
            code_sections = [CodeSections.from_dictionary(x) for x in dictionary.get('code_sections')]
        else:
            code_sections = APIHelper.SKIP
        # Return an object of this model
        return cls(resource_id,
                   id,
                   site_id,
                   approved,
                   asset_type_number,
                   asset_type_name,
                   class_type,
                   criticality_number,
                   criticality_name,
                   display_name,
                   first_seen,
                   last_seen,
                   last_updated,
                   ghost,
                   hostname,
                   installed_programs_count,
                   mac,
                   name,
                   network_id,
                   num_alerts,
                   patch_count,
                   parsed,
                   protocol,
                   purdue_level,
                   risk_level,
                   site_name,
                   special_hint,
                   special_hint_name,
                   vlan,
                   virtual_zone_id,
                   virtual_zone_name,
                   vendor,
                   valid,
                   subnet_id,
                   usb_devices_count,
                   timestamp,
                   network,
                   active_queries_names,
                   active_scans_names,
                   children,
                   custom_attributes,
                   custom_informations,
                   insight_names,
                   code_sections)
