/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: d84cf6b4d9ee */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { GleanCore } from "../core.js"; import { indexingPeopleProcessAllEmployeesAndTeams } from "../funcs/indexingPeopleProcessAllEmployeesAndTeams.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.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 IndexingPeopleProcessAllEmployeesAndTeamsMutationVariables = { options?: RequestOptions; }; export type IndexingPeopleProcessAllEmployeesAndTeamsMutationData = void; export type IndexingPeopleProcessAllEmployeesAndTeamsMutationError = | GleanBaseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Schedules the processing of uploaded employees and teams * * @remarks * Schedules the immediate processing of employees and teams uploaded through the indexing API. By default all uploaded people data will be processed asynchronously but this API can be used to schedule its processing on demand. */ export function useIndexingPeopleProcessAllEmployeesAndTeamsMutation( options?: MutationHookOptions< IndexingPeopleProcessAllEmployeesAndTeamsMutationData, IndexingPeopleProcessAllEmployeesAndTeamsMutationError, IndexingPeopleProcessAllEmployeesAndTeamsMutationVariables >, ): UseMutationResult< IndexingPeopleProcessAllEmployeesAndTeamsMutationData, IndexingPeopleProcessAllEmployeesAndTeamsMutationError, IndexingPeopleProcessAllEmployeesAndTeamsMutationVariables > { const client = useGleanContext(); return useMutation({ ...buildIndexingPeopleProcessAllEmployeesAndTeamsMutation(client, options), ...options, }); } export function mutationKeyIndexingPeopleProcessAllEmployeesAndTeams(): MutationKey { return ["@gleanwork/api-client", "people", "processAllEmployeesAndTeams"]; } export function buildIndexingPeopleProcessAllEmployeesAndTeamsMutation( client$: GleanCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: IndexingPeopleProcessAllEmployeesAndTeamsMutationVariables, ) => Promise; } { return { mutationKey: mutationKeyIndexingPeopleProcessAllEmployeesAndTeams(), mutationFn: function indexingPeopleProcessAllEmployeesAndTeamsMutationFn({ options, }): Promise { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(indexingPeopleProcessAllEmployeesAndTeams( client$, mergedOptions, )); }, }; }