Skip to content

Commit

Permalink
Generate indices.get
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Oct 31, 2024
1 parent fb46101 commit 21ca1d3
Show file tree
Hide file tree
Showing 43 changed files with 1,425 additions and 645 deletions.
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.
*/
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,10 +30,16 @@
* GitHub history for details.
*/

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

package org.opensearch.client.opensearch._types.mapping;

import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
Expand All @@ -47,15 +53,20 @@
// typedef: _types.mapping.AllField

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

@Nonnull
private final String analyzer;

private final boolean enabled;

private final boolean omitNorms;

@Nonnull
private final String searchAnalyzer;

@Nonnull
private final String similarity;

private final boolean store;
Expand All @@ -71,7 +82,6 @@ public class AllField implements PlainJsonSerializable {
// ---------------------------------------------------------------------------------------------

private AllField(Builder builder) {

this.analyzer = ApiTypeHelper.requireNonNull(builder.analyzer, this, "analyzer");
this.enabled = ApiTypeHelper.requireNonNull(builder.enabled, this, "enabled");
this.omitNorms = ApiTypeHelper.requireNonNull(builder.omitNorms, this, "omitNorms");
Expand All @@ -82,16 +92,16 @@ private AllField(Builder builder) {
this.storeTermVectorPayloads = ApiTypeHelper.requireNonNull(builder.storeTermVectorPayloads, this, "storeTermVectorPayloads");
this.storeTermVectorPositions = ApiTypeHelper.requireNonNull(builder.storeTermVectorPositions, this, "storeTermVectorPositions");
this.storeTermVectors = ApiTypeHelper.requireNonNull(builder.storeTermVectors, this, "storeTermVectors");

}

public static AllField of(Function<Builder, ObjectBuilder<AllField>> fn) {
public static AllField of(Function<AllField.Builder, ObjectBuilder<AllField>> fn) {
return fn.apply(new Builder()).build();
}

/**
* Required - API name: {@code analyzer}
*/
@Nonnull
public final String analyzer() {
return this.analyzer;
}
Expand All @@ -113,13 +123,15 @@ public final boolean omitNorms() {
/**
* Required - API name: {@code search_analyzer}
*/
@Nonnull
public final String searchAnalyzer() {
return this.searchAnalyzer;
}

/**
* Required - API name: {@code similarity}
*/
@Nonnull
public final String similarity() {
return this.similarity;
}
Expand Down Expand Up @@ -162,14 +174,14 @@ public final boolean storeTermVectors() {
/**
* 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("analyzer");
generator.write(this.analyzer);

Expand Down Expand Up @@ -199,34 +211,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

generator.writeKey("store_term_vectors");
generator.write(this.storeTermVectors);

}

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

/**
* Builder for {@link AllField}.
*/

public static class Builder extends ObjectBuilderBase implements ObjectBuilder<AllField> {
private String analyzer;

private Boolean enabled;

private Boolean omitNorms;

private String searchAnalyzer;

private String similarity;

private Boolean store;

private Boolean storeTermVectorOffsets;

private Boolean storeTermVectorPayloads;

private Boolean storeTermVectorPositions;

private Boolean storeTermVectors;

/**
Expand Down Expand Up @@ -312,8 +313,7 @@ public final Builder storeTermVectors(boolean value) {
/**
* Builds a {@link AllField}.
*
* @throws NullPointerException
* if some of the required fields are null.
* @throws NullPointerException if some of the required fields are null.
*/
public AllField build() {
_checkSingleUse();
Expand All @@ -333,7 +333,6 @@ public AllField build() {
);

protected static void setupAllFieldDeserializer(ObjectDeserializer<AllField.Builder> op) {

op.add(Builder::analyzer, JsonpDeserializer.stringDeserializer(), "analyzer");
op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled");
op.add(Builder::omitNorms, JsonpDeserializer.booleanDeserializer(), "omit_norms");
Expand All @@ -344,7 +343,38 @@ protected static void setupAllFieldDeserializer(ObjectDeserializer<AllField.Buil
op.add(Builder::storeTermVectorPayloads, JsonpDeserializer.booleanDeserializer(), "store_term_vector_payloads");
op.add(Builder::storeTermVectorPositions, JsonpDeserializer.booleanDeserializer(), "store_term_vector_positions");
op.add(Builder::storeTermVectors, JsonpDeserializer.booleanDeserializer(), "store_term_vectors");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.analyzer.hashCode();
result = 31 * result + Boolean.hashCode(this.enabled);
result = 31 * result + Boolean.hashCode(this.omitNorms);
result = 31 * result + this.searchAnalyzer.hashCode();
result = 31 * result + this.similarity.hashCode();
result = 31 * result + Boolean.hashCode(this.store);
result = 31 * result + Boolean.hashCode(this.storeTermVectorOffsets);
result = 31 * result + Boolean.hashCode(this.storeTermVectorPayloads);
result = 31 * result + Boolean.hashCode(this.storeTermVectorPositions);
result = 31 * result + Boolean.hashCode(this.storeTermVectors);
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
AllField other = (AllField) o;
return this.analyzer.equals(other.analyzer)
&& this.enabled == other.enabled
&& this.omitNorms == other.omitNorms
&& this.searchAnalyzer.equals(other.searchAnalyzer)
&& this.similarity.equals(other.similarity)
&& this.store == other.store
&& this.storeTermVectorOffsets == other.storeTermVectorOffsets
&& this.storeTermVectorPayloads == other.storeTermVectorPayloads
&& this.storeTermVectorPositions == other.storeTermVectorPositions
&& this.storeTermVectors == other.storeTermVectors;
}
}
Loading

0 comments on commit 21ca1d3

Please sign in to comment.