/* 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 { Session } from './Session';
import {
    SessionFromJSON,
    SessionFromJSONTyped,
    SessionToJSON,
    SessionToJSONTyped,
} from './Session';

/**
 *
 * @export
 * @interface SessionsResponse
 */
export interface SessionsResponse {
    /**
     *
     * @type {Array<Session>}
     * @memberof SessionsResponse
     */
    data: Array<Session>;
}

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

export function SessionsResponseFromJSON(json: any): SessionsResponse {
    return SessionsResponseFromJSONTyped(json, false);
}

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

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

export function SessionsResponseToJSON(json: any): SessionsResponse {
    return SessionsResponseToJSONTyped(json, false);
}

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

    return {

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