/* 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 { Id } from './Id';
import {
    IdFromJSON,
    IdFromJSONTyped,
    IdToJSON,
    IdToJSONTyped,
} from './Id';

/**
 * 
 * @export
 * @interface JsonRpcRequest
 */
export interface JsonRpcRequest {
    /**
     * 
     * @type {string}
     * @memberof JsonRpcRequest
     */
    jsonrpc?: string;
    /**
     * 
     * @type {string}
     * @memberof JsonRpcRequest
     */
    method: string;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof JsonRpcRequest
     */
    params?: { [key: string]: any; };
    /**
     * 
     * @type {Id}
     * @memberof JsonRpcRequest
     */
    id?: Id | null;
}

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

export function JsonRpcRequestFromJSON(json: any): JsonRpcRequest {
    return JsonRpcRequestFromJSONTyped(json, false);
}

export function JsonRpcRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): JsonRpcRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'jsonrpc': json['jsonrpc'] == null ? undefined : json['jsonrpc'],
        'method': json['method'],
        'params': json['params'] == null ? undefined : json['params'],
        'id': json['id'] == null ? undefined : IdFromJSON(json['id']),
    };
}

export function JsonRpcRequestToJSON(json: any): JsonRpcRequest {
    return JsonRpcRequestToJSONTyped(json, false);
}

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

    return {
        
        'jsonrpc': value['jsonrpc'],
        'method': value['method'],
        'params': value['params'],
        'id': IdToJSON(value['id']),
    };
}

