Skip to content

Commit 773b200

Browse files
authoredDec 18, 2024··
Generate more indices operations (opensearch-project#1358)
* Generate aliases operations Signed-off-by: Thomas Farr <tsfarr@amazon.com> * Generate indices.add_block Signed-off-by: Thomas Farr <tsfarr@amazon.com> * Generate indices.analyze Signed-off-by: Thomas Farr <tsfarr@amazon.com> * Generate indices.clear_cache Signed-off-by: Thomas Farr <tsfarr@amazon.com> * Remove deserializing of path params in request objects Signed-off-by: Thomas Farr <tsfarr@amazon.com> * Test that deserialization fails Signed-off-by: Thomas Farr <tsfarr@amazon.com> * spotless Signed-off-by: Thomas Farr <tsfarr@amazon.com> --------- Signed-off-by: Thomas Farr <tsfarr@amazon.com>
1 parent 354debe commit 773b200

File tree

54 files changed

+3959
-1891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3959
-1891
lines changed
 

‎UPGRADING.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,11 @@ After:
191191

192192
### snapshot.ShardsStatsSummaryItem renamed to snapshot.SnapshotShardsStatsSummaryItem
193193
- The `snapshot.ShardsStatsSummaryItem` class has been renamed to `snapshot.SnapshotShardsStatsSummaryItem`, this affects:
194-
- `snapshot.SnapshotShardsStatsSummary`'s (previously `snapshot.ShardsStatsSummary`) `incremental` and `total` fields.
194+
- `snapshot.SnapshotShardsStatsSummary`'s (previously `snapshot.ShardsStatsSummary`) `incremental` and `total` fields.
195+
196+
### AnalyzeToken
197+
- The `endOffset`, `position`, `positionLength` and `startOffset` properties have been corrected to be of type `int` instead of `long`.
198+
199+
### ExplainAnalyzeToken
200+
- The `endOffset`, `position`, `positionLength`, `startOffset` and `termFrequency` properties have been corrected to be of type `int` instead of `long`.
201+
- The `positionlength` and `termfrequency` properties have had their casing corrected to `positionLength` and `termFrequency` respectively.

‎java-client/src/main/java/org/opensearch/client/opensearch/_types/ShardsOperationResponseBase.java ‎java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardsOperationResponseBase.java

+43-9
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@
3030
* GitHub history for details.
3131
*/
3232

33+
//----------------------------------------------------
34+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
35+
//----------------------------------------------------
36+
3337
package org.opensearch.client.opensearch._types;
3438

3539
import jakarta.json.stream.JsonGenerator;
3640
import java.util.function.Function;
41+
import javax.annotation.Generated;
42+
import javax.annotation.Nonnull;
3743
import org.opensearch.client.json.JsonpMapper;
3844
import org.opensearch.client.json.ObjectDeserializer;
3945
import org.opensearch.client.json.PlainJsonSerializable;
@@ -43,46 +49,63 @@
4349

4450
// typedef: _types.ShardsOperationResponseBase
4551

52+
@Generated("org.opensearch.client.codegen.CodeGenerator")
4653
public abstract class ShardsOperationResponseBase implements PlainJsonSerializable {
54+
55+
@Nonnull
4756
private final ShardStatistics shards;
4857

4958
// ---------------------------------------------------------------------------------------------
5059

5160
protected ShardsOperationResponseBase(AbstractBuilder<?> builder) {
52-
5361
this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards");
54-
5562
}
5663

5764
/**
5865
* Required - API name: {@code _shards}
5966
*/
67+
@Nonnull
6068
public final ShardStatistics shards() {
6169
return this.shards;
6270
}
6371

6472
/**
6573
* Serialize this object to JSON.
6674
*/
75+
@Override
6776
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
6877
generator.writeStartObject();
6978
serializeInternal(generator, mapper);
7079
generator.writeEnd();
7180
}
7281

7382
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
74-
7583
generator.writeKey("_shards");
7684
this.shards.serialize(generator, mapper);
77-
7885
}
7986

87+
// ---------------------------------------------------------------------------------------------
88+
8089
protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>> extends ObjectBuilderBase {
8190
private ShardStatistics shards;
8291

92+
protected AbstractBuilder() {}
93+
94+
protected AbstractBuilder(ShardsOperationResponseBase o) {
95+
this.shards = o.shards;
96+
}
97+
98+
protected AbstractBuilder(AbstractBuilder<BuilderT> o) {
99+
this.shards = o.shards;
100+
}
101+
102+
@Nonnull
103+
protected abstract BuilderT self();
104+
83105
/**
84106
* Required - API name: {@code _shards}
85107
*/
108+
@Nonnull
86109
public final BuilderT shards(ShardStatistics value) {
87110
this.shards = value;
88111
return self();
@@ -91,21 +114,32 @@ public final BuilderT shards(ShardStatistics value) {
91114
/**
92115
* Required - API name: {@code _shards}
93116
*/
117+
@Nonnull
94118
public final BuilderT shards(Function<ShardStatistics.Builder, ObjectBuilder<ShardStatistics>> fn) {
95-
return this.shards(fn.apply(new ShardStatistics.Builder()).build());
119+
return shards(fn.apply(new ShardStatistics.Builder()).build());
96120
}
97-
98-
protected abstract BuilderT self();
99-
100121
}
101122

102123
// ---------------------------------------------------------------------------------------------
124+
103125
protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupShardsOperationResponseBaseDeserializer(
104126
ObjectDeserializer<BuilderT> op
105127
) {
106-
107128
op.add(AbstractBuilder::shards, ShardStatistics._DESERIALIZER, "_shards");
129+
}
108130

131+
@Override
132+
public int hashCode() {
133+
int result = 17;
134+
result = 31 * result + this.shards.hashCode();
135+
return result;
109136
}
110137

138+
@Override
139+
public boolean equals(Object o) {
140+
if (this == o) return true;
141+
if (o == null || this.getClass() != o.getClass()) return false;
142+
ShardsOperationResponseBase other = (ShardsOperationResponseBase) o;
143+
return this.shards.equals(other.shards);
144+
}
111145
}

0 commit comments

Comments
 (0)
Please sign in to comment.