/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { SDKCore } from "../core.js"; import { llmModelsDeactivateRegistryEntry } from "../funcs/llmModelsDeactivateRegistryEntry.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.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 LlmModelsDeactivateRegistryEntryMutationVariables = { request: operations.DeactivateModelRegistryEntryRequest; options?: RequestOptions; }; export type LlmModelsDeactivateRegistryEntryMutationData = components.DeactivateRegistryEntryResponse; export type LlmModelsDeactivateRegistryEntryMutationError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Deactivate a model registry name * * @remarks * Idempotently removes the active name and closes its org-scope price rows without touching the catalog definition. */ export function useLlmModelsDeactivateRegistryEntryMutation( options?: MutationHookOptions< LlmModelsDeactivateRegistryEntryMutationData, LlmModelsDeactivateRegistryEntryMutationError, LlmModelsDeactivateRegistryEntryMutationVariables >, ): UseMutationResult< LlmModelsDeactivateRegistryEntryMutationData, LlmModelsDeactivateRegistryEntryMutationError, LlmModelsDeactivateRegistryEntryMutationVariables > { const client = useSDKContext(); return useMutation({ ...buildLlmModelsDeactivateRegistryEntryMutation(client, options), ...options, }); } export function mutationKeyLlmModelsDeactivateRegistryEntry(): MutationKey { return ["@meetkai/mka1", "models", "deactivateRegistryEntry"]; } export function buildLlmModelsDeactivateRegistryEntryMutation( client$: SDKCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: LlmModelsDeactivateRegistryEntryMutationVariables, ) => Promise; } { return { mutationKey: mutationKeyLlmModelsDeactivateRegistryEntry(), mutationFn: function llmModelsDeactivateRegistryEntryMutationFn({ request, options, }): Promise { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(llmModelsDeactivateRegistryEntry( client$, request, mergedOptions, )); }, }; }