Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public class RuntimeField implements DynamicTemplateVariant, JsonpSerializable {
@Nullable
private final Script script;

@Nullable
private final OnScriptError onScriptError;

private final RuntimeFieldType type;

// ---------------------------------------------------------------------------------------------
Expand All @@ -94,6 +97,7 @@ private RuntimeField(Builder builder) {
this.targetField = builder.targetField;
this.targetIndex = builder.targetIndex;
this.script = builder.script;
this.onScriptError = builder.onScriptError;
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");

}
Expand Down Expand Up @@ -178,6 +182,14 @@ public final Script script() {
return this.script;
}

/**
* API name: {@code on_script_error}
*/
@Nullable
public final OnScriptError onScriptError() {
return this.onScriptError;
}

/**
* Required - Field type, which can be: <code>boolean</code>,
* <code>composite</code>, <code>date</code>, <code>double</code>,
Expand Down Expand Up @@ -247,6 +259,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.script.serialize(generator, mapper);

}
if (this.onScriptError != null) {
generator.writeKey("on_script_error");
this.onScriptError.serialize(generator, mapper);
}
generator.writeKey("type");
this.type.serialize(generator, mapper);

Expand Down Expand Up @@ -285,6 +301,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
@Nullable
private Script script;

@Nullable
private OnScriptError onScriptError;

private RuntimeFieldType type;

public Builder() {
Expand All @@ -297,6 +316,7 @@ private Builder(RuntimeField instance) {
this.targetField = instance.targetField;
this.targetIndex = instance.targetIndex;
this.script = instance.script;
this.onScriptError = instance.onScriptError;
this.type = instance.type;

}
Expand Down Expand Up @@ -431,6 +451,14 @@ public final Builder script(Function<Script.Builder, ObjectBuilder<Script>> fn)
return this.script(fn.apply(new Script.Builder()).build());
}

/**
* API name: {@code on_script_error}
*/
public final Builder onScriptError(@Nullable OnScriptError value) {
this.onScriptError = value;
return this;
}

/**
* Required - Field type, which can be: <code>boolean</code>,
* <code>composite</code>, <code>date</code>, <code>double</code>,
Expand Down Expand Up @@ -486,6 +514,7 @@ protected static void setupRuntimeFieldDeserializer(ObjectDeserializer<RuntimeFi
op.add(Builder::targetField, JsonpDeserializer.stringDeserializer(), "target_field");
op.add(Builder::targetIndex, JsonpDeserializer.stringDeserializer(), "target_index");
op.add(Builder::script, Script._DESERIALIZER, "script");
op.add(Builder::onScriptError, OnScriptError._DESERIALIZER, "on_script_error");
op.add(Builder::type, RuntimeFieldType._DESERIALIZER, "type");

}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ public class IndexSettings implements JsonpSerializable {
@Nullable
private final IndexRouting routing;

@Nullable
private final IndexSettingsUnassigned unassigned;

@Nullable
private final Time gcDeletes;

Expand Down Expand Up @@ -279,6 +282,7 @@ private IndexSettings(Builder builder) {
this.maxTermsCount = builder.maxTermsCount;
this.maxRegexLength = builder.maxRegexLength;
this.routing = builder.routing;
this.unassigned = builder.unassigned;
this.gcDeletes = builder.gcDeletes;
this.defaultPipeline = builder.defaultPipeline;
this.finalPipeline = builder.finalPipeline;
Expand Down Expand Up @@ -572,6 +576,14 @@ public final IndexRouting routing() {
return this.routing;
}

/**
* API name: {@code unassigned}
*/
@Nullable
public final IndexSettingsUnassigned unassigned() {
return this.unassigned;
}

/**
* API name: {@code gc_deletes}
*/
Expand Down Expand Up @@ -962,6 +974,11 @@ else if (isExpNullAutoExpandReplicas) {
generator.writeKey("routing");
this.routing.serialize(generator, mapper);

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

}
if (this.gcDeletes != null) {
generator.writeKey("gc_deletes");
Expand Down Expand Up @@ -1232,6 +1249,9 @@ public final Builder otherSettings(String key, JsonData value) {
@Nullable
private IndexRouting routing;

@Nullable
private IndexSettingsUnassigned unassigned;

@Nullable
private Time gcDeletes;

Expand Down Expand Up @@ -1341,6 +1361,7 @@ private Builder(IndexSettings instance) {
this.maxTermsCount = instance.maxTermsCount;
this.maxRegexLength = instance.maxRegexLength;
this.routing = instance.routing;
this.unassigned = instance.unassigned;
this.gcDeletes = instance.gcDeletes;
this.defaultPipeline = instance.defaultPipeline;
this.finalPipeline = instance.finalPipeline;
Expand Down Expand Up @@ -1717,6 +1738,22 @@ public final Builder routing(Function<IndexRouting.Builder, ObjectBuilder<IndexR
return this.routing(fn.apply(new IndexRouting.Builder()).build());
}

/**
* API name: {@code unassigned}
*/
public final Builder unassigned(@Nullable IndexSettingsUnassigned value) {
this.unassigned = value;
return this;
}

/**
* API name: {@code unassigned}
*/
public final Builder unassigned(
Function<IndexSettingsUnassigned.Builder, ObjectBuilder<IndexSettingsUnassigned>> fn) {
return this.unassigned(fn.apply(new IndexSettingsUnassigned.Builder()).build());
}

/**
* API name: {@code gc_deletes}
*/
Expand Down Expand Up @@ -2124,6 +2161,7 @@ protected static void setupIndexSettingsDeserializer(ObjectDeserializer<IndexSet
op.add(Builder::maxTermsCount, JsonpDeserializer.integerDeserializer(), "max_terms_count");
op.add(Builder::maxRegexLength, JsonpDeserializer.integerDeserializer(), "max_regex_length");
op.add(Builder::routing, IndexRouting._DESERIALIZER, "routing");
op.add(Builder::unassigned, IndexSettingsUnassigned._DESERIALIZER, "unassigned");
op.add(Builder::gcDeletes, Time._DESERIALIZER, "gc_deletes");
op.add(Builder::defaultPipeline, JsonpDeserializer.stringDeserializer(), "default_pipeline");
op.add(Builder::finalPipeline, JsonpDeserializer.stringDeserializer(), "final_pipeline");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package co.elastic.clients.elasticsearch.indices;

import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
import co.elastic.clients.json.JsonpSerializable;
import co.elastic.clients.json.JsonpUtils;
import co.elastic.clients.json.ObjectBuilderDeserializer;
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ObjectBuilder;
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;

//----------------------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------------------
//
// This code is generated from the Elasticsearch API specification
// at https://github.com/elastic/elasticsearch-specification
//
// Manual updates to this file will be lost when the code is
// re-generated.
//
// If you find a property that is missing or wrongly typed, please
// open an issue or a PR on the API specification repository.
//
//----------------------------------------------------------------

// typedef: indices._types.IndexSettingsUnassigned

/**
*
* @see <a href=
* "../doc-files/api-spec.html#indices._types.IndexSettingsUnassigned">API
* specification</a>
*/
@JsonpDeserializable
public class IndexSettingsUnassigned implements JsonpSerializable {
@Nullable
private final IndexSettingsUnassignedNodeLeft nodeLeft;

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

private IndexSettingsUnassigned(Builder builder) {

this.nodeLeft = builder.nodeLeft;

}

public static IndexSettingsUnassigned of(Function<Builder, ObjectBuilder<IndexSettingsUnassigned>> fn) {
return fn.apply(new Builder()).build();
}

/**
* API name: {@code node_left}
*/
@Nullable
public final IndexSettingsUnassignedNodeLeft nodeLeft() {
return this.nodeLeft;
}

/**
* Serialize this object to JSON.
*/
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
generator.writeEnd();
}

protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

if (this.nodeLeft != null) {
generator.writeKey("node_left");
this.nodeLeft.serialize(generator, mapper);

}

}

@Override
public String toString() {
return JsonpUtils.toString(this);
}

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

/**
* Builder for {@link IndexSettingsUnassigned}.
*/

public static class Builder extends WithJsonObjectBuilderBase<Builder>
implements
ObjectBuilder<IndexSettingsUnassigned> {
@Nullable
private IndexSettingsUnassignedNodeLeft nodeLeft;

public Builder() {
}
private Builder(IndexSettingsUnassigned instance) {
this.nodeLeft = instance.nodeLeft;

}
/**
* API name: {@code node_left}
*/
public final Builder nodeLeft(@Nullable IndexSettingsUnassignedNodeLeft value) {
this.nodeLeft = value;
return this;
}

/**
* API name: {@code node_left}
*/
public final Builder nodeLeft(
Function<IndexSettingsUnassignedNodeLeft.Builder, ObjectBuilder<IndexSettingsUnassignedNodeLeft>> fn) {
return this.nodeLeft(fn.apply(new IndexSettingsUnassignedNodeLeft.Builder()).build());
}

@Override
protected Builder self() {
return this;
}

/**
* Builds a {@link IndexSettingsUnassigned}.
*
* @throws NullPointerException
* if some of the required fields are null.
*/
public IndexSettingsUnassigned build() {
_checkSingleUse();

return new IndexSettingsUnassigned(this);
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
* Json deserializer for {@link IndexSettingsUnassigned}
*/
public static final JsonpDeserializer<IndexSettingsUnassigned> _DESERIALIZER = ObjectBuilderDeserializer
.lazy(Builder::new, IndexSettingsUnassigned::setupIndexSettingsUnassignedDeserializer);

protected static void setupIndexSettingsUnassignedDeserializer(
ObjectDeserializer<IndexSettingsUnassigned.Builder> op) {

op.add(Builder::nodeLeft, IndexSettingsUnassignedNodeLeft._DESERIALIZER, "node_left");

}

}
Loading
Loading