Skip to content

Commit 05154a9

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/go-refacto
2 parents 4c7e982 + 736998a commit 05154a9

File tree

207 files changed

+6119
-2033
lines changed

Some content is hidden

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

207 files changed

+6119
-2033
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ runs:
202202
if: ${{ inputs.language == 'swift' }}
203203
id: swiftformat-version
204204
shell: bash
205-
run: echo "SWIFTFORMAT_VERSION=0.55.6" >> $GITHUB_OUTPUT
205+
run: echo "SWIFTFORMAT_VERSION=0.56.1" >> $GITHUB_OUTPUT
206206

207207
- name: Checkout swiftformat
208208
if: ${{ inputs.language == 'swift' }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.15.0
1+
22.16.0

clients/algoliasearch-client-csharp/.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"csharpier": {
6-
"version": "1.0.1",
6+
"version": "1.0.2",
77
"commands": [
88
"csharpier"
99
]

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,8 @@ public EstimateABTestResponse EstimateABTest(
767767
RequestOptions options = null,
768768
CancellationToken cancellationToken = default
769769
) =>
770-
AsyncHelper.RunSync(() => EstimateABTestAsync(estimateABTestRequest, options, cancellationToken)
770+
AsyncHelper.RunSync(() =>
771+
EstimateABTestAsync(estimateABTestRequest, options, cancellationToken)
771772
);
772773

773774
/// <inheritdoc />

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ public SearchResponse<T> Search<T>(
228228
RequestOptions options = null,
229229
CancellationToken cancellationToken = default
230230
) =>
231-
AsyncHelper.RunSync(() => SearchAsync<T>(compositionID, requestBody, options, cancellationToken)
231+
AsyncHelper.RunSync(() =>
232+
SearchAsync<T>(compositionID, requestBody, options, cancellationToken)
232233
);
233234

234235
/// <inheritdoc />

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

Lines changed: 112 additions & 10 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>
@@ -2738,7 +2788,8 @@ public DestinationCreateResponse CreateDestination(
27382788
RequestOptions options = null,
27392789
CancellationToken cancellationToken = default
27402790
) =>
2741-
AsyncHelper.RunSync(() => CreateDestinationAsync(destinationCreate, options, cancellationToken)
2791+
AsyncHelper.RunSync(() =>
2792+
CreateDestinationAsync(destinationCreate, options, cancellationToken)
27422793
);
27432794

27442795
/// <inheritdoc />
@@ -4105,6 +4156,52 @@ public ListTransformationsResponse ListTransformations(
41054156
ListTransformationsAsync(itemsPerPage, page, sort, order, options, cancellationToken)
41064157
);
41074158

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

41924290
/// <inheritdoc />
@@ -4319,7 +4417,8 @@ public List<Destination> SearchDestinations(
43194417
RequestOptions options = null,
43204418
CancellationToken cancellationToken = default
43214419
) =>
4322-
AsyncHelper.RunSync(() => SearchDestinationsAsync(destinationSearch, options, cancellationToken)
4420+
AsyncHelper.RunSync(() =>
4421+
SearchDestinationsAsync(destinationSearch, options, cancellationToken)
43234422
);
43244423

43254424
/// <inheritdoc />
@@ -4488,7 +4587,8 @@ public WatchResponse TriggerDockerSourceDiscover(
44884587
RequestOptions options = null,
44894588
CancellationToken cancellationToken = default
44904589
) =>
4491-
AsyncHelper.RunSync(() => TriggerDockerSourceDiscoverAsync(sourceID, options, cancellationToken)
4590+
AsyncHelper.RunSync(() =>
4591+
TriggerDockerSourceDiscoverAsync(sourceID, options, cancellationToken)
44924592
);
44934593

44944594
/// <inheritdoc />
@@ -4522,7 +4622,8 @@ public TransformationTryResponse TryTransformation(
45224622
RequestOptions options = null,
45234623
CancellationToken cancellationToken = default
45244624
) =>
4525-
AsyncHelper.RunSync(() => TryTransformationAsync(transformationTry, options, cancellationToken)
4625+
AsyncHelper.RunSync(() =>
4626+
TryTransformationAsync(transformationTry, options, cancellationToken)
45264627
);
45274628

45284629
/// <inheritdoc />
@@ -4709,7 +4810,8 @@ public SourceUpdateResponse UpdateSource(
47094810
RequestOptions options = null,
47104811
CancellationToken cancellationToken = default
47114812
) =>
4712-
AsyncHelper.RunSync(() => UpdateSourceAsync(sourceID, sourceUpdate, options, cancellationToken)
4813+
AsyncHelper.RunSync(() =>
4814+
UpdateSourceAsync(sourceID, sourceUpdate, options, cancellationToken)
47134815
);
47144816

47154817
/// <inheritdoc />

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ public BaseResponse CreateConfig(
555555
RequestOptions options = null,
556556
CancellationToken cancellationToken = default
557557
) =>
558-
AsyncHelper.RunSync(() => CreateConfigAsync(configurationWithIndex, options, cancellationToken)
558+
AsyncHelper.RunSync(() =>
559+
CreateConfigAsync(configurationWithIndex, options, cancellationToken)
559560
);
560561

561562
/// <inheritdoc />

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-csharp/algoliasearch/Models/Ingestion/WatchResponse.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ public WatchResponse(string runID)
3838
[JsonPropertyName("runID")]
3939
public string RunID { get; set; }
4040

41+
/// <summary>
42+
/// Universally unique identifier (UUID) of an event.
43+
/// </summary>
44+
/// <value>Universally unique identifier (UUID) of an event.</value>
45+
[JsonPropertyName("eventID")]
46+
public string EventID { get; set; }
47+
4148
/// <summary>
4249
/// when used with discovering or validating sources, the sampled data of your source is returned.
4350
/// </summary>
@@ -59,6 +66,13 @@ public WatchResponse(string runID)
5966
[JsonPropertyName("message")]
6067
public string Message { get; set; }
6168

69+
/// <summary>
70+
/// Date of creation in RFC 3339 format.
71+
/// </summary>
72+
/// <value>Date of creation in RFC 3339 format.</value>
73+
[JsonPropertyName("createdAt")]
74+
public string CreatedAt { get; set; }
75+
6276
/// <summary>
6377
/// Returns the string presentation of the object
6478
/// </summary>
@@ -68,9 +82,11 @@ public override string ToString()
6882
StringBuilder sb = new StringBuilder();
6983
sb.Append("class WatchResponse {\n");
7084
sb.Append(" RunID: ").Append(RunID).Append("\n");
85+
sb.Append(" EventID: ").Append(EventID).Append("\n");
7186
sb.Append(" Data: ").Append(Data).Append("\n");
7287
sb.Append(" Events: ").Append(Events).Append("\n");
7388
sb.Append(" Message: ").Append(Message).Append("\n");
89+
sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n");
7490
sb.Append("}\n");
7591
return sb.ToString();
7692
}
@@ -97,14 +113,16 @@ public override bool Equals(object obj)
97113
}
98114

99115
return (RunID == input.RunID || (RunID != null && RunID.Equals(input.RunID)))
116+
&& (EventID == input.EventID || (EventID != null && EventID.Equals(input.EventID)))
100117
&& (
101118
Data == input.Data || Data != null && input.Data != null && Data.SequenceEqual(input.Data)
102119
)
103120
&& (
104121
Events == input.Events
105122
|| Events != null && input.Events != null && Events.SequenceEqual(input.Events)
106123
)
107-
&& (Message == input.Message || (Message != null && Message.Equals(input.Message)));
124+
&& (Message == input.Message || (Message != null && Message.Equals(input.Message)))
125+
&& (CreatedAt == input.CreatedAt || (CreatedAt != null && CreatedAt.Equals(input.CreatedAt)));
108126
}
109127

110128
/// <summary>
@@ -120,6 +138,10 @@ public override int GetHashCode()
120138
{
121139
hashCode = (hashCode * 59) + RunID.GetHashCode();
122140
}
141+
if (EventID != null)
142+
{
143+
hashCode = (hashCode * 59) + EventID.GetHashCode();
144+
}
123145
if (Data != null)
124146
{
125147
hashCode = (hashCode * 59) + Data.GetHashCode();
@@ -132,6 +154,10 @@ public override int GetHashCode()
132154
{
133155
hashCode = (hashCode * 59) + Message.GetHashCode();
134156
}
157+
if (CreatedAt != null)
158+
{
159+
hashCode = (hashCode * 59) + CreatedAt.GetHashCode();
160+
}
135161
return hashCode;
136162
}
137163
}

clients/algoliasearch-client-csharp/algoliasearch/Models/Search/FetchedIndex.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public FetchedIndex(
3939
string createdAt,
4040
string updatedAt,
4141
int entries,
42-
int dataSize,
43-
int fileSize,
42+
long dataSize,
43+
long fileSize,
4444
int lastBuildTimeS,
4545
int numberOfPendingTasks,
4646
bool pendingTask
@@ -90,14 +90,14 @@ bool pendingTask
9090
/// </summary>
9191
/// <value>Number of bytes of the index in minified format.</value>
9292
[JsonPropertyName("dataSize")]
93-
public int DataSize { get; set; }
93+
public long DataSize { get; set; }
9494

9595
/// <summary>
9696
/// Number of bytes of the index binary file.
9797
/// </summary>
9898
/// <value>Number of bytes of the index binary file.</value>
9999
[JsonPropertyName("fileSize")]
100-
public int FileSize { get; set; }
100+
public long FileSize { get; set; }
101101

102102
/// <summary>
103103
/// Last build time.

0 commit comments

Comments
 (0)