/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { GustoEmbeddedCore } from "../core.js"; import { employeeTaxSetupGetStateTaxes } from "../funcs/employeeTaxSetupGetStateTaxes.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import { GetV1EmployeesEmployeeIdStateTaxesHeaderXGustoAPIVersion, GetV1EmployeesEmployeeIdStateTaxesRequest, GetV1EmployeesEmployeeIdStateTaxesResponse, } from "../models/operations/getv1employeesemployeeidstatetaxes.js"; import { unwrapAsync } from "../types/fp.js"; export type EmployeeTaxSetupGetStateTaxesQueryData = GetV1EmployeesEmployeeIdStateTaxesResponse; export function prefetchEmployeeTaxSetupGetStateTaxes( queryClient: QueryClient, client$: GustoEmbeddedCore, request: GetV1EmployeesEmployeeIdStateTaxesRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildEmployeeTaxSetupGetStateTaxesQuery( client$, request, options, ), }); } export function buildEmployeeTaxSetupGetStateTaxesQuery( client$: GustoEmbeddedCore, request: GetV1EmployeesEmployeeIdStateTaxesRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise; } { return { queryKey: queryKeyEmployeeTaxSetupGetStateTaxes(request.employeeUuid, { xGustoAPIVersion: request.xGustoAPIVersion, }), queryFn: async function employeeTaxSetupGetStateTaxesQueryFn( ctx, ): Promise { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync(employeeTaxSetupGetStateTaxes( client$, request, mergedOptions, )); }, }; } export function queryKeyEmployeeTaxSetupGetStateTaxes( employeeUuid: string, parameters: { xGustoAPIVersion?: | GetV1EmployeesEmployeeIdStateTaxesHeaderXGustoAPIVersion | undefined; }, ): QueryKey { return [ "@gusto/embedded-api", "employeeTaxSetup", "getStateTaxes", employeeUuid, parameters, ]; }