/* tslint:disable */
/* eslint-disable */
/**
 * Deepfence ThreatMapper
 * Deepfence Runtime API provides programmatic control over Deepfence microservice securing your container, kubernetes and cloud deployments. The API abstracts away underlying infrastructure details like cloud provider,  container distros, container orchestrator and type of deployment. This is one uniform API to manage and control security alerts, policies and response to alerts for microservices running anywhere i.e. managed pure greenfield container deployments or a mix of containers, VMs and serverless paradigms like AWS Fargate.
 *
 * The version of the OpenAPI document: v2.5.0
 * Contact: community@deepfence.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { exists, mapValues } from '../runtime';
import type { ModelBasicNode } from './ModelBasicNode';
import {
    ModelBasicNodeFromJSON,
    ModelBasicNodeFromJSONTyped,
    ModelBasicNodeToJSON,
} from './ModelBasicNode';

/**
 * 
 * @export
 * @interface ModelVulnerabilityRule
 */
export interface ModelVulnerabilityRule {
    /**
     * 
     * @type {boolean}
     * @memberof ModelVulnerabilityRule
     */
    cisa_kev: boolean;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    cve_attack_vectors: Array<string> | null;
    /**
     * 
     * @type {Array<any>}
     * @memberof ModelVulnerabilityRule
     */
    cve_cvss_scores: Array<any> | null;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    cve_descriptions: Array<string> | null;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    cve_fixed_ins: Array<string> | null;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerabilityRule
     */
    cve_id: string;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    cve_links: Array<string> | null;
    /**
     * 
     * @type {Array<any>}
     * @memberof ModelVulnerabilityRule
     */
    cve_overall_scores: Array<any> | null;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    cve_severities: Array<string> | null;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    cve_types: Array<string> | null;
    /**
     * 
     * @type {number}
     * @memberof ModelVulnerabilityRule
     */
    epss_score: number;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    exploit_pocs: Array<string> | null;
    /**
     * 
     * @type {boolean}
     * @memberof ModelVulnerabilityRule
     */
    masked: boolean;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    namespaces: Array<string> | null;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerabilityRule
     */
    node_id: string;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    package_names: Array<string> | null;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    parsed_attack_vectors: Array<string> | null;
    /**
     * 
     * @type {Array<ModelBasicNode>}
     * @memberof ModelVulnerabilityRule
     */
    resources?: Array<ModelBasicNode> | null;
    /**
     * 
     * @type {number}
     * @memberof ModelVulnerabilityRule
     */
    updated_at: number;
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelVulnerabilityRule
     */
    urls: Array<string> | null;
}

/**
 * Check if a given object implements the ModelVulnerabilityRule interface.
 */
export function instanceOfModelVulnerabilityRule(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "cisa_kev" in value;
    isInstance = isInstance && "cve_attack_vectors" in value;
    isInstance = isInstance && "cve_cvss_scores" in value;
    isInstance = isInstance && "cve_descriptions" in value;
    isInstance = isInstance && "cve_fixed_ins" in value;
    isInstance = isInstance && "cve_id" in value;
    isInstance = isInstance && "cve_links" in value;
    isInstance = isInstance && "cve_overall_scores" in value;
    isInstance = isInstance && "cve_severities" in value;
    isInstance = isInstance && "cve_types" in value;
    isInstance = isInstance && "epss_score" in value;
    isInstance = isInstance && "exploit_pocs" in value;
    isInstance = isInstance && "masked" in value;
    isInstance = isInstance && "namespaces" in value;
    isInstance = isInstance && "node_id" in value;
    isInstance = isInstance && "package_names" in value;
    isInstance = isInstance && "parsed_attack_vectors" in value;
    isInstance = isInstance && "updated_at" in value;
    isInstance = isInstance && "urls" in value;

    return isInstance;
}

export function ModelVulnerabilityRuleFromJSON(json: any): ModelVulnerabilityRule {
    return ModelVulnerabilityRuleFromJSONTyped(json, false);
}

export function ModelVulnerabilityRuleFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelVulnerabilityRule {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'cisa_kev': json['cisa_kev'],
        'cve_attack_vectors': json['cve_attack_vectors'],
        'cve_cvss_scores': json['cve_cvss_scores'],
        'cve_descriptions': json['cve_descriptions'],
        'cve_fixed_ins': json['cve_fixed_ins'],
        'cve_id': json['cve_id'],
        'cve_links': json['cve_links'],
        'cve_overall_scores': json['cve_overall_scores'],
        'cve_severities': json['cve_severities'],
        'cve_types': json['cve_types'],
        'epss_score': json['epss_score'],
        'exploit_pocs': json['exploit_pocs'],
        'masked': json['masked'],
        'namespaces': json['namespaces'],
        'node_id': json['node_id'],
        'package_names': json['package_names'],
        'parsed_attack_vectors': json['parsed_attack_vectors'],
        'resources': !exists(json, 'resources') ? undefined : (json['resources'] === null ? null : (json['resources'] as Array<any>).map(ModelBasicNodeFromJSON)),
        'updated_at': json['updated_at'],
        'urls': json['urls'],
    };
}

export function ModelVulnerabilityRuleToJSON(value?: ModelVulnerabilityRule | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'cisa_kev': value.cisa_kev,
        'cve_attack_vectors': value.cve_attack_vectors,
        'cve_cvss_scores': value.cve_cvss_scores,
        'cve_descriptions': value.cve_descriptions,
        'cve_fixed_ins': value.cve_fixed_ins,
        'cve_id': value.cve_id,
        'cve_links': value.cve_links,
        'cve_overall_scores': value.cve_overall_scores,
        'cve_severities': value.cve_severities,
        'cve_types': value.cve_types,
        'epss_score': value.epss_score,
        'exploit_pocs': value.exploit_pocs,
        'masked': value.masked,
        'namespaces': value.namespaces,
        'node_id': value.node_id,
        'package_names': value.package_names,
        'parsed_attack_vectors': value.parsed_attack_vectors,
        'resources': value.resources === undefined ? undefined : (value.resources === null ? null : (value.resources as Array<any>).map(ModelBasicNodeToJSON)),
        'updated_at': value.updated_at,
        'urls': value.urls,
    };
}

