Skip to content

Commit

Permalink
[codegen] Update to latest API specification
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Nov 29, 2022
1 parent 1e3c382 commit 2d5bf2d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

package co.elastic.clients.elasticsearch._types.mapping;

import co.elastic.clients.json.JsonData;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
Expand Down Expand Up @@ -51,8 +50,6 @@
*/

public abstract class PropertyBase implements JsonpSerializable {
private final Map<String, JsonData> localMetadata;

private final Map<String, String> meta;

private final Map<String, Property> properties;
Expand All @@ -69,7 +66,6 @@ public abstract class PropertyBase implements JsonpSerializable {

protected PropertyBase(AbstractBuilder<?> builder) {

this.localMetadata = ApiTypeHelper.unmodifiable(builder.localMetadata);
this.meta = ApiTypeHelper.unmodifiable(builder.meta);
this.properties = ApiTypeHelper.unmodifiable(builder.properties);
this.ignoreAbove = builder.ignoreAbove;
Expand All @@ -79,13 +75,8 @@ protected PropertyBase(AbstractBuilder<?> builder) {
}

/**
* API name: {@code local_metadata}
*/
public final Map<String, JsonData> localMetadata() {
return this.localMetadata;
}

/**
* Metadata about the field.
* <p>
* API name: {@code meta}
*/
public final Map<String, String> meta() {
Expand Down Expand Up @@ -133,17 +124,6 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {

protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

if (ApiTypeHelper.isDefined(this.localMetadata)) {
generator.writeKey("local_metadata");
generator.writeStartObject();
for (Map.Entry<String, JsonData> item0 : this.localMetadata.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);

}
generator.writeEnd();

}
if (ApiTypeHelper.isDefined(this.meta)) {
generator.writeKey("meta");
generator.writeStartObject();
Expand Down Expand Up @@ -197,9 +177,6 @@ public String toString() {
protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>>
extends
WithJsonObjectBuilderBase<BuilderT> {
@Nullable
private Map<String, JsonData> localMetadata;

@Nullable
private Map<String, String> meta;

Expand All @@ -216,26 +193,8 @@ protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder
private Map<String, Property> fields;

/**
* API name: {@code local_metadata}
* <p>
* Adds all entries of <code>map</code> to <code>localMetadata</code>.
*/
public final BuilderT localMetadata(Map<String, JsonData> map) {
this.localMetadata = _mapPutAll(this.localMetadata, map);
return self();
}

/**
* API name: {@code local_metadata}
* Metadata about the field.
* <p>
* Adds an entry to <code>localMetadata</code>.
*/
public final BuilderT localMetadata(String key, JsonData value) {
this.localMetadata = _mapPut(this.localMetadata, key, value);
return self();
}

/**
* API name: {@code meta}
* <p>
* Adds all entries of <code>map</code> to <code>meta</code>.
Expand All @@ -246,6 +205,8 @@ public final BuilderT meta(Map<String, String> map) {
}

/**
* Metadata about the field.
* <p>
* API name: {@code meta}
* <p>
* Adds an entry to <code>meta</code>.
Expand Down Expand Up @@ -337,8 +298,6 @@ public final BuilderT fields(String key, Function<Property.Builder, ObjectBuilde
protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupPropertyBaseDeserializer(
ObjectDeserializer<BuilderT> op) {

op.add(AbstractBuilder::localMetadata, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER),
"local_metadata");
op.add(AbstractBuilder::meta, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()),
"meta");
op.add(AbstractBuilder::properties, JsonpDeserializer.stringMapDeserializer(Property._DESERIALIZER),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@
'_types.mapping.FieldAliasProperty': '_types/mapping/specialized.ts#L48-L51',
'_types.mapping.FieldMapping': '_types/mapping/meta-fields.ts#L24-L27',
'_types.mapping.FieldNamesField': '_types/mapping/meta-fields.ts#L42-L44',
'_types.mapping.FieldType': '_types/mapping/Property.ts#L70-L113',
'_types.mapping.FieldType': '_types/mapping/Property.ts#L73-L116',
'_types.mapping.FlattenedProperty': '_types/mapping/complex.ts#L25-L36',
'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L156-L159',
'_types.mapping.FloatRangeProperty': '_types/mapping/range.ts#L46-L48',
Expand Down Expand Up @@ -700,8 +700,8 @@
'_types.mapping.OnScriptError': '_types/mapping/core.ts#L145-L148',
'_types.mapping.PercolatorProperty': '_types/mapping/core.ts#L214-L216',
'_types.mapping.PointProperty': '_types/mapping/geo.ts#L62-L67',
'_types.mapping.Property': '_types/mapping/Property.ts#L52-L68',
'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L43-L50',
'_types.mapping.Property': '_types/mapping/Property.ts#L55-L71',
'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L43-L53',
'_types.mapping.RangePropertyBase': '_types/mapping/range.ts#L23-L27',
'_types.mapping.RankFeatureProperty': '_types/mapping/core.ts#L218-L221',
'_types.mapping.RankFeaturesProperty': '_types/mapping/core.ts#L223-L225',
Expand Down Expand Up @@ -2319,10 +2319,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/ecbb204f697e82575febfeae209c2eca4a8912fd/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/3fce738c33988c6222c9032831ba566bf2d63885/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/ecbb204f697e82575febfeae209c2eca4a8912fd/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/3fce738c33988c6222c9032831ba566bf2d63885/specification/">Elasticsearch API specification</a>.
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ public final Time masterTimeout() {
}

/**
* Filters the returned indices to only indices that are managed by ILM.
* Filters the returned indices to only indices that are managed by ILM and are
* in an error state, either due to an encountering an error while executing the
* policy, or attempting to use a policy that does not exist.
* <p>
* API name: {@code only_errors}
*/
Expand All @@ -119,9 +121,7 @@ public final Boolean onlyErrors() {
}

/**
* Filters the returned indices to only indices that are managed by ILM and are
* in an error state, either due to an encountering an error while executing the
* policy, or attempting to use a policy that does not exist.
* Filters the returned indices to only indices that are managed by ILM.
* <p>
* API name: {@code only_managed}
*/
Expand Down Expand Up @@ -198,7 +198,9 @@ public final Builder masterTimeout(Function<Time.Builder, ObjectBuilder<Time>> f
}

/**
* Filters the returned indices to only indices that are managed by ILM.
* Filters the returned indices to only indices that are managed by ILM and are
* in an error state, either due to an encountering an error while executing the
* policy, or attempting to use a policy that does not exist.
* <p>
* API name: {@code only_errors}
*/
Expand All @@ -208,9 +210,7 @@ public final Builder onlyErrors(@Nullable Boolean value) {
}

/**
* Filters the returned indices to only indices that are managed by ILM and are
* in an error state, either due to an encountering an error while executing the
* policy, or attempting to use a policy that does not exist.
* Filters the returned indices to only indices that are managed by ILM.
* <p>
* API name: {@code only_managed}
*/
Expand Down

0 comments on commit 2d5bf2d

Please sign in to comment.