diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c56882829..f299533f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ This section is for maintaining a changelog for all breaking changes for the cli ## [Unreleased 2.x] ### Added +- Add `hashCode` and `equals` implementations ([#312](https://github.com/opensearch-project/opensearch-java/pull/312)). ### Dependencies - Bumps `org.junit:junit-bom` from 5.10.3 to 5.11.0 diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java index d955102ca7..631c4bdef1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java @@ -109,4 +109,17 @@ protected static > void setupAcknowle ) { op.add(AbstractBuilder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Boolean.hashCode(this.acknowledged); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + AcknowledgedResponseBase other = (AcknowledgedResponseBase) o; + return this.acknowledged() == other.acknowledged(); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java index 8726abe2e5..bcd4083925 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java @@ -39,6 +39,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.List; import java.util.Map; +import java.util.Objects; import javax.annotation.Generated; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializer; @@ -281,4 +282,27 @@ protected static > void setupBaseNode op.add(AbstractBuilder::roles, JsonpDeserializer.arrayDeserializer(NodeRole._DESERIALIZER), "roles"); op.add(AbstractBuilder::transportAddress, JsonpDeserializer.stringDeserializer(), "transport_address"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.attributes); + result = 31 * result + Objects.hashCode(this.host); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + this.name.hashCode(); + result = 31 * result + Objects.hashCode(this.roles); + result = 31 * result + Objects.hashCode(this.transportAddress); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + BaseNode other = (BaseNode) o; + return Objects.equals(this.attributes, other.attributes) + && Objects.equals(this.host, other.host) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.name, other.name) + && Objects.equals(this.roles, other.roles) + && Objects.equals(this.transportAddress, other.transportAddress); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java index a31cc9741a..d3993eacfb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java @@ -37,6 +37,7 @@ package org.opensearch.client.opensearch._types; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -313,4 +314,29 @@ protected static void setupBulkByScrollFailureDeserializer(ObjectDeserializer buildBulkByS public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.lazy( BulkByScrollTaskStatusOrException::buildBulkByScrollTaskStatusOrExceptionDeserializer ); + + public int hashCode() { + int result = 17; + result = 31 * result + _kind.hashCode(); + result = 31 * result + _value.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + BulkByScrollTaskStatusOrException other = (BulkByScrollTaskStatusOrException) o; + return this._kind().equals(other._kind()) && this._get().equals(other._get()); + } + } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java index c029456c39..de1cad3599 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java @@ -40,6 +40,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -404,4 +405,29 @@ protected static void setupErrorCauseDeserializer(ObjectDeserializer> void setupWriteRes op.add(AbstractBuilder::shards, ShardStatistics._DESERIALIZER, "_shards"); op.add(AbstractBuilder::version, JsonpDeserializer.longDeserializer(), "_version"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Boolean.hashCode(this.forcedRefresh); + result = 31 * result + this.id.hashCode(); + result = 31 * result + this.index.hashCode(); + result = 31 * result + Long.hashCode(this.primaryTerm); + result = 31 * result + this.result.hashCode(); + result = 31 * result + Long.hashCode(this.seqNo); + result = 31 * result + this.shards.hashCode(); + result = 31 * result + Long.hashCode(this.version); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (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(); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java index 6c9e5d2202..b40292bc51 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java @@ -72,4 +72,15 @@ public InfoRequest() {} false, InfoResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoResponse.java index 8f48dfd984..8698576035 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoResponse.java @@ -37,6 +37,7 @@ package org.opensearch.client.opensearch.core; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import org.opensearch.client.json.JsonpDeserializable; @@ -230,4 +231,25 @@ protected static void setupInfoResponseDeserializer(ObjectDeserializer op) { AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); } + + public int hashCode() { + int result = super.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java index 4b1440b7eb..127d1763b8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java @@ -38,6 +38,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -290,4 +291,25 @@ public ImportDanglingIndexRequest build() { false, ImportDanglingIndexResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + Boolean.hashCode(this.acceptDataLoss); + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + this.indexUuid.hashCode(); + result = 31 * result + Objects.hashCode(this.masterTimeout); + result = 31 * result + Objects.hashCode(this.timeout); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + ImportDanglingIndexRequest other = (ImportDanglingIndexRequest) o; + return this.acceptDataLoss() == other.acceptDataLoss() + && Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.indexUuid, other.indexUuid) + && Objects.equals(this.masterTimeout, other.masterTimeout) + && Objects.equals(this.timeout, other.timeout); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexResponse.java index eaef581983..586d116d62 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexResponse.java @@ -101,4 +101,18 @@ public ImportDanglingIndexResponse build() { protected static void setupImportDanglingIndexResponseDeserializer(ObjectDeserializer op) { AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); } + + public int hashCode() { + int result = super.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesRequest.java index 641bb9b012..5452b35c3b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesRequest.java @@ -72,4 +72,15 @@ public ListDanglingIndicesRequest() {} false, ListDanglingIndicesResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesResponse.java index 54acd845ff..6b15626049 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesResponse.java @@ -38,6 +38,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.List; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -230,4 +231,21 @@ protected static void setupListDanglingIndicesResponseDeserializer(ObjectDeseria op.add(Builder::danglingIndices, JsonpDeserializer.arrayDeserializer(DanglingIndex._DESERIALIZER), "dangling_indices"); op.add(Builder::nodes, NodeStatistics._DESERIALIZER, "_nodes"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.clusterName); + result = 31 * result + this.danglingIndices.hashCode(); + result = 31 * result + Objects.hashCode(this.nodes); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + ListDanglingIndicesResponse other = (ListDanglingIndicesResponse) o; + return Objects.equals(this.clusterName, other.clusterName) + && Objects.equals(this.danglingIndices, other.danglingIndices) + && Objects.equals(this.nodes, other.nodes); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/list_dangling_indices/DanglingIndex.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/list_dangling_indices/DanglingIndex.java index c18d275f82..a3b848732b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/list_dangling_indices/DanglingIndex.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/list_dangling_indices/DanglingIndex.java @@ -38,6 +38,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.List; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -249,4 +250,25 @@ protected static void setupDanglingIndexDeserializer(ObjectDeserializer op.add(Builder::requestBody, JsonpDeserializer.stringDeserializer(), "request_body"); op.add(Builder::url, JsonpDeserializer.stringDeserializer(), "url"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.actionType); + result = 31 * result + Objects.hashCode(this.headers); + result = 31 * result + Objects.hashCode(this.method); + result = 31 * result + Objects.hashCode(this.postProcessFunction); + result = 31 * result + Objects.hashCode(this.preProcessFunction); + result = 31 * result + Objects.hashCode(this.requestBody); + result = 31 * result + Objects.hashCode(this.url); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + Action other = (Action) o; + return Objects.equals(this.actionType, other.actionType) + && Objects.equals(this.headers, other.headers) + && Objects.equals(this.method, other.method) + && Objects.equals(this.postProcessFunction, other.postProcessFunction) + && Objects.equals(this.preProcessFunction, other.preProcessFunction) + && Objects.equals(this.requestBody, other.requestBody) + && Objects.equals(this.url, other.url); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java index e3907e7f59..0a3fa1a853 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -279,4 +280,29 @@ protected static void setupClientConfigDeserializer(ObjectDeserializer op) { op.add(Builder::connectorId, JsonpDeserializer.stringDeserializer(), "connector_id"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.connectorId); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + CreateConnectorResponse other = (CreateConnectorResponse) o; + return Objects.equals(this.connectorId, other.connectorId); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java index 8e32830e5e..1e465e9f59 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java @@ -15,6 +15,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -214,4 +215,23 @@ protected static void setupCredentialDeserializer(ObjectDeserializer op) { WriteResponseBase.setupWriteResponseBaseDeserializer(op); } + + public int hashCode() { + int result = super.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java index 30e0f7d202..b108f9b63e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java @@ -12,6 +12,7 @@ package org.opensearch.client.opensearch.ml; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import org.opensearch.client.opensearch._types.ErrorResponse; @@ -98,4 +99,17 @@ public DeleteConnectorRequest build() { false, DeleteConnectorResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + this.connectorId.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + DeleteConnectorRequest other = (DeleteConnectorRequest) o; + return Objects.equals(this.connectorId, other.connectorId); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java index 1ba0900cc8..9119d195e6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java @@ -73,4 +73,18 @@ public DeleteConnectorResponse build() { protected static void setupDeleteConnectorResponseDeserializer(ObjectDeserializer op) { WriteResponseBase.setupWriteResponseBaseDeserializer(op); } + + public int hashCode() { + int result = super.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java index 181a605275..7575637baf 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java @@ -12,6 +12,7 @@ package org.opensearch.client.opensearch.ml; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import org.opensearch.client.opensearch._types.ErrorResponse; @@ -98,4 +99,17 @@ public DeleteModelGroupRequest build() { false, DeleteModelGroupResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + this.modelGroupId.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + DeleteModelGroupRequest other = (DeleteModelGroupRequest) o; + return Objects.equals(this.modelGroupId, other.modelGroupId); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupResponse.java index 742257bf99..5315f6739b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupResponse.java @@ -73,4 +73,18 @@ public DeleteModelGroupResponse build() { protected static void setupDeleteModelGroupResponseDeserializer(ObjectDeserializer op) { WriteResponseBase.setupWriteResponseBaseDeserializer(op); } + + public int hashCode() { + int result = super.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java index f9be99c118..f14d9eb0cd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java @@ -12,6 +12,7 @@ package org.opensearch.client.opensearch.ml; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import org.opensearch.client.opensearch._types.ErrorResponse; @@ -98,4 +99,17 @@ public DeleteModelRequest build() { false, DeleteModelResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + this.modelId.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + DeleteModelRequest other = (DeleteModelRequest) o; + return Objects.equals(this.modelId, other.modelId); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelResponse.java index 1395e93e08..feb2c322d6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelResponse.java @@ -73,4 +73,18 @@ public DeleteModelResponse build() { protected static void setupDeleteModelResponseDeserializer(ObjectDeserializer op) { WriteResponseBase.setupWriteResponseBaseDeserializer(op); } + + public int hashCode() { + int result = super.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java index a378f83fde..9620b90898 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java @@ -12,6 +12,7 @@ package org.opensearch.client.opensearch.ml; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import org.opensearch.client.opensearch._types.ErrorResponse; @@ -98,4 +99,17 @@ public DeleteTaskRequest build() { false, DeleteTaskResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + this.taskId.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + DeleteTaskRequest other = (DeleteTaskRequest) o; + return Objects.equals(this.taskId, other.taskId); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskResponse.java index 93e33ffd2c..ee52e15754 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskResponse.java @@ -73,4 +73,18 @@ public DeleteTaskResponse build() { protected static void setupDeleteTaskResponseDeserializer(ObjectDeserializer op) { WriteResponseBase.setupWriteResponseBaseDeserializer(op); } + + public int hashCode() { + int result = super.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java index 2230cb1d82..dc823dd744 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java @@ -12,6 +12,7 @@ package org.opensearch.client.opensearch.ml; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import org.opensearch.client.opensearch._types.ErrorResponse; @@ -99,4 +100,17 @@ public DeployModelRequest build() { false, DeployModelResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + this.modelId.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + DeployModelRequest other = (DeployModelRequest) o; + return Objects.equals(this.modelId, other.modelId); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelResponse.java index 23b01f8025..2d436560f4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelResponse.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -158,4 +159,21 @@ protected static void setupDeployModelResponseDeserializer(ObjectDeserializer op) { op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id"); op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.modelId); + result = 31 * result + Objects.hashCode(this.parameters); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + LLM other = (LLM) o; + return Objects.equals(this.modelId, other.modelId) && Objects.equals(this.parameters, other.parameters); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java index dfc0a9083c..3ae6dcaf1e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -111,4 +112,17 @@ public Memory build() { protected static void setupMemoryDeserializer(ObjectDeserializer op) { op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.type); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + Memory other = (Memory) o; + return Objects.equals(this.type, other.type); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java index 155e0de881..1924edac77 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java @@ -15,6 +15,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -386,4 +387,31 @@ protected static void setupRegisterAgentsRequestDeserializer(ObjectDeserializer< true, RegisterAgentsResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.appType); + result = 31 * result + Objects.hashCode(this.description); + result = 31 * result + Objects.hashCode(this.llm); + result = 31 * result + Objects.hashCode(this.memory); + result = 31 * result + this.name.hashCode(); + result = 31 * result + Objects.hashCode(this.parameters); + result = 31 * result + Objects.hashCode(this.tools); + result = 31 * result + this.type.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + RegisterAgentsRequest other = (RegisterAgentsRequest) o; + return Objects.equals(this.appType, other.appType) + && Objects.equals(this.description, other.description) + && Objects.equals(this.llm, other.llm) + && Objects.equals(this.memory, other.memory) + && Objects.equals(this.name, other.name) + && Objects.equals(this.parameters, other.parameters) + && Objects.equals(this.tools, other.tools) + && Objects.equals(this.type, other.type); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java index e69ff9e0de..199ae5fde6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -111,4 +112,17 @@ public RegisterAgentsResponse build() { protected static void setupRegisterAgentsResponseDeserializer(ObjectDeserializer op) { op.add(Builder::agentId, JsonpDeserializer.stringDeserializer(), "agent_id"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.agentId); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + RegisterAgentsResponse other = (RegisterAgentsResponse) o; + return Objects.equals(this.agentId, other.agentId); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java index 2cf102fca7..b9f1b069fd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java @@ -14,6 +14,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.List; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -294,4 +295,25 @@ protected static void setupRegisterModelGroupRequestDeserializer(ObjectDeseriali true, RegisterModelGroupResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.accessMode); + result = 31 * result + Boolean.hashCode(this.addAllBackendRoles); + result = 31 * result + Objects.hashCode(this.backendRoles); + result = 31 * result + Objects.hashCode(this.description); + result = 31 * result + this.name.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + RegisterModelGroupRequest other = (RegisterModelGroupRequest) o; + return Objects.equals(this.accessMode, other.accessMode) + && this.addAllBackendRoles() == other.addAllBackendRoles() + && Objects.equals(this.backendRoles, other.backendRoles) + && Objects.equals(this.description, other.description) + && Objects.equals(this.name, other.name); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java index 240993a8c8..6ee1aab4cf 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import org.opensearch.client.json.JsonpDeserializable; @@ -143,4 +144,18 @@ protected static void setupRegisterModelGroupResponseDeserializer(ObjectDeserial op.add(Builder::modelGroupId, JsonpDeserializer.stringDeserializer(), "model_group_id"); op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status"); } + + public int hashCode() { + int result = 17; + result = 31 * result + this.modelGroupId.hashCode(); + result = 31 * result + this.status.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + RegisterModelGroupResponse other = (RegisterModelGroupResponse) o; + return Objects.equals(this.modelGroupId, other.modelGroupId) && Objects.equals(this.status, other.status); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java index 98fb7909fd..9536644078 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -262,4 +263,25 @@ protected static void setupRegisterModelRequestDeserializer(ObjectDeserializer op) { op.add(Builder::stats, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "stats"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.stats); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + UndeployModelNode other = (UndeployModelNode) o; + return Objects.equals(this.stats, other.stats); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java index 4ae83cb5b5..0b9f760371 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java @@ -12,6 +12,7 @@ package org.opensearch.client.opensearch.ml; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import org.opensearch.client.opensearch._types.ErrorResponse; @@ -99,4 +100,17 @@ public UndeployModelRequest build() { false, UndeployModelResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + this.modelId.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + UndeployModelRequest other = (UndeployModelRequest) o; + return Objects.equals(this.modelId, other.modelId); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelResponse.java index 83128a460a..74cd159526 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelResponse.java @@ -15,6 +15,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -140,4 +141,17 @@ protected static void setupUndeployModelResponseDeserializer(ObjectDeserializer< builder.nodes.put(name, UndeployModelNode._DESERIALIZER.deserialize(parser, mapper)); }); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.nodes); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + UndeployModelResponse other = (UndeployModelResponse) o; + return Objects.equals(this.nodes, other.nodes); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java index 44b99ef7a0..383f28b8eb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java @@ -39,6 +39,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -310,4 +311,25 @@ public CancelRequest build() { false, CancelResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.actions); + result = 31 * result + Objects.hashCode(this.nodes); + result = 31 * result + Objects.hashCode(this.parentTaskId); + result = 31 * result + Objects.hashCode(this.taskId); + result = 31 * result + Boolean.hashCode(this.waitForCompletion); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + CancelRequest other = (CancelRequest) o; + return Objects.equals(this.actions, other.actions) + && Objects.equals(this.nodes, other.nodes) + && Objects.equals(this.parentTaskId, other.parentTaskId) + && Objects.equals(this.taskId, other.taskId) + && this.waitForCompletion() == other.waitForCompletion(); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelResponse.java index c8b3e3f539..0f96ce30d4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelResponse.java @@ -96,4 +96,18 @@ public CancelResponse build() { protected static void setupCancelResponseDeserializer(ObjectDeserializer op) { TaskListResponseBase.setupTaskListResponseBaseDeserializer(op); } + + public int hashCode() { + int result = super.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java index 7f120b8d9e..2c27e75efc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java @@ -38,6 +38,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -207,4 +208,21 @@ public GetTasksRequest build() { false, GetTasksResponse._DESERIALIZER ); + + public int hashCode() { + int result = 17; + result = 31 * result + this.taskId.hashCode(); + result = 31 * result + Objects.hashCode(this.timeout); + result = 31 * result + Boolean.hashCode(this.waitForCompletion); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + GetTasksRequest other = (GetTasksRequest) o; + return Objects.equals(this.taskId, other.taskId) + && Objects.equals(this.timeout, other.timeout) + && this.waitForCompletion() == other.waitForCompletion(); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksResponse.java index 929d2ebbf0..13c285185f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksResponse.java @@ -37,6 +37,7 @@ package org.opensearch.client.opensearch.tasks; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -232,4 +233,23 @@ protected static void setupGetTasksResponseDeserializer(ObjectDeserializer op) { TaskListResponseBase.setupTaskListResponseBaseDeserializer(op); } + + public int hashCode() { + int result = super.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + return true; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/Status.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/Status.java index 743796d107..eb052d1f47 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/Status.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/Status.java @@ -40,6 +40,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -767,4 +768,53 @@ protected static void setupStatusDeserializer(ObjectDeserializer builder.metadata.put(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); }); } + + public int hashCode() { + int result = 17; + result = 31 * result + Integer.hashCode(this.batches); + result = 31 * result + Objects.hashCode(this.canceled); + result = 31 * result + Long.hashCode(this.created); + result = 31 * result + Long.hashCode(this.deleted); + result = 31 * result + Long.hashCode(this.noops); + result = 31 * result + Objects.hashCode(this.phase); + result = 31 * result + Float.hashCode(this.requestsPerSecond); + result = 31 * result + Objects.hashCode(this.retries); + result = 31 * result + Integer.hashCode(this.sliceId); + result = 31 * result + Objects.hashCode(this.slices); + result = 31 * result + Objects.hashCode(this.state); + result = 31 * result + Objects.hashCode(this.throttled); + result = 31 * result + Long.hashCode(this.throttledMillis); + result = 31 * result + Objects.hashCode(this.throttledUntil); + result = 31 * result + Long.hashCode(this.throttledUntilMillis); + result = 31 * result + Long.hashCode(this.total); + result = 31 * result + Long.hashCode(this.updated); + result = 31 * result + Long.hashCode(this.versionConflicts); + result = 31 * result + Objects.hashCode(this.metadata); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + Status other = (Status) o; + return this.batches() == other.batches() + && Objects.equals(this.canceled, other.canceled) + && this.created() == other.created() + && this.deleted() == other.deleted() + && this.noops() == other.noops() + && Objects.equals(this.phase, other.phase) + && this.requestsPerSecond() == other.requestsPerSecond() + && Objects.equals(this.retries, other.retries) + && this.sliceId() == other.sliceId() + && Objects.equals(this.slices, other.slices) + && Objects.equals(this.state, other.state) + && Objects.equals(this.throttled, other.throttled) + && this.throttledMillis() == other.throttledMillis() + && Objects.equals(this.throttledUntil, other.throttledUntil) + && this.throttledUntilMillis() == other.throttledUntilMillis() + && this.total() == other.total() + && this.updated() == other.updated() + && this.versionConflicts() == other.versionConflicts() + && Objects.equals(this.metadata, other.metadata); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java index 3f4c19e178..7a9d77716f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java @@ -38,6 +38,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import org.opensearch.client.json.JsonpDeserializable; @@ -160,4 +161,20 @@ protected static void setupTaskExecutingNodeDeserializer(ObjectDeserializer> void setupTaskInfo op.add(AbstractBuilder::status, Status._DESERIALIZER, "status"); op.add(AbstractBuilder::type, JsonpDeserializer.stringDeserializer(), "type"); } + + public int hashCode() { + int result = 17; + result = 31 * result + this.action.hashCode(); + result = 31 * result + Boolean.hashCode(this.cancellable); + result = 31 * result + Boolean.hashCode(this.cancelled); + result = 31 * result + Objects.hashCode(this.description); + result = 31 * result + this.headers.hashCode(); + result = 31 * result + Long.hashCode(this.id); + result = 31 * result + this.node.hashCode(); + result = 31 * result + Objects.hashCode(this.parentTaskId); + result = 31 * result + Objects.hashCode(this.runningTime); + result = 31 * result + Long.hashCode(this.runningTimeInNanos); + result = 31 * result + Long.hashCode(this.startTimeInMillis); + result = 31 * result + Objects.hashCode(this.status); + result = 31 * result + this.type.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + TaskInfo other = (TaskInfo) o; + return Objects.equals(this.action, other.action) + && this.cancellable() == other.cancellable() + && this.cancelled() == other.cancelled() + && Objects.equals(this.description, other.description) + && Objects.equals(this.headers, other.headers) + && this.id() == other.id() + && Objects.equals(this.node, other.node) + && Objects.equals(this.parentTaskId, other.parentTaskId) + && Objects.equals(this.runningTime, other.runningTime) + && this.runningTimeInNanos() == other.runningTimeInNanos() + && this.startTimeInMillis() == other.startTimeInMillis() + && Objects.equals(this.status, other.status) + && Objects.equals(this.type, other.type); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfos.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfos.java index 9e394d3d7a..aeb0c0e298 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfos.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfos.java @@ -160,4 +160,19 @@ private static JsonpDeserializer buildTaskInfosDeserializer() { } public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.lazy(TaskInfos::buildTaskInfosDeserializer); + + public int hashCode() { + int result = 17; + result = 31 * result + _kind.hashCode(); + result = 31 * result + _value.hashCode(); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + TaskInfos other = (TaskInfos) o; + return this._kind().equals(other._kind()) && this._get().equals(other._get()); + } + } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java index b67eb2965d..36ad3d85d3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java @@ -39,6 +39,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -306,4 +307,23 @@ protected static > void setupTaskList op.add(AbstractBuilder::taskFailures, JsonpDeserializer.arrayDeserializer(TaskFailure._DESERIALIZER), "task_failures"); op.add(AbstractBuilder::tasks, TaskInfos._DESERIALIZER, "tasks"); } + + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.nodeFailures); + result = 31 * result + Objects.hashCode(this.nodes); + result = 31 * result + Objects.hashCode(this.taskFailures); + result = 31 * result + Objects.hashCode(this.tasks); + return result; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (this.getClass() != o.getClass()) return false; + TaskListResponseBase other = (TaskListResponseBase) o; + return Objects.equals(this.nodeFailures, other.nodeFailures) + && Objects.equals(this.nodes, other.nodes) + && Objects.equals(this.taskFailures, other.taskFailures) + && Objects.equals(this.tasks, other.tasks); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java index 80edbb43d0..c737e57217 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java @@ -38,6 +38,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.List; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -718,4 +719,53 @@ protected static void setupTaskResponseDeserializer(ObjectDeserializer getImplementsTypes() { return hasFieldsToSerialize() && !extendsOtherShape() ? List.of(Types.Client.Json.PlainJsonSerializable) : null; } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/RequestShape.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/RequestShape.java index 18facfd53e..d76a67d2fe 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/RequestShape.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/RequestShape.java @@ -151,6 +151,10 @@ public boolean hasAnyRequiredFields() { return fields.values().stream().anyMatch(Field::isRequired); } + public boolean hasFields() { + return !fields.isEmpty(); + } + public Type getJsonEndpointType() { return Types.Client.Transport.JsonEndpoint(getType(), getResponseType(), Types.Client.OpenSearch._Types.ErrorResponse); } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Type.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Type.java index 2e4391b787..d9123a7eaa 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Type.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Type.java @@ -157,6 +157,18 @@ public boolean isPrimitive() { return PRIMITIVES.contains(name); } + public boolean isUnboxedPrimitive() { + return isPrimitive() + && !name.equals("String") + && !name.equals("Boolean") + && !name.equals("Character") + && !name.equals("Integer") + && !name.equals("Long") + && !name.equals("Float") + && !name.equals("Double") + && !name.equals("Number"); + } + public boolean isNumber() { return "Number".equals(name); } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java index 8d522a11f1..d5f4e9a750 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java @@ -72,6 +72,7 @@ public static final class Lang { public static final class Util { public static final String PACKAGE = Java.PACKAGE + ".util"; + public static final Type Objects = Type.builder().withPackage(PACKAGE).withName("Objects").build(); public static final Type HashMap = Type.builder().withPackage(PACKAGE).withName("HashMap").build(); public static Type Map(Type keyType, Type valueType) { diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape.mustache index 627af1db03..0cd936e3b4 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape.mustache @@ -19,4 +19,8 @@ // --------------------------------------------------------------------------------------------- {{>ObjectShape/Deserialize}} -} \ No newline at end of file + + {{>ObjectShape/HashCode}} + + {{>ObjectShape/Equals}} +} diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Equals.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Equals.mustache new file mode 100644 index 0000000000..6e45e22d72 --- /dev/null +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Equals.mustache @@ -0,0 +1,27 @@ + public boolean equals(Object o) { + {{#extendsOtherShape}} + if(!super.equals(o)) { + return false; + } + {{/extendsOtherShape}} + if(this == o) return true; + if(this.getClass() != o.getClass()) return false; + {{^hasFields}} + return true; + {{/hasFields}} + {{#hasFields}} + {{className}} other = ({{className}})o; + return + {{#fields}} + {{#isUnboxedPrimitive}} + this.{{name}}() == other.{{name}}() + {{/isUnboxedPrimitive}} + {{^isUnboxedPrimitive}} + {{TYPES.Java.Util.Objects}}.equals(this.{{name}}, other.{{name}}) + {{/isUnboxedPrimitive}} + {{^-last}} + && + {{/-last}} + {{/fields}}; + {{/hasFields}} + } diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/HashCode.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/HashCode.mustache new file mode 100644 index 0000000000..5418321cc6 --- /dev/null +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/HashCode.mustache @@ -0,0 +1,22 @@ + public int hashCode() { + {{#extendsOtherShape}} + int result = super.hashCode(); + {{/extendsOtherShape}} + {{^extendsOtherShape}} + int result = 17; + {{/extendsOtherShape}} + {{#fields}} + {{#isUnboxedPrimitive}} + result = 31 * result + {{getBoxedType}}.hashCode(this.{{name}}); + {{/isUnboxedPrimitive}} + {{^isUnboxedPrimitive}} + {{#isRequired}} + result = 31 * result + this.{{name}}.hashCode(); + {{/isRequired}} + {{^isRequired}} + result = 31 * result + {{TYPES.Java.Util.Objects}}.hashCode(this.{{name}}); + {{/isRequired}} + {{/isUnboxedPrimitive}} + {{/fields}} + return result; + } diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/TaggedUnionEquals.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/TaggedUnionEquals.mustache new file mode 100644 index 0000000000..7a368dc538 --- /dev/null +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/TaggedUnionEquals.mustache @@ -0,0 +1,6 @@ + public boolean equals(Object o) { + if(this == o) return true; + if(this.getClass() != o.getClass()) return false; + {{className}} other = ({{className}})o; + return this._kind().equals(other._kind()) && this._get().equals(other._get()); + } diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/TaggedUnionHashCode.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/TaggedUnionHashCode.mustache new file mode 100644 index 0000000000..8cd7137529 --- /dev/null +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/TaggedUnionHashCode.mustache @@ -0,0 +1,6 @@ + public int hashCode() { + int result = 17; + result = 31 * result + _kind.hashCode(); + result = 31 * result + _value.hashCode(); + return result; + } diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache index 73c0960fea..f73f6dd4a2 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache @@ -96,4 +96,8 @@ {{hasRequestBody}}, {{responseType}}._DESERIALIZER ); -} \ No newline at end of file + + {{>ObjectShape/HashCode}} + + {{>ObjectShape/Equals}} +} diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/TaggedUnionShape.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/TaggedUnionShape.mustache index 236daf9abb..c59a635d39 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/TaggedUnionShape.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/TaggedUnionShape.mustache @@ -111,4 +111,9 @@ } public static final {{TYPES.Client.Json.JsonpDeserializer}}<{{className}}> _DESERIALIZER = {{TYPES.Client.Json.JsonpDeserializer}}.lazy({{className}}::build{{className}}Deserializer); + + {{>ObjectShape/TaggedUnionHashCode}} + + {{>ObjectShape/TaggedUnionEquals}} + }