/* 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 { ScanModuleResult } from './ScanModuleResult';
import {
    ScanModuleResultFromJSON,
    ScanModuleResultFromJSONTyped,
    ScanModuleResultToJSON,
    ScanModuleResultToJSONTyped,
} from './ScanModuleResult';

/**
 * Pydantic wrapper around the legacy ScanResult.
 * 
 * The legacy result is rich and complex (free/pro/elite per-tier data
 * blocks, modules_run, confidence, etc.). We expose the most useful
 * fields at the top level for API consumers.
 * @export
 * @interface ScanResponse
 */
export interface ScanResponse {
    /**
     * 
     * @type {string}
     * @memberof ScanResponse
     */
    address: string;
    /**
     * 
     * @type {string}
     * @memberof ScanResponse
     */
    chain: string;
    /**
     * 
     * @type {string}
     * @memberof ScanResponse
     */
    symbol?: string;
    /**
     * 
     * @type {string}
     * @memberof ScanResponse
     */
    name?: string;
    /**
     * 
     * @type {number}
     * @memberof ScanResponse
     */
    safetyScore?: number;
    /**
     * 
     * @type {Array<string>}
     * @memberof ScanResponse
     */
    riskFlags?: Array<string>;
    /**
     * 
     * @type {string}
     * @memberof ScanResponse
     */
    tierRequired?: string;
    /**
     * 
     * @type {number}
     * @memberof ScanResponse
     */
    confidence?: number;
    /**
     * 
     * @type {Array<ScanModuleResult>}
     * @memberof ScanResponse
     */
    modulesRun?: Array<ScanModuleResult>;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof ScanResponse
     */
    free?: { [key: string]: any; };
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof ScanResponse
     */
    pro?: { [key: string]: any; };
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof ScanResponse
     */
    elite?: { [key: string]: any; };
    /**
     * 
     * @type {string}
     * @memberof ScanResponse
     */
    scannedAt?: string;
}

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

export function ScanResponseFromJSON(json: any): ScanResponse {
    return ScanResponseFromJSONTyped(json, false);
}

export function ScanResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScanResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'address': json['address'],
        'chain': json['chain'],
        'symbol': json['symbol'] == null ? undefined : json['symbol'],
        'name': json['name'] == null ? undefined : json['name'],
        'safetyScore': json['safety_score'] == null ? undefined : json['safety_score'],
        'riskFlags': json['risk_flags'] == null ? undefined : json['risk_flags'],
        'tierRequired': json['tier_required'] == null ? undefined : json['tier_required'],
        'confidence': json['confidence'] == null ? undefined : json['confidence'],
        'modulesRun': json['modules_run'] == null ? undefined : ((json['modules_run'] as Array<any>).map(ScanModuleResultFromJSON)),
        'free': json['free'] == null ? undefined : json['free'],
        'pro': json['pro'] == null ? undefined : json['pro'],
        'elite': json['elite'] == null ? undefined : json['elite'],
        'scannedAt': json['scanned_at'] == null ? undefined : json['scanned_at'],
    };
}

export function ScanResponseToJSON(json: any): ScanResponse {
    return ScanResponseToJSONTyped(json, false);
}

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

    return {
        
        'address': value['address'],
        'chain': value['chain'],
        'symbol': value['symbol'],
        'name': value['name'],
        'safety_score': value['safetyScore'],
        'risk_flags': value['riskFlags'],
        'tier_required': value['tierRequired'],
        'confidence': value['confidence'],
        'modules_run': value['modulesRun'] == null ? undefined : ((value['modulesRun'] as Array<any>).map(ScanModuleResultToJSON)),
        'free': value['free'],
        'pro': value['pro'],
        'elite': value['elite'],
        'scanned_at': value['scannedAt'],
    };
}

