/* * 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 { GetV1WebhooksHealthCheckHeaderXGustoAPIVersion, GetV1WebhooksHealthCheckRequest, GetV1WebhooksHealthCheckSecurity, } from "../models/operations/getv1webhookshealthcheck.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildWebhooksGetV1WebhooksHealthCheckQuery, prefetchWebhooksGetV1WebhooksHealthCheck, queryKeyWebhooksGetV1WebhooksHealthCheck, WebhooksGetV1WebhooksHealthCheckQueryData, } from "./webhooksGetV1WebhooksHealthCheck.core.js"; export { buildWebhooksGetV1WebhooksHealthCheckQuery, prefetchWebhooksGetV1WebhooksHealthCheck, queryKeyWebhooksGetV1WebhooksHealthCheck, type WebhooksGetV1WebhooksHealthCheckQueryData, }; export type WebhooksGetV1WebhooksHealthCheckQueryError = | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Get the webhooks health status * * @remarks * Returns the health status (`healthy`, `unhealthy`, or `unknown`) of the webhooks system based on the last ten minutes of activity. * * 📘 System Access Authentication * * This endpoint uses the [Bearer Auth scheme with the system-level access token in the HTTP Authorization header](https://docs.gusto.com/embedded-payroll/docs/system-access) * * scope: `webhook_subscriptions:read` */ export function useWebhooksGetV1WebhooksHealthCheck( security: GetV1WebhooksHealthCheckSecurity, request: GetV1WebhooksHealthCheckRequest, options?: QueryHookOptions< WebhooksGetV1WebhooksHealthCheckQueryData, WebhooksGetV1WebhooksHealthCheckQueryError >, ): UseQueryResult< WebhooksGetV1WebhooksHealthCheckQueryData, WebhooksGetV1WebhooksHealthCheckQueryError > { const client = useGustoEmbeddedContext(); return useQuery({ ...buildWebhooksGetV1WebhooksHealthCheckQuery( client, security, request, options, ), ...options, }); } /** * Get the webhooks health status * * @remarks * Returns the health status (`healthy`, `unhealthy`, or `unknown`) of the webhooks system based on the last ten minutes of activity. * * 📘 System Access Authentication * * This endpoint uses the [Bearer Auth scheme with the system-level access token in the HTTP Authorization header](https://docs.gusto.com/embedded-payroll/docs/system-access) * * scope: `webhook_subscriptions:read` */ export function useWebhooksGetV1WebhooksHealthCheckSuspense( security: GetV1WebhooksHealthCheckSecurity, request: GetV1WebhooksHealthCheckRequest, options?: SuspenseQueryHookOptions< WebhooksGetV1WebhooksHealthCheckQueryData, WebhooksGetV1WebhooksHealthCheckQueryError >, ): UseSuspenseQueryResult< WebhooksGetV1WebhooksHealthCheckQueryData, WebhooksGetV1WebhooksHealthCheckQueryError > { const client = useGustoEmbeddedContext(); return useSuspenseQuery({ ...buildWebhooksGetV1WebhooksHealthCheckQuery( client, security, request, options, ), ...options, }); } export function setWebhooksGetV1WebhooksHealthCheckData( client: QueryClient, queryKeyBase: [ parameters: { xGustoAPIVersion?: | GetV1WebhooksHealthCheckHeaderXGustoAPIVersion | undefined; }, ], data: WebhooksGetV1WebhooksHealthCheckQueryData, ): WebhooksGetV1WebhooksHealthCheckQueryData | undefined { const key = queryKeyWebhooksGetV1WebhooksHealthCheck(...queryKeyBase); return client.setQueryData( key, data, ); } export function invalidateWebhooksGetV1WebhooksHealthCheck( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { xGustoAPIVersion?: | GetV1WebhooksHealthCheckHeaderXGustoAPIVersion | undefined; }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api", "Webhooks", "getV1WebhooksHealthCheck", ...queryKeyBase, ], }); } export function invalidateAllWebhooksGetV1WebhooksHealthCheck( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@gusto/embedded-api", "Webhooks", "getV1WebhooksHealthCheck"], }); }