Skip to content

Update to latest API spec, update ES test server to use SSL #384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 30, 2022
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
4 changes: 2 additions & 2 deletions java-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ dependencies {

// MIT
// https://www.testcontainers.org/
testImplementation("org.testcontainers", "testcontainers", "1.17.2")
testImplementation("org.testcontainers", "elasticsearch", "1.17.2")
testImplementation("org.testcontainers", "testcontainers", "1.17.3")
testImplementation("org.testcontainers", "elasticsearch", "1.17.3")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class ErrorCause implements JsonpSerializable {
@Nullable
private final String type;

@Nullable
private final String reason;

@Nullable
Expand All @@ -79,7 +80,7 @@ private ErrorCause(Builder builder) {
this.metadata = ApiTypeHelper.unmodifiable(builder.metadata);

this.type = builder.type;
this.reason = ApiTypeHelper.requireNonNull(builder.reason, this, "reason");
this.reason = builder.reason;
this.stackTrace = builder.stackTrace;
this.causedBy = builder.causedBy;
this.rootCause = ApiTypeHelper.unmodifiable(builder.rootCause);
Expand Down Expand Up @@ -109,10 +110,11 @@ public final String type() {
}

/**
* Required - A human-readable explanation of the error, in english
* A human-readable explanation of the error, in english
* <p>
* API name: {@code reason}
*/
@Nullable
public final String reason() {
return this.reason;
}
Expand Down Expand Up @@ -172,9 +174,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write(this.type);

}
generator.writeKey("reason");
generator.write(this.reason);
if (this.reason != null) {
generator.writeKey("reason");
generator.write(this.reason);

}
if (this.stackTrace != null) {
generator.writeKey("stack_trace");
generator.write(this.stackTrace);
Expand Down Expand Up @@ -246,6 +250,7 @@ public final Builder metadata(String key, JsonData value) {
@Nullable
private String type;

@Nullable
private String reason;

@Nullable
Expand All @@ -271,11 +276,11 @@ public final Builder type(@Nullable String value) {
}

/**
* Required - A human-readable explanation of the error, in english
* A human-readable explanation of the error, in english
* <p>
* API name: {@code reason}
*/
public final Builder reason(String value) {
public final Builder reason(@Nullable String value) {
this.reason = value;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import co.elastic.clients.json.JsonpMapper;
import co.elastic.clients.json.ObjectBuilderDeserializer;
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ApiTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import jakarta.json.stream.JsonGenerator;
import java.util.Objects;
Expand All @@ -46,14 +45,15 @@
*/
@JsonpDeserializable
public class GeoBoundsAggregate extends AggregateBase implements AggregateVariant {
@Nullable
private final GeoBounds bounds;

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

private GeoBoundsAggregate(Builder builder) {
super(builder);

this.bounds = ApiTypeHelper.requireNonNull(builder.bounds, this, "bounds");
this.bounds = builder.bounds;

}

Expand All @@ -70,17 +70,21 @@ public Aggregate.Kind _aggregateKind() {
}

/**
* Required - API name: {@code bounds}
* API name: {@code bounds}
*/
@Nullable
public final GeoBounds bounds() {
return this.bounds;
}

protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

super.serializeInternal(generator, mapper);
generator.writeKey("bounds");
this.bounds.serialize(generator, mapper);
if (this.bounds != null) {
generator.writeKey("bounds");
this.bounds.serialize(generator, mapper);

}

}

Expand All @@ -93,18 +97,19 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
public static class Builder extends AggregateBase.AbstractBuilder<Builder>
implements
ObjectBuilder<GeoBoundsAggregate> {
@Nullable
private GeoBounds bounds;

/**
* Required - API name: {@code bounds}
* API name: {@code bounds}
*/
public final Builder bounds(GeoBounds value) {
public final Builder bounds(@Nullable GeoBounds value) {
this.bounds = value;
return this;
}

/**
* Required - API name: {@code bounds}
* API name: {@code bounds}
*/
public final Builder bounds(Function<GeoBounds.Builder, ObjectBuilder<GeoBounds>> fn) {
return this.bounds(fn.apply(new GeoBounds.Builder()).build());
Expand Down
Loading