/* * 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 { NotFoundErrorObject } from "../models/errors/notfounderrorobject.js"; import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import { GetReportsRequestUuidHeaderXGustoAPIVersion, GetReportsRequestUuidRequest, } from "../models/operations/getreportsrequestuuid.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildReportsGetReportsRequestUuidQuery, prefetchReportsGetReportsRequestUuid, queryKeyReportsGetReportsRequestUuid, ReportsGetReportsRequestUuidQueryData, } from "./reportsGetReportsRequestUuid.core.js"; export { buildReportsGetReportsRequestUuidQuery, prefetchReportsGetReportsRequestUuid, queryKeyReportsGetReportsRequestUuid, type ReportsGetReportsRequestUuidQueryData, }; export type ReportsGetReportsRequestUuidQueryError = | NotFoundErrorObject | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Get a report * * @remarks * Get a company's report given the `request_uuid`. The response will include the report request's status and, if complete, the report URL. * * Reports containing PHI are inaccessible with `company_reports:read:tier_2_only` data scope * * scope: `company_reports:read` */ export function useReportsGetReportsRequestUuid( request: GetReportsRequestUuidRequest, options?: QueryHookOptions< ReportsGetReportsRequestUuidQueryData, ReportsGetReportsRequestUuidQueryError >, ): UseQueryResult< ReportsGetReportsRequestUuidQueryData, ReportsGetReportsRequestUuidQueryError > { const client = useGustoEmbeddedContext(); return useQuery({ ...buildReportsGetReportsRequestUuidQuery( client, request, options, ), ...options, }); } /** * Get a report * * @remarks * Get a company's report given the `request_uuid`. The response will include the report request's status and, if complete, the report URL. * * Reports containing PHI are inaccessible with `company_reports:read:tier_2_only` data scope * * scope: `company_reports:read` */ export function useReportsGetReportsRequestUuidSuspense( request: GetReportsRequestUuidRequest, options?: SuspenseQueryHookOptions< ReportsGetReportsRequestUuidQueryData, ReportsGetReportsRequestUuidQueryError >, ): UseSuspenseQueryResult< ReportsGetReportsRequestUuidQueryData, ReportsGetReportsRequestUuidQueryError > { const client = useGustoEmbeddedContext(); return useSuspenseQuery({ ...buildReportsGetReportsRequestUuidQuery( client, request, options, ), ...options, }); } export function setReportsGetReportsRequestUuidData( client: QueryClient, queryKeyBase: [ requestUuid: string, parameters: { xGustoAPIVersion?: | GetReportsRequestUuidHeaderXGustoAPIVersion | undefined; }, ], data: ReportsGetReportsRequestUuidQueryData, ): ReportsGetReportsRequestUuidQueryData | undefined { const key = queryKeyReportsGetReportsRequestUuid(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateReportsGetReportsRequestUuid( client: QueryClient, queryKeyBase: TupleToPrefixes< [ requestUuid: string, parameters: { xGustoAPIVersion?: | GetReportsRequestUuidHeaderXGustoAPIVersion | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api", "Reports", "getReportsRequestUuid", ...queryKeyBase, ], }); } export function invalidateAllReportsGetReportsRequestUuid( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@gusto/embedded-api", "Reports", "getReportsRequestUuid"], }); }