/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: b80464692bc7 */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { GleanCore } from "../core.js"; import { indexingPeopleDeleteTeam } from "../funcs/indexingPeopleDeleteTeam.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { GleanBaseError } from "../models/errors/gleanbaseerror.js"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import { unwrapAsync } from "../types/fp.js"; import { useGleanContext } from "./_context.js"; import { MutationHookOptions } from "./_types.js"; export type IndexingPeopleDeleteTeamMutationVariables = { request: components.DeleteTeamRequest; options?: RequestOptions; }; export type IndexingPeopleDeleteTeamMutationData = void; export type IndexingPeopleDeleteTeamMutationError = | GleanBaseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Delete team * * @remarks * Delete a team based on provided id. */ export function useIndexingPeopleDeleteTeamMutation( options?: MutationHookOptions< IndexingPeopleDeleteTeamMutationData, IndexingPeopleDeleteTeamMutationError, IndexingPeopleDeleteTeamMutationVariables >, ): UseMutationResult< IndexingPeopleDeleteTeamMutationData, IndexingPeopleDeleteTeamMutationError, IndexingPeopleDeleteTeamMutationVariables > { const client = useGleanContext(); return useMutation({ ...buildIndexingPeopleDeleteTeamMutation(client, options), ...options, }); } export function mutationKeyIndexingPeopleDeleteTeam(): MutationKey { return ["@gleanwork/api-client", "people", "deleteTeam"]; } export function buildIndexingPeopleDeleteTeamMutation( client$: GleanCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: IndexingPeopleDeleteTeamMutationVariables, ) => Promise; } { return { mutationKey: mutationKeyIndexingPeopleDeleteTeam(), mutationFn: function indexingPeopleDeleteTeamMutationFn({ request, options, }): Promise { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(indexingPeopleDeleteTeam( client$, request, mergedOptions, )); }, }; }