Skip to content
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

Generate more indices operations #1358

Merged
merged 7 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
9 changes: 8 additions & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,11 @@ After:

### snapshot.ShardsStatsSummaryItem renamed to snapshot.SnapshotShardsStatsSummaryItem
- The `snapshot.ShardsStatsSummaryItem` class has been renamed to `snapshot.SnapshotShardsStatsSummaryItem`, this affects:
- `snapshot.SnapshotShardsStatsSummary`'s (previously `snapshot.ShardsStatsSummary`) `incremental` and `total` fields.
- `snapshot.SnapshotShardsStatsSummary`'s (previously `snapshot.ShardsStatsSummary`) `incremental` and `total` fields.

### AnalyzeToken
- The `endOffset`, `position`, `positionLength` and `startOffset` properties have been corrected to be of type `int` instead of `long`.

### ExplainAnalyzeToken
- The `endOffset`, `position`, `positionLength`, `startOffset` and `termFrequency` properties have been corrected to be of type `int` instead of `long`.
- The `positionlength` and `termfrequency` properties have had their casing corrected to `positionLength` and `termFrequency` respectively.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@
* GitHub history for details.
*/

//----------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------

package org.opensearch.client.opensearch._types;

import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
Expand All @@ -43,46 +49,63 @@

// typedef: _types.ShardsOperationResponseBase

@Generated("org.opensearch.client.codegen.CodeGenerator")
public abstract class ShardsOperationResponseBase implements PlainJsonSerializable {

@Nonnull
private final ShardStatistics shards;

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

protected ShardsOperationResponseBase(AbstractBuilder<?> builder) {

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

}

/**
* Required - API name: {@code _shards}
*/
@Nonnull
public final ShardStatistics shards() {
return this.shards;
}

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

protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

generator.writeKey("_shards");
this.shards.serialize(generator, mapper);

}

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

protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>> extends ObjectBuilderBase {
private ShardStatistics shards;

protected AbstractBuilder() {}

protected AbstractBuilder(ShardsOperationResponseBase o) {
this.shards = o.shards;
}

protected AbstractBuilder(AbstractBuilder<BuilderT> o) {
this.shards = o.shards;
}

@Nonnull
protected abstract BuilderT self();

/**
* Required - API name: {@code _shards}
*/
@Nonnull
public final BuilderT shards(ShardStatistics value) {
this.shards = value;
return self();
Expand All @@ -91,21 +114,32 @@ public final BuilderT shards(ShardStatistics value) {
/**
* Required - API name: {@code _shards}
*/
@Nonnull
public final BuilderT shards(Function<ShardStatistics.Builder, ObjectBuilder<ShardStatistics>> fn) {
return this.shards(fn.apply(new ShardStatistics.Builder()).build());
return shards(fn.apply(new ShardStatistics.Builder()).build());
}

protected abstract BuilderT self();

}

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

protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupShardsOperationResponseBaseDeserializer(
ObjectDeserializer<BuilderT> op
) {

op.add(AbstractBuilder::shards, ShardStatistics._DESERIALIZER, "_shards");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.shards.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
ShardsOperationResponseBase other = (ShardsOperationResponseBase) o;
return this.shards.equals(other.shards);
}
}
Loading
Loading