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

Regenerate dangling_indices namespace #1124

Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This section is for maintaining a changelog for all breaking changes for the cli
### Changed
- Migrate client transports to Apache HttpClient / Core 5.x ([#246](https://github.com/opensearch-project/opensearch-java/pull/246))
- Changed SearchAfter of SearchRequest type to FieldValue instead of String ([#769](https://github.com/opensearch-project/opensearch-java/pull/769))
- Changed type of `DanglingIndex`'s `creationDateMillis` field from `String` to `long` ([#1124](https://github.com/opensearch-project/opensearch-java/pull/1124))

### Deprecated
- Deprecate RestClientTransport ([#536](https://github.com/opensearch-project/opensearch-java/pull/536))
Expand Down
3 changes: 3 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ After:
.searchAfter(FieldValue.of("string1"), FieldValue.of("string2"))
.searchAfter(List.of(FieldValue.of("String")))
```

### DanglingIndex creationDateMillis type
- The type of `DanglingIndex`'s `creationDateMillis` field has been corrected from a `String` to a `long`.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@
import org.opensearch.client.opensearch._types.OpenSearchException;
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.transport.OpenSearchTransport;
import org.opensearch.client.transport.TransportOptions;

/**
* Client for the namespace.
*/
@Generated("org.opensearch.client.codegen.CodeGenerator")
public class OpenSearchAsyncClient extends OpenSearchAsyncClientBase<OpenSearchAsyncClient> {
public OpenSearchAsyncClient(OpenSearchTransport transport) {
Expand All @@ -61,6 +65,12 @@ public OpenSearchAsyncClient withTransportOptions(@Nullable TransportOptions tra
return new OpenSearchAsyncClient(this.transport, transportOptions);
}

// ----- Child clients

public OpenSearchDanglingIndicesAsyncClient danglingIndices() {
reta marked this conversation as resolved.
Show resolved Hide resolved
return new OpenSearchDanglingIndicesAsyncClient(this.transport, this.transportOptions);
}

// ----- Endpoint: info

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@
import org.opensearch.client.opensearch._types.OpenSearchException;
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.transport.OpenSearchTransport;
import org.opensearch.client.transport.TransportOptions;

/**
* Client for the namespace.
*/
@Generated("org.opensearch.client.codegen.CodeGenerator")
public class OpenSearchClient extends OpenSearchClientBase<OpenSearchClient> {
public OpenSearchClient(OpenSearchTransport transport) {
Expand All @@ -60,6 +64,12 @@ public OpenSearchClient withTransportOptions(@Nullable TransportOptions transpor
return new OpenSearchClient(this.transport, transportOptions);
}

// ----- Child clients

public OpenSearchDanglingIndicesClient danglingIndices() {
return new OpenSearchDanglingIndicesClient(this.transport, this.transportOptions);
}

// ----- Endpoint: info

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@
* 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 javax.annotation.Generated;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
import org.opensearch.client.json.ObjectDeserializer;
Expand All @@ -42,22 +47,22 @@

// typedef: _types.AcknowledgedResponseBase

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

private final boolean acknowledged;

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

protected AcknowledgedResponseBase(AbstractBuilder<?> builder) {

this.acknowledged = ApiTypeHelper.requireNonNull(builder.acknowledged, this, "acknowledged");

}

/**
* Required - For a successful response, this value is always true. On failure,
* an exception is returned instead.
* Required - For a successful response, this value is always true. On failure, an exception is returned instead.
* <p>
* API name: {@code acknowledged}
* </p>
*/
public final boolean acknowledged() {
return this.acknowledged;
Expand All @@ -66,44 +71,42 @@ public final boolean acknowledged() {
/**
* 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("acknowledged");
generator.write(this.acknowledged);

}

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

protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>> extends ObjectBuilderBase {
private Boolean acknowledged;

/**
* Required - For a successful response, this value is always true. On failure,
* an exception is returned instead.
* Required - For a successful response, this value is always true. On failure, an exception is returned instead.
* <p>
* API name: {@code acknowledged}
* </p>
*/
public final BuilderT acknowledged(boolean value) {
this.acknowledged = value;
return self();
}

protected abstract BuilderT self();

}

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

protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupAcknowledgedResponseBaseDeserializer(
ObjectDeserializer<BuilderT> op
) {

op.add(AbstractBuilder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged");

}

}
Loading
Loading