Skip to content

Commit a3935bd

Browse files
algolia-botshortcutsmillotp
committed
fix(specs): ingestion push task payload [skip-bc] (generated)
algolia/api-clients-automation#3607 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 5d1bc3d commit a3935bd

File tree

3 files changed

+62
-46
lines changed

3 files changed

+62
-46
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3074,54 +3074,54 @@ public CompletableFuture<ListTransformationsResponse> listTransformationsAsync()
30743074
* with the observability endpoints.
30753075
*
30763076
* @param taskID Unique identifier of a task. (required)
3077-
* @param batchWriteParams Request body of a Search API `batch` request that will be pushed in the
3077+
* @param pushTaskPayload Request body of a Search API `batch` request that will be pushed in the
30783078
* Connectors pipeline. (required)
30793079
* @param requestOptions The requestOptions to send along with the query, they will be merged with
30803080
* the transporter requestOptions.
30813081
* @throws AlgoliaRuntimeException If it fails to process the API call
30823082
*/
3083-
public RunResponse pushTask(@Nonnull String taskID, @Nonnull BatchWriteParams batchWriteParams, RequestOptions requestOptions)
3083+
public RunResponse pushTask(@Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload, RequestOptions requestOptions)
30843084
throws AlgoliaRuntimeException {
3085-
return LaunderThrowable.await(pushTaskAsync(taskID, batchWriteParams, requestOptions));
3085+
return LaunderThrowable.await(pushTaskAsync(taskID, pushTaskPayload, requestOptions));
30863086
}
30873087

30883088
/**
30893089
* Push a `batch` request payload through the Pipeline. You can check the status of task pushes
30903090
* with the observability endpoints.
30913091
*
30923092
* @param taskID Unique identifier of a task. (required)
3093-
* @param batchWriteParams Request body of a Search API `batch` request that will be pushed in the
3093+
* @param pushTaskPayload Request body of a Search API `batch` request that will be pushed in the
30943094
* Connectors pipeline. (required)
30953095
* @throws AlgoliaRuntimeException If it fails to process the API call
30963096
*/
3097-
public RunResponse pushTask(@Nonnull String taskID, @Nonnull BatchWriteParams batchWriteParams) throws AlgoliaRuntimeException {
3098-
return this.pushTask(taskID, batchWriteParams, null);
3097+
public RunResponse pushTask(@Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload) throws AlgoliaRuntimeException {
3098+
return this.pushTask(taskID, pushTaskPayload, null);
30993099
}
31003100

31013101
/**
31023102
* (asynchronously) Push a `batch` request payload through the Pipeline. You can check the status
31033103
* of task pushes with the observability endpoints.
31043104
*
31053105
* @param taskID Unique identifier of a task. (required)
3106-
* @param batchWriteParams Request body of a Search API `batch` request that will be pushed in the
3106+
* @param pushTaskPayload Request body of a Search API `batch` request that will be pushed in the
31073107
* Connectors pipeline. (required)
31083108
* @param requestOptions The requestOptions to send along with the query, they will be merged with
31093109
* the transporter requestOptions.
31103110
* @throws AlgoliaRuntimeException If it fails to process the API call
31113111
*/
31123112
public CompletableFuture<RunResponse> pushTaskAsync(
31133113
@Nonnull String taskID,
3114-
@Nonnull BatchWriteParams batchWriteParams,
3114+
@Nonnull PushTaskPayload pushTaskPayload,
31153115
RequestOptions requestOptions
31163116
) throws AlgoliaRuntimeException {
31173117
Parameters.requireNonNull(taskID, "Parameter `taskID` is required when calling `pushTask`.");
31183118

3119-
Parameters.requireNonNull(batchWriteParams, "Parameter `batchWriteParams` is required when calling `pushTask`.");
3119+
Parameters.requireNonNull(pushTaskPayload, "Parameter `pushTaskPayload` is required when calling `pushTask`.");
31203120

31213121
HttpRequest request = HttpRequest.builder()
31223122
.setPath("/2/tasks/{taskID}/push", taskID)
31233123
.setMethod("POST")
3124-
.setBody(batchWriteParams)
3124+
.setBody(pushTaskPayload)
31253125
.build();
31263126
return executeAsync(request, requestOptions, new TypeReference<RunResponse>() {});
31273127
}
@@ -3131,13 +3131,13 @@ public CompletableFuture<RunResponse> pushTaskAsync(
31313131
* of task pushes with the observability endpoints.
31323132
*
31333133
* @param taskID Unique identifier of a task. (required)
3134-
* @param batchWriteParams Request body of a Search API `batch` request that will be pushed in the
3134+
* @param pushTaskPayload Request body of a Search API `batch` request that will be pushed in the
31353135
* Connectors pipeline. (required)
31363136
* @throws AlgoliaRuntimeException If it fails to process the API call
31373137
*/
3138-
public CompletableFuture<RunResponse> pushTaskAsync(@Nonnull String taskID, @Nonnull BatchWriteParams batchWriteParams)
3138+
public CompletableFuture<RunResponse> pushTaskAsync(@Nonnull String taskID, @Nonnull PushTaskPayload pushTaskPayload)
31393139
throws AlgoliaRuntimeException {
3140-
return this.pushTaskAsync(taskID, batchWriteParams, null);
3140+
return this.pushTaskAsync(taskID, pushTaskPayload, null);
31413141
}
31423142

31433143
/**

algoliasearch/src/main/java/com/algolia/model/ingestion/BatchRequest.java renamed to algoliasearch/src/main/java/com/algolia/model/ingestion/PushTaskPayload.java

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55

66
import com.fasterxml.jackson.annotation.*;
77
import com.fasterxml.jackson.databind.annotation.*;
8+
import java.util.ArrayList;
9+
import java.util.List;
810
import java.util.Objects;
911

10-
/** BatchRequest */
11-
public class BatchRequest {
12+
/** PushTaskPayload */
13+
public class PushTaskPayload {
1214

1315
@JsonProperty("action")
1416
private Action action;
1517

16-
@JsonProperty("body")
17-
private Object body;
18+
@JsonProperty("records")
19+
private List<PushTaskRecords> records = new ArrayList<>();
1820

19-
public BatchRequest setAction(Action action) {
21+
public PushTaskPayload setAction(Action action) {
2022
this.action = action;
2123
return this;
2224
}
@@ -27,15 +29,20 @@ public Action getAction() {
2729
return action;
2830
}
2931

30-
public BatchRequest setBody(Object body) {
31-
this.body = body;
32+
public PushTaskPayload setRecords(List<PushTaskRecords> records) {
33+
this.records = records;
3234
return this;
3335
}
3436

35-
/** Operation arguments (varies with specified `action`). */
37+
public PushTaskPayload addRecords(PushTaskRecords recordsItem) {
38+
this.records.add(recordsItem);
39+
return this;
40+
}
41+
42+
/** Get records */
3643
@javax.annotation.Nonnull
37-
public Object getBody() {
38-
return body;
44+
public List<PushTaskRecords> getRecords() {
45+
return records;
3946
}
4047

4148
@Override
@@ -46,21 +53,21 @@ public boolean equals(Object o) {
4653
if (o == null || getClass() != o.getClass()) {
4754
return false;
4855
}
49-
BatchRequest batchRequest = (BatchRequest) o;
50-
return Objects.equals(this.action, batchRequest.action) && Objects.equals(this.body, batchRequest.body);
56+
PushTaskPayload pushTaskPayload = (PushTaskPayload) o;
57+
return Objects.equals(this.action, pushTaskPayload.action) && Objects.equals(this.records, pushTaskPayload.records);
5158
}
5259

5360
@Override
5461
public int hashCode() {
55-
return Objects.hash(action, body);
62+
return Objects.hash(action, records);
5663
}
5764

5865
@Override
5966
public String toString() {
6067
StringBuilder sb = new StringBuilder();
61-
sb.append("class BatchRequest {\n");
68+
sb.append("class PushTaskPayload {\n");
6269
sb.append(" action: ").append(toIndentedString(action)).append("\n");
63-
sb.append(" body: ").append(toIndentedString(body)).append("\n");
70+
sb.append(" records: ").append(toIndentedString(records)).append("\n");
6471
sb.append("}");
6572
return sb.toString();
6673
}

algoliasearch/src/main/java/com/algolia/model/ingestion/BatchWriteParams.java renamed to algoliasearch/src/main/java/com/algolia/model/ingestion/PushTaskRecords.java

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,38 @@
55

66
import com.fasterxml.jackson.annotation.*;
77
import com.fasterxml.jackson.databind.annotation.*;
8-
import java.util.ArrayList;
9-
import java.util.List;
8+
import java.util.HashMap;
9+
import java.util.Map;
1010
import java.util.Objects;
1111

12-
/** Batch parameters. */
13-
public class BatchWriteParams {
12+
/** PushTaskRecords */
13+
public class PushTaskRecords {
1414

15-
@JsonProperty("requests")
16-
private List<BatchRequest> requests = new ArrayList<>();
15+
@JsonProperty("objectID")
16+
private String objectID;
1717

18-
public BatchWriteParams setRequests(List<BatchRequest> requests) {
19-
this.requests = requests;
18+
private Map<String, Object> additionalProperties = new HashMap<>();
19+
20+
@JsonAnyGetter
21+
public Map<String, Object> getAdditionalProperties() {
22+
return this.additionalProperties;
23+
}
24+
25+
@JsonAnySetter
26+
public PushTaskRecords setAdditionalProperty(String name, Object value) {
27+
this.additionalProperties.put(name, value);
2028
return this;
2129
}
2230

23-
public BatchWriteParams addRequests(BatchRequest requestsItem) {
24-
this.requests.add(requestsItem);
31+
public PushTaskRecords setObjectID(String objectID) {
32+
this.objectID = objectID;
2533
return this;
2634
}
2735

28-
/** Get requests */
36+
/** Unique record identifier. */
2937
@javax.annotation.Nonnull
30-
public List<BatchRequest> getRequests() {
31-
return requests;
38+
public String getObjectID() {
39+
return objectID;
3240
}
3341

3442
@Override
@@ -39,20 +47,21 @@ public boolean equals(Object o) {
3947
if (o == null || getClass() != o.getClass()) {
4048
return false;
4149
}
42-
BatchWriteParams batchWriteParams = (BatchWriteParams) o;
43-
return Objects.equals(this.requests, batchWriteParams.requests);
50+
PushTaskRecords pushTaskRecords = (PushTaskRecords) o;
51+
return Objects.equals(this.objectID, pushTaskRecords.objectID) && super.equals(o);
4452
}
4553

4654
@Override
4755
public int hashCode() {
48-
return Objects.hash(requests);
56+
return Objects.hash(objectID, super.hashCode());
4957
}
5058

5159
@Override
5260
public String toString() {
5361
StringBuilder sb = new StringBuilder();
54-
sb.append("class BatchWriteParams {\n");
55-
sb.append(" requests: ").append(toIndentedString(requests)).append("\n");
62+
sb.append("class PushTaskRecords {\n");
63+
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
64+
sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n");
5665
sb.append("}");
5766
return sb.toString();
5867
}

0 commit comments

Comments
 (0)