Skip to content

Commit

Permalink
[codegen] update to latest api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta committed May 30, 2024
1 parent de23292 commit f80ab05
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1114,12 +1114,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
if (ApiTypeHelper.isDefined(this.storedFields)) {
generator.writeKey("stored_fields");
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);
if (this.storedFields.size() == 1) {
String singleItem = this.storedFields.get(0);
generator.write(singleItem);

} else {
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);

}
generator.writeEnd();
}
generator.writeEnd();

}
if (this.suggest != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

if (ApiTypeHelper.isDefined(this.storedFields)) {
generator.writeKey("stored_fields");
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);
if (this.storedFields.size() == 1) {
String singleItem = this.storedFields.get(0);
generator.write(singleItem);

} else {
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);

}
generator.writeEnd();
}
generator.writeEnd();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1200,12 +1200,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
if (ApiTypeHelper.isDefined(this.storedFields)) {
generator.writeKey("stored_fields");
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);
if (this.storedFields.size() == 1) {
String singleItem = this.storedFields.get(0);
generator.write(singleItem);

} else {
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);

}
generator.writeEnd();
}
generator.writeEnd();

}
if (this.suggest != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
public class Hit<TDocument> implements JsonpSerializable {
private final String index;

@Nullable
private final String id;

@Nullable
Expand Down Expand Up @@ -126,7 +127,7 @@ public class Hit<TDocument> implements JsonpSerializable {
private Hit(Builder<TDocument> builder) {

this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
this.id = builder.id;
this.score = builder.score;
this.explanation = builder.explanation;
this.fields = ApiTypeHelper.unmodifiable(builder.fields);
Expand Down Expand Up @@ -160,8 +161,9 @@ public final String index() {
}

/**
* Required - API name: {@code _id}
* API name: {@code _id}
*/
@Nullable
public final String id() {
return this.id;
}
Expand Down Expand Up @@ -311,9 +313,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("_index");
generator.write(this.index);

generator.writeKey("_id");
generator.write(this.id);
if (this.id != null) {
generator.writeKey("_id");
generator.write(this.id);

}
if (this.score != null) {
generator.writeKey("_score");
JsonpUtils.serializeDoubleOrNull(generator, this.score, Double.NaN);
Expand Down Expand Up @@ -470,6 +474,7 @@ public static class Builder<TDocument> extends WithJsonObjectBuilderBase<Builder
ObjectBuilder<Hit<TDocument>> {
private String index;

@Nullable
private String id;

@Nullable
Expand Down Expand Up @@ -535,9 +540,9 @@ public final Builder<TDocument> index(String value) {
}

/**
* Required - API name: {@code _id}
* API name: {@code _id}
*/
public final Builder<TDocument> id(String value) {
public final Builder<TDocument> id(@Nullable String value) {
this.id = value;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2170,7 +2170,7 @@
'search_application.put_behavioral_analytics.AnalyticsAcknowledgeResponseBase': 'search_application/put_behavioral_analytics/BehavioralAnalyticsPutResponse.ts#L28-L33',
'search_application.put_behavioral_analytics.Request': 'search_application/put_behavioral_analytics/BehavioralAnalyticsPutRequest.ts#L22-L35',
'search_application.put_behavioral_analytics.Response': 'search_application/put_behavioral_analytics/BehavioralAnalyticsPutResponse.ts#L24-L26',
'search_application.search.Request': 'search_application/search/SearchApplicationsSearchRequest.ts#L24-L43',
'search_application.search.Request': 'search_application/search/SearchApplicationsSearchRequest.ts#L24-L52',
'search_application.search.Response': 'search_application/search/SearchApplicationsSearchResponse.ts#L23-L25',
'searchable_snapshots._types.StatsLevel': 'searchable_snapshots/_types/stats.ts#L20-L24',
'searchable_snapshots.cache_stats.Node': 'searchable_snapshots/cache_stats/Response.ts#L30-L32',
Expand Down Expand Up @@ -2720,10 +2720,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/71f49732424ed53b8d1df829f2a2c48efce4dda3/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/2438c4b3e5ecd91091d9a9a75eace1c380d8e479/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/71f49732424ed53b8d1df829f2a2c48efce4dda3/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/2438c4b3e5ecd91091d9a9a75eace1c380d8e479/specification/">Elasticsearch API specification</a>.
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -1005,12 +1005,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
if (ApiTypeHelper.isDefined(this.storedFields)) {
generator.writeKey("stored_fields");
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);
if (this.storedFields.size() == 1) {
String singleItem = this.storedFields.get(0);
generator.write(singleItem);

} else {
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);

}
generator.writeEnd();
}
generator.writeEnd();

}
if (this.suggest != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Integer;
import java.lang.Long;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -60,7 +60,7 @@
@JsonpDeserializable
public class MappingLimitSettingsDepth implements JsonpSerializable {
@Nullable
private final Integer limit;
private final Long limit;

// ---------------------------------------------------------------------------------------------

Expand All @@ -83,7 +83,7 @@ public static MappingLimitSettingsDepth of(Function<Builder, ObjectBuilder<Mappi
* API name: {@code limit}
*/
@Nullable
public final Integer limit() {
public final Long limit() {
return this.limit;
}

Expand Down Expand Up @@ -121,7 +121,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
implements
ObjectBuilder<MappingLimitSettingsDepth> {
@Nullable
private Integer limit;
private Long limit;

/**
* The maximum depth for a field, which is measured as the number of inner
Expand All @@ -131,7 +131,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
* <p>
* API name: {@code limit}
*/
public final Builder limit(@Nullable Integer value) {
public final Builder limit(@Nullable Long value) {
this.limit = value;
return this;
}
Expand Down Expand Up @@ -165,7 +165,7 @@ public MappingLimitSettingsDepth build() {
protected static void setupMappingLimitSettingsDepthDeserializer(
ObjectDeserializer<MappingLimitSettingsDepth.Builder> op) {

op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit");
op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Integer;
import java.lang.Long;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -60,7 +60,7 @@
@JsonpDeserializable
public class MappingLimitSettingsDimensionFields implements JsonpSerializable {
@Nullable
private final Integer limit;
private final Long limit;

// ---------------------------------------------------------------------------------------------

Expand All @@ -84,7 +84,7 @@ public static MappingLimitSettingsDimensionFields of(
* API name: {@code limit}
*/
@Nullable
public final Integer limit() {
public final Long limit() {
return this.limit;
}

Expand Down Expand Up @@ -122,7 +122,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
implements
ObjectBuilder<MappingLimitSettingsDimensionFields> {
@Nullable
private Integer limit;
private Long limit;

/**
* [preview] This functionality is in technical preview and may be changed or
Expand All @@ -132,7 +132,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
* <p>
* API name: {@code limit}
*/
public final Builder limit(@Nullable Integer value) {
public final Builder limit(@Nullable Long value) {
this.limit = value;
return this;
}
Expand Down Expand Up @@ -167,7 +167,7 @@ public MappingLimitSettingsDimensionFields build() {
protected static void setupMappingLimitSettingsDimensionFieldsDeserializer(
ObjectDeserializer<MappingLimitSettingsDimensionFields.Builder> op) {

op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit");
op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Integer;
import java.lang.Long;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -60,7 +60,7 @@
@JsonpDeserializable
public class MappingLimitSettingsNestedFields implements JsonpSerializable {
@Nullable
private final Integer limit;
private final Long limit;

// ---------------------------------------------------------------------------------------------

Expand All @@ -84,7 +84,7 @@ public static MappingLimitSettingsNestedFields of(
* API name: {@code limit}
*/
@Nullable
public final Integer limit() {
public final Long limit() {
return this.limit;
}

Expand Down Expand Up @@ -122,7 +122,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
implements
ObjectBuilder<MappingLimitSettingsNestedFields> {
@Nullable
private Integer limit;
private Long limit;

/**
* The maximum number of distinct nested mappings in an index. The nested type
Expand All @@ -132,7 +132,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
* <p>
* API name: {@code limit}
*/
public final Builder limit(@Nullable Integer value) {
public final Builder limit(@Nullable Long value) {
this.limit = value;
return this;
}
Expand Down Expand Up @@ -166,7 +166,7 @@ public MappingLimitSettingsNestedFields build() {
protected static void setupMappingLimitSettingsNestedFieldsDeserializer(
ObjectDeserializer<MappingLimitSettingsNestedFields.Builder> op) {

op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit");
op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Integer;
import java.lang.Long;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -60,7 +60,7 @@
@JsonpDeserializable
public class MappingLimitSettingsNestedObjects implements JsonpSerializable {
@Nullable
private final Integer limit;
private final Long limit;

// ---------------------------------------------------------------------------------------------

Expand All @@ -83,7 +83,7 @@ public static MappingLimitSettingsNestedObjects of(
* API name: {@code limit}
*/
@Nullable
public final Integer limit() {
public final Long limit() {
return this.limit;
}

Expand Down Expand Up @@ -121,7 +121,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
implements
ObjectBuilder<MappingLimitSettingsNestedObjects> {
@Nullable
private Integer limit;
private Long limit;

/**
* The maximum number of nested JSON objects that a single document can contain
Expand All @@ -130,7 +130,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
* <p>
* API name: {@code limit}
*/
public final Builder limit(@Nullable Integer value) {
public final Builder limit(@Nullable Long value) {
this.limit = value;
return this;
}
Expand Down Expand Up @@ -164,7 +164,7 @@ public MappingLimitSettingsNestedObjects build() {
protected static void setupMappingLimitSettingsNestedObjectsDeserializer(
ObjectDeserializer<MappingLimitSettingsNestedObjects.Builder> op) {

op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit");
op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit");

}

Expand Down
Loading

0 comments on commit f80ab05

Please sign in to comment.