Skip to content

Commit 17c4cf5

Browse files
committed
[codegen] update to latest spec
1 parent f67b74c commit 17c4cf5

11 files changed

+1226
-41
lines changed

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

+27-16
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

+10-5
Original file line numberDiff line numberDiff line change
@@ -1681,11 +1681,16 @@
16811681
'ingest._types.UserAgentProperty': 'ingest/_types/Processors.ts#L266-L277',
16821682
'ingest.delete_pipeline.Request': 'ingest/delete_pipeline/DeletePipelineRequest.ts#L24-L52',
16831683
'ingest.delete_pipeline.Response': 'ingest/delete_pipeline/DeletePipelineResponse.ts#L22-L24',
1684-
'ingest.geo_ip_stats.GeoIpDownloadStatistics': 'ingest/geo_ip_stats/types.ts#L24-L35',
1685-
'ingest.geo_ip_stats.GeoIpNodeDatabaseName': 'ingest/geo_ip_stats/types.ts#L45-L48',
1686-
'ingest.geo_ip_stats.GeoIpNodeDatabases': 'ingest/geo_ip_stats/types.ts#L37-L43',
1684+
'ingest.geo_ip_stats.GeoIpDownloadStatistics': 'ingest/geo_ip_stats/types.ts#L24-L37',
1685+
'ingest.geo_ip_stats.GeoIpNodeDatabaseName': 'ingest/geo_ip_stats/types.ts#L47-L50',
1686+
'ingest.geo_ip_stats.GeoIpNodeDatabases': 'ingest/geo_ip_stats/types.ts#L39-L45',
16871687
'ingest.geo_ip_stats.Request': 'ingest/geo_ip_stats/IngestGeoIpStatsRequest.ts#L22-L29',
16881688
'ingest.geo_ip_stats.Response': 'ingest/geo_ip_stats/IngestGeoIpStatsResponse.ts#L24-L31',
1689+
'ingest.get_geoip_database.DatabaseConfiguration': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L35-L38',
1690+
'ingest.get_geoip_database.DatabaseConfigurationMetadata': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L28-L33',
1691+
'ingest.get_geoip_database.Maxmind': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L40-L42',
1692+
'ingest.get_geoip_database.Request': 'ingest/get_geoip_database/GetGeoipDatabaseRequest.ts#L24-L46',
1693+
'ingest.get_geoip_database.Response': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L24-L26',
16891694
'ingest.get_pipeline.Request': 'ingest/get_pipeline/GetPipelineRequest.ts#L24-L50',
16901695
'ingest.get_pipeline.Response': 'ingest/get_pipeline/GetPipelineResponse.ts#L23-L26',
16911696
'ingest.processor_grok.Request': 'ingest/processor_grok/GrokProcessorPatternsRequest.ts#L22-L31',
@@ -2842,10 +2847,10 @@
28422847
if (hash.length > 1) {
28432848
hash = hash.substring(1);
28442849
}
2845-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/80d8b44424441c00001ed25673bf63a9cb4cb2cd/specification/" + (paths[hash] || "");
2850+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/b385d5edde19fc2e435eba2f334b00175ec5ef10/specification/" + (paths[hash] || "");
28462851
</script>
28472852
</head>
28482853
<body>
2849-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/80d8b44424441c00001ed25673bf63a9cb4cb2cd/specification/">Elasticsearch API specification</a>.
2854+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/b385d5edde19fc2e435eba2f334b00175ec5ef10/specification/">Elasticsearch API specification</a>.
28502855
</body>
28512856
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java

+46
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,52 @@ public CompletableFuture<GeoIpStatsResponse> geoIpStats() {
112112
this.transportOptions);
113113
}
114114

115+
// ----- Endpoint: ingest.get_geoip_database
116+
117+
/**
118+
* Returns information about one or more geoip database configurations.
119+
*
120+
* @see <a href=
121+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
122+
* on elastic.co</a>
123+
*/
124+
125+
public CompletableFuture<GetGeoipDatabaseResponse> getGeoipDatabase(GetGeoipDatabaseRequest request) {
126+
@SuppressWarnings("unchecked")
127+
JsonEndpoint<GetGeoipDatabaseRequest, GetGeoipDatabaseResponse, ErrorResponse> endpoint = (JsonEndpoint<GetGeoipDatabaseRequest, GetGeoipDatabaseResponse, ErrorResponse>) GetGeoipDatabaseRequest._ENDPOINT;
128+
129+
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
130+
}
131+
132+
/**
133+
* Returns information about one or more geoip database configurations.
134+
*
135+
* @param fn
136+
* a function that initializes a builder to create the
137+
* {@link GetGeoipDatabaseRequest}
138+
* @see <a href=
139+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
140+
* on elastic.co</a>
141+
*/
142+
143+
public final CompletableFuture<GetGeoipDatabaseResponse> getGeoipDatabase(
144+
Function<GetGeoipDatabaseRequest.Builder, ObjectBuilder<GetGeoipDatabaseRequest>> fn) {
145+
return getGeoipDatabase(fn.apply(new GetGeoipDatabaseRequest.Builder()).build());
146+
}
147+
148+
/**
149+
* Returns information about one or more geoip database configurations.
150+
*
151+
* @see <a href=
152+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
153+
* on elastic.co</a>
154+
*/
155+
156+
public CompletableFuture<GetGeoipDatabaseResponse> getGeoipDatabase() {
157+
return this.transport.performRequestAsync(new GetGeoipDatabaseRequest.Builder().build(),
158+
GetGeoipDatabaseRequest._ENDPOINT, this.transportOptions);
159+
}
160+
115161
// ----- Endpoint: ingest.get_pipeline
116162

117163
/**

java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java

+48
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,54 @@ public GeoIpStatsResponse geoIpStats() throws IOException, ElasticsearchExceptio
114114
this.transportOptions);
115115
}
116116

117+
// ----- Endpoint: ingest.get_geoip_database
118+
119+
/**
120+
* Returns information about one or more geoip database configurations.
121+
*
122+
* @see <a href=
123+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
124+
* on elastic.co</a>
125+
*/
126+
127+
public GetGeoipDatabaseResponse getGeoipDatabase(GetGeoipDatabaseRequest request)
128+
throws IOException, ElasticsearchException {
129+
@SuppressWarnings("unchecked")
130+
JsonEndpoint<GetGeoipDatabaseRequest, GetGeoipDatabaseResponse, ErrorResponse> endpoint = (JsonEndpoint<GetGeoipDatabaseRequest, GetGeoipDatabaseResponse, ErrorResponse>) GetGeoipDatabaseRequest._ENDPOINT;
131+
132+
return this.transport.performRequest(request, endpoint, this.transportOptions);
133+
}
134+
135+
/**
136+
* Returns information about one or more geoip database configurations.
137+
*
138+
* @param fn
139+
* a function that initializes a builder to create the
140+
* {@link GetGeoipDatabaseRequest}
141+
* @see <a href=
142+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
143+
* on elastic.co</a>
144+
*/
145+
146+
public final GetGeoipDatabaseResponse getGeoipDatabase(
147+
Function<GetGeoipDatabaseRequest.Builder, ObjectBuilder<GetGeoipDatabaseRequest>> fn)
148+
throws IOException, ElasticsearchException {
149+
return getGeoipDatabase(fn.apply(new GetGeoipDatabaseRequest.Builder()).build());
150+
}
151+
152+
/**
153+
* Returns information about one or more geoip database configurations.
154+
*
155+
* @see <a href=
156+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
157+
* on elastic.co</a>
158+
*/
159+
160+
public GetGeoipDatabaseResponse getGeoipDatabase() throws IOException, ElasticsearchException {
161+
return this.transport.performRequest(new GetGeoipDatabaseRequest.Builder().build(),
162+
GetGeoipDatabaseRequest._ENDPOINT, this.transportOptions);
163+
}
164+
117165
// ----- Endpoint: ingest.get_pipeline
118166

119167
/**

0 commit comments

Comments
 (0)