/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { GustoEmbeddedCore } from "../core.js"; import { salaryEstimatesGetV1SalaryEstimatesOccupations } from "../funcs/salaryEstimatesGetV1SalaryEstimatesOccupations.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import { GetV1SalaryEstimatesOccupationsHeaderXGustoAPIVersion, GetV1SalaryEstimatesOccupationsRequest, GetV1SalaryEstimatesOccupationsResponse, GetV1SalaryEstimatesOccupationsSecurity, } from "../models/operations/getv1salaryestimatesoccupations.js"; import { unwrapAsync } from "../types/fp.js"; export type SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData = GetV1SalaryEstimatesOccupationsResponse; export function prefetchSalaryEstimatesGetV1SalaryEstimatesOccupations( queryClient: QueryClient, client$: GustoEmbeddedCore, security: GetV1SalaryEstimatesOccupationsSecurity, request: GetV1SalaryEstimatesOccupationsRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildSalaryEstimatesGetV1SalaryEstimatesOccupationsQuery( client$, security, request, options, ), }); } export function buildSalaryEstimatesGetV1SalaryEstimatesOccupationsQuery( client$: GustoEmbeddedCore, security: GetV1SalaryEstimatesOccupationsSecurity, request: GetV1SalaryEstimatesOccupationsRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise; } { return { queryKey: queryKeySalaryEstimatesGetV1SalaryEstimatesOccupations({ xGustoAPIVersion: request.xGustoAPIVersion, search: request.search, }), queryFn: async function salaryEstimatesGetV1SalaryEstimatesOccupationsQueryFn( ctx, ): Promise { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync(salaryEstimatesGetV1SalaryEstimatesOccupations( client$, security, request, mergedOptions, )); }, }; } export function queryKeySalaryEstimatesGetV1SalaryEstimatesOccupations( parameters: { xGustoAPIVersion?: | GetV1SalaryEstimatesOccupationsHeaderXGustoAPIVersion | undefined; search: string; }, ): QueryKey { return [ "@gusto/embedded-api", "Salary Estimates", "getV1SalaryEstimatesOccupations", parameters, ]; }