diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java index 1dd07215be..3b1776a93b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java @@ -50,8 +50,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: snapshot.get.Request @@ -59,7 +61,7 @@ * Returns information about a snapshot. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetSnapshotRequest extends RequestBase { +public class GetSnapshotRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -107,7 +109,7 @@ public final Time clusterManagerTimeout() { } /** - * If false, the request returns an error for any snapshots that are unavailable. + * If false, the request returns an error for any snapshots that are unavailable. *

* API name: {@code ignore_unavailable} *

@@ -118,8 +120,8 @@ public final Boolean ignoreUnavailable() { } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails + * and returns an error. *

* API name: {@code master_timeout} *

@@ -144,11 +146,11 @@ public final String repository() { /** * Required - *

- * Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). + * Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). *

* *

* API name: {@code snapshot} @@ -160,8 +162,8 @@ public final List snapshot() { } /** - * If true, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, the start and - * end times of the snapshot, and the number of shards snapshotted. + * If true, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, + * the start and end times of the snapshot, and the number of shards snapshotted. *

* API name: {@code verbose} *

@@ -173,10 +175,21 @@ public final Boolean verbose() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetSnapshotRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -188,12 +201,39 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -205,42 +245,46 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } /** - * If false, the request returns an error for any snapshots that are unavailable. + * If false, the request returns an error for any snapshots that are unavailable. *

* API name: {@code ignore_unavailable} *

*/ + @Nonnull public final Builder ignoreUnavailable(@Nullable Boolean value) { this.ignoreUnavailable = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -251,6 +295,7 @@ public final Builder masterTimeout(Function> f * API name: {@code repository} *

*/ + @Nonnull public final Builder repository(String value) { this.repository = value; return this; @@ -259,11 +304,11 @@ public final Builder repository(String value) { /** * Required - *

- * Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). + * Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). *

*
    - *
  • To get information about all snapshots in a registered repository, use a wildcard (*) or _all.
  • - *
  • To get information about any snapshots that are currently running, use _current.
  • + *
  • To get information about all snapshots in a registered repository, use a wildcard (*) or _all.
  • + *
  • To get information about any snapshots that are currently running, use _current.
  • *
*

* API name: {@code snapshot} @@ -273,6 +318,7 @@ public final Builder repository(String value) { * Adds all elements of list to snapshot. *

*/ + @Nonnull public final Builder snapshot(List list) { this.snapshot = _listAddAll(this.snapshot, list); return this; @@ -281,11 +327,11 @@ public final Builder snapshot(List list) { /** * Required - *

- * Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). + * Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). *

*
    - *
  • To get information about all snapshots in a registered repository, use a wildcard (*) or _all.
  • - *
  • To get information about any snapshots that are currently running, use _current.
  • + *
  • To get information about all snapshots in a registered repository, use a wildcard (*) or _all.
  • + *
  • To get information about any snapshots that are currently running, use _current.
  • *
*

* API name: {@code snapshot} @@ -295,18 +341,20 @@ public final Builder snapshot(List list) { * Adds one or more values to snapshot. *

*/ + @Nonnull public final Builder snapshot(String value, String... values) { this.snapshot = _listAdd(this.snapshot, value, values); return this; } /** - * If true, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, the start - * and end times of the snapshot, and the number of shards snapshotted. + * If true, returns additional information about each snapshot such as the version of OpenSearch which took the + * snapshot, the start and end times of the snapshot, and the number of shards snapshotted. *

* API name: {@code verbose} *

*/ + @Nonnull public final Builder verbose(@Nullable Boolean value) { this.verbose = value; return this; @@ -317,6 +365,8 @@ public final Builder verbose(@Nullable Boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GetSnapshotRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotResponse.java index f8b88031c6..253287d4c3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotResponse.java @@ -48,14 +48,16 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: snapshot.get.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetSnapshotResponse implements PlainJsonSerializable { +public class GetSnapshotResponse implements PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final List snapshots; @@ -99,12 +101,39 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetSnapshotResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List snapshots; + public Builder() {} + + private Builder(GetSnapshotResponse o) { + this.snapshots = _listCopy(o.snapshots); + } + + private Builder(Builder o) { + this.snapshots = _listCopy(o.snapshots); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code snapshots} * @@ -112,6 +141,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to snapshots. *

*/ + @Nonnull public final Builder snapshots(List list) { this.snapshots = _listAddAll(this.snapshots, list); return this; @@ -124,6 +154,7 @@ public final Builder snapshots(List list) { * Adds one or more values to snapshots. *

*/ + @Nonnull public final Builder snapshots(SnapshotInfo value, SnapshotInfo... values) { this.snapshots = _listAdd(this.snapshots, value, values); return this; @@ -136,6 +167,7 @@ public final Builder snapshots(SnapshotInfo value, SnapshotInfo... values) { * Adds a value to snapshots using a builder lambda. *

*/ + @Nonnull public final Builder snapshots(Function> fn) { return snapshots(fn.apply(new SnapshotInfo.Builder()).build()); } @@ -145,6 +177,8 @@ public final Builder snapshots(Function { @Nonnull private final List dataStreams; @@ -437,10 +439,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SnapshotInfo}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List dataStreams; @Nullable private Time duration; @@ -479,6 +492,60 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to dataStreams. *

*/ + @Nonnull public final Builder dataStreams(List list) { this.dataStreams = _listAddAll(this.dataStreams, list); return this; @@ -498,6 +566,7 @@ public final Builder dataStreams(List list) { * Adds one or more values to dataStreams. *

*/ + @Nonnull public final Builder dataStreams(String value, String... values) { this.dataStreams = _listAdd(this.dataStreams, value, values); return this; @@ -506,6 +575,7 @@ public final Builder dataStreams(String value, String... values) { /** * API name: {@code duration} */ + @Nonnull public final Builder duration(@Nullable Time value) { this.duration = value; return this; @@ -514,6 +584,7 @@ public final Builder duration(@Nullable Time value) { /** * API name: {@code duration} */ + @Nonnull public final Builder duration(Function> fn) { return duration(fn.apply(new Time.Builder()).build()); } @@ -521,6 +592,7 @@ public final Builder duration(Function> fn) { /** * API name: {@code duration_in_millis} */ + @Nonnull public final Builder durationInMillis(@Nullable Long value) { this.durationInMillis = value; return this; @@ -529,6 +601,7 @@ public final Builder durationInMillis(@Nullable Long value) { /** * API name: {@code end_time} */ + @Nonnull public final Builder endTime(@Nullable String value) { this.endTime = value; return this; @@ -537,6 +610,7 @@ public final Builder endTime(@Nullable String value) { /** * API name: {@code end_time_in_millis} */ + @Nonnull public final Builder endTimeInMillis(@Nullable Long value) { this.endTimeInMillis = value; return this; @@ -549,6 +623,7 @@ public final Builder endTimeInMillis(@Nullable Long value) { * Adds all elements of list to failures. *

*/ + @Nonnull public final Builder failures(List list) { this.failures = _listAddAll(this.failures, list); return this; @@ -561,6 +636,7 @@ public final Builder failures(List list) { * Adds one or more values to failures. *

*/ + @Nonnull public final Builder failures(SnapshotShardFailure value, SnapshotShardFailure... values) { this.failures = _listAdd(this.failures, value, values); return this; @@ -573,6 +649,7 @@ public final Builder failures(SnapshotShardFailure value, SnapshotShardFailure.. * Adds a value to failures using a builder lambda. *

*/ + @Nonnull public final Builder failures(Function> fn) { return failures(fn.apply(new SnapshotShardFailure.Builder()).build()); } @@ -580,6 +657,7 @@ public final Builder failures(Functionlist to indices. *

*/ + @Nonnull public final Builder indices(List list) { this.indices = _listAddAll(this.indices, list); return this; @@ -604,6 +683,7 @@ public final Builder indices(List list) { * Adds one or more values to indices. *

*/ + @Nonnull public final Builder indices(String value, String... values) { this.indices = _listAdd(this.indices, value, values); return this; @@ -616,6 +696,7 @@ public final Builder indices(String value, String... values) { * Adds all elements of map to metadata. *

*/ + @Nonnull public final Builder metadata(Map map) { this.metadata = _mapPutAll(this.metadata, map); return this; @@ -628,6 +709,7 @@ public final Builder metadata(Map map) { * Adds an entry to metadata. *

*/ + @Nonnull public final Builder metadata(String key, JsonData value) { this.metadata = _mapPut(this.metadata, key, value); return this; @@ -636,6 +718,7 @@ public final Builder metadata(String key, JsonData value) { /** * API name: {@code pinned_timestamp} */ + @Nonnull public final Builder pinnedTimestamp(@Nullable Long value) { this.pinnedTimestamp = value; return this; @@ -644,6 +727,7 @@ public final Builder pinnedTimestamp(@Nullable Long value) { /** * API name: {@code reason} */ + @Nonnull public final Builder reason(@Nullable String value) { this.reason = value; return this; @@ -652,6 +736,7 @@ public final Builder reason(@Nullable String value) { /** * API name: {@code remote_store_index_shallow_copy} */ + @Nonnull public final Builder remoteStoreIndexShallowCopy(@Nullable Boolean value) { this.remoteStoreIndexShallowCopy = value; return this; @@ -660,6 +745,7 @@ public final Builder remoteStoreIndexShallowCopy(@Nullable Boolean value) { /** * API name: {@code shards} */ + @Nonnull public final Builder shards(@Nullable ShardStatistics value) { this.shards = value; return this; @@ -668,6 +754,7 @@ public final Builder shards(@Nullable ShardStatistics value) { /** * API name: {@code shards} */ + @Nonnull public final Builder shards(Function> fn) { return shards(fn.apply(new ShardStatistics.Builder()).build()); } @@ -675,6 +762,7 @@ public final Builder shards(Function { @Nonnull private final String index; @@ -158,10 +160,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SnapshotShardFailure}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String index; @Nullable private String nodeId; @@ -169,9 +182,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder