Skip to content

Commit c6091e4

Browse files
[9.3] Regenerate client (#1131)
* [codegen] update to latest spec * support for routing list in bulk op * [codegen] update to latest spec and generator --------- Co-authored-by: Laura Trotta <laura.trotta@elastic.co>
1 parent 3d45840 commit c6091e4

2,463 files changed

Lines changed: 61227 additions & 7080 deletions

File tree

Some content is hidden

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

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java

Lines changed: 159 additions & 98 deletions
Large diffs are not rendered by default.

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java

Lines changed: 159 additions & 98 deletions
Large diffs are not rendered by default.

java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/bulk/IngesterOperation.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import co.elastic.clients.util.BinaryData;
3131

3232
import javax.annotation.Nullable;
33+
import java.util.List;
3334

3435
/**
3536
* A bulk operation whose size has been calculated and content turned to a binary blob (to compute its size).
@@ -212,6 +213,23 @@ private static int size(String name, @Nullable JsonEnum value) {
212213
}
213214
}
214215

216+
private static int size(String name, @Nullable List<String> value) {
217+
if (value != null) {
218+
if (value.isEmpty()) {
219+
return name.length() + 6; // 6 added chars for empty array "name":[],
220+
}
221+
int listSize = 0;
222+
for (String item : value) {
223+
listSize += item.length();
224+
listSize += 2; // +2 quotes each item
225+
}
226+
listSize += value.size()-1 ; // +1 comma between each item
227+
return name.length() + listSize + 6; // "name":["item1","item2","item3"],
228+
} else {
229+
return 0;
230+
}
231+
}
232+
215233
private static int basePropertiesSize(BulkOperationBase op) {
216234
return
217235
size("id", op.id()) +

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/BulkIndexByScrollFailure.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
158158

159159
private Integer status;
160160

161+
public Builder() {
162+
}
163+
private Builder(BulkIndexByScrollFailure instance) {
164+
this.cause = instance.cause;
165+
this.id = instance.id;
166+
this.index = instance.index;
167+
this.status = instance.status;
168+
169+
}
161170
/**
162171
* Required - API name: {@code cause}
163172
*/
@@ -215,6 +224,12 @@ public BulkIndexByScrollFailure build() {
215224
}
216225
}
217226

227+
/**
228+
* @return New {@link Builder} initialized with field values of this instance
229+
*/
230+
public Builder rebuild() {
231+
return new Builder(this);
232+
}
218233
// ---------------------------------------------------------------------------------------------
219234

220235
/**

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/BulkStats.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,20 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
251251

252252
private Long avgSizeInBytes;
253253

254+
public Builder() {
255+
}
256+
private Builder(BulkStats instance) {
257+
this.totalOperations = instance.totalOperations;
258+
this.totalTime = instance.totalTime;
259+
this.totalTimeInMillis = instance.totalTimeInMillis;
260+
this.totalSize = instance.totalSize;
261+
this.totalSizeInBytes = instance.totalSizeInBytes;
262+
this.avgTime = instance.avgTime;
263+
this.avgTimeInMillis = instance.avgTimeInMillis;
264+
this.avgSize = instance.avgSize;
265+
this.avgSizeInBytes = instance.avgSizeInBytes;
266+
267+
}
254268
/**
255269
* Required - API name: {@code total_operations}
256270
*/
@@ -355,6 +369,12 @@ public BulkStats build() {
355369
}
356370
}
357371

372+
/**
373+
* @return New {@link Builder} initialized with field values of this instance
374+
*/
375+
public Builder rebuild() {
376+
return new Builder(this);
377+
}
358378
// ---------------------------------------------------------------------------------------------
359379

360380
/**

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/CartesianPoint.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
124124

125125
private Double y;
126126

127+
public Builder() {
128+
}
129+
private Builder(CartesianPoint instance) {
130+
this.x = instance.x;
131+
this.y = instance.y;
132+
133+
}
127134
/**
128135
* Required - API name: {@code x}
129136
*/
@@ -158,6 +165,12 @@ public CartesianPoint build() {
158165
}
159166
}
160167

168+
/**
169+
* @return New {@link Builder} initialized with field values of this instance
170+
*/
171+
public Builder rebuild() {
172+
return new Builder(this);
173+
}
161174
// ---------------------------------------------------------------------------------------------
162175

163176
/**

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ChunkRescorer.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
140140
@Nullable
141141
private ChunkRescorerChunkingSettings chunkingSettings;
142142

143+
public Builder() {
144+
}
145+
private Builder(ChunkRescorer instance) {
146+
this.size = instance.size;
147+
this.chunkingSettings = instance.chunkingSettings;
148+
149+
}
143150
/**
144151
* The number of chunks per document to evaluate for reranking.
145152
* <p>
@@ -188,6 +195,12 @@ public ChunkRescorer build() {
188195
}
189196
}
190197

198+
/**
199+
* @return New {@link Builder} initialized with field values of this instance
200+
*/
201+
public Builder rebuild() {
202+
return new Builder(this);
203+
}
191204
// ---------------------------------------------------------------------------------------------
192205

193206
/**

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterDetails.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,17 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
206206
@Nullable
207207
private List<ShardFailure> failures;
208208

209+
public Builder() {
210+
}
211+
private Builder(ClusterDetails instance) {
212+
this.status = instance.status;
213+
this.indices = instance.indices;
214+
this.took = instance.took;
215+
this.timedOut = instance.timedOut;
216+
this.shards = instance.shards;
217+
this.failures = instance.failures;
218+
219+
}
209220
/**
210221
* Required - API name: {@code status}
211222
*/
@@ -300,6 +311,12 @@ public ClusterDetails build() {
300311
}
301312
}
302313

314+
/**
315+
* @return New {@link Builder} initialized with field values of this instance
316+
*/
317+
public Builder rebuild() {
318+
return new Builder(this);
319+
}
303320
// ---------------------------------------------------------------------------------------------
304321

305322
/**

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterStatistics.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,18 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
212212
@Nullable
213213
private Map<String, ClusterDetails> details;
214214

215+
public Builder() {
216+
}
217+
private Builder(ClusterStatistics instance) {
218+
this.skipped = instance.skipped;
219+
this.successful = instance.successful;
220+
this.total = instance.total;
221+
this.running = instance.running;
222+
this.partial = instance.partial;
223+
this.failed = instance.failed;
224+
this.details = instance.details;
225+
226+
}
215227
/**
216228
* Required - API name: {@code skipped}
217229
*/
@@ -307,6 +319,12 @@ public ClusterStatistics build() {
307319
}
308320
}
309321

322+
/**
323+
* @return New {@link Builder} initialized with field values of this instance
324+
*/
325+
public Builder rebuild() {
326+
return new Builder(this);
327+
}
310328
// ---------------------------------------------------------------------------------------------
311329

312330
/**
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package co.elastic.clients.elasticsearch._types;
21+
22+
import co.elastic.clients.json.JsonEnum;
23+
import co.elastic.clients.json.JsonpDeserializable;
24+
import co.elastic.clients.json.JsonpDeserializer;
25+
26+
//----------------------------------------------------------------
27+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
28+
//----------------------------------------------------------------
29+
//
30+
// This code is generated from the Elasticsearch API specification
31+
// at https://github.com/elastic/elasticsearch-specification
32+
//
33+
// Manual updates to this file will be lost when the code is
34+
// re-generated.
35+
//
36+
// If you find a property that is missing or wrongly typed, please
37+
// open an issue or a PR on the API specification repository.
38+
//
39+
//----------------------------------------------------------------
40+
41+
/**
42+
*
43+
* @see <a href="../doc-files/api-spec.html#_types.CommonStatsFlag">API
44+
* specification</a>
45+
*/
46+
@JsonpDeserializable
47+
public enum CommonStatsFlag implements JsonEnum {
48+
All("_all"),
49+
50+
Store("store"),
51+
52+
Indexing("indexing"),
53+
54+
Get("get"),
55+
56+
Search("search"),
57+
58+
Merge("merge"),
59+
60+
Flush("flush"),
61+
62+
Refresh("refresh"),
63+
64+
QueryCache("query_cache"),
65+
66+
Fielddata("fielddata"),
67+
68+
Docs("docs"),
69+
70+
Warmer("warmer"),
71+
72+
Completion("completion"),
73+
74+
Segments("segments"),
75+
76+
Translog("translog"),
77+
78+
RequestCache("request_cache"),
79+
80+
Recovery("recovery"),
81+
82+
Bulk("bulk"),
83+
84+
ShardStats("shard_stats"),
85+
86+
Mappings("mappings"),
87+
88+
DenseVector("dense_vector"),
89+
90+
SparseVector("sparse_vector"),
91+
92+
;
93+
94+
private final String jsonValue;
95+
96+
CommonStatsFlag(String jsonValue) {
97+
this.jsonValue = jsonValue;
98+
}
99+
100+
public String jsonValue() {
101+
return this.jsonValue;
102+
}
103+
104+
public static final JsonEnum.Deserializer<CommonStatsFlag> _DESERIALIZER = new JsonEnum.Deserializer<>(
105+
CommonStatsFlag.values());
106+
}

0 commit comments

Comments
 (0)