/* tslint:disable */
/* eslint-disable */
/**
 * RMI Backend
 * Rug Munch Intelligence — institutional-grade crypto intelligence API. 13+ chains, 96 data providers, 8 MCP tools, x402 paid tier, sovereign-first FOSS.
 *
 * The version of the OpenAPI document: 2026.06.21
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from '../runtime';
import type { AppDomainTokenModelsRiskLevel } from './AppDomainTokenModelsRiskLevel';
import {
    AppDomainTokenModelsRiskLevelFromJSON,
    AppDomainTokenModelsRiskLevelFromJSONTyped,
    AppDomainTokenModelsRiskLevelToJSON,
    AppDomainTokenModelsRiskLevelToJSONTyped,
} from './AppDomainTokenModelsRiskLevel';

/**
 * A risk flag raised by a scan.
 * @export
 * @interface ScanFlag
 */
export interface ScanFlag {
    /**
     * 
     * @type {string}
     * @memberof ScanFlag
     */
    code: string;
    /**
     * 
     * @type {AppDomainTokenModelsRiskLevel}
     * @memberof ScanFlag
     */
    severity: AppDomainTokenModelsRiskLevel;
    /**
     * 
     * @type {string}
     * @memberof ScanFlag
     */
    message: string;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof ScanFlag
     */
    evidence?: { [key: string]: any; };
}



/**
 * Check if a given object implements the ScanFlag interface.
 */
export function instanceOfScanFlag(value: object): value is ScanFlag {
    if (!('code' in value) || value['code'] === undefined) return false;
    if (!('severity' in value) || value['severity'] === undefined) return false;
    if (!('message' in value) || value['message'] === undefined) return false;
    return true;
}

export function ScanFlagFromJSON(json: any): ScanFlag {
    return ScanFlagFromJSONTyped(json, false);
}

export function ScanFlagFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScanFlag {
    if (json == null) {
        return json;
    }
    return {
        
        'code': json['code'],
        'severity': AppDomainTokenModelsRiskLevelFromJSON(json['severity']),
        'message': json['message'],
        'evidence': json['evidence'] == null ? undefined : json['evidence'],
    };
}

export function ScanFlagToJSON(json: any): ScanFlag {
    return ScanFlagToJSONTyped(json, false);
}

export function ScanFlagToJSONTyped(value?: ScanFlag | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'code': value['code'],
        'severity': AppDomainTokenModelsRiskLevelToJSON(value['severity']),
        'message': value['message'],
        'evidence': value['evidence'],
    };
}

