/* 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 { AlertType } from './AlertType';
import {
    AlertTypeFromJSON,
    AlertTypeFromJSONTyped,
    AlertTypeToJSON,
    AlertTypeToJSONTyped,
} from './AlertType';

/**
 * What the API accepts to create a subscription.
 * @export
 * @interface CreateAlertRequest
 */
export interface CreateAlertRequest {
    /**
     * 
     * @type {string}
     * @memberof CreateAlertRequest
     */
    tokenAddress: string;
    /**
     * 
     * @type {Array<AlertType>}
     * @memberof CreateAlertRequest
     */
    alertTypes?: Array<AlertType> | null;
    /**
     * 
     * @type {string}
     * @memberof CreateAlertRequest
     */
    webhookUrl?: string | null;
}

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

export function CreateAlertRequestFromJSON(json: any): CreateAlertRequest {
    return CreateAlertRequestFromJSONTyped(json, false);
}

export function CreateAlertRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAlertRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'tokenAddress': json['token_address'],
        'alertTypes': json['alert_types'] == null ? undefined : ((json['alert_types'] as Array<any>).map(AlertTypeFromJSON)),
        'webhookUrl': json['webhook_url'] == null ? undefined : json['webhook_url'],
    };
}

export function CreateAlertRequestToJSON(json: any): CreateAlertRequest {
    return CreateAlertRequestToJSONTyped(json, false);
}

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

    return {
        
        'token_address': value['tokenAddress'],
        'alert_types': value['alertTypes'] == null ? undefined : ((value['alertTypes'] as Array<any>).map(AlertTypeToJSON)),
        'webhook_url': value['webhookUrl'],
    };
}

