/* 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';

/**
 * Full token scan result.
 * @export
 * @interface TokenScanResult
 */
export interface TokenScanResult {
    /**
     * 
     * @type {string}
     * @memberof TokenScanResult
     */
    address: string;
    /**
     * 
     * @type {string}
     * @memberof TokenScanResult
     */
    chain: string;
    /**
     * 
     * @type {number}
     * @memberof TokenScanResult
     */
    safetyScore?: number;
    /**
     * 
     * @type {number}
     * @memberof TokenScanResult
     */
    riskScore?: number;
    /**
     * 
     * @type {AppDomainTokenModelsRiskLevel}
     * @memberof TokenScanResult
     */
    riskLevel: AppDomainTokenModelsRiskLevel;
    /**
     * 
     * @type {Array<string>}
     * @memberof TokenScanResult
     */
    riskFlags?: Array<string>;
    /**
     * 
     * @type {Array<string>}
     * @memberof TokenScanResult
     */
    warnings?: Array<string>;
    /**
     * 
     * @type {Array<string>}
     * @memberof TokenScanResult
     */
    modulesRun?: Array<string>;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof TokenScanResult
     */
    metadata?: { [key: string]: any; };
    /**
     * 
     * @type {Date}
     * @memberof TokenScanResult
     */
    scannedAt?: Date;
}



/**
 * Check if a given object implements the TokenScanResult interface.
 */
export function instanceOfTokenScanResult(value: object): value is TokenScanResult {
    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 TokenScanResultFromJSON(json: any): TokenScanResult {
    return TokenScanResultFromJSONTyped(json, false);
}

export function TokenScanResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenScanResult {
    if (json == null) {
        return json;
    }
    return {
        
        'address': json['address'],
        'chain': json['chain'],
        'safetyScore': json['safety_score'] == null ? undefined : json['safety_score'],
        'riskScore': json['risk_score'] == null ? undefined : json['risk_score'],
        'riskLevel': AppDomainTokenModelsRiskLevelFromJSON(json['risk_level']),
        'riskFlags': json['risk_flags'] == null ? undefined : json['risk_flags'],
        'warnings': json['warnings'] == null ? undefined : json['warnings'],
        'modulesRun': json['modules_run'] == null ? undefined : json['modules_run'],
        'metadata': json['metadata'] == null ? undefined : json['metadata'],
        'scannedAt': json['scanned_at'] == null ? undefined : (new Date(json['scanned_at'])),
    };
}

export function TokenScanResultToJSON(json: any): TokenScanResult {
    return TokenScanResultToJSONTyped(json, false);
}

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

    return {
        
        'address': value['address'],
        'chain': value['chain'],
        'safety_score': value['safetyScore'],
        'risk_score': value['riskScore'],
        'risk_level': AppDomainTokenModelsRiskLevelToJSON(value['riskLevel']),
        'risk_flags': value['riskFlags'],
        'warnings': value['warnings'],
        'modules_run': value['modulesRun'],
        'metadata': value['metadata'],
        'scanned_at': value['scannedAt'] == null ? value['scannedAt'] : value['scannedAt'].toISOString(),
    };
}

