Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Aug 2, 2024
1 parent e3798df commit ce493d4
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

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;
import org.opensearch.client.json.PlainJsonSerializable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,7 @@ public DeleteDanglingIndexRequest build() {
// Request parameters
request -> {
Map<String, String> params = new HashMap<>();
if (request.acceptDataLoss != null) {
params.put("accept_data_loss", String.valueOf(request.acceptDataLoss));
}
params.put("accept_data_loss", String.valueOf(request.acceptDataLoss));
if (request.clusterManagerTimeout != null) {
params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,7 @@ public ImportDanglingIndexRequest build() {
// Request parameters
request -> {
Map<String, String> params = new HashMap<>();
if (request.acceptDataLoss != null) {
params.put("accept_data_loss", String.valueOf(request.acceptDataLoss));
}
params.put("accept_data_loss", String.valueOf(request.acceptDataLoss));
if (request.clusterManagerTimeout != null) {
params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
import org.opensearch.client.opensearch.core.pit.DeletePitResponse;
import org.opensearch.client.opensearch.core.pit.ListAllPitRequest;
import org.opensearch.client.opensearch.core.pit.ListAllPitResponse;
import org.opensearch.client.opensearch.dangling_indices.OpenSearchDanglingIndicesAsyncClient;
import org.opensearch.client.opensearch.features.OpenSearchFeaturesAsyncClient;
import org.opensearch.client.opensearch.indices.OpenSearchIndicesAsyncClient;
import org.opensearch.client.opensearch.ingest.OpenSearchIngestAsyncClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
import org.opensearch.client.opensearch.core.pit.DeletePitResponse;
import org.opensearch.client.opensearch.core.pit.ListAllPitRequest;
import org.opensearch.client.opensearch.core.pit.ListAllPitResponse;
import org.opensearch.client.opensearch.dangling_indices.OpenSearchDanglingIndicesClient;
import org.opensearch.client.opensearch.features.OpenSearchFeaturesClient;
import org.opensearch.client.opensearch.generic.OpenSearchGenericClient;
import org.opensearch.client.opensearch.indices.OpenSearchIndicesClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@

public class CodeGenerator {
private static final Logger LOGGER = LogManager.getLogger();
private static final OperationGroup.Matcher OPERATION_MATCHER = OperationGroup.matcher()
.add(null, "info")
.add("dangling_indices");
private static final OperationGroup.Matcher OPERATION_MATCHER = OperationGroup.matcher().add(null, "info").add("dangling_indices");

public static void main(String[] args) {
var inputOpt = Option.builder("i")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public class Field {
private final boolean isAdditionalProperties;

public Field(
@Nonnull String wireName,
@Nonnull Type type,
boolean required,
@Nullable String description,
@Nullable Deprecation deprecation
@Nonnull String wireName,
@Nonnull Type type,
boolean required,
@Nullable String description,
@Nullable Deprecation deprecation
) {
this(wireName, type, required, description, deprecation, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,20 @@
{{#hasQueryParams}}
request -> {
{{TYPES.Java.Util.Map}}<String, String> params = new {{TYPES.Java.Util.HashMap}}<>();
{{#queryParams}}
{{#queryParams}}
{{^required}}
{{#type.isListOrMap}}
if ({{TYPES.Client.Util.ApiTypeHelper}}.isDefined(request.{{name}})) {
{{/type.isListOrMap}}
{{^type.isListOrMap}}
if (request.{{name}} != null) {
{{/type.isListOrMap}}
{{/required}}
params.put({{#quoted}}{{wireName}}{{/quoted}}, {{#type.queryParamify}}request.{{name}}{{/type.queryParamify}});
{{^required}}
}
{{/queryParams}}
{{/required}}
{{/queryParams}}
return params;
},
{{/hasQueryParams}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{#isPrimitive}}
JsonpDeserializer.{{#toLower}}{{boxed.name}}{{/toLower}}Deserializer()
{{TYPES.Client.Json.JsonpDeserializer}}.{{#toLower}}{{boxed.name}}{{/toLower}}Deserializer()
{{/isPrimitive}}
{{^isPrimitive}}
{{#isList}}
JsonpDeserializer.arrayDeserializer({{#listValueType}}{{>Type/deserializer}}{{/listValueType}})
{{TYPES.Client.Json.JsonpDeserializer}}.arrayDeserializer({{#listValueType}}{{>Type/deserializer}}{{/listValueType}})
{{/isList}}
{{#isMap}}
JsonpDeserializer.stringMapDeserializer({{#mapValueType}}{{>Type/deserializer}}{{/mapValueType}})
{{TYPES.Client.Json.JsonpDeserializer}}.stringMapDeserializer({{#mapValueType}}{{>Type/deserializer}}{{/mapValueType}})
{{/isMap}}
{{^isListOrMap}}
{{name}}._DESERIALIZER
Expand Down

0 comments on commit ce493d4

Please sign in to comment.