/* 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 { ScanFlag } from './ScanFlag';
import {
    ScanFlagFromJSON,
    ScanFlagFromJSONTyped,
    ScanFlagToJSON,
    ScanFlagToJSONTyped,
} from './ScanFlag';
import type { AppDomainTokenModelsRiskLevel } from './AppDomainTokenModelsRiskLevel';
import {
    AppDomainTokenModelsRiskLevelFromJSON,
    AppDomainTokenModelsRiskLevelFromJSONTyped,
    AppDomainTokenModelsRiskLevelToJSON,
    AppDomainTokenModelsRiskLevelToJSONTyped,
} from './AppDomainTokenModelsRiskLevel';

/**
 * Threat scan result.
 * @export
 * @interface ScanResult
 */
export interface ScanResult {
    /**
     * 
     * @type {string}
     * @memberof ScanResult
     */
    address: string;
    /**
     * 
     * @type {string}
     * @memberof ScanResult
     */
    chain: string;
    /**
     * 
     * @type {number}
     * @memberof ScanResult
     */
    riskScore?: number;
    /**
     * 
     * @type {AppDomainTokenModelsRiskLevel}
     * @memberof ScanResult
     */
    riskLevel: AppDomainTokenModelsRiskLevel;
    /**
     * 
     * @type {Array<ScanFlag>}
     * @memberof ScanResult
     */
    flags?: Array<ScanFlag>;
    /**
     * 
     * @type {Array<string>}
     * @memberof ScanResult
     */
    modulesRun?: Array<string>;
    /**
     * 
     * @type {Date}
     * @memberof ScanResult
     */
    scannedAt?: Date;
}



/**
 * Check if a given object implements the ScanResult interface.
 */
export function instanceOfScanResult(value: object): value is ScanResult {
    if (!('address' in value) || value['address'] === undefined) return false;
    if (!('chain' in value) || value['chain'] === undefined) return false;
    if ((!('riskLevel' in value) && !('risk_level' in value)) || (value['riskLevel'] === undefined && value['risk_level'] === undefined)) return false;
    return true;
}

export function ScanResultFromJSON(json: any): ScanResult {
    return ScanResultFromJSONTyped(json, false);
}

export function ScanResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScanResult {
    if (json == null) {
        return json;
    }
    return {
        
        'address': json['address'],
        'chain': json['chain'],
        'riskScore': json['risk_score'] == null ? undefined : json['risk_score'],
        'riskLevel': AppDomainTokenModelsRiskLevelFromJSON(json['risk_level']),
        'flags': json['flags'] == null ? undefined : ((json['flags'] as Array<any>).map(ScanFlagFromJSON)),
        'modulesRun': json['modules_run'] == null ? undefined : json['modules_run'],
        'scannedAt': json['scanned_at'] == null ? undefined : (new Date(json['scanned_at'])),
    };
}

export function ScanResultToJSON(json: any): ScanResult {
    return ScanResultToJSONTyped(json, false);
}

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

    return {
        
        'address': value['address'],
        'chain': value['chain'],
        'risk_score': value['riskScore'],
        'risk_level': AppDomainTokenModelsRiskLevelToJSON(value['riskLevel']),
        'flags': value['flags'] == null ? undefined : ((value['flags'] as Array<any>).map(ScanFlagToJSON)),
        'modules_run': value['modulesRun'],
        'scanned_at': value['scannedAt'] == null ? value['scannedAt'] : value['scannedAt'].toISOString(),
    };
}

