Skip to content

Commit a9f0c6a

Browse files
[codegen] update to latest spec (#1123)
Co-authored-by: Laura Trotta <[email protected]>
1 parent 2711965 commit a9f0c6a

File tree

3 files changed

+62
-13
lines changed

3 files changed

+62
-13
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import co.elastic.clients.json.JsonpUtils;
2727
import co.elastic.clients.json.ObjectBuilderDeserializer;
2828
import co.elastic.clients.json.ObjectDeserializer;
29-
import co.elastic.clients.util.ApiTypeHelper;
3029
import co.elastic.clients.util.ObjectBuilder;
3130
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3231
import jakarta.json.stream.JsonGenerator;
@@ -60,6 +59,7 @@
6059
*/
6160
@JsonpDeserializable
6261
public class KuromojiAnalyzer implements AnalyzerVariant, JsonpSerializable {
62+
@Nullable
6363
private final KuromojiTokenizationMode mode;
6464

6565
@Nullable
@@ -69,7 +69,7 @@ public class KuromojiAnalyzer implements AnalyzerVariant, JsonpSerializable {
6969

7070
private KuromojiAnalyzer(Builder builder) {
7171

72-
this.mode = ApiTypeHelper.requireNonNull(builder.mode, this, "mode");
72+
this.mode = builder.mode;
7373
this.userDictionary = builder.userDictionary;
7474

7575
}
@@ -87,8 +87,9 @@ public Analyzer.Kind _analyzerKind() {
8787
}
8888

8989
/**
90-
* Required - API name: {@code mode}
90+
* API name: {@code mode}
9191
*/
92+
@Nullable
9293
public final KuromojiTokenizationMode mode() {
9394
return this.mode;
9495
}
@@ -114,8 +115,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
114115

115116
generator.write("type", "kuromoji");
116117

117-
generator.writeKey("mode");
118-
this.mode.serialize(generator, mapper);
118+
if (this.mode != null) {
119+
generator.writeKey("mode");
120+
this.mode.serialize(generator, mapper);
121+
}
119122
if (this.userDictionary != null) {
120123
generator.writeKey("user_dictionary");
121124
generator.write(this.userDictionary);
@@ -136,15 +139,16 @@ public String toString() {
136139
*/
137140

138141
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<KuromojiAnalyzer> {
142+
@Nullable
139143
private KuromojiTokenizationMode mode;
140144

141145
@Nullable
142146
private String userDictionary;
143147

144148
/**
145-
* Required - API name: {@code mode}
149+
* API name: {@code mode}
146150
*/
147-
public final Builder mode(KuromojiTokenizationMode value) {
151+
public final Builder mode(@Nullable KuromojiTokenizationMode value) {
148152
this.mode = value;
149153
return this;
150154
}

java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3082,10 +3082,10 @@
30823082
'transform._types.PivotGroupByContainer': 'transform/_types/Transform.ts#L70-L78',
30833083
'transform._types.RetentionPolicy': 'transform/_types/Transform.ts#L88-L96',
30843084
'transform._types.RetentionPolicyContainer': 'transform/_types/Transform.ts#L80-L86',
3085-
'transform._types.Settings': 'transform/_types/Transform.ts#L98-L144',
3086-
'transform._types.Source': 'transform/_types/Transform.ts#L146-L165',
3087-
'transform._types.SyncContainer': 'transform/_types/Transform.ts#L169-L175',
3088-
'transform._types.TimeSync': 'transform/_types/Transform.ts#L177-L189',
3085+
'transform._types.Settings': 'transform/_types/Transform.ts#L98-L154',
3086+
'transform._types.Source': 'transform/_types/Transform.ts#L156-L175',
3087+
'transform._types.SyncContainer': 'transform/_types/Transform.ts#L179-L185',
3088+
'transform._types.TimeSync': 'transform/_types/Transform.ts#L187-L199',
30893089
'transform.delete_transform.Request': 'transform/delete_transform/DeleteTransformRequest.ts#L24-L64',
30903090
'transform.delete_transform.Response': 'transform/delete_transform/DeleteTransformResponse.ts#L22-L25',
30913091
'transform.get_transform.Request': 'transform/get_transform/GetTransformRequest.ts#L24-L84',
@@ -3322,10 +3322,10 @@
33223322
if (hash.length > 1) {
33233323
hash = hash.substring(1);
33243324
}
3325-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/32e19181074f337369c123c1b7e9518f71b8bb6b/specification/" + (paths[hash] || "");
3325+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/d4d8c79c221bc01acf5f802bc5c41632dcf6cde9/specification/" + (paths[hash] || "");
33263326
</script>
33273327
</head>
33283328
<body>
3329-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/32e19181074f337369c123c1b7e9518f71b8bb6b/specification/">Elasticsearch API specification</a>.
3329+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/d4d8c79c221bc01acf5f802bc5c41632dcf6cde9/specification/">Elasticsearch API specification</a>.
33303330
</body>
33313331
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/transform/Settings.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public class Settings implements JsonpSerializable {
7676
@Nullable
7777
private final Integer maxPageSearchSize;
7878

79+
@Nullable
80+
private final Boolean usePointInTime;
81+
7982
@Nullable
8083
private final Boolean unattended;
8184

@@ -88,6 +91,7 @@ private Settings(Builder builder) {
8891
this.deduceMappings = builder.deduceMappings;
8992
this.docsPerSecond = builder.docsPerSecond;
9093
this.maxPageSearchSize = builder.maxPageSearchSize;
94+
this.usePointInTime = builder.usePointInTime;
9195
this.unattended = builder.unattended;
9296

9397
}
@@ -159,6 +163,22 @@ public final Integer maxPageSearchSize() {
159163
return this.maxPageSearchSize;
160164
}
161165

166+
/**
167+
* Specifies whether the transform checkpoint will use the Point In Time API
168+
* while searching over the source index. In general, Point In Time is an
169+
* optimization that will reduce pressure on the source index by reducing the
170+
* amount of refreshes and merges, but it can be expensive if a large number of
171+
* Point In Times are opened and closed for a given index. The benefits and
172+
* impact depend on the data being searched, the ingest rate into the source
173+
* index, and the amount of other consumers searching the same source index.
174+
* <p>
175+
* API name: {@code use_point_in_time}
176+
*/
177+
@Nullable
178+
public final Boolean usePointInTime() {
179+
return this.usePointInTime;
180+
}
181+
162182
/**
163183
* If <code>true</code>, the transform runs in unattended mode. In unattended
164184
* mode, the transform retries indefinitely in case of an error which means the
@@ -207,6 +227,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
207227
generator.writeKey("max_page_search_size");
208228
generator.write(this.maxPageSearchSize);
209229

230+
}
231+
if (this.usePointInTime != null) {
232+
generator.writeKey("use_point_in_time");
233+
generator.write(this.usePointInTime);
234+
210235
}
211236
if (this.unattended != null) {
212237
generator.writeKey("unattended");
@@ -243,6 +268,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
243268
@Nullable
244269
private Integer maxPageSearchSize;
245270

271+
@Nullable
272+
private Boolean usePointInTime;
273+
246274
@Nullable
247275
private Boolean unattended;
248276

@@ -309,6 +337,22 @@ public final Builder maxPageSearchSize(@Nullable Integer value) {
309337
return this;
310338
}
311339

340+
/**
341+
* Specifies whether the transform checkpoint will use the Point In Time API
342+
* while searching over the source index. In general, Point In Time is an
343+
* optimization that will reduce pressure on the source index by reducing the
344+
* amount of refreshes and merges, but it can be expensive if a large number of
345+
* Point In Times are opened and closed for a given index. The benefits and
346+
* impact depend on the data being searched, the ingest rate into the source
347+
* index, and the amount of other consumers searching the same source index.
348+
* <p>
349+
* API name: {@code use_point_in_time}
350+
*/
351+
public final Builder usePointInTime(@Nullable Boolean value) {
352+
this.usePointInTime = value;
353+
return this;
354+
}
355+
312356
/**
313357
* If <code>true</code>, the transform runs in unattended mode. In unattended
314358
* mode, the transform retries indefinitely in case of an error which means the
@@ -355,6 +399,7 @@ protected static void setupSettingsDeserializer(ObjectDeserializer<Settings.Buil
355399
op.add(Builder::deduceMappings, JsonpDeserializer.booleanDeserializer(), "deduce_mappings");
356400
op.add(Builder::docsPerSecond, JsonpDeserializer.floatDeserializer(), "docs_per_second");
357401
op.add(Builder::maxPageSearchSize, JsonpDeserializer.integerDeserializer(), "max_page_search_size");
402+
op.add(Builder::usePointInTime, JsonpDeserializer.booleanDeserializer(), "use_point_in_time");
358403
op.add(Builder::unattended, JsonpDeserializer.booleanDeserializer(), "unattended");
359404

360405
}

0 commit comments

Comments
 (0)