/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { InvalidateQueryFilters, QueryClient, useQuery, UseQueryResult, useSuspenseQuery, UseSuspenseQueryResult, } from "@tanstack/react-query"; import { GustoEmbeddedError } from "../models/errors/gustoembeddederror.js"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import { GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion, GetV1GarnishmentsChildSupportRequest, } from "../models/operations/getv1garnishmentschildsupport.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildGarnishmentsGetChildSupportDataQuery, GarnishmentsGetChildSupportDataQueryData, prefetchGarnishmentsGetChildSupportData, queryKeyGarnishmentsGetChildSupportData, } from "./garnishmentsGetChildSupportData.core.js"; export { buildGarnishmentsGetChildSupportDataQuery, type GarnishmentsGetChildSupportDataQueryData, prefetchGarnishmentsGetChildSupportData, queryKeyGarnishmentsGetChildSupportData, }; export type GarnishmentsGetChildSupportDataQueryError = | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Get child support garnishment data * * @remarks * Agency data and requirements to be used for creating child support garnishments * * scope: `garnishments:read` */ export function useGarnishmentsGetChildSupportData( request: GetV1GarnishmentsChildSupportRequest, options?: QueryHookOptions< GarnishmentsGetChildSupportDataQueryData, GarnishmentsGetChildSupportDataQueryError >, ): UseQueryResult< GarnishmentsGetChildSupportDataQueryData, GarnishmentsGetChildSupportDataQueryError > { const client = useGustoEmbeddedContext(); return useQuery({ ...buildGarnishmentsGetChildSupportDataQuery( client, request, options, ), ...options, }); } /** * Get child support garnishment data * * @remarks * Agency data and requirements to be used for creating child support garnishments * * scope: `garnishments:read` */ export function useGarnishmentsGetChildSupportDataSuspense( request: GetV1GarnishmentsChildSupportRequest, options?: SuspenseQueryHookOptions< GarnishmentsGetChildSupportDataQueryData, GarnishmentsGetChildSupportDataQueryError >, ): UseSuspenseQueryResult< GarnishmentsGetChildSupportDataQueryData, GarnishmentsGetChildSupportDataQueryError > { const client = useGustoEmbeddedContext(); return useSuspenseQuery({ ...buildGarnishmentsGetChildSupportDataQuery( client, request, options, ), ...options, }); } export function setGarnishmentsGetChildSupportDataData( client: QueryClient, queryKeyBase: [ parameters: { xGustoAPIVersion?: | GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion | undefined; }, ], data: GarnishmentsGetChildSupportDataQueryData, ): GarnishmentsGetChildSupportDataQueryData | undefined { const key = queryKeyGarnishmentsGetChildSupportData(...queryKeyBase); return client.setQueryData( key, data, ); } export function invalidateGarnishmentsGetChildSupportData( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { xGustoAPIVersion?: | GetV1GarnishmentsChildSupportHeaderXGustoAPIVersion | undefined; }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api", "Garnishments", "getChildSupportData", ...queryKeyBase, ], }); } export function invalidateAllGarnishmentsGetChildSupportData( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@gusto/embedded-api", "Garnishments", "getChildSupportData"], }); }