/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { GustoEmbeddedCore } from "../core.js"; import { employeesGetV1CompaniesCompanyIdEmployeesPaymentDetails } from "../funcs/employeesGetV1CompaniesCompanyIdEmployeesPaymentDetails.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import { GetV1CompaniesCompanyIdEmployeesPaymentDetailsHeaderXGustoAPIVersion, GetV1CompaniesCompanyIdEmployeesPaymentDetailsRequest, GetV1CompaniesCompanyIdEmployeesPaymentDetailsResponse, } from "../models/operations/getv1companiescompanyidemployeespaymentdetails.js"; import { unwrapAsync } from "../types/fp.js"; export type EmployeesGetV1CompaniesCompanyIdEmployeesPaymentDetailsQueryData = GetV1CompaniesCompanyIdEmployeesPaymentDetailsResponse; export function prefetchEmployeesGetV1CompaniesCompanyIdEmployeesPaymentDetails( queryClient: QueryClient, client$: GustoEmbeddedCore, request: GetV1CompaniesCompanyIdEmployeesPaymentDetailsRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildEmployeesGetV1CompaniesCompanyIdEmployeesPaymentDetailsQuery( client$, request, options, ), }); } export function buildEmployeesGetV1CompaniesCompanyIdEmployeesPaymentDetailsQuery( client$: GustoEmbeddedCore, request: GetV1CompaniesCompanyIdEmployeesPaymentDetailsRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise< EmployeesGetV1CompaniesCompanyIdEmployeesPaymentDetailsQueryData >; } { return { queryKey: queryKeyEmployeesGetV1CompaniesCompanyIdEmployeesPaymentDetails( request.companyId, { xGustoAPIVersion: request.xGustoAPIVersion, employeeUuid: request.employeeUuid, payrollUuid: request.payrollUuid, page: request.page, per: request.per, }, ), queryFn: async function employeesGetV1CompaniesCompanyIdEmployeesPaymentDetailsQueryFn( ctx, ): Promise< EmployeesGetV1CompaniesCompanyIdEmployeesPaymentDetailsQueryData > { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync( employeesGetV1CompaniesCompanyIdEmployeesPaymentDetails( client$, request, mergedOptions, ), ); }, }; } export function queryKeyEmployeesGetV1CompaniesCompanyIdEmployeesPaymentDetails( companyId: string, parameters: { xGustoAPIVersion?: | GetV1CompaniesCompanyIdEmployeesPaymentDetailsHeaderXGustoAPIVersion | undefined; employeeUuid?: string | undefined; payrollUuid?: string | undefined; page?: number | undefined; per?: number | undefined; }, ): QueryKey { return [ "@gusto/embedded-api", "Employees", "getV1CompaniesCompanyIdEmployeesPaymentDetails", companyId, parameters, ]; }