/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { GustoEmbeddedCore } from "../core.js"; import { timeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuid } from "../funcs/timeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuid.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import { GetV1TimeOffRequestsTimeOffRequestUuidHeaderXGustoAPIVersion, GetV1TimeOffRequestsTimeOffRequestUuidRequest, GetV1TimeOffRequestsTimeOffRequestUuidResponse, } from "../models/operations/getv1timeoffrequeststimeoffrequestuuid.js"; import { unwrapAsync } from "../types/fp.js"; export type TimeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuidQueryData = GetV1TimeOffRequestsTimeOffRequestUuidResponse; export function prefetchTimeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuid( queryClient: QueryClient, client$: GustoEmbeddedCore, request: GetV1TimeOffRequestsTimeOffRequestUuidRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildTimeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuidQuery( client$, request, options, ), }); } export function buildTimeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuidQuery( client$: GustoEmbeddedCore, request: GetV1TimeOffRequestsTimeOffRequestUuidRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise; } { return { queryKey: queryKeyTimeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuid( request.timeOffRequestUuid, { xGustoAPIVersion: request.xGustoAPIVersion }, ), queryFn: async function timeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuidQueryFn( ctx, ): Promise< TimeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuidQueryData > { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync( timeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuid( client$, request, mergedOptions, ), ); }, }; } export function queryKeyTimeOffRequestsGetV1TimeOffRequestsTimeOffRequestUuid( timeOffRequestUuid: string, parameters: { xGustoAPIVersion?: | GetV1TimeOffRequestsTimeOffRequestUuidHeaderXGustoAPIVersion | undefined; }, ): QueryKey { return [ "@gusto/embedded-api", "Time Off Requests", "getV1TimeOffRequestsTimeOffRequestUuid", timeOffRequestUuid, parameters, ]; }