Skip to content

Commit 0177005

Browse files
committed
[codegen] update to latest spec
1 parent c8c062e commit 0177005

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

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

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ public class PhoneticTokenFilter extends TokenFilterBase implements TokenFilterD
6666
@Nullable
6767
private final Integer maxCodeLen;
6868

69+
@Nullable
6970
private final PhoneticNameType nameType;
7071

7172
@Nullable
7273
private final Boolean replace;
7374

75+
@Nullable
7476
private final PhoneticRuleType ruleType;
7577

7678
// ---------------------------------------------------------------------------------------------
@@ -79,11 +81,11 @@ private PhoneticTokenFilter(Builder builder) {
7981
super(builder);
8082

8183
this.encoder = ApiTypeHelper.requireNonNull(builder.encoder, this, "encoder");
82-
this.languageset = ApiTypeHelper.unmodifiableRequired(builder.languageset, this, "languageset");
84+
this.languageset = ApiTypeHelper.unmodifiable(builder.languageset);
8385
this.maxCodeLen = builder.maxCodeLen;
84-
this.nameType = ApiTypeHelper.requireNonNull(builder.nameType, this, "nameType");
86+
this.nameType = builder.nameType;
8587
this.replace = builder.replace;
86-
this.ruleType = ApiTypeHelper.requireNonNull(builder.ruleType, this, "ruleType");
88+
this.ruleType = builder.ruleType;
8789

8890
}
8991

@@ -107,7 +109,7 @@ public final PhoneticEncoder encoder() {
107109
}
108110

109111
/**
110-
* Required - API name: {@code languageset}
112+
* API name: {@code languageset}
111113
*/
112114
public final List<PhoneticLanguage> languageset() {
113115
return this.languageset;
@@ -122,8 +124,9 @@ public final Integer maxCodeLen() {
122124
}
123125

124126
/**
125-
* Required - API name: {@code name_type}
127+
* API name: {@code name_type}
126128
*/
129+
@Nullable
127130
public final PhoneticNameType nameType() {
128131
return this.nameType;
129132
}
@@ -137,8 +140,9 @@ public final Boolean replace() {
137140
}
138141

139142
/**
140-
* Required - API name: {@code rule_type}
143+
* API name: {@code rule_type}
141144
*/
145+
@Nullable
142146
public final PhoneticRuleType ruleType() {
143147
return this.ruleType;
144148
}
@@ -163,15 +167,19 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
163167
generator.write(this.maxCodeLen);
164168

165169
}
166-
generator.writeKey("name_type");
167-
this.nameType.serialize(generator, mapper);
170+
if (this.nameType != null) {
171+
generator.writeKey("name_type");
172+
this.nameType.serialize(generator, mapper);
173+
}
168174
if (this.replace != null) {
169175
generator.writeKey("replace");
170176
generator.write(this.replace);
171177

172178
}
173-
generator.writeKey("rule_type");
174-
this.ruleType.serialize(generator, mapper);
179+
if (this.ruleType != null) {
180+
generator.writeKey("rule_type");
181+
this.ruleType.serialize(generator, mapper);
182+
}
175183

176184
}
177185

@@ -186,16 +194,19 @@ public static class Builder extends TokenFilterBase.AbstractBuilder<Builder>
186194
ObjectBuilder<PhoneticTokenFilter> {
187195
private PhoneticEncoder encoder;
188196

197+
@Nullable
189198
private List<PhoneticLanguage> languageset;
190199

191200
@Nullable
192201
private Integer maxCodeLen;
193202

203+
@Nullable
194204
private PhoneticNameType nameType;
195205

196206
@Nullable
197207
private Boolean replace;
198208

209+
@Nullable
199210
private PhoneticRuleType ruleType;
200211

201212
/**
@@ -207,7 +218,7 @@ public final Builder encoder(PhoneticEncoder value) {
207218
}
208219

209220
/**
210-
* Required - API name: {@code languageset}
221+
* API name: {@code languageset}
211222
* <p>
212223
* Adds all elements of <code>list</code> to <code>languageset</code>.
213224
*/
@@ -217,7 +228,7 @@ public final Builder languageset(List<PhoneticLanguage> list) {
217228
}
218229

219230
/**
220-
* Required - API name: {@code languageset}
231+
* API name: {@code languageset}
221232
* <p>
222233
* Adds one or more values to <code>languageset</code>.
223234
*/
@@ -235,9 +246,9 @@ public final Builder maxCodeLen(@Nullable Integer value) {
235246
}
236247

237248
/**
238-
* Required - API name: {@code name_type}
249+
* API name: {@code name_type}
239250
*/
240-
public final Builder nameType(PhoneticNameType value) {
251+
public final Builder nameType(@Nullable PhoneticNameType value) {
241252
this.nameType = value;
242253
return this;
243254
}
@@ -251,9 +262,9 @@ public final Builder replace(@Nullable Boolean value) {
251262
}
252263

253264
/**
254-
* Required - API name: {@code rule_type}
265+
* API name: {@code rule_type}
255266
*/
256-
public final Builder ruleType(PhoneticRuleType value) {
267+
public final Builder ruleType(@Nullable PhoneticRuleType value) {
257268
this.ruleType = value;
258269
return this;
259270
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,10 +2350,10 @@
23502350
if (hash.length > 1) {
23512351
hash = hash.substring(1);
23522352
}
2353-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/43e53398502a36eb2b7d1fae305787228fa0a089/specification/" + (paths[hash] || "");
2353+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/c3d97bbbee47ac9449ae90feef71586f3809a141/specification/" + (paths[hash] || "");
23542354
</script>
23552355
</head>
23562356
<body>
2357-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/43e53398502a36eb2b7d1fae305787228fa0a089/specification/">Elasticsearch API specification</a>.
2357+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/c3d97bbbee47ac9449ae90feef71586f3809a141/specification/">Elasticsearch API specification</a>.
23582358
</body>
23592359
</html>

0 commit comments

Comments
 (0)