Skip to content

Commit a42e72e

Browse files
feat(specs): add new ingestion property for push (#5007) (generated) [skip ci]
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
1 parent 973cc0c commit a42e72e

File tree

36 files changed

+244
-58
lines changed

36 files changed

+244
-58
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,6 +1695,7 @@ ListTransformationsResponse ListTransformations(
16951695
/// <param name="indexName">Name of the index on which to perform the operation.</param>
16961696
/// <param name="pushTaskPayload"></param>
16971697
/// <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="referenceIndexName">This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name). (optional)</param>
16981699
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
16991700
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
17001701
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
@@ -1705,6 +1706,7 @@ Task<WatchResponse> PushAsync(
17051706
string indexName,
17061707
PushTaskPayload pushTaskPayload,
17071708
bool? watch = default,
1709+
string referenceIndexName = default,
17081710
RequestOptions options = null,
17091711
CancellationToken cancellationToken = default
17101712
);
@@ -1720,6 +1722,7 @@ Task<WatchResponse> PushAsync(
17201722
/// <param name="indexName">Name of the index on which to perform the operation.</param>
17211723
/// <param name="pushTaskPayload"></param>
17221724
/// <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>
1725+
/// <param name="referenceIndexName">This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name). (optional)</param>
17231726
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
17241727
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
17251728
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
@@ -1730,6 +1733,7 @@ WatchResponse Push(
17301733
string indexName,
17311734
PushTaskPayload pushTaskPayload,
17321735
bool? watch = default,
1736+
string referenceIndexName = default,
17331737
RequestOptions options = null,
17341738
CancellationToken cancellationToken = default
17351739
);
@@ -4161,6 +4165,7 @@ public async Task<WatchResponse> PushAsync(
41614165
string indexName,
41624166
PushTaskPayload pushTaskPayload,
41634167
bool? watch = default,
4168+
string referenceIndexName = default,
41644169
RequestOptions options = null,
41654170
CancellationToken cancellationToken = default
41664171
)
@@ -4176,6 +4181,7 @@ public async Task<WatchResponse> PushAsync(
41764181
requestOptions.PathParameters.Add("indexName", QueryStringHelper.ParameterToString(indexName));
41774182

41784183
requestOptions.AddQueryParameter("watch", watch);
4184+
requestOptions.AddQueryParameter("referenceIndexName", referenceIndexName);
41794185
requestOptions.Data = pushTaskPayload;
41804186
requestOptions.ReadTimeout ??= TimeSpan.FromMilliseconds(180000);
41814187
requestOptions.WriteTimeout ??= TimeSpan.FromMilliseconds(180000);
@@ -4195,11 +4201,12 @@ public WatchResponse Push(
41954201
string indexName,
41964202
PushTaskPayload pushTaskPayload,
41974203
bool? watch = default,
4204+
string referenceIndexName = default,
41984205
RequestOptions options = null,
41994206
CancellationToken cancellationToken = default
42004207
) =>
42014208
AsyncHelper.RunSync(() =>
4202-
PushAsync(indexName, pushTaskPayload, watch, options, cancellationToken)
4209+
PushAsync(indexName, pushTaskPayload, watch, referenceIndexName, options, cancellationToken)
42034210
);
42044211

42054212
/// <inheritdoc />

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

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

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/api/IngestionClient.java

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3133,6 +3133,9 @@ public CompletableFuture<ListTransformationsResponse> listTransformationsAsync()
31333133
* @param pushTaskPayload (required)
31343134
* @param watch When provided, the push operation will be synchronous and the API will wait for
31353135
* the ingestion to be finished before responding. (optional)
3136+
* @param referenceIndexName This is required when targeting an index that does not have a push
3137+
* connector setup (e.g. a tmp index), but you wish to attach another index's transformation
3138+
* to it (e.g. the source index name). (optional)
31363139
* @param requestOptions The requestOptions to send along with the query, they will be merged with
31373140
* the transporter requestOptions.
31383141
* @throws AlgoliaRuntimeException If it fails to process the API call
@@ -3141,9 +3144,10 @@ public WatchResponse push(
31413144
@Nonnull String indexName,
31423145
@Nonnull PushTaskPayload pushTaskPayload,
31433146
Boolean watch,
3147+
String referenceIndexName,
31443148
@Nullable RequestOptions requestOptions
31453149
) throws AlgoliaRuntimeException {
3146-
return LaunderThrowable.await(pushAsync(indexName, pushTaskPayload, watch, requestOptions));
3150+
return LaunderThrowable.await(pushAsync(indexName, pushTaskPayload, watch, referenceIndexName, requestOptions));
31473151
}
31483152

31493153
/**
@@ -3160,11 +3164,14 @@ public WatchResponse push(
31603164
* @param pushTaskPayload (required)
31613165
* @param watch When provided, the push operation will be synchronous and the API will wait for
31623166
* the ingestion to be finished before responding. (optional)
3167+
* @param referenceIndexName This is required when targeting an index that does not have a push
3168+
* connector setup (e.g. a tmp index), but you wish to attach another index's transformation
3169+
* to it (e.g. the source index name). (optional)
31633170
* @throws AlgoliaRuntimeException If it fails to process the API call
31643171
*/
3165-
public WatchResponse push(@Nonnull String indexName, @Nonnull PushTaskPayload pushTaskPayload, Boolean watch)
3172+
public WatchResponse push(@Nonnull String indexName, @Nonnull PushTaskPayload pushTaskPayload, Boolean watch, String referenceIndexName)
31663173
throws AlgoliaRuntimeException {
3167-
return this.push(indexName, pushTaskPayload, watch, null);
3174+
return this.push(indexName, pushTaskPayload, watch, referenceIndexName, null);
31683175
}
31693176

31703177
/**
@@ -3185,7 +3192,7 @@ public WatchResponse push(@Nonnull String indexName, @Nonnull PushTaskPayload pu
31853192
*/
31863193
public WatchResponse push(@Nonnull String indexName, @Nonnull PushTaskPayload pushTaskPayload, @Nullable RequestOptions requestOptions)
31873194
throws AlgoliaRuntimeException {
3188-
return this.push(indexName, pushTaskPayload, null, requestOptions);
3195+
return this.push(indexName, pushTaskPayload, null, null, requestOptions);
31893196
}
31903197

31913198
/**
@@ -3203,7 +3210,7 @@ public WatchResponse push(@Nonnull String indexName, @Nonnull PushTaskPayload pu
32033210
* @throws AlgoliaRuntimeException If it fails to process the API call
32043211
*/
32053212
public WatchResponse push(@Nonnull String indexName, @Nonnull PushTaskPayload pushTaskPayload) throws AlgoliaRuntimeException {
3206-
return this.push(indexName, pushTaskPayload, null, null);
3213+
return this.push(indexName, pushTaskPayload, null, null, null);
32073214
}
32083215

32093216
/**
@@ -3220,6 +3227,9 @@ public WatchResponse push(@Nonnull String indexName, @Nonnull PushTaskPayload pu
32203227
* @param pushTaskPayload (required)
32213228
* @param watch When provided, the push operation will be synchronous and the API will wait for
32223229
* the ingestion to be finished before responding. (optional)
3230+
* @param referenceIndexName This is required when targeting an index that does not have a push
3231+
* connector setup (e.g. a tmp index), but you wish to attach another index's transformation
3232+
* to it (e.g. the source index name). (optional)
32233233
* @param requestOptions The requestOptions to send along with the query, they will be merged with
32243234
* the transporter requestOptions.
32253235
* @throws AlgoliaRuntimeException If it fails to process the API call
@@ -3228,6 +3238,7 @@ public CompletableFuture<WatchResponse> pushAsync(
32283238
@Nonnull String indexName,
32293239
@Nonnull PushTaskPayload pushTaskPayload,
32303240
Boolean watch,
3241+
String referenceIndexName,
32313242
@Nullable RequestOptions requestOptions
32323243
) throws AlgoliaRuntimeException {
32333244
Parameters.requireNonNull(indexName, "Parameter `indexName` is required when calling `push`.");
@@ -3239,6 +3250,7 @@ public CompletableFuture<WatchResponse> pushAsync(
32393250
.setMethod("POST")
32403251
.setBody(pushTaskPayload)
32413252
.addQueryParameter("watch", watch)
3253+
.addQueryParameter("referenceIndexName", referenceIndexName)
32423254
.build();
32433255
return executeAsync(
32443256
request,
@@ -3265,11 +3277,18 @@ public CompletableFuture<WatchResponse> pushAsync(
32653277
* @param pushTaskPayload (required)
32663278
* @param watch When provided, the push operation will be synchronous and the API will wait for
32673279
* the ingestion to be finished before responding. (optional)
3280+
* @param referenceIndexName This is required when targeting an index that does not have a push
3281+
* connector setup (e.g. a tmp index), but you wish to attach another index's transformation
3282+
* to it (e.g. the source index name). (optional)
32683283
* @throws AlgoliaRuntimeException If it fails to process the API call
32693284
*/
3270-
public CompletableFuture<WatchResponse> pushAsync(@Nonnull String indexName, @Nonnull PushTaskPayload pushTaskPayload, Boolean watch)
3271-
throws AlgoliaRuntimeException {
3272-
return this.pushAsync(indexName, pushTaskPayload, watch, null);
3285+
public CompletableFuture<WatchResponse> pushAsync(
3286+
@Nonnull String indexName,
3287+
@Nonnull PushTaskPayload pushTaskPayload,
3288+
Boolean watch,
3289+
String referenceIndexName
3290+
) throws AlgoliaRuntimeException {
3291+
return this.pushAsync(indexName, pushTaskPayload, watch, referenceIndexName, null);
32733292
}
32743293

32753294
/**
@@ -3293,7 +3312,7 @@ public CompletableFuture<WatchResponse> pushAsync(
32933312
@Nonnull PushTaskPayload pushTaskPayload,
32943313
@Nullable RequestOptions requestOptions
32953314
) throws AlgoliaRuntimeException {
3296-
return this.pushAsync(indexName, pushTaskPayload, null, requestOptions);
3315+
return this.pushAsync(indexName, pushTaskPayload, null, null, requestOptions);
32973316
}
32983317

32993318
/**
@@ -3312,7 +3331,7 @@ public CompletableFuture<WatchResponse> pushAsync(
33123331
*/
33133332
public CompletableFuture<WatchResponse> pushAsync(@Nonnull String indexName, @Nonnull PushTaskPayload pushTaskPayload)
33143333
throws AlgoliaRuntimeException {
3315-
return this.pushAsync(indexName, pushTaskPayload, null, null);
3334+
return this.pushAsync(indexName, pushTaskPayload, null, null, null);
33163335
}
33173336

33183337
/**

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/api/SearchClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6838,6 +6838,7 @@ public <T> WatchResponse saveObjectsWithTransformation(
68386838
indexName,
68396839
new PushTaskPayload().setAction(com.algolia.model.ingestion.Action.ADD_OBJECT).setRecords(this.objectsToPushTaskRecords(objects)),
68406840
waitForTasks,
6841+
null,
68416842
requestOptions
68426843
);
68436844
}
@@ -7095,6 +7096,7 @@ public <T> WatchResponse partialUpdateObjectsWithTransformation(
70957096
)
70967097
.setRecords(this.objectsToPushTaskRecords(objects)),
70977098
waitForTasks,
7099+
null,
70987100
requestOptions
70997101
);
71007102
}

clients/algoliasearch-client-javascript/packages/ingestion/model/clientMethodProps.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,10 @@ export type PushProps = {
593593
* When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
594594
*/
595595
watch?: boolean | undefined;
596+
/**
597+
* This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index\'s transformation to it (e.g. the source index name).
598+
*/
599+
referenceIndexName?: string | undefined;
596600
};
597601

598602
/**

clients/algoliasearch-client-javascript/packages/ingestion/src/ingestionClient.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1714,9 +1714,13 @@ export function createIngestionClient({
17141714
* @param push.indexName - Name of the index on which to perform the operation.
17151715
* @param push.pushTaskPayload - The pushTaskPayload object.
17161716
* @param push.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
1717+
* @param push.referenceIndexName - This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index\'s transformation to it (e.g. the source index name).
17171718
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
17181719
*/
1719-
push({ indexName, pushTaskPayload, watch }: PushProps, requestOptions?: RequestOptions): Promise<WatchResponse> {
1720+
push(
1721+
{ indexName, pushTaskPayload, watch, referenceIndexName }: PushProps,
1722+
requestOptions?: RequestOptions,
1723+
): Promise<WatchResponse> {
17201724
if (!indexName) {
17211725
throw new Error('Parameter `indexName` is required when calling `push`.');
17221726
}
@@ -1740,6 +1744,10 @@ export function createIngestionClient({
17401744
queryParameters['watch'] = watch.toString();
17411745
}
17421746

1747+
if (referenceIndexName !== undefined) {
1748+
queryParameters['referenceIndexName'] = referenceIndexName.toString();
1749+
}
1750+
17431751
const request: Request = {
17441752
method: 'POST',
17451753
path: requestPath,

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/IngestionClient.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,15 +931,17 @@ public class IngestionClient(
931931
* @param indexName Name of the index on which to perform the operation.
932932
* @param pushTaskPayload
933933
* @param watch When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
934+
* @param referenceIndexName This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name).
934935
* @param requestOptions additional request configuration.
935936
*/
936-
public suspend fun push(indexName: String, pushTaskPayload: PushTaskPayload, watch: Boolean? = null, requestOptions: RequestOptions? = null): WatchResponse {
937+
public suspend fun push(indexName: String, pushTaskPayload: PushTaskPayload, watch: Boolean? = null, referenceIndexName: String? = null, requestOptions: RequestOptions? = null): WatchResponse {
937938
require(indexName.isNotBlank()) { "Parameter `indexName` is required when calling `push`." }
938939
val requestConfig = RequestConfig(
939940
method = RequestMethod.POST,
940941
path = listOf("1", "push", "$indexName"),
941942
query = buildMap {
942943
watch?.let { put("watch", it) }
944+
referenceIndexName?.let { put("referenceIndexName", it) }
943945
},
944946
body = pushTaskPayload,
945947
)

clients/algoliasearch-client-php/lib/Api/IngestionClient.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,12 +1814,13 @@ public function listTransformations($itemsPerPage = null, $page = null, $sort =
18141814
*
18151815
* @see PushTaskPayload
18161816
*
1817-
* @param bool $watch When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding. (optional)
1818-
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
1817+
* @param bool $watch When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding. (optional)
1818+
* @param string $referenceIndexName This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name). (optional)
1819+
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
18191820
*
18201821
* @return array<string, mixed>|WatchResponse
18211822
*/
1822-
public function push($indexName, $pushTaskPayload, $watch = null, $requestOptions = [])
1823+
public function push($indexName, $pushTaskPayload, $watch = null, $referenceIndexName = null, $requestOptions = [])
18231824
{
18241825
// verify the required parameter 'indexName' is set
18251826
if (!isset($indexName)) {
@@ -1843,6 +1844,10 @@ public function push($indexName, $pushTaskPayload, $watch = null, $requestOption
18431844
$queryParameters['watch'] = $watch;
18441845
}
18451846

1847+
if (null !== $referenceIndexName) {
1848+
$queryParameters['referenceIndexName'] = $referenceIndexName;
1849+
}
1850+
18461851
// path params
18471852
if (null !== $indexName) {
18481853
$resourcePath = str_replace(

0 commit comments

Comments
 (0)