Skip to content

Commit

Permalink
[codegen] update to latest spec
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta committed Aug 28, 2024
1 parent f67b74c commit 17c4cf5
Show file tree
Hide file tree
Showing 11 changed files with 1,226 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ public class PhoneticTokenFilter extends TokenFilterBase implements TokenFilterD
@Nullable
private final Integer maxCodeLen;

@Nullable
private final PhoneticNameType nameType;

@Nullable
private final Boolean replace;

@Nullable
private final PhoneticRuleType ruleType;

// ---------------------------------------------------------------------------------------------
Expand All @@ -79,11 +81,11 @@ private PhoneticTokenFilter(Builder builder) {
super(builder);

this.encoder = ApiTypeHelper.requireNonNull(builder.encoder, this, "encoder");
this.languageset = ApiTypeHelper.unmodifiableRequired(builder.languageset, this, "languageset");
this.languageset = ApiTypeHelper.unmodifiable(builder.languageset);
this.maxCodeLen = builder.maxCodeLen;
this.nameType = ApiTypeHelper.requireNonNull(builder.nameType, this, "nameType");
this.nameType = builder.nameType;
this.replace = builder.replace;
this.ruleType = ApiTypeHelper.requireNonNull(builder.ruleType, this, "ruleType");
this.ruleType = builder.ruleType;

}

Expand All @@ -107,7 +109,7 @@ public final PhoneticEncoder encoder() {
}

/**
* Required - API name: {@code languageset}
* API name: {@code languageset}
*/
public final List<PhoneticLanguage> languageset() {
return this.languageset;
Expand All @@ -122,8 +124,9 @@ public final Integer maxCodeLen() {
}

/**
* Required - API name: {@code name_type}
* API name: {@code name_type}
*/
@Nullable
public final PhoneticNameType nameType() {
return this.nameType;
}
Expand All @@ -137,8 +140,9 @@ public final Boolean replace() {
}

/**
* Required - API name: {@code rule_type}
* API name: {@code rule_type}
*/
@Nullable
public final PhoneticRuleType ruleType() {
return this.ruleType;
}
Expand All @@ -163,15 +167,19 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write(this.maxCodeLen);

}
generator.writeKey("name_type");
this.nameType.serialize(generator, mapper);
if (this.nameType != null) {
generator.writeKey("name_type");
this.nameType.serialize(generator, mapper);
}
if (this.replace != null) {
generator.writeKey("replace");
generator.write(this.replace);

}
generator.writeKey("rule_type");
this.ruleType.serialize(generator, mapper);
if (this.ruleType != null) {
generator.writeKey("rule_type");
this.ruleType.serialize(generator, mapper);
}

}

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

@Nullable
private List<PhoneticLanguage> languageset;

@Nullable
private Integer maxCodeLen;

@Nullable
private PhoneticNameType nameType;

@Nullable
private Boolean replace;

@Nullable
private PhoneticRuleType ruleType;

/**
Expand All @@ -207,7 +218,7 @@ public final Builder encoder(PhoneticEncoder value) {
}

/**
* Required - API name: {@code languageset}
* API name: {@code languageset}
* <p>
* Adds all elements of <code>list</code> to <code>languageset</code>.
*/
Expand All @@ -217,7 +228,7 @@ public final Builder languageset(List<PhoneticLanguage> list) {
}

/**
* Required - API name: {@code languageset}
* API name: {@code languageset}
* <p>
* Adds one or more values to <code>languageset</code>.
*/
Expand All @@ -235,9 +246,9 @@ public final Builder maxCodeLen(@Nullable Integer value) {
}

/**
* Required - API name: {@code name_type}
* API name: {@code name_type}
*/
public final Builder nameType(PhoneticNameType value) {
public final Builder nameType(@Nullable PhoneticNameType value) {
this.nameType = value;
return this;
}
Expand All @@ -251,9 +262,9 @@ public final Builder replace(@Nullable Boolean value) {
}

/**
* Required - API name: {@code rule_type}
* API name: {@code rule_type}
*/
public final Builder ruleType(PhoneticRuleType value) {
public final Builder ruleType(@Nullable PhoneticRuleType value) {
this.ruleType = value;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1681,11 +1681,16 @@
'ingest._types.UserAgentProperty': 'ingest/_types/Processors.ts#L266-L277',
'ingest.delete_pipeline.Request': 'ingest/delete_pipeline/DeletePipelineRequest.ts#L24-L52',
'ingest.delete_pipeline.Response': 'ingest/delete_pipeline/DeletePipelineResponse.ts#L22-L24',
'ingest.geo_ip_stats.GeoIpDownloadStatistics': 'ingest/geo_ip_stats/types.ts#L24-L35',
'ingest.geo_ip_stats.GeoIpNodeDatabaseName': 'ingest/geo_ip_stats/types.ts#L45-L48',
'ingest.geo_ip_stats.GeoIpNodeDatabases': 'ingest/geo_ip_stats/types.ts#L37-L43',
'ingest.geo_ip_stats.GeoIpDownloadStatistics': 'ingest/geo_ip_stats/types.ts#L24-L37',
'ingest.geo_ip_stats.GeoIpNodeDatabaseName': 'ingest/geo_ip_stats/types.ts#L47-L50',
'ingest.geo_ip_stats.GeoIpNodeDatabases': 'ingest/geo_ip_stats/types.ts#L39-L45',
'ingest.geo_ip_stats.Request': 'ingest/geo_ip_stats/IngestGeoIpStatsRequest.ts#L22-L29',
'ingest.geo_ip_stats.Response': 'ingest/geo_ip_stats/IngestGeoIpStatsResponse.ts#L24-L31',
'ingest.get_geoip_database.DatabaseConfiguration': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L35-L38',
'ingest.get_geoip_database.DatabaseConfigurationMetadata': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L28-L33',
'ingest.get_geoip_database.Maxmind': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L40-L42',
'ingest.get_geoip_database.Request': 'ingest/get_geoip_database/GetGeoipDatabaseRequest.ts#L24-L46',
'ingest.get_geoip_database.Response': 'ingest/get_geoip_database/GetGeoipDatabaseResponse.ts#L24-L26',
'ingest.get_pipeline.Request': 'ingest/get_pipeline/GetPipelineRequest.ts#L24-L50',
'ingest.get_pipeline.Response': 'ingest/get_pipeline/GetPipelineResponse.ts#L23-L26',
'ingest.processor_grok.Request': 'ingest/processor_grok/GrokProcessorPatternsRequest.ts#L22-L31',
Expand Down Expand Up @@ -2842,10 +2847,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/80d8b44424441c00001ed25673bf63a9cb4cb2cd/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/b385d5edde19fc2e435eba2f334b00175ec5ef10/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/80d8b44424441c00001ed25673bf63a9cb4cb2cd/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/b385d5edde19fc2e435eba2f334b00175ec5ef10/specification/">Elasticsearch API specification</a>.
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,52 @@ public CompletableFuture<GeoIpStatsResponse> geoIpStats() {
this.transportOptions);
}

// ----- Endpoint: ingest.get_geoip_database

/**
* Returns information about one or more geoip database configurations.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
* on elastic.co</a>
*/

public CompletableFuture<GetGeoipDatabaseResponse> getGeoipDatabase(GetGeoipDatabaseRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<GetGeoipDatabaseRequest, GetGeoipDatabaseResponse, ErrorResponse> endpoint = (JsonEndpoint<GetGeoipDatabaseRequest, GetGeoipDatabaseResponse, ErrorResponse>) GetGeoipDatabaseRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}

/**
* Returns information about one or more geoip database configurations.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetGeoipDatabaseRequest}
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
* on elastic.co</a>
*/

public final CompletableFuture<GetGeoipDatabaseResponse> getGeoipDatabase(
Function<GetGeoipDatabaseRequest.Builder, ObjectBuilder<GetGeoipDatabaseRequest>> fn) {
return getGeoipDatabase(fn.apply(new GetGeoipDatabaseRequest.Builder()).build());
}

/**
* Returns information about one or more geoip database configurations.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
* on elastic.co</a>
*/

public CompletableFuture<GetGeoipDatabaseResponse> getGeoipDatabase() {
return this.transport.performRequestAsync(new GetGeoipDatabaseRequest.Builder().build(),
GetGeoipDatabaseRequest._ENDPOINT, this.transportOptions);
}

// ----- Endpoint: ingest.get_pipeline

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,54 @@ public GeoIpStatsResponse geoIpStats() throws IOException, ElasticsearchExceptio
this.transportOptions);
}

// ----- Endpoint: ingest.get_geoip_database

/**
* Returns information about one or more geoip database configurations.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
* on elastic.co</a>
*/

public GetGeoipDatabaseResponse getGeoipDatabase(GetGeoipDatabaseRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint<GetGeoipDatabaseRequest, GetGeoipDatabaseResponse, ErrorResponse> endpoint = (JsonEndpoint<GetGeoipDatabaseRequest, GetGeoipDatabaseResponse, ErrorResponse>) GetGeoipDatabaseRequest._ENDPOINT;

return this.transport.performRequest(request, endpoint, this.transportOptions);
}

/**
* Returns information about one or more geoip database configurations.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetGeoipDatabaseRequest}
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
* on elastic.co</a>
*/

public final GetGeoipDatabaseResponse getGeoipDatabase(
Function<GetGeoipDatabaseRequest.Builder, ObjectBuilder<GetGeoipDatabaseRequest>> fn)
throws IOException, ElasticsearchException {
return getGeoipDatabase(fn.apply(new GetGeoipDatabaseRequest.Builder()).build());
}

/**
* Returns information about one or more geoip database configurations.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/TODO.html">Documentation
* on elastic.co</a>
*/

public GetGeoipDatabaseResponse getGeoipDatabase() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetGeoipDatabaseRequest.Builder().build(),
GetGeoipDatabaseRequest._ENDPOINT, this.transportOptions);
}

// ----- Endpoint: ingest.get_pipeline

/**
Expand Down
Loading

0 comments on commit 17c4cf5

Please sign in to comment.