/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { InvalidateQueryFilters, QueryClient, useQuery, UseQueryResult, useSuspenseQuery, UseSuspenseQueryResult, } from "@tanstack/react-query"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; import * as errors from "../models/errors/index.js"; import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKError } from "../models/errors/sdkerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { useSDKContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { AuthOrgsGetQuotaQueryData, buildAuthOrgsGetQuotaQuery, prefetchAuthOrgsGetQuota, queryKeyAuthOrgsGetQuota, } from "./authOrgsGetQuota.core.js"; export { type AuthOrgsGetQuotaQueryData, buildAuthOrgsGetQuotaQuery, prefetchAuthOrgsGetQuota, queryKeyAuthOrgsGetQuota, }; export type AuthOrgsGetQuotaQueryError = | errors.GetOrgQuotaResponseBody | errors.GetOrgQuotaAuthOrgsResponseBody | errors.GetOrgQuotaAuthOrgsResponseResponseBody | errors.GetOrgQuotaAuthOrgsResponse404ResponseBody | errors.GetOrgQuotaAuthOrgsResponse409ResponseBody | errors.GetOrgQuotaAuthOrgsResponse429ResponseBody | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Get an org's usage quota */ export function useAuthOrgsGetQuota( request: operations.GetOrgQuotaRequest, options?: QueryHookOptions< AuthOrgsGetQuotaQueryData, AuthOrgsGetQuotaQueryError >, ): UseQueryResult { const client = useSDKContext(); return useQuery({ ...buildAuthOrgsGetQuotaQuery( client, request, options, ), ...options, }); } /** * Get an org's usage quota */ export function useAuthOrgsGetQuotaSuspense( request: operations.GetOrgQuotaRequest, options?: SuspenseQueryHookOptions< AuthOrgsGetQuotaQueryData, AuthOrgsGetQuotaQueryError >, ): UseSuspenseQueryResult< AuthOrgsGetQuotaQueryData, AuthOrgsGetQuotaQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildAuthOrgsGetQuotaQuery( client, request, options, ), ...options, }); } export function setAuthOrgsGetQuotaData( client: QueryClient, queryKeyBase: [ orgId: string, parameters: { xOnBehalfOf?: string | undefined }, ], data: AuthOrgsGetQuotaQueryData, ): AuthOrgsGetQuotaQueryData | undefined { const key = queryKeyAuthOrgsGetQuota(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateAuthOrgsGetQuota( client: QueryClient, queryKeyBase: TupleToPrefixes< [orgId: string, parameters: { xOnBehalfOf?: string | undefined }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "orgs", "getQuota", ...queryKeyBase], }); } export function invalidateAllAuthOrgsGetQuota( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "orgs", "getQuota"], }); }