/* tslint:disable */
/* eslint-disable */
/**
 * HumanLayer Daemon REST API
 * REST API for HumanLayer daemon operations, providing session management, approval workflows, and real-time event streaming capabilities.
 *
 * The version of the OpenAPI document: 1.0.0
 *
 *
 * 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 { Approval } from './Approval';
import {
    ApprovalFromJSON,
    ApprovalFromJSONTyped,
    ApprovalToJSON,
    ApprovalToJSONTyped,
} from './Approval';

/**
 *
 * @export
 * @interface ApprovalsResponse
 */
export interface ApprovalsResponse {
    /**
     *
     * @type {Array<Approval>}
     * @memberof ApprovalsResponse
     */
    data: Array<Approval>;
}

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

export function ApprovalsResponseFromJSON(json: any): ApprovalsResponse {
    return ApprovalsResponseFromJSONTyped(json, false);
}

export function ApprovalsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApprovalsResponse {
    if (json == null) {
        return json;
    }
    return {

        'data': ((json['data'] as Array<any>).map(ApprovalFromJSON)),
    };
}

export function ApprovalsResponseToJSON(json: any): ApprovalsResponse {
    return ApprovalsResponseToJSONTyped(json, false);
}

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

    return {

        'data': ((value['data'] as Array<any>).map(ApprovalToJSON)),
    };
}
