/* 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 ModelMalware
 */
export interface ModelMalware {
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    author?: string;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    _class: string;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    complete_filename: string;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    date?: string;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    description?: string;
    /**
     * 
     * @type {number}
     * @memberof ModelMalware
     */
    file_sev_score: number;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    file_severity: ModelMalwareFileSeverityEnum;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    filetype?: string;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    image_layer_id: string;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    info?: string;
    /**
     * 
     * @type {boolean}
     * @memberof ModelMalware
     */
    masked: boolean;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    node_id: string;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    reference?: string;
    /**
     * 
     * @type {Array<ModelBasicNode>}
     * @memberof ModelMalware
     */
    resources?: Array<ModelBasicNode> | null;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    rule_id: string;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    rule_name: string;
    /**
     * 
     * @type {number}
     * @memberof ModelMalware
     */
    severity_score?: number;
    /**
     * 
     * @type {Array<any>}
     * @memberof ModelMalware
     */
    strings_to_match?: Array<any> | null;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    summary?: string;
    /**
     * 
     * @type {string}
     * @memberof ModelMalware
     */
    version?: string;
}


/**
 * @export
 */
export const ModelMalwareFileSeverityEnum = {
    Critical: 'critical',
    High: 'high',
    Medium: 'medium',
    Low: 'low',
    Unknown: 'unknown'
} as const;
export type ModelMalwareFileSeverityEnum = typeof ModelMalwareFileSeverityEnum[keyof typeof ModelMalwareFileSeverityEnum];


/**
 * Check if a given object implements the ModelMalware interface.
 */
export function instanceOfModelMalware(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "_class" in value;
    isInstance = isInstance && "complete_filename" in value;
    isInstance = isInstance && "file_sev_score" in value;
    isInstance = isInstance && "file_severity" in value;
    isInstance = isInstance && "image_layer_id" in value;
    isInstance = isInstance && "masked" in value;
    isInstance = isInstance && "node_id" in value;
    isInstance = isInstance && "rule_id" in value;
    isInstance = isInstance && "rule_name" in value;

    return isInstance;
}

export function ModelMalwareFromJSON(json: any): ModelMalware {
    return ModelMalwareFromJSONTyped(json, false);
}

export function ModelMalwareFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelMalware {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'author': !exists(json, 'author') ? undefined : json['author'],
        '_class': json['class'],
        'complete_filename': json['complete_filename'],
        'date': !exists(json, 'date') ? undefined : json['date'],
        'description': !exists(json, 'description') ? undefined : json['description'],
        'file_sev_score': json['file_sev_score'],
        'file_severity': json['file_severity'],
        'filetype': !exists(json, 'filetype') ? undefined : json['filetype'],
        'image_layer_id': json['image_layer_id'],
        'info': !exists(json, 'info') ? undefined : json['info'],
        'masked': json['masked'],
        'node_id': json['node_id'],
        'reference': !exists(json, 'reference') ? undefined : json['reference'],
        'resources': !exists(json, 'resources') ? undefined : (json['resources'] === null ? null : (json['resources'] as Array<any>).map(ModelBasicNodeFromJSON)),
        'rule_id': json['rule_id'],
        'rule_name': json['rule_name'],
        'severity_score': !exists(json, 'severity_score') ? undefined : json['severity_score'],
        'strings_to_match': !exists(json, 'strings_to_match') ? undefined : json['strings_to_match'],
        'summary': !exists(json, 'summary') ? undefined : json['summary'],
        'version': !exists(json, 'version') ? undefined : json['version'],
    };
}

export function ModelMalwareToJSON(value?: ModelMalware | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'author': value.author,
        'class': value._class,
        'complete_filename': value.complete_filename,
        'date': value.date,
        'description': value.description,
        'file_sev_score': value.file_sev_score,
        'file_severity': value.file_severity,
        'filetype': value.filetype,
        'image_layer_id': value.image_layer_id,
        'info': value.info,
        'masked': value.masked,
        'node_id': value.node_id,
        'reference': value.reference,
        'resources': value.resources === undefined ? undefined : (value.resources === null ? null : (value.resources as Array<any>).map(ModelBasicNodeToJSON)),
        'rule_id': value.rule_id,
        'rule_name': value.rule_name,
        'severity_score': value.severity_score,
        'strings_to_match': value.strings_to_match,
        'summary': value.summary,
        'version': value.version,
    };
}

