Skip to content

Commit dceb3c8

Browse files
feat(specs): document runMetadata parameter (generated)
algolia/api-clients-automation#5087 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Devin Beeuwkes <[email protected]>
1 parent d60441d commit dceb3c8

File tree

3 files changed

+226
-17
lines changed

3 files changed

+226
-17
lines changed

algoliasearch/src/main/java/com/algolia/api/IngestionClient.java

Lines changed: 126 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3641,6 +3641,31 @@ public CompletableFuture<RunSourceResponse> runSourceAsync(@Nonnull String sourc
36413641
return this.runSourceAsync(sourceID, null, null);
36423642
}
36433643

3644+
/**
3645+
* Runs a task. You can check the status of task runs with the observability endpoints.
3646+
*
3647+
* @param taskID Unique identifier of a task. (required)
3648+
* @param runTaskPayload (optional)
3649+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
3650+
* the transporter requestOptions.
3651+
* @throws AlgoliaRuntimeException If it fails to process the API call
3652+
*/
3653+
public RunResponse runTask(@Nonnull String taskID, RunTaskPayload runTaskPayload, @Nullable RequestOptions requestOptions)
3654+
throws AlgoliaRuntimeException {
3655+
return LaunderThrowable.await(runTaskAsync(taskID, runTaskPayload, requestOptions));
3656+
}
3657+
3658+
/**
3659+
* Runs a task. You can check the status of task runs with the observability endpoints.
3660+
*
3661+
* @param taskID Unique identifier of a task. (required)
3662+
* @param runTaskPayload (optional)
3663+
* @throws AlgoliaRuntimeException If it fails to process the API call
3664+
*/
3665+
public RunResponse runTask(@Nonnull String taskID, RunTaskPayload runTaskPayload) throws AlgoliaRuntimeException {
3666+
return this.runTask(taskID, runTaskPayload, null);
3667+
}
3668+
36443669
/**
36453670
* Runs a task. You can check the status of task runs with the observability endpoints.
36463671
*
@@ -3650,7 +3675,7 @@ public CompletableFuture<RunSourceResponse> runSourceAsync(@Nonnull String sourc
36503675
* @throws AlgoliaRuntimeException If it fails to process the API call
36513676
*/
36523677
public RunResponse runTask(@Nonnull String taskID, @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
3653-
return LaunderThrowable.await(runTaskAsync(taskID, requestOptions));
3678+
return this.runTask(taskID, null, requestOptions);
36543679
}
36553680

36563681
/**
@@ -3660,27 +3685,56 @@ public RunResponse runTask(@Nonnull String taskID, @Nullable RequestOptions requ
36603685
* @throws AlgoliaRuntimeException If it fails to process the API call
36613686
*/
36623687
public RunResponse runTask(@Nonnull String taskID) throws AlgoliaRuntimeException {
3663-
return this.runTask(taskID, null);
3688+
return this.runTask(taskID, null, null);
36643689
}
36653690

36663691
/**
36673692
* (asynchronously) Runs a task. You can check the status of task runs with the observability
36683693
* endpoints.
36693694
*
36703695
* @param taskID Unique identifier of a task. (required)
3696+
* @param runTaskPayload (optional)
36713697
* @param requestOptions The requestOptions to send along with the query, they will be merged with
36723698
* the transporter requestOptions.
36733699
* @throws AlgoliaRuntimeException If it fails to process the API call
36743700
*/
3675-
public CompletableFuture<RunResponse> runTaskAsync(@Nonnull String taskID, @Nullable RequestOptions requestOptions)
3676-
throws AlgoliaRuntimeException {
3701+
public CompletableFuture<RunResponse> runTaskAsync(
3702+
@Nonnull String taskID,
3703+
RunTaskPayload runTaskPayload,
3704+
@Nullable RequestOptions requestOptions
3705+
) throws AlgoliaRuntimeException {
36773706
Parameters.requireNonNull(taskID, "Parameter `taskID` is required when calling `runTask`.");
36783707

3679-
HttpRequest request = HttpRequest.builder().setPath("/2/tasks/{taskID}/run", taskID).setMethod("POST").build();
3680-
3708+
HttpRequest request = HttpRequest.builder().setPath("/2/tasks/{taskID}/run", taskID).setMethod("POST").setBody(runTaskPayload).build();
36813709
return executeAsync(request, requestOptions, new TypeReference<RunResponse>() {});
36823710
}
36833711

3712+
/**
3713+
* (asynchronously) Runs a task. You can check the status of task runs with the observability
3714+
* endpoints.
3715+
*
3716+
* @param taskID Unique identifier of a task. (required)
3717+
* @param runTaskPayload (optional)
3718+
* @throws AlgoliaRuntimeException If it fails to process the API call
3719+
*/
3720+
public CompletableFuture<RunResponse> runTaskAsync(@Nonnull String taskID, RunTaskPayload runTaskPayload) throws AlgoliaRuntimeException {
3721+
return this.runTaskAsync(taskID, runTaskPayload, null);
3722+
}
3723+
3724+
/**
3725+
* (asynchronously) Runs a task. You can check the status of task runs with the observability
3726+
* endpoints.
3727+
*
3728+
* @param taskID Unique identifier of a task. (required)
3729+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
3730+
* the transporter requestOptions.
3731+
* @throws AlgoliaRuntimeException If it fails to process the API call
3732+
*/
3733+
public CompletableFuture<RunResponse> runTaskAsync(@Nonnull String taskID, @Nullable RequestOptions requestOptions)
3734+
throws AlgoliaRuntimeException {
3735+
return this.runTaskAsync(taskID, null, requestOptions);
3736+
}
3737+
36843738
/**
36853739
* (asynchronously) Runs a task. You can check the status of task runs with the observability
36863740
* endpoints.
@@ -3689,54 +3743,84 @@ public CompletableFuture<RunResponse> runTaskAsync(@Nonnull String taskID, @Null
36893743
* @throws AlgoliaRuntimeException If it fails to process the API call
36903744
*/
36913745
public CompletableFuture<RunResponse> runTaskAsync(@Nonnull String taskID) throws AlgoliaRuntimeException {
3692-
return this.runTaskAsync(taskID, null);
3746+
return this.runTaskAsync(taskID, null, null);
36933747
}
36943748

36953749
/**
36963750
* Runs a task using the v1 endpoint, please use `runTask` instead. You can check the status of
36973751
* task runs with the observability endpoints.
36983752
*
36993753
* @param taskID Unique identifier of a task. (required)
3754+
* @param runTaskPayload (optional)
37003755
* @param requestOptions The requestOptions to send along with the query, they will be merged with
37013756
* the transporter requestOptions.
37023757
* @throws AlgoliaRuntimeException If it fails to process the API call
37033758
* @deprecated
37043759
*/
37053760
@Deprecated
3706-
public RunResponse runTaskV1(@Nonnull String taskID, @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
3707-
return LaunderThrowable.await(runTaskV1Async(taskID, requestOptions));
3761+
public RunResponse runTaskV1(@Nonnull String taskID, RunTaskPayload runTaskPayload, @Nullable RequestOptions requestOptions)
3762+
throws AlgoliaRuntimeException {
3763+
return LaunderThrowable.await(runTaskV1Async(taskID, runTaskPayload, requestOptions));
37083764
}
37093765

37103766
/**
37113767
* Runs a task using the v1 endpoint, please use `runTask` instead. You can check the status of
37123768
* task runs with the observability endpoints.
37133769
*
37143770
* @param taskID Unique identifier of a task. (required)
3771+
* @param runTaskPayload (optional)
37153772
* @throws AlgoliaRuntimeException If it fails to process the API call
37163773
* @deprecated
37173774
*/
37183775
@Deprecated
3776+
public RunResponse runTaskV1(@Nonnull String taskID, RunTaskPayload runTaskPayload) throws AlgoliaRuntimeException {
3777+
return this.runTaskV1(taskID, runTaskPayload, null);
3778+
}
3779+
3780+
/**
3781+
* Runs a task using the v1 endpoint, please use `runTask` instead. You can check the status of
3782+
* task runs with the observability endpoints.
3783+
*
3784+
* @param taskID Unique identifier of a task. (required)
3785+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
3786+
* the transporter requestOptions.
3787+
* @throws AlgoliaRuntimeException If it fails to process the API call
3788+
*/
3789+
public RunResponse runTaskV1(@Nonnull String taskID, @Nullable RequestOptions requestOptions) throws AlgoliaRuntimeException {
3790+
return this.runTaskV1(taskID, null, requestOptions);
3791+
}
3792+
3793+
/**
3794+
* Runs a task using the v1 endpoint, please use `runTask` instead. You can check the status of
3795+
* task runs with the observability endpoints.
3796+
*
3797+
* @param taskID Unique identifier of a task. (required)
3798+
* @throws AlgoliaRuntimeException If it fails to process the API call
3799+
*/
37193800
public RunResponse runTaskV1(@Nonnull String taskID) throws AlgoliaRuntimeException {
3720-
return this.runTaskV1(taskID, null);
3801+
return this.runTaskV1(taskID, null, null);
37213802
}
37223803

37233804
/**
37243805
* (asynchronously) Runs a task using the v1 endpoint, please use `runTask` instead. You can check
37253806
* the status of task runs with the observability endpoints.
37263807
*
37273808
* @param taskID Unique identifier of a task. (required)
3809+
* @param runTaskPayload (optional)
37283810
* @param requestOptions The requestOptions to send along with the query, they will be merged with
37293811
* the transporter requestOptions.
37303812
* @throws AlgoliaRuntimeException If it fails to process the API call
37313813
* @deprecated
37323814
*/
37333815
@Deprecated
3734-
public CompletableFuture<RunResponse> runTaskV1Async(@Nonnull String taskID, @Nullable RequestOptions requestOptions)
3735-
throws AlgoliaRuntimeException {
3816+
public CompletableFuture<RunResponse> runTaskV1Async(
3817+
@Nonnull String taskID,
3818+
RunTaskPayload runTaskPayload,
3819+
@Nullable RequestOptions requestOptions
3820+
) throws AlgoliaRuntimeException {
37363821
Parameters.requireNonNull(taskID, "Parameter `taskID` is required when calling `runTaskV1`.");
37373822

3738-
HttpRequest request = HttpRequest.builder().setPath("/1/tasks/{taskID}/run", taskID).setMethod("POST").build();
3739-
3823+
HttpRequest request = HttpRequest.builder().setPath("/1/tasks/{taskID}/run", taskID).setMethod("POST").setBody(runTaskPayload).build();
37403824
return executeAsync(request, requestOptions, new TypeReference<RunResponse>() {});
37413825
}
37423826

@@ -3745,12 +3829,39 @@ public CompletableFuture<RunResponse> runTaskV1Async(@Nonnull String taskID, @Nu
37453829
* the status of task runs with the observability endpoints.
37463830
*
37473831
* @param taskID Unique identifier of a task. (required)
3832+
* @param runTaskPayload (optional)
37483833
* @throws AlgoliaRuntimeException If it fails to process the API call
37493834
* @deprecated
37503835
*/
37513836
@Deprecated
3837+
public CompletableFuture<RunResponse> runTaskV1Async(@Nonnull String taskID, RunTaskPayload runTaskPayload)
3838+
throws AlgoliaRuntimeException {
3839+
return this.runTaskV1Async(taskID, runTaskPayload, null);
3840+
}
3841+
3842+
/**
3843+
* (asynchronously) Runs a task using the v1 endpoint, please use `runTask` instead. You can check
3844+
* the status of task runs with the observability endpoints.
3845+
*
3846+
* @param taskID Unique identifier of a task. (required)
3847+
* @param requestOptions The requestOptions to send along with the query, they will be merged with
3848+
* the transporter requestOptions.
3849+
* @throws AlgoliaRuntimeException If it fails to process the API call
3850+
*/
3851+
public CompletableFuture<RunResponse> runTaskV1Async(@Nonnull String taskID, @Nullable RequestOptions requestOptions)
3852+
throws AlgoliaRuntimeException {
3853+
return this.runTaskV1Async(taskID, null, requestOptions);
3854+
}
3855+
3856+
/**
3857+
* (asynchronously) Runs a task using the v1 endpoint, please use `runTask` instead. You can check
3858+
* the status of task runs with the observability endpoints.
3859+
*
3860+
* @param taskID Unique identifier of a task. (required)
3861+
* @throws AlgoliaRuntimeException If it fails to process the API call
3862+
*/
37523863
public CompletableFuture<RunResponse> runTaskV1Async(@Nonnull String taskID) throws AlgoliaRuntimeException {
3753-
return this.runTaskV1Async(taskID, null);
3864+
return this.runTaskV1Async(taskID, null, null);
37543865
}
37553866

37563867
/**

algoliasearch/src/main/java/com/algolia/model/ingestion/RunSourcePayload.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
import com.fasterxml.jackson.annotation.*;
77
import com.fasterxml.jackson.databind.annotation.*;
88
import java.util.ArrayList;
9+
import java.util.HashMap;
910
import java.util.List;
11+
import java.util.Map;
1012
import java.util.Objects;
1113

1214
/** RunSourcePayload */
@@ -24,6 +26,9 @@ public class RunSourcePayload {
2426
@JsonProperty("entityType")
2527
private EntityType entityType;
2628

29+
@JsonProperty("runMetadata")
30+
private Map<String, Object> runMetadata;
31+
2732
public RunSourcePayload setIndexToInclude(List<String> indexToInclude) {
2833
this.indexToInclude = indexToInclude;
2934
return this;
@@ -92,6 +97,25 @@ public EntityType getEntityType() {
9297
return entityType;
9398
}
9499

100+
public RunSourcePayload setRunMetadata(Map<String, Object> runMetadata) {
101+
this.runMetadata = runMetadata;
102+
return this;
103+
}
104+
105+
public RunSourcePayload putRunMetadata(String key, Object runMetadataItem) {
106+
if (this.runMetadata == null) {
107+
this.runMetadata = new HashMap<>();
108+
}
109+
this.runMetadata.put(key, runMetadataItem);
110+
return this;
111+
}
112+
113+
/** Additional information that will be passed to the created runs. */
114+
@javax.annotation.Nullable
115+
public Map<String, Object> getRunMetadata() {
116+
return runMetadata;
117+
}
118+
95119
@Override
96120
public boolean equals(Object o) {
97121
if (this == o) {
@@ -105,13 +129,14 @@ public boolean equals(Object o) {
105129
Objects.equals(this.indexToInclude, runSourcePayload.indexToInclude) &&
106130
Objects.equals(this.indexToExclude, runSourcePayload.indexToExclude) &&
107131
Objects.equals(this.entityIDs, runSourcePayload.entityIDs) &&
108-
Objects.equals(this.entityType, runSourcePayload.entityType)
132+
Objects.equals(this.entityType, runSourcePayload.entityType) &&
133+
Objects.equals(this.runMetadata, runSourcePayload.runMetadata)
109134
);
110135
}
111136

112137
@Override
113138
public int hashCode() {
114-
return Objects.hash(indexToInclude, indexToExclude, entityIDs, entityType);
139+
return Objects.hash(indexToInclude, indexToExclude, entityIDs, entityType, runMetadata);
115140
}
116141

117142
@Override
@@ -122,6 +147,7 @@ public String toString() {
122147
sb.append(" indexToExclude: ").append(toIndentedString(indexToExclude)).append("\n");
123148
sb.append(" entityIDs: ").append(toIndentedString(entityIDs)).append("\n");
124149
sb.append(" entityType: ").append(toIndentedString(entityType)).append("\n");
150+
sb.append(" runMetadata: ").append(toIndentedString(runMetadata)).append("\n");
125151
sb.append("}");
126152
return sb.toString();
127153
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
2+
// - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
package com.algolia.model.ingestion;
5+
6+
import com.fasterxml.jackson.annotation.*;
7+
import com.fasterxml.jackson.databind.annotation.*;
8+
import java.util.HashMap;
9+
import java.util.Map;
10+
import java.util.Objects;
11+
12+
/** RunTaskPayload */
13+
public class RunTaskPayload {
14+
15+
@JsonProperty("runMetadata")
16+
private Map<String, Object> runMetadata;
17+
18+
public RunTaskPayload setRunMetadata(Map<String, Object> runMetadata) {
19+
this.runMetadata = runMetadata;
20+
return this;
21+
}
22+
23+
public RunTaskPayload putRunMetadata(String key, Object runMetadataItem) {
24+
if (this.runMetadata == null) {
25+
this.runMetadata = new HashMap<>();
26+
}
27+
this.runMetadata.put(key, runMetadataItem);
28+
return this;
29+
}
30+
31+
/** Additional information that will be passed to the created run. */
32+
@javax.annotation.Nullable
33+
public Map<String, Object> getRunMetadata() {
34+
return runMetadata;
35+
}
36+
37+
@Override
38+
public boolean equals(Object o) {
39+
if (this == o) {
40+
return true;
41+
}
42+
if (o == null || getClass() != o.getClass()) {
43+
return false;
44+
}
45+
RunTaskPayload runTaskPayload = (RunTaskPayload) o;
46+
return Objects.equals(this.runMetadata, runTaskPayload.runMetadata);
47+
}
48+
49+
@Override
50+
public int hashCode() {
51+
return Objects.hash(runMetadata);
52+
}
53+
54+
@Override
55+
public String toString() {
56+
StringBuilder sb = new StringBuilder();
57+
sb.append("class RunTaskPayload {\n");
58+
sb.append(" runMetadata: ").append(toIndentedString(runMetadata)).append("\n");
59+
sb.append("}");
60+
return sb.toString();
61+
}
62+
63+
/**
64+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
65+
*/
66+
private String toIndentedString(Object o) {
67+
if (o == null) {
68+
return "null";
69+
}
70+
return o.toString().replace("\n", "\n ");
71+
}
72+
}

0 commit comments

Comments
 (0)