/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { SDKCore } from "../core.js"; import { llmModelsClearClusterPrice } from "../funcs/llmModelsClearClusterPrice.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 LlmModelsClearClusterPriceMutationVariables = { request: operations.ClearClusterPriceRequest; options?: RequestOptions; }; export type LlmModelsClearClusterPriceMutationData = components.DeleteModelPriceResponse; export type LlmModelsClearClusterPriceMutationError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Clear a cluster-default model price * * @remarks * Closes the cluster-default price. Active cluster lineage then uses an org override or becomes unpriced ($0). */ export function useLlmModelsClearClusterPriceMutation( options?: MutationHookOptions< LlmModelsClearClusterPriceMutationData, LlmModelsClearClusterPriceMutationError, LlmModelsClearClusterPriceMutationVariables >, ): UseMutationResult< LlmModelsClearClusterPriceMutationData, LlmModelsClearClusterPriceMutationError, LlmModelsClearClusterPriceMutationVariables > { const client = useSDKContext(); return useMutation({ ...buildLlmModelsClearClusterPriceMutation(client, options), ...options, }); } export function mutationKeyLlmModelsClearClusterPrice(): MutationKey { return ["@meetkai/mka1", "models", "clearClusterPrice"]; } export function buildLlmModelsClearClusterPriceMutation( client$: SDKCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: LlmModelsClearClusterPriceMutationVariables, ) => Promise; } { return { mutationKey: mutationKeyLlmModelsClearClusterPrice(), mutationFn: function llmModelsClearClusterPriceMutationFn({ request, options, }): Promise { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(llmModelsClearClusterPrice( client$, request, mergedOptions, )); }, }; }