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 cat namespace #1376

Merged
merged 18 commits into from
Jan 8, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@

import java.io.IOException;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.opensearch.client.ApiClient;
import org.opensearch.client.opensearch._types.OpenSearchException;
import org.opensearch.client.opensearch.cat.OpenSearchCatAsyncClient;
import org.opensearch.client.opensearch.cluster.OpenSearchClusterAsyncClient;
import org.opensearch.client.opensearch.core.InfoRequest;
import org.opensearch.client.opensearch.core.InfoResponse;
Expand All @@ -54,6 +56,7 @@
import org.opensearch.client.opensearch.tasks.OpenSearchTasksAsyncClient;
import org.opensearch.client.transport.OpenSearchTransport;
import org.opensearch.client.transport.TransportOptions;
import org.opensearch.client.util.ObjectBuilder;

/**
* Client for the namespace.
Expand All @@ -66,6 +69,10 @@ public OpenSearchAsyncClientBase(OpenSearchTransport transport, @Nullable Transp

// ----- Child clients

public OpenSearchCatAsyncClient cat() {
return new OpenSearchCatAsyncClient(this.transport, this.transportOptions);
}

public OpenSearchClusterAsyncClient cluster() {
return new OpenSearchClusterAsyncClient(this.transport, this.transportOptions);
}
Expand Down Expand Up @@ -103,7 +110,24 @@ public OpenSearchTasksAsyncClient tasks() {
/**
* Returns basic information about the cluster.
*/
public CompletableFuture<InfoResponse> info() throws IOException, OpenSearchException {
return this.transport.performRequestAsync(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions);
public CompletableFuture<InfoResponse> info(InfoRequest request) throws IOException, OpenSearchException {
return this.transport.performRequestAsync(request, InfoRequest._ENDPOINT, this.transportOptions);
}

/**
* Returns basic information about the cluster.
*
* @param fn a function that initializes a builder to create the {@link InfoRequest}
*/
public final CompletableFuture<InfoResponse> info(Function<InfoRequest.Builder, ObjectBuilder<InfoRequest>> fn) throws IOException,
OpenSearchException {
return info(fn.apply(new InfoRequest.Builder()).build());
}

/**
* Returns basic information about the cluster.
*/
public final CompletableFuture<InfoResponse> info() throws IOException, OpenSearchException {
return info(new InfoRequest.Builder().build());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
package org.opensearch.client.opensearch;

import java.io.IOException;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.opensearch.client.ApiClient;
import org.opensearch.client.opensearch._types.OpenSearchException;
import org.opensearch.client.opensearch.cat.OpenSearchCatClient;
import org.opensearch.client.opensearch.cluster.OpenSearchClusterClient;
import org.opensearch.client.opensearch.core.InfoRequest;
import org.opensearch.client.opensearch.core.InfoResponse;
Expand All @@ -53,6 +55,7 @@
import org.opensearch.client.opensearch.tasks.OpenSearchTasksClient;
import org.opensearch.client.transport.OpenSearchTransport;
import org.opensearch.client.transport.TransportOptions;
import org.opensearch.client.util.ObjectBuilder;

/**
* Client for the namespace.
Expand All @@ -65,6 +68,10 @@ public OpenSearchClientBase(OpenSearchTransport transport, @Nullable TransportOp

// ----- Child clients

public OpenSearchCatClient cat() {
return new OpenSearchCatClient(this.transport, this.transportOptions);
}

public OpenSearchClusterClient cluster() {
return new OpenSearchClusterClient(this.transport, this.transportOptions);
}
Expand Down Expand Up @@ -102,7 +109,23 @@ public OpenSearchTasksClient tasks() {
/**
* Returns basic information about the cluster.
*/
public InfoResponse info() throws IOException, OpenSearchException {
return this.transport.performRequest(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions);
public InfoResponse info(InfoRequest request) throws IOException, OpenSearchException {
return this.transport.performRequest(request, InfoRequest._ENDPOINT, this.transportOptions);
}

/**
* Returns basic information about the cluster.
*
* @param fn a function that initializes a builder to create the {@link InfoRequest}
*/
public final InfoResponse info(Function<InfoRequest.Builder, ObjectBuilder<InfoRequest>> fn) throws IOException, OpenSearchException {
return info(fn.apply(new InfoRequest.Builder()).build());
}

/**
* Returns basic information about the cluster.
*/
public final InfoResponse info() throws IOException, OpenSearchException {
return info(new InfoRequest.Builder().build());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,48 @@
* 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.ByteUnit

@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum Bytes implements JsonEnum {
Bytes("b"),

KiloBytes("kb"),

MegaBytes("mb"),
GigaBytes("gb", "g"),

GigaBytes("gb"),
KiloBytes("kb", "k"),

TeraBytes("tb"),
MegaBytes("mb", "m"),

PetaBytes("pb"),
PetaBytes("pb", "p"),

;
TeraBytes("tb", "t");

private final String jsonValue;
private final String[] aliases;

Bytes(String jsonValue) {
Bytes(String jsonValue, String... aliases) {
this.jsonValue = jsonValue;
this.aliases = aliases;
}

public String jsonValue() {
return this.jsonValue;
}

public String[] aliases() {
return this.aliases;
}

public static final JsonEnum.Deserializer<Bytes> _DESERIALIZER = new JsonEnum.Deserializer<>(Bytes.values());
}
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 javax.annotation.Generated;
import org.opensearch.client.json.JsonEnum;
import org.opensearch.client.json.JsonpDeserializable;

// typedef: _types.TimeUnit

@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum TimeUnit implements JsonEnum {
Nanoseconds("nanos"),
Days("d"),

Hours("h"),

Microseconds("micros"),

Milliseconds("ms"),

Seconds("s"),

Minutes("m"),

Hours("h"),

Days("d"),
Nanoseconds("nanos"),

;
Seconds("s");

private final String jsonValue;

Expand Down
Loading
Loading