/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { GustoEmbeddedCore } from "../core.js"; import { peopleBatchesGetV1PeopleBatchesPeopleBatchUuid } from "../funcs/peopleBatchesGetV1PeopleBatchesPeopleBatchUuid.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import { GetV1PeopleBatchesPeopleBatchUuidHeaderXGustoAPIVersion, GetV1PeopleBatchesPeopleBatchUuidRequest, GetV1PeopleBatchesPeopleBatchUuidResponse, } from "../models/operations/getv1peoplebatchespeoplebatchuuid.js"; import { unwrapAsync } from "../types/fp.js"; export type PeopleBatchesGetV1PeopleBatchesPeopleBatchUuidQueryData = GetV1PeopleBatchesPeopleBatchUuidResponse; export function prefetchPeopleBatchesGetV1PeopleBatchesPeopleBatchUuid( queryClient: QueryClient, client$: GustoEmbeddedCore, request: GetV1PeopleBatchesPeopleBatchUuidRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildPeopleBatchesGetV1PeopleBatchesPeopleBatchUuidQuery( client$, request, options, ), }); } export function buildPeopleBatchesGetV1PeopleBatchesPeopleBatchUuidQuery( client$: GustoEmbeddedCore, request: GetV1PeopleBatchesPeopleBatchUuidRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise; } { return { queryKey: queryKeyPeopleBatchesGetV1PeopleBatchesPeopleBatchUuid( request.peopleBatchUuid, { xGustoAPIVersion: request.xGustoAPIVersion }, ), queryFn: async function peopleBatchesGetV1PeopleBatchesPeopleBatchUuidQueryFn( ctx, ): Promise { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync(peopleBatchesGetV1PeopleBatchesPeopleBatchUuid( client$, request, mergedOptions, )); }, }; } export function queryKeyPeopleBatchesGetV1PeopleBatchesPeopleBatchUuid( peopleBatchUuid: string, parameters: { xGustoAPIVersion?: | GetV1PeopleBatchesPeopleBatchUuidHeaderXGustoAPIVersion | undefined; }, ): QueryKey { return [ "@gusto/embedded-api", "People Batches", "getV1PeopleBatchesPeopleBatchUuid", peopleBatchUuid, parameters, ]; }