/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { SDKCore } from "../core.js"; import { authOrgsUpdateQuota } from "../funcs/authOrgsUpdateQuota.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; 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 { unwrapAsync } from "../types/fp.js"; import { useSDKContext } from "./_context.js"; import { MutationHookOptions } from "./_types.js"; export type AuthOrgsUpdateQuotaMutationVariables = { request: operations.UpdateOrgQuotaRequest; options?: RequestOptions; }; export type AuthOrgsUpdateQuotaMutationData = operations.UpdateOrgQuotaResponseBody; export type AuthOrgsUpdateQuotaMutationError = | errors.UpdateOrgQuotaResponseBody | errors.UpdateOrgQuotaAuthOrgsResponseBody | errors.UpdateOrgQuotaAuthOrgsResponseResponseBody | errors.UpdateOrgQuotaAuthOrgsResponse404ResponseBody | errors.UpdateOrgQuotaAuthOrgsResponse409ResponseBody | errors.UpdateOrgQuotaAuthOrgsResponse429ResponseBody | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Set an org's usage quota (cluster-admin) */ export function useAuthOrgsUpdateQuotaMutation( options?: MutationHookOptions< AuthOrgsUpdateQuotaMutationData, AuthOrgsUpdateQuotaMutationError, AuthOrgsUpdateQuotaMutationVariables >, ): UseMutationResult< AuthOrgsUpdateQuotaMutationData, AuthOrgsUpdateQuotaMutationError, AuthOrgsUpdateQuotaMutationVariables > { const client = useSDKContext(); return useMutation({ ...buildAuthOrgsUpdateQuotaMutation(client, options), ...options, }); } export function mutationKeyAuthOrgsUpdateQuota(): MutationKey { return ["@meetkai/mka1", "orgs", "updateQuota"]; } export function buildAuthOrgsUpdateQuotaMutation( client$: SDKCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: AuthOrgsUpdateQuotaMutationVariables, ) => Promise; } { return { mutationKey: mutationKeyAuthOrgsUpdateQuota(), mutationFn: function authOrgsUpdateQuotaMutationFn({ request, options, }): Promise { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(authOrgsUpdateQuota( client$, request, mergedOptions, )); }, }; }