Skip to content

Commit c9c64d1

Browse files
authored
Merge branch 'main' into feat/save-partialUpdate-ObjectsWithTransformation
2 parents a0011a5 + 77ed32e commit c9c64d1

File tree

45 files changed

+3600
-643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3600
-643
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Clients/IngestionClient.cs

Lines changed: 100 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,15 +1685,65 @@ ListTransformationsResponse ListTransformations(
16851685
);
16861686

16871687
/// <summary>
1688-
/// Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints.
1688+
/// Pushes records through the Pipeline, directly to an index. You can make the call synchronous by providing the `watch` parameter, for asynchronous calls, you can use the observability endpoints and/or debugger dashboard to see the status of your task. If you want to leverage the [pre-indexing data transformation](https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/transform-your-data/), this is the recommended way of ingesting your records. This method is similar to `pushTask`, but requires an `indexName` instead of a `taskID`. If zero or many tasks are found, an error will be returned.
1689+
/// </summary>
1690+
///
1691+
/// Required API Key ACLs:
1692+
/// - addObject
1693+
/// - deleteIndex
1694+
/// - editSettings
1695+
/// <param name="indexName">Name of the index on which to perform the operation.</param>
1696+
/// <param name="pushTaskPayload"></param>
1697+
/// <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>
1698+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
1699+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
1700+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
1701+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
1702+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
1703+
/// <returns>Task of WatchResponse</returns>
1704+
Task<WatchResponse> PushAsync(
1705+
string indexName,
1706+
PushTaskPayload pushTaskPayload,
1707+
bool? watch = default,
1708+
RequestOptions options = null,
1709+
CancellationToken cancellationToken = default
1710+
);
1711+
1712+
/// <summary>
1713+
/// Pushes records through the Pipeline, directly to an index. You can make the call synchronous by providing the `watch` parameter, for asynchronous calls, you can use the observability endpoints and/or debugger dashboard to see the status of your task. If you want to leverage the [pre-indexing data transformation](https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/transform-your-data/), this is the recommended way of ingesting your records. This method is similar to `pushTask`, but requires an `indexName` instead of a `taskID`. If zero or many tasks are found, an error will be returned. (Synchronous version)
1714+
/// </summary>
1715+
///
1716+
/// Required API Key ACLs:
1717+
/// - addObject
1718+
/// - deleteIndex
1719+
/// - editSettings
1720+
/// <param name="indexName">Name of the index on which to perform the operation.</param>
1721+
/// <param name="pushTaskPayload"></param>
1722+
/// <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>
1723+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
1724+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
1725+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
1726+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
1727+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
1728+
/// <returns>WatchResponse</returns>
1729+
WatchResponse Push(
1730+
string indexName,
1731+
PushTaskPayload pushTaskPayload,
1732+
bool? watch = default,
1733+
RequestOptions options = null,
1734+
CancellationToken cancellationToken = default
1735+
);
1736+
1737+
/// <summary>
1738+
/// Pushes records through the Pipeline, directly to an index. You can make the call synchronous by providing the `watch` parameter, for asynchronous calls, you can use the observability endpoints and/or debugger dashboard to see the status of your task. If you want to leverage the [pre-indexing data transformation](https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/transform-your-data/), this is the recommended way of ingesting your records. This method is similar to `push`, but requires a `taskID` instead of a `indexName`, which is useful when many `destinations` target the same `indexName`.
16891739
/// </summary>
16901740
///
16911741
/// Required API Key ACLs:
16921742
/// - addObject
16931743
/// - deleteIndex
16941744
/// - editSettings
16951745
/// <param name="taskID">Unique identifier of a task.</param>
1696-
/// <param name="pushTaskPayload">Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.</param>
1746+
/// <param name="pushTaskPayload"></param>
16971747
/// <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>
16981748
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
16991749
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
@@ -1710,15 +1760,15 @@ Task<WatchResponse> PushTaskAsync(
17101760
);
17111761

17121762
/// <summary>
1713-
/// Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints. (Synchronous version)
1763+
/// Pushes records through the Pipeline, directly to an index. You can make the call synchronous by providing the `watch` parameter, for asynchronous calls, you can use the observability endpoints and/or debugger dashboard to see the status of your task. If you want to leverage the [pre-indexing data transformation](https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/transform-your-data/), this is the recommended way of ingesting your records. This method is similar to `push`, but requires a `taskID` instead of a `indexName`, which is useful when many `destinations` target the same `indexName`. (Synchronous version)
17141764
/// </summary>
17151765
///
17161766
/// Required API Key ACLs:
17171767
/// - addObject
17181768
/// - deleteIndex
17191769
/// - editSettings
17201770
/// <param name="taskID">Unique identifier of a task.</param>
1721-
/// <param name="pushTaskPayload">Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.</param>
1771+
/// <param name="pushTaskPayload"></param>
17221772
/// <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>
17231773
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
17241774
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
@@ -4105,6 +4155,52 @@ public ListTransformationsResponse ListTransformations(
41054155
ListTransformationsAsync(itemsPerPage, page, sort, order, options, cancellationToken)
41064156
);
41074157

4158+
/// <inheritdoc />
4159+
public async Task<WatchResponse> PushAsync(
4160+
string indexName,
4161+
PushTaskPayload pushTaskPayload,
4162+
bool? watch = default,
4163+
RequestOptions options = null,
4164+
CancellationToken cancellationToken = default
4165+
)
4166+
{
4167+
if (indexName == null)
4168+
throw new ArgumentException("Parameter `indexName` is required when calling `Push`.");
4169+
4170+
if (pushTaskPayload == null)
4171+
throw new ArgumentException("Parameter `pushTaskPayload` is required when calling `Push`.");
4172+
4173+
var requestOptions = new InternalRequestOptions(options);
4174+
4175+
requestOptions.PathParameters.Add("indexName", QueryStringHelper.ParameterToString(indexName));
4176+
4177+
requestOptions.AddQueryParameter("watch", watch);
4178+
requestOptions.Data = pushTaskPayload;
4179+
requestOptions.ReadTimeout ??= TimeSpan.FromMilliseconds(180000);
4180+
requestOptions.WriteTimeout ??= TimeSpan.FromMilliseconds(180000);
4181+
requestOptions.ConnectTimeout ??= TimeSpan.FromMilliseconds(180000);
4182+
return await _transport
4183+
.ExecuteRequestAsync<WatchResponse>(
4184+
new HttpMethod("POST"),
4185+
"/1/push/{indexName}",
4186+
requestOptions,
4187+
cancellationToken
4188+
)
4189+
.ConfigureAwait(false);
4190+
}
4191+
4192+
/// <inheritdoc />
4193+
public WatchResponse Push(
4194+
string indexName,
4195+
PushTaskPayload pushTaskPayload,
4196+
bool? watch = default,
4197+
RequestOptions options = null,
4198+
CancellationToken cancellationToken = default
4199+
) =>
4200+
AsyncHelper.RunSync(() =>
4201+
PushAsync(indexName, pushTaskPayload, watch, options, cancellationToken)
4202+
);
4203+
41084204
/// <inheritdoc />
41094205
public async Task<WatchResponse> PushTaskAsync(
41104206
string taskID,

clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/Action.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,4 @@ public enum Action
4141
/// </summary>
4242
[JsonPropertyName("partialUpdateObjectNoCreate")]
4343
PartialUpdateObjectNoCreate = 4,
44-
45-
/// <summary>
46-
/// Enum DeleteObject for value: deleteObject
47-
/// </summary>
48-
[JsonPropertyName("deleteObject")]
49-
DeleteObject = 5,
50-
51-
/// <summary>
52-
/// Enum Delete for value: delete
53-
/// </summary>
54-
[JsonPropertyName("delete")]
55-
Delete = 6,
56-
57-
/// <summary>
58-
/// Enum Clear for value: clear
59-
/// </summary>
60-
[JsonPropertyName("clear")]
61-
Clear = 7,
6244
}

clients/algoliasearch-client-go/algolia/ingestion/api_ingestion.go

Lines changed: 180 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)