Skip to content

Commit

Permalink
Re-run codegen (opensearch-project#1216)
Browse files Browse the repository at this point in the history
* Re-run codegen

Signed-off-by: Thomas Farr <[email protected]>

* Improve null handling

Signed-off-by: Thomas Farr <[email protected]>

---------

Signed-off-by: Thomas Farr <[email protected]>
(cherry picked from commit 897cc9b)
  • Loading branch information
Xtansia committed Oct 1, 2024
1 parent a981eb7 commit a640485
Show file tree
Hide file tree
Showing 54 changed files with 338 additions and 208 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonData;
import org.opensearch.client.json.JsonpDeserializable;
Expand All @@ -67,15 +68,19 @@ public class ErrorCause implements PlainJsonSerializable {
@Nullable
private final String reason;

@Nonnull
private final List<ErrorCause> rootCause;

@Nullable
private final String stackTrace;

@Nonnull
private final List<ErrorCause> suppressed;

@Nonnull
private final String type;

@Nonnull
private final Map<String, JsonData> metadata;

// ---------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -116,6 +121,7 @@ public final String reason() {
/**
* API name: {@code root_cause}
*/
@Nonnull
public final List<ErrorCause> rootCause() {
return this.rootCause;
}
Expand All @@ -134,6 +140,7 @@ public final String stackTrace() {
/**
* API name: {@code suppressed}
*/
@Nonnull
public final List<ErrorCause> suppressed() {
return this.suppressed;
}
Expand All @@ -144,13 +151,15 @@ public final List<ErrorCause> suppressed() {
* API name: {@code type}
* </p>
*/
@Nonnull
public final String type() {
return this.type;
}

/**
* Additional details about the error.
*/
@Nonnull
public final Map<String, JsonData> metadata() {
return this.metadata;
}
Expand Down Expand Up @@ -420,14 +429,14 @@ public int hashCode() {

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
if (o == null || this.getClass() != o.getClass()) return false;
ErrorCause other = (ErrorCause) o;
return Objects.equals(this.causedBy, other.causedBy)
&& Objects.equals(this.reason, other.reason)
&& Objects.equals(this.rootCause, other.rootCause)
&& Objects.equals(this.stackTrace, other.stackTrace)
&& Objects.equals(this.suppressed, other.suppressed)
&& Objects.equals(this.type, other.type)
&& this.type.equals(other.type)
&& Objects.equals(this.metadata, other.metadata);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
Expand All @@ -63,6 +64,7 @@ public class ShardFailure implements PlainJsonSerializable {
@Nullable
private final String node;

@Nonnull
private final ErrorCause reason;

private final int shard;
Expand Down Expand Up @@ -103,6 +105,7 @@ public final String node() {
/**
* Required - API name: {@code reason}
*/
@Nonnull
public final ErrorCause reason() {
return this.reason;
}
Expand Down Expand Up @@ -259,12 +262,12 @@ public int hashCode() {

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
if (o == null || this.getClass() != o.getClass()) return false;
ShardFailure other = (ShardFailure) o;
return Objects.equals(this.index, other.index)
&& Objects.equals(this.node, other.node)
&& Objects.equals(this.reason, other.reason)
&& this.shard() == other.shard()
&& this.reason.equals(other.reason)
&& this.shard == other.shard
&& Objects.equals(this.status, other.status);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
Expand All @@ -58,15 +59,19 @@
@Generated("org.opensearch.client.codegen.CodeGenerator")
public class ShardStatistics implements PlainJsonSerializable {

@Nonnull
private final Number failed;

@Nonnull
private final List<ShardFailure> failures;

@Nullable
private final Number skipped;

@Nonnull
private final Number successful;

@Nonnull
private final Number total;

// ---------------------------------------------------------------------------------------------
Expand All @@ -86,13 +91,15 @@ public static ShardStatistics of(Function<ShardStatistics.Builder, ObjectBuilder
/**
* Required - API name: {@code failed}
*/
@Nonnull
public final Number failed() {
return this.failed;
}

/**
* API name: {@code failures}
*/
@Nonnull
public final List<ShardFailure> failures() {
return this.failures;
}
Expand All @@ -108,13 +115,15 @@ public final Number skipped() {
/**
* Required - API name: {@code successful}
*/
@Nonnull
public final Number successful() {
return this.successful;
}

/**
* Required - API name: {@code total}
*/
@Nonnull
public final Number total() {
return this.total;
}
Expand Down Expand Up @@ -277,12 +286,12 @@ public int hashCode() {

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
if (o == null || this.getClass() != o.getClass()) return false;
ShardStatistics other = (ShardStatistics) o;
return Objects.equals(this.failed, other.failed)
return this.failed.equals(other.failed)
&& Objects.equals(this.failures, other.failures)
&& Objects.equals(this.skipped, other.skipped)
&& Objects.equals(this.successful, other.successful)
&& Objects.equals(this.total, other.total);
&& this.successful.equals(other.successful)
&& this.total.equals(other.total);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
Expand All @@ -57,16 +58,20 @@ public abstract class WriteResponseBase implements PlainJsonSerializable {
@Nullable
private final Boolean forcedRefresh;

@Nonnull
private final String id;

@Nonnull
private final String index;

private final long primaryTerm;

@Nonnull
private final Result result;

private final long seqNo;

@Nonnull
private final ShardStatistics shards;

private final long version;
Expand Down Expand Up @@ -95,13 +100,15 @@ public final Boolean forcedRefresh() {
/**
* Required - API name: {@code _id}
*/
@Nonnull
public final String id() {
return this.id;
}

/**
* Required - API name: {@code _index}
*/
@Nonnull
public final String index() {
return this.index;
}
Expand All @@ -116,6 +123,7 @@ public final long primaryTerm() {
/**
* Required - API name: {@code result}
*/
@Nonnull
public final Result result() {
return this.result;
}
Expand All @@ -130,6 +138,7 @@ public final long seqNo() {
/**
* Required - API name: {@code _shards}
*/
@Nonnull
public final ShardStatistics shards() {
return this.shards;
}
Expand Down Expand Up @@ -281,7 +290,7 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupWriteRes

public int hashCode() {
int result = 17;
result = 31 * result + Boolean.hashCode(this.forcedRefresh);
result = 31 * result + Objects.hashCode(this.forcedRefresh);
result = 31 * result + this.id.hashCode();
result = 31 * result + this.index.hashCode();
result = 31 * result + Long.hashCode(this.primaryTerm);
Expand All @@ -294,15 +303,15 @@ public int hashCode() {

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
if (o == null || this.getClass() != o.getClass()) return false;
WriteResponseBase other = (WriteResponseBase) o;
return this.forcedRefresh() == other.forcedRefresh()
&& Objects.equals(this.id, other.id)
&& Objects.equals(this.index, other.index)
&& this.primaryTerm() == other.primaryTerm()
&& Objects.equals(this.result, other.result)
&& this.seqNo() == other.seqNo()
&& Objects.equals(this.shards, other.shards)
&& this.version() == other.version();
return Objects.equals(this.forcedRefresh, other.forcedRefresh)
&& this.id.equals(other.id)
&& this.index.equals(other.index)
&& this.primaryTerm == other.primaryTerm
&& this.result.equals(other.result)
&& this.seqNo == other.seqNo
&& this.shards.equals(other.shards)
&& this.version == other.version;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public int hashCode() {

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
if (o == null || this.getClass() != o.getClass()) return false;
Action other = (Action) o;
return Objects.equals(this.actionType, other.actionType)
&& Objects.equals(this.headers, other.headers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,26 +283,26 @@ protected static void setupClientConfigDeserializer(ObjectDeserializer<ClientCon

public int hashCode() {
int result = 17;
result = 31 * result + Integer.hashCode(this.connectionTimeout);
result = 31 * result + Integer.hashCode(this.maxConnection);
result = 31 * result + Integer.hashCode(this.maxRetryTimes);
result = 31 * result + Integer.hashCode(this.readTimeout);
result = 31 * result + Integer.hashCode(this.retryBackoffMillis);
result = 31 * result + Objects.hashCode(this.connectionTimeout);
result = 31 * result + Objects.hashCode(this.maxConnection);
result = 31 * result + Objects.hashCode(this.maxRetryTimes);
result = 31 * result + Objects.hashCode(this.readTimeout);
result = 31 * result + Objects.hashCode(this.retryBackoffMillis);
result = 31 * result + Objects.hashCode(this.retryBackoffPolicy);
result = 31 * result + Integer.hashCode(this.retryTimeoutSeconds);
result = 31 * result + Objects.hashCode(this.retryTimeoutSeconds);
return result;
}

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
if (o == null || this.getClass() != o.getClass()) return false;
ClientConfig other = (ClientConfig) o;
return this.connectionTimeout() == other.connectionTimeout()
&& this.maxConnection() == other.maxConnection()
&& this.maxRetryTimes() == other.maxRetryTimes()
&& this.readTimeout() == other.readTimeout()
&& this.retryBackoffMillis() == other.retryBackoffMillis()
return Objects.equals(this.connectionTimeout, other.connectionTimeout)
&& Objects.equals(this.maxConnection, other.maxConnection)
&& Objects.equals(this.maxRetryTimes, other.maxRetryTimes)
&& Objects.equals(this.readTimeout, other.readTimeout)
&& Objects.equals(this.retryBackoffMillis, other.retryBackoffMillis)
&& Objects.equals(this.retryBackoffPolicy, other.retryBackoffPolicy)
&& this.retryTimeoutSeconds() == other.retryTimeoutSeconds();
&& Objects.equals(this.retryTimeoutSeconds, other.retryTimeoutSeconds);
}
}
Loading

0 comments on commit a640485

Please sign in to comment.