/* 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 { AlertmanagerAlert } from './AlertmanagerAlert';
import {
    AlertmanagerAlertFromJSON,
    AlertmanagerAlertFromJSONTyped,
    AlertmanagerAlertToJSON,
    AlertmanagerAlertToJSONTyped,
} from './AlertmanagerAlert';

/**
 * 
 * @export
 * @interface AlertmanagerPayload
 */
export interface AlertmanagerPayload {
    /**
     * 
     * @type {string}
     * @memberof AlertmanagerPayload
     */
    version?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AlertmanagerPayload
     */
    groupKey?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AlertmanagerPayload
     */
    status: string;
    /**
     * 
     * @type {string}
     * @memberof AlertmanagerPayload
     */
    receiver?: string | null;
    /**
     * 
     * @type {{ [key: string]: string; }}
     * @memberof AlertmanagerPayload
     */
    groupLabels?: { [key: string]: string; };
    /**
     * 
     * @type {{ [key: string]: string; }}
     * @memberof AlertmanagerPayload
     */
    commonLabels?: { [key: string]: string; };
    /**
     * 
     * @type {{ [key: string]: string; }}
     * @memberof AlertmanagerPayload
     */
    commonAnnotations?: { [key: string]: string; };
    /**
     * 
     * @type {string}
     * @memberof AlertmanagerPayload
     */
    externalURL?: string | null;
    /**
     * 
     * @type {Array<AlertmanagerAlert>}
     * @memberof AlertmanagerPayload
     */
    alerts?: Array<AlertmanagerAlert>;
}

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

export function AlertmanagerPayloadFromJSON(json: any): AlertmanagerPayload {
    return AlertmanagerPayloadFromJSONTyped(json, false);
}

export function AlertmanagerPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlertmanagerPayload {
    if (json == null) {
        return json;
    }
    return {
        
        'version': json['version'] == null ? undefined : json['version'],
        'groupKey': json['groupKey'] == null ? undefined : json['groupKey'],
        'status': json['status'],
        'receiver': json['receiver'] == null ? undefined : json['receiver'],
        'groupLabels': json['groupLabels'] == null ? undefined : json['groupLabels'],
        'commonLabels': json['commonLabels'] == null ? undefined : json['commonLabels'],
        'commonAnnotations': json['commonAnnotations'] == null ? undefined : json['commonAnnotations'],
        'externalURL': json['externalURL'] == null ? undefined : json['externalURL'],
        'alerts': json['alerts'] == null ? undefined : ((json['alerts'] as Array<any>).map(AlertmanagerAlertFromJSON)),
    };
}

export function AlertmanagerPayloadToJSON(json: any): AlertmanagerPayload {
    return AlertmanagerPayloadToJSONTyped(json, false);
}

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

    return {
        
        'version': value['version'],
        'groupKey': value['groupKey'],
        'status': value['status'],
        'receiver': value['receiver'],
        'groupLabels': value['groupLabels'],
        'commonLabels': value['commonLabels'],
        'commonAnnotations': value['commonAnnotations'],
        'externalURL': value['externalURL'],
        'alerts': value['alerts'] == null ? undefined : ((value['alerts'] as Array<any>).map(AlertmanagerAlertToJSON)),
    };
}

