Skip to content

Commit

Permalink
Regenerate dangling_indices namespace (#1124)
Browse files Browse the repository at this point in the history
* Rename genericArgs to typeParams

Signed-off-by: Thomas Farr <[email protected]>

* Fix required path param handling

Signed-off-by: Thomas Farr <[email protected]>

* Correctly generate AcknowledgedResponseBase

Signed-off-by: Thomas Farr <[email protected]>

* Generate DeleteDanglingIndexRequest

Signed-off-by: Thomas Farr <[email protected]>

* Correctly generate DeleteDanglingIndexResponse

Signed-off-by: Thomas Farr <[email protected]>

* Generate import_dangling_index

Signed-off-by: Thomas Farr <[email protected]>

* Generate ListDanglingIndicesRequest

Signed-off-by: Thomas Farr <[email protected]>

* Generate ErrorCause

Signed-off-by: Thomas Farr <[email protected]>

* Generate NodeStatistics

Signed-off-by: Thomas Farr <[email protected]>

* Generate DanglingIndex

Signed-off-by: Thomas Farr <[email protected]>

* Generate ListDanglingIndicesResponse

Signed-off-by: Thomas Farr <[email protected]>

* Generate DanglingIndicesClient

Signed-off-by: Thomas Farr <[email protected]>

* Fixes

Signed-off-by: Thomas Farr <[email protected]>

* Changelog and Upgrading

Signed-off-by: Thomas Farr <[email protected]>

* Fix javadoc

Signed-off-by: Thomas Farr <[email protected]>

* Fix tests

Signed-off-by: Thomas Farr <[email protected]>

---------

Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia authored Aug 5, 2024
1 parent 45b805a commit 324f90a
Show file tree
Hide file tree
Showing 49 changed files with 1,436 additions and 694 deletions.
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() {
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

0 comments on commit 324f90a

Please sign in to comment.