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

Begin generating index CRUD operations #1220

Merged
merged 5 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 7 additions & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ After:
- The `name` field, getter and builder method have been renamed to `repository`.

### CloneSnapshotRequest timeout removal
- The `timeout` field, getter and builder method have been removed from `CloneSnapshotRequest` as it is not supported by OpenSearch.
- The `timeout` field, getter and builder method have been removed from `CloneSnapshotRequest` as it is not supported by OpenSearch.

### DynamicMapping
- Removed the `Runtime` variant from the `DynamicMapping` enum as it is not supported by OpenSearch.

### TypeMapping
- Removed the `runtime` field, getter and builder methods from `TypeMapping` as it is not supported by OpenSearch.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.opensearch.client.opensearch.core.InfoRequest;
import org.opensearch.client.opensearch.core.InfoResponse;
import org.opensearch.client.opensearch.dangling_indices.OpenSearchDanglingIndicesAsyncClient;
import org.opensearch.client.opensearch.indices.OpenSearchIndicesAsyncClient;
import org.opensearch.client.opensearch.ml.OpenSearchMlAsyncClient;
import org.opensearch.client.opensearch.snapshot.OpenSearchSnapshotAsyncClient;
import org.opensearch.client.opensearch.tasks.OpenSearchTasksAsyncClient;
Expand All @@ -66,6 +67,10 @@ public OpenSearchDanglingIndicesAsyncClient danglingIndices() {
return new OpenSearchDanglingIndicesAsyncClient(this.transport, this.transportOptions);
}

public OpenSearchIndicesAsyncClient indices() {
return new OpenSearchIndicesAsyncClient(this.transport, this.transportOptions);
}

public OpenSearchMlAsyncClient ml() {
return new OpenSearchMlAsyncClient(this.transport, this.transportOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.opensearch.client.opensearch.core.InfoRequest;
import org.opensearch.client.opensearch.core.InfoResponse;
import org.opensearch.client.opensearch.dangling_indices.OpenSearchDanglingIndicesClient;
import org.opensearch.client.opensearch.indices.OpenSearchIndicesClient;
import org.opensearch.client.opensearch.ml.OpenSearchMlClient;
import org.opensearch.client.opensearch.snapshot.OpenSearchSnapshotClient;
import org.opensearch.client.opensearch.tasks.OpenSearchTasksClient;
Expand All @@ -65,6 +66,10 @@ public OpenSearchDanglingIndicesClient danglingIndices() {
return new OpenSearchDanglingIndicesClient(this.transport, this.transportOptions);
}

public OpenSearchIndicesClient indices() {
return new OpenSearchIndicesClient(this.transport, this.transportOptions);
}

public OpenSearchMlClient ml() {
return new OpenSearchMlClient(this.transport, this.transportOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,33 @@
* GitHub history for details.
*/

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

package org.opensearch.client.opensearch._types;

import javax.annotation.Generated;
import org.opensearch.client.json.JsonEnum;
import org.opensearch.client.json.JsonpDeserializable;

// typedef: _types.ExpandWildcard

@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum ExpandWildcard implements JsonEnum {
/**
* Match any data stream or index, including hidden ones.
* Match any index, including hidden ones.
reta marked this conversation as resolved.
Show resolved Hide resolved
*/
All("all"),

/**
* Match open, non-hidden indices. Also matches any non-hidden data stream.
*/
Open("open"),

/**
* Match closed, non-hidden indices. Also matches any non-hidden data stream.
* Data streams cannot be closed.
* Match closed, non-hidden indices.
*/
Closed("closed"),

/**
* Match hidden data streams and hidden indices. Must be combined with open,
* closed, or both.
* Match hidden indices. Must be combined with open, closed, or both.
*/
Hidden("hidden"),

Expand All @@ -64,7 +65,10 @@ public enum ExpandWildcard implements JsonEnum {
*/
None("none"),

;
/**
* Match open, non-hidden indices.
*/
Open("open");

private final String jsonValue;

Expand Down
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,24 @@
* GitHub history for details.
*/

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

package org.opensearch.client.opensearch._types;

import javax.annotation.Generated;
import org.opensearch.client.json.JsonEnum;
import org.opensearch.client.json.JsonpDeserializable;

// typedef: _types.WaitForActiveShardOptions

@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum WaitForActiveShardOptions implements JsonEnum {
All("all"),

;
IndexSetting("index-setting");

private final String jsonValue;

Expand Down
Loading
Loading