/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { SDKCore } from "../core.js"; import { authClusterSuspendOrg } from "../funcs/authClusterSuspendOrg.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 AuthClusterSuspendOrgMutationVariables = { request: operations.SuspendClusterOrgRequest; options?: RequestOptions; }; export type AuthClusterSuspendOrgMutationData = operations.SuspendClusterOrgResponseBody; export type AuthClusterSuspendOrgMutationError = | errors.SuspendClusterOrgResponseBody | errors.SuspendClusterOrgAuthClusterResponseBody | errors.SuspendClusterOrgAuthClusterResponseResponseBody | errors.SuspendClusterOrgAuthClusterResponse404ResponseBody | errors.SuspendClusterOrgAuthClusterResponse409ResponseBody | errors.SuspendClusterOrgAuthClusterResponse429ResponseBody | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Suspend an organization */ export function useAuthClusterSuspendOrgMutation( options?: MutationHookOptions< AuthClusterSuspendOrgMutationData, AuthClusterSuspendOrgMutationError, AuthClusterSuspendOrgMutationVariables >, ): UseMutationResult< AuthClusterSuspendOrgMutationData, AuthClusterSuspendOrgMutationError, AuthClusterSuspendOrgMutationVariables > { const client = useSDKContext(); return useMutation({ ...buildAuthClusterSuspendOrgMutation(client, options), ...options, }); } export function mutationKeyAuthClusterSuspendOrg(): MutationKey { return ["@meetkai/mka1", "cluster", "suspendOrg"]; } export function buildAuthClusterSuspendOrgMutation( client$: SDKCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: AuthClusterSuspendOrgMutationVariables, ) => Promise; } { return { mutationKey: mutationKeyAuthClusterSuspendOrg(), mutationFn: function authClusterSuspendOrgMutationFn({ request, options, }): Promise { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(authClusterSuspendOrg( client$, request, mergedOptions, )); }, }; }