/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { GustoEmbeddedCore } from "../core.js"; import { reimbursementsGetV1EmployeesEmployeeIdRecurringReimbursements } from "../funcs/reimbursementsGetV1EmployeesEmployeeIdRecurringReimbursements.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import { GetV1EmployeesEmployeeIdRecurringReimbursementsHeaderXGustoAPIVersion, GetV1EmployeesEmployeeIdRecurringReimbursementsRequest, GetV1EmployeesEmployeeIdRecurringReimbursementsResponse, } from "../models/operations/getv1employeesemployeeidrecurringreimbursements.js"; import { unwrapAsync } from "../types/fp.js"; export type ReimbursementsGetV1EmployeesEmployeeIdRecurringReimbursementsQueryData = GetV1EmployeesEmployeeIdRecurringReimbursementsResponse; export function prefetchReimbursementsGetV1EmployeesEmployeeIdRecurringReimbursements( queryClient: QueryClient, client$: GustoEmbeddedCore, request: GetV1EmployeesEmployeeIdRecurringReimbursementsRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildReimbursementsGetV1EmployeesEmployeeIdRecurringReimbursementsQuery( client$, request, options, ), }); } export function buildReimbursementsGetV1EmployeesEmployeeIdRecurringReimbursementsQuery( client$: GustoEmbeddedCore, request: GetV1EmployeesEmployeeIdRecurringReimbursementsRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise< ReimbursementsGetV1EmployeesEmployeeIdRecurringReimbursementsQueryData >; } { return { queryKey: queryKeyReimbursementsGetV1EmployeesEmployeeIdRecurringReimbursements( request.employeeId, { xGustoAPIVersion: request.xGustoAPIVersion, page: request.page, per: request.per, }, ), queryFn: async function reimbursementsGetV1EmployeesEmployeeIdRecurringReimbursementsQueryFn( ctx, ): Promise< ReimbursementsGetV1EmployeesEmployeeIdRecurringReimbursementsQueryData > { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync( reimbursementsGetV1EmployeesEmployeeIdRecurringReimbursements( client$, request, mergedOptions, ), ); }, }; } export function queryKeyReimbursementsGetV1EmployeesEmployeeIdRecurringReimbursements( employeeId: string, parameters: { xGustoAPIVersion?: | GetV1EmployeesEmployeeIdRecurringReimbursementsHeaderXGustoAPIVersion | undefined; page?: number | undefined; per?: number | undefined; }, ): QueryKey { return [ "@gusto/embedded-api", "Reimbursements", "getV1EmployeesEmployeeIdRecurringReimbursements", employeeId, parameters, ]; }