/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: a8df14bd150e */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { GleanCore } from "../core.js"; import { indexingPeopleIndexTeam } from "../funcs/indexingPeopleIndexTeam.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 IndexingPeopleIndexTeamMutationVariables = { request: components.IndexTeamRequest; options?: RequestOptions; }; export type IndexingPeopleIndexTeamMutationData = void; export type IndexingPeopleIndexTeamMutationError = | GleanBaseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Index team * * @remarks * Adds a team or updates information about a team */ export function useIndexingPeopleIndexTeamMutation( options?: MutationHookOptions< IndexingPeopleIndexTeamMutationData, IndexingPeopleIndexTeamMutationError, IndexingPeopleIndexTeamMutationVariables >, ): UseMutationResult< IndexingPeopleIndexTeamMutationData, IndexingPeopleIndexTeamMutationError, IndexingPeopleIndexTeamMutationVariables > { const client = useGleanContext(); return useMutation({ ...buildIndexingPeopleIndexTeamMutation(client, options), ...options, }); } export function mutationKeyIndexingPeopleIndexTeam(): MutationKey { return ["@gleanwork/api-client", "people", "indexTeam"]; } export function buildIndexingPeopleIndexTeamMutation( client$: GleanCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: IndexingPeopleIndexTeamMutationVariables, ) => Promise; } { return { mutationKey: mutationKeyIndexingPeopleIndexTeam(), mutationFn: function indexingPeopleIndexTeamMutationFn({ request, options, }): Promise { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(indexingPeopleIndexTeam( client$, request, mergedOptions, )); }, }; }