/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { GustoEmbeddedCore } from "../core.js"; import { contractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursements } from "../funcs/contractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursements.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import { GetV1ContractorPaymentGroupsIdPartnerDisbursementsHeaderXGustoAPIVersion, GetV1ContractorPaymentGroupsIdPartnerDisbursementsRequest, GetV1ContractorPaymentGroupsIdPartnerDisbursementsResponse, } from "../models/operations/getv1contractorpaymentgroupsidpartnerdisbursements.js"; import { unwrapAsync } from "../types/fp.js"; export type ContractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursementsQueryData = GetV1ContractorPaymentGroupsIdPartnerDisbursementsResponse; export function prefetchContractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursements( queryClient: QueryClient, client$: GustoEmbeddedCore, request: GetV1ContractorPaymentGroupsIdPartnerDisbursementsRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildContractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursementsQuery( client$, request, options, ), }); } export function buildContractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursementsQuery( client$: GustoEmbeddedCore, request: GetV1ContractorPaymentGroupsIdPartnerDisbursementsRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise< ContractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursementsQueryData >; } { return { queryKey: queryKeyContractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursements( request.id, { xGustoAPIVersion: request.xGustoAPIVersion }, ), queryFn: async function contractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursementsQueryFn( ctx, ): Promise< ContractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursementsQueryData > { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync( contractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursements( client$, request, mergedOptions, ), ); }, }; } export function queryKeyContractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursements( id: string, parameters: { xGustoAPIVersion?: | GetV1ContractorPaymentGroupsIdPartnerDisbursementsHeaderXGustoAPIVersion | undefined; }, ): QueryKey { return [ "@gusto/embedded-api", "contractorPaymentGroups", "getV1ContractorPaymentGroupsIdPartnerDisbursements", id, parameters, ]; }