Skip to content

Commit 9fc0cc1

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 9291170 commit 9fc0cc1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

algoliasearch/Clients/IngestionClient.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,13 +1275,14 @@ public interface IIngestionClient
12751275
/// - editSettings
12761276
/// <param name="taskID">Unique identifier of a task.</param>
12771277
/// <param name="pushTaskPayload">Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.</param>
1278+
/// <param name="watch">When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding. (optional)</param>
12781279
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
12791280
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
12801281
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
12811282
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
12821283
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
12831284
/// <returns>Task of RunResponse</returns>
1284-
Task<RunResponse> PushTaskAsync(string taskID, PushTaskPayload pushTaskPayload, RequestOptions options = null, CancellationToken cancellationToken = default);
1285+
Task<RunResponse> PushTaskAsync(string taskID, PushTaskPayload pushTaskPayload, bool? watch = default, RequestOptions options = null, CancellationToken cancellationToken = default);
12851286

12861287
/// <summary>
12871288
/// Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints. (Synchronous version)
@@ -1293,13 +1294,14 @@ public interface IIngestionClient
12931294
/// - editSettings
12941295
/// <param name="taskID">Unique identifier of a task.</param>
12951296
/// <param name="pushTaskPayload">Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.</param>
1297+
/// <param name="watch">When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding. (optional)</param>
12961298
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
12971299
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
12981300
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
12991301
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
13001302
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
13011303
/// <returns>RunResponse</returns>
1302-
RunResponse PushTask(string taskID, PushTaskPayload pushTaskPayload, RequestOptions options = null, CancellationToken cancellationToken = default);
1304+
RunResponse PushTask(string taskID, PushTaskPayload pushTaskPayload, bool? watch = default, RequestOptions options = null, CancellationToken cancellationToken = default);
13031305

13041306
/// <summary>
13051307
/// Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
@@ -2802,7 +2804,7 @@ public ListTransformationsResponse ListTransformations(int? itemsPerPage = defau
28022804

28032805

28042806
/// <inheritdoc />
2805-
public async Task<RunResponse> PushTaskAsync(string taskID, PushTaskPayload pushTaskPayload, RequestOptions options = null, CancellationToken cancellationToken = default)
2807+
public async Task<RunResponse> PushTaskAsync(string taskID, PushTaskPayload pushTaskPayload, bool? watch = default, RequestOptions options = null, CancellationToken cancellationToken = default)
28062808
{
28072809

28082810
if (taskID == null)
@@ -2816,14 +2818,15 @@ public async Task<RunResponse> PushTaskAsync(string taskID, PushTaskPayload push
28162818

28172819
requestOptions.PathParameters.Add("taskID", QueryStringHelper.ParameterToString(taskID));
28182820

2821+
requestOptions.AddQueryParameter("watch", watch);
28192822
requestOptions.Data = pushTaskPayload;
28202823
return await _transport.ExecuteRequestAsync<RunResponse>(new HttpMethod("POST"), "/2/tasks/{taskID}/push", requestOptions, cancellationToken).ConfigureAwait(false);
28212824
}
28222825

28232826

28242827
/// <inheritdoc />
2825-
public RunResponse PushTask(string taskID, PushTaskPayload pushTaskPayload, RequestOptions options = null, CancellationToken cancellationToken = default) =>
2826-
AsyncHelper.RunSync(() => PushTaskAsync(taskID, pushTaskPayload, options, cancellationToken));
2828+
public RunResponse PushTask(string taskID, PushTaskPayload pushTaskPayload, bool? watch = default, RequestOptions options = null, CancellationToken cancellationToken = default) =>
2829+
AsyncHelper.RunSync(() => PushTaskAsync(taskID, pushTaskPayload, watch, options, cancellationToken));
28272830

28282831

28292832
/// <inheritdoc />

0 commit comments

Comments
 (0)