/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { GustoEmbeddedCore } from "../core.js"; import { salaryEstimatesGetV1SalaryEstimatesId } from "../funcs/salaryEstimatesGetV1SalaryEstimatesId.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import { GetV1SalaryEstimatesIdHeaderXGustoAPIVersion, GetV1SalaryEstimatesIdRequest, GetV1SalaryEstimatesIdResponse, } from "../models/operations/getv1salaryestimatesid.js"; import { unwrapAsync } from "../types/fp.js"; export type SalaryEstimatesGetV1SalaryEstimatesIdQueryData = GetV1SalaryEstimatesIdResponse; export function prefetchSalaryEstimatesGetV1SalaryEstimatesId( queryClient: QueryClient, client$: GustoEmbeddedCore, request: GetV1SalaryEstimatesIdRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildSalaryEstimatesGetV1SalaryEstimatesIdQuery( client$, request, options, ), }); } export function buildSalaryEstimatesGetV1SalaryEstimatesIdQuery( client$: GustoEmbeddedCore, request: GetV1SalaryEstimatesIdRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise; } { return { queryKey: queryKeySalaryEstimatesGetV1SalaryEstimatesId(request.uuid, { xGustoAPIVersion: request.xGustoAPIVersion, }), queryFn: async function salaryEstimatesGetV1SalaryEstimatesIdQueryFn( ctx, ): Promise { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync(salaryEstimatesGetV1SalaryEstimatesId( client$, request, mergedOptions, )); }, }; } export function queryKeySalaryEstimatesGetV1SalaryEstimatesId( uuid: string, parameters: { xGustoAPIVersion?: GetV1SalaryEstimatesIdHeaderXGustoAPIVersion | undefined; }, ): QueryKey { return [ "@gusto/embedded-api", "Salary Estimates", "getV1SalaryEstimatesId", uuid, parameters, ]; }