Skip to content

Commit 716eed3

Browse files
feat(specs): add watch to pushTask ingestion (generated)
algolia/api-clients-automation#4224 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 9d872d7 commit 716eed3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/ingestion/model/clientMethodProps.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,10 @@ export type PushTaskProps = {
588588
* Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
589589
*/
590590
pushTaskPayload: PushTaskPayload;
591+
/**
592+
* When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
593+
*/
594+
watch?: boolean;
591595
};
592596

593597
/**

packages/ingestion/src/ingestionClient.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,9 +1691,10 @@ export function createIngestionClient({
16911691
* @param pushTask - The pushTask object.
16921692
* @param pushTask.taskID - Unique identifier of a task.
16931693
* @param pushTask.pushTaskPayload - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
1694+
* @param pushTask.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
16941695
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
16951696
*/
1696-
pushTask({ taskID, pushTaskPayload }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse> {
1697+
pushTask({ taskID, pushTaskPayload, watch }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse> {
16971698
if (!taskID) {
16981699
throw new Error('Parameter `taskID` is required when calling `pushTask`.');
16991700
}
@@ -1713,6 +1714,10 @@ export function createIngestionClient({
17131714
const headers: Headers = {};
17141715
const queryParameters: QueryParameters = {};
17151716

1717+
if (watch !== undefined) {
1718+
queryParameters['watch'] = watch.toString();
1719+
}
1720+
17161721
const request: Request = {
17171722
method: 'POST',
17181723
path: requestPath,

0 commit comments

Comments
 (0)