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 10, 2024
1 parent f7340a5 commit ba10e9d
Show file tree
Hide file tree
Showing 9 changed files with 236 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,33 @@ 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");
}

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

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 ba10e9d

Please sign in to comment.