Skip to content

Commit

Permalink
Generate indices.delete
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Oct 24, 2024
1 parent b544fec commit 4a489a4
Show file tree
Hide file tree
Showing 9 changed files with 242 additions and 179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,34 @@
* 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.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.util.ObjectBuilder;

// typedef: _types.IndicesResponseBase

@Generated("org.opensearch.client.codegen.CodeGenerator")
public abstract class IndicesResponseBase extends AcknowledgedResponseBase {

@Nullable
private final ShardStatistics shards;

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

protected IndicesResponseBase(AbstractBuilder<?> builder) {
super(builder);

this.shards = builder.shards;

}

/**
Expand All @@ -63,16 +69,15 @@ public final ShardStatistics shards() {
}

protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

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

}

}

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

protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>> extends
AcknowledgedResponseBase.AbstractBuilder<BuilderT> {
@Nullable
Expand All @@ -90,18 +95,35 @@ public final BuilderT shards(@Nullable ShardStatistics value) {
* API name: {@code _shards}
*/
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 static <BuilderT extends AbstractBuilder<BuilderT>> void setupIndicesResponseBaseDeserializer(
ObjectDeserializer<BuilderT> op
) {
setupAcknowledgedResponseBaseDeserializer(op);
op.add(AbstractBuilder::shards, ShardStatistics._DESERIALIZER, "_shards");
}

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

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

0 comments on commit 4a489a4

Please sign in to comment.