/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { SDKCore } from "../core.js"; import { llmSpeechListTranscriptionHistory } from "../funcs/llmSpeechListTranscriptionHistory.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export type LlmSpeechListTranscriptionHistoryQueryData = components.SpeechToTextHistoryList; export function prefetchLlmSpeechListTranscriptionHistory( queryClient: QueryClient, client$: SDKCore, request: operations.ListSpeechToTextHistoryRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildLlmSpeechListTranscriptionHistoryQuery( client$, request, options, ), }); } export function buildLlmSpeechListTranscriptionHistoryQuery( client$: SDKCore, request: operations.ListSpeechToTextHistoryRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise; } { return { queryKey: queryKeyLlmSpeechListTranscriptionHistory({ after: request.after, limit: request.limit, order: request.order, model: request.model, xOnBehalfOf: request.xOnBehalfOf, }), queryFn: async function llmSpeechListTranscriptionHistoryQueryFn( ctx, ): Promise { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync(llmSpeechListTranscriptionHistory( client$, request, mergedOptions, )); }, }; } export function queryKeyLlmSpeechListTranscriptionHistory( parameters: { after?: string | undefined; limit?: number | undefined; order?: operations.ListSpeechToTextHistoryQueryParamOrder | undefined; model?: string | undefined; xOnBehalfOf?: string | undefined; }, ): QueryKey { return ["@meetkai/mka1", "speech", "listTranscriptionHistory", parameters]; }