diff --git a/java-netapp/README.md b/java-netapp/README.md index 1cd9564d0050..6283b3b152a6 100644 --- a/java-netapp/README.md +++ b/java-netapp/README.md @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.20.0 + 26.21.0 pom import diff --git a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/NetAppClient.java b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/NetAppClient.java index c34a7d300ef4..3db3c08a837a 100644 --- a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/NetAppClient.java +++ b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/NetAppClient.java @@ -28,6 +28,10 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.netapp.v1.stub.NetAppStub; import com.google.cloud.netapp.v1.stub.NetAppStubSettings; import com.google.common.util.concurrent.MoreExecutors; @@ -5009,6 +5013,160 @@ public final OperationFuture reverseReplicationD return stub.reverseReplicationDirectionCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NetAppClient netAppClient = NetAppClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : netAppClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NetAppClient netAppClient = NetAppClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = netAppClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NetAppClient netAppClient = NetAppClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = netAppClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NetAppClient netAppClient = NetAppClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = netAppClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (NetAppClient netAppClient = NetAppClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = netAppClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + @Override public final void close() { stub.close(); @@ -5501,4 +5659,80 @@ protected ListReplicationsFixedSizeCollection createCollection( return new ListReplicationsFixedSizeCollection(pages, collectionSize); } } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/NetAppSettings.java b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/NetAppSettings.java index 7b8c32c796be..58e93de0bf33 100644 --- a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/NetAppSettings.java +++ b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/NetAppSettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.netapp.v1.NetAppClient.ListActiveDirectoriesPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListKmsConfigsPagedResponse; +import static com.google.cloud.netapp.v1.NetAppClient.ListLocationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListReplicationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListSnapshotsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListStoragePoolsPagedResponse; @@ -36,6 +37,10 @@ import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.netapp.v1.stub.NetAppStubSettings; import com.google.longrunning.Operation; import com.google.protobuf.Empty; @@ -418,6 +423,17 @@ public UnaryCallSettings resumeReplicationS return ((NetAppStubSettings) getStubSettings()).reverseReplicationDirectionOperationSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((NetAppStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((NetAppStubSettings) getStubSettings()).getLocationSettings(); + } + public static final NetAppSettings create(NetAppStubSettings stub) throws IOException { return new NetAppSettings.Builder(stub.toBuilder()).build(); } @@ -880,6 +896,18 @@ public UnaryCallSettings.Builder stopReplicat return getStubSettingsBuilder().reverseReplicationDirectionOperationSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + @Override public NetAppSettings build() throws IOException { return new NetAppSettings(this); diff --git a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/gapic_metadata.json b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/gapic_metadata.json index 34a3656561e8..994709332957 100644 --- a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/gapic_metadata.json +++ b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/gapic_metadata.json @@ -55,6 +55,9 @@ "GetKmsConfig": { "methods": ["getKmsConfig", "getKmsConfig", "getKmsConfig", "getKmsConfigCallable"] }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetReplication": { "methods": ["getReplication", "getReplication", "getReplication", "getReplicationCallable"] }, @@ -73,6 +76,9 @@ "ListKmsConfigs": { "methods": ["listKmsConfigs", "listKmsConfigs", "listKmsConfigs", "listKmsConfigsPagedCallable", "listKmsConfigsCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "ListReplications": { "methods": ["listReplications", "listReplications", "listReplications", "listReplicationsPagedCallable", "listReplicationsCallable"] }, diff --git a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/GrpcNetAppStub.java b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/GrpcNetAppStub.java index 1cf07978a12f..5ad34db4aeb9 100644 --- a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/GrpcNetAppStub.java +++ b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/GrpcNetAppStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.netapp.v1.NetAppClient.ListActiveDirectoriesPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListKmsConfigsPagedResponse; +import static com.google.cloud.netapp.v1.NetAppClient.ListLocationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListReplicationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListSnapshotsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListStoragePoolsPagedResponse; @@ -31,6 +32,10 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.netapp.v1.ActiveDirectory; import com.google.cloud.netapp.v1.CreateActiveDirectoryRequest; import com.google.cloud.netapp.v1.CreateKmsConfigRequest; @@ -455,6 +460,25 @@ public class GrpcNetAppStub extends NetAppStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + private final UnaryCallable listStoragePoolsCallable; private final UnaryCallable @@ -559,6 +583,10 @@ public class GrpcNetAppStub extends NetAppStub { private final OperationCallable< ReverseReplicationDirectionRequest, Replication, OperationMetadata> reverseReplicationDirectionOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -974,6 +1002,26 @@ protected GrpcNetAppStub( return builder.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); this.listStoragePoolsCallable = callableFactory.createUnaryCallable( @@ -1267,6 +1315,15 @@ protected GrpcNetAppStub( settings.reverseReplicationDirectionOperationSettings(), clientContext, operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -1633,6 +1690,22 @@ public UnaryCallable resumeReplicationCalla return reverseReplicationDirectionOperationCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/HttpJsonNetAppStub.java b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/HttpJsonNetAppStub.java index 884fe55376f7..d0df66c823df 100644 --- a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/HttpJsonNetAppStub.java +++ b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/HttpJsonNetAppStub.java @@ -18,11 +18,13 @@ import static com.google.cloud.netapp.v1.NetAppClient.ListActiveDirectoriesPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListKmsConfigsPagedResponse; +import static com.google.cloud.netapp.v1.NetAppClient.ListLocationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListReplicationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListSnapshotsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListStoragePoolsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListVolumesPagedResponse; +import com.google.api.HttpRule; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -39,6 +41,10 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.netapp.v1.ActiveDirectory; import com.google.cloud.netapp.v1.CreateActiveDirectoryRequest; import com.google.cloud.netapp.v1.CreateKmsConfigRequest; @@ -89,6 +95,7 @@ import com.google.cloud.netapp.v1.VerifyKmsConfigRequest; import com.google.cloud.netapp.v1.VerifyKmsConfigResponse; import com.google.cloud.netapp.v1.Volume; +import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import com.google.protobuf.TypeRegistry; @@ -1518,6 +1525,74 @@ public class HttpJsonNetAppStub extends NetAppStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private final UnaryCallable listStoragePoolsCallable; private final UnaryCallable @@ -1622,6 +1697,10 @@ public class HttpJsonNetAppStub extends NetAppStub { private final OperationCallable< ReverseReplicationDirectionRequest, Replication, OperationMetadata> reverseReplicationDirectionOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -1663,7 +1742,32 @@ protected HttpJsonNetAppStub( throws IOException { this.callableFactory = callableFactory; this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*}/operations") + .build()) + .build()); HttpJsonCallSettings listStoragePoolsTransportSettings = @@ -2077,6 +2181,29 @@ protected HttpJsonNetAppStub( return builder.build(); }) .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); this.listStoragePoolsCallable = callableFactory.createUnaryCallable( @@ -2370,6 +2497,15 @@ protected HttpJsonNetAppStub( settings.reverseReplicationDirectionOperationSettings(), clientContext, httpJsonOperationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -2414,6 +2550,8 @@ public static List getMethodDescriptors() { methodDescriptors.add(stopReplicationMethodDescriptor); methodDescriptors.add(resumeReplicationMethodDescriptor); methodDescriptors.add(reverseReplicationDirectionMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); return methodDescriptors; } @@ -2778,6 +2916,22 @@ public UnaryCallable resumeReplicationCalla return reverseReplicationDirectionOperationCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + @Override public final void close() { try { diff --git a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/NetAppStub.java b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/NetAppStub.java index 7dc3dfc39f8a..c10df7d5b561 100644 --- a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/NetAppStub.java +++ b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/NetAppStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.netapp.v1.NetAppClient.ListActiveDirectoriesPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListKmsConfigsPagedResponse; +import static com.google.cloud.netapp.v1.NetAppClient.ListLocationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListReplicationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListSnapshotsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListStoragePoolsPagedResponse; @@ -26,6 +27,10 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.netapp.v1.ActiveDirectory; import com.google.cloud.netapp.v1.CreateActiveDirectoryRequest; import com.google.cloud.netapp.v1.CreateKmsConfigRequest; @@ -403,6 +408,19 @@ public UnaryCallable resumeReplicationCalla "Not implemented: reverseReplicationDirectionCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + @Override public abstract void close(); } diff --git a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/NetAppStubSettings.java b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/NetAppStubSettings.java index c94ea2c90146..e2a45ef1d41c 100644 --- a/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/NetAppStubSettings.java +++ b/java-netapp/google-cloud-netapp/src/main/java/com/google/cloud/netapp/v1/stub/NetAppStubSettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.netapp.v1.NetAppClient.ListActiveDirectoriesPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListKmsConfigsPagedResponse; +import static com.google.cloud.netapp.v1.NetAppClient.ListLocationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListReplicationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListSnapshotsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListStoragePoolsPagedResponse; @@ -52,6 +53,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.netapp.v1.ActiveDirectory; import com.google.cloud.netapp.v1.CreateActiveDirectoryRequest; import com.google.cloud.netapp.v1.CreateKmsConfigRequest; @@ -259,6 +264,10 @@ public class NetAppStubSettings extends StubSettings { private final OperationCallSettings< ReverseReplicationDirectionRequest, Replication, OperationMetadata> reverseReplicationDirectionOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; private static final PagedListDescriptor< ListStoragePoolsRequest, ListStoragePoolsResponse, StoragePool> @@ -490,6 +499,42 @@ public Iterable extractResources(ListReplicationsResponse payload) } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListStoragePoolsRequest, ListStoragePoolsResponse, ListStoragePoolsPagedResponse> LIST_STORAGE_POOLS_PAGE_STR_FACT = @@ -603,6 +648,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listStoragePools. */ public PagedCallSettings< ListStoragePoolsRequest, ListStoragePoolsResponse, ListStoragePoolsPagedResponse> @@ -939,6 +1001,17 @@ public UnaryCallSettings resumeReplicationS return reverseReplicationDirectionOperationSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + public NetAppStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -1114,6 +1187,8 @@ protected NetAppStubSettings(Builder settingsBuilder) throws IOException { settingsBuilder.reverseReplicationDirectionSettings().build(); reverseReplicationDirectionOperationSettings = settingsBuilder.reverseReplicationDirectionOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); } /** Builder for NetAppStubSettings. */ @@ -1250,6 +1325,10 @@ public static class Builder extends StubSettings.Builder reverseReplicationDirectionOperationSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -1261,6 +1340,7 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); definitions.put( "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -1288,6 +1368,8 @@ public static class Builder extends StubSettings.Builder>of( @@ -1396,7 +1480,9 @@ protected Builder(ClientContext clientContext) { updateReplicationSettings, stopReplicationSettings, resumeReplicationSettings, - reverseReplicationDirectionSettings); + reverseReplicationDirectionSettings, + listLocationsSettings, + getLocationSettings); initDefaults(this); } @@ -1467,6 +1553,8 @@ protected Builder(NetAppStubSettings settings) { settings.reverseReplicationDirectionSettings.toBuilder(); reverseReplicationDirectionOperationSettings = settings.reverseReplicationDirectionOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -1505,7 +1593,9 @@ protected Builder(NetAppStubSettings settings) { updateReplicationSettings, stopReplicationSettings, resumeReplicationSettings, - reverseReplicationDirectionSettings); + reverseReplicationDirectionSettings, + listLocationsSettings, + getLocationSettings); } private static Builder createDefault() { @@ -1715,6 +1805,16 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .createStoragePoolOperationSettings() .setInitialCallSettings( @@ -2680,6 +2780,18 @@ public UnaryCallSettings.Builder stopReplicat return reverseReplicationDirectionOperationSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + @Override public NetAppStubSettings build() throws IOException { return new NetAppStubSettings(this); diff --git a/java-netapp/google-cloud-netapp/src/main/resources/META-INF/native-image/com.google.cloud.netapp.v1/reflect-config.json b/java-netapp/google-cloud-netapp/src/main/resources/META-INF/native-image/com.google.cloud.netapp.v1/reflect-config.json index f0392a035170..333b8a104fcf 100644 --- a/java-netapp/google-cloud-netapp/src/main/resources/META-INF/native-image/com.google.cloud.netapp.v1/reflect-config.json +++ b/java-netapp/google-cloud-netapp/src/main/resources/META-INF/native-image/com.google.cloud.netapp.v1/reflect-config.json @@ -1286,6 +1286,15 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.netapp.v1.RestrictedAction", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.netapp.v1.ResumeReplicationRequest", "queryAllDeclaredConstructors": true, diff --git a/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/MockLocationsImpl.java b/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/MockLocationsImpl.java index 88b320dd8557..262d2fd6111a 100644 --- a/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/MockLocationsImpl.java +++ b/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/MockLocationsImpl.java @@ -17,8 +17,13 @@ package com.google.cloud.netapp.v1; import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.location.LocationsGrpc.LocationsImplBase; import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @@ -56,4 +61,45 @@ public void reset() { requests = new ArrayList<>(); responses = new LinkedList<>(); } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/NetAppClientHttpJsonTest.java b/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/NetAppClientHttpJsonTest.java index dda41851d579..0557820d86c6 100644 --- a/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/NetAppClientHttpJsonTest.java +++ b/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/NetAppClientHttpJsonTest.java @@ -18,6 +18,7 @@ import static com.google.cloud.netapp.v1.NetAppClient.ListActiveDirectoriesPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListKmsConfigsPagedResponse; +import static com.google.cloud.netapp.v1.NetAppClient.ListLocationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListReplicationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListSnapshotsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListStoragePoolsPagedResponse; @@ -32,6 +33,10 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.netapp.v1.stub.HttpJsonNetAppStub; import com.google.common.collect.Lists; import com.google.longrunning.Operation; @@ -777,6 +782,7 @@ public void getVolumeTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -850,6 +856,7 @@ public void getVolumeTest2() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -923,6 +930,7 @@ public void createVolumeTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1005,6 +1013,7 @@ public void createVolumeTest2() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1087,6 +1096,7 @@ public void updateVolumeTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1128,6 +1138,7 @@ public void updateVolumeTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -1190,6 +1201,7 @@ public void updateVolumeExceptionTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateVolumeAsync(volume, updateMask).get(); @@ -1322,6 +1334,7 @@ public void revertVolumeTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -3797,4 +3810,120 @@ public void reverseReplicationDirectionExceptionTest() throws Exception { } catch (ExecutionException e) { } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/NetAppClientTest.java b/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/NetAppClientTest.java index b09c4497b83e..9a7628cbb269 100644 --- a/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/NetAppClientTest.java +++ b/java-netapp/google-cloud-netapp/src/test/java/com/google/cloud/netapp/v1/NetAppClientTest.java @@ -18,6 +18,7 @@ import static com.google.cloud.netapp.v1.NetAppClient.ListActiveDirectoriesPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListKmsConfigsPagedResponse; +import static com.google.cloud.netapp.v1.NetAppClient.ListLocationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListReplicationsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListSnapshotsPagedResponse; import static com.google.cloud.netapp.v1.NetAppClient.ListStoragePoolsPagedResponse; @@ -31,6 +32,10 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; @@ -700,6 +705,7 @@ public void getVolumeTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); mockNetApp.addResponse(expectedResponse); @@ -767,6 +773,7 @@ public void getVolumeTest2() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); mockNetApp.addResponse(expectedResponse); @@ -834,6 +841,7 @@ public void createVolumeTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -915,6 +923,7 @@ public void createVolumeTest2() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -996,6 +1005,7 @@ public void updateVolumeTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1158,6 +1168,7 @@ public void revertVolumeTest() throws Exception { .setKmsConfig(KmsConfigName.of("[PROJECT]", "[LOCATION]", "[KMS_CONFIG]").toString()) .setEncryptionType(EncryptionType.forNumber(0)) .setHasReplication(true) + .addAllRestrictedActions(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -3361,4 +3372,105 @@ public void reverseReplicationDirectionExceptionTest() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-netapp/pom.xml b/java-netapp/pom.xml index d1c22eeb2056..e41c86df2506 100644 --- a/java-netapp/pom.xml +++ b/java-netapp/pom.xml @@ -51,4 +51,4 @@ google-cloud-netapp-bom - + diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/CreateKmsConfigRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/CreateKmsConfigRequest.java index ee3891a400b8..baa7118a0a22 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/CreateKmsConfigRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/CreateKmsConfigRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.CreateKmsConfigRequest} */ +/** + * + * + *
+ * CreateKmsConfigRequest creates a KMS Config.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.CreateKmsConfigRequest} + */ public final class CreateKmsConfigRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.CreateKmsConfigRequest) @@ -403,7 +411,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.CreateKmsConfigRequest} */ + /** + * + * + *
+   * CreateKmsConfigRequest creates a KMS Config.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.CreateKmsConfigRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.CreateKmsConfigRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/CreateStoragePoolRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/CreateStoragePoolRequest.java index 5964f6fcf03f..74115fc13c2d 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/CreateStoragePoolRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/CreateStoragePoolRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.CreateStoragePoolRequest} */ +/** + * + * + *
+ * CreateStoragePoolRequest creates a Storage Pool.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.CreateStoragePoolRequest} + */ public final class CreateStoragePoolRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.CreateStoragePoolRequest) @@ -403,7 +411,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.CreateStoragePoolRequest} */ + /** + * + * + *
+   * CreateStoragePoolRequest creates a Storage Pool.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.CreateStoragePoolRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.CreateStoragePoolRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/DeleteKmsConfigRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/DeleteKmsConfigRequest.java index e655a2d754db..7ba5493a6728 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/DeleteKmsConfigRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/DeleteKmsConfigRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.DeleteKmsConfigRequest} */ +/** + * + * + *
+ * DeleteKmsConfigRequest deletes a KMS Config.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.DeleteKmsConfigRequest} + */ public final class DeleteKmsConfigRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.DeleteKmsConfigRequest) @@ -268,7 +276,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.DeleteKmsConfigRequest} */ + /** + * + * + *
+   * DeleteKmsConfigRequest deletes a KMS Config.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.DeleteKmsConfigRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.DeleteKmsConfigRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/DeleteStoragePoolRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/DeleteStoragePoolRequest.java index 08e40b0e579c..c8a67e47563c 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/DeleteStoragePoolRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/DeleteStoragePoolRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.DeleteStoragePoolRequest} */ +/** + * + * + *
+ * DeleteStoragePoolRequest deletes a Storage Pool.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.DeleteStoragePoolRequest} + */ public final class DeleteStoragePoolRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.DeleteStoragePoolRequest) @@ -268,7 +276,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.DeleteStoragePoolRequest} */ + /** + * + * + *
+   * DeleteStoragePoolRequest deletes a Storage Pool.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.DeleteStoragePoolRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.DeleteStoragePoolRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/GetKmsConfigRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/GetKmsConfigRequest.java index 3559ec0ee389..6da0bd1815bb 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/GetKmsConfigRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/GetKmsConfigRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.GetKmsConfigRequest} */ +/** + * + * + *
+ * GetKmsConfigRequest gets a KMS Config.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.GetKmsConfigRequest} + */ public final class GetKmsConfigRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.GetKmsConfigRequest) @@ -268,7 +276,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.GetKmsConfigRequest} */ + /** + * + * + *
+   * GetKmsConfigRequest gets a KMS Config.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.GetKmsConfigRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.GetKmsConfigRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/GetStoragePoolRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/GetStoragePoolRequest.java index 01d2a15c44f6..99372e53b275 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/GetStoragePoolRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/GetStoragePoolRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.GetStoragePoolRequest} */ +/** + * + * + *
+ * GetStoragePoolRequest gets a Storage Pool.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.GetStoragePoolRequest} + */ public final class GetStoragePoolRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.GetStoragePoolRequest) @@ -268,7 +276,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.GetStoragePoolRequest} */ + /** + * + * + *
+   * GetStoragePoolRequest gets a Storage Pool.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.GetStoragePoolRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.GetStoragePoolRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListKmsConfigsRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListKmsConfigsRequest.java index 42a142a7d100..10f7c39db8fe 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListKmsConfigsRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListKmsConfigsRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.ListKmsConfigsRequest} */ +/** + * + * + *
+ * ListKmsConfigsRequest lists KMS Configs.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.ListKmsConfigsRequest} + */ public final class ListKmsConfigsRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.ListKmsConfigsRequest) @@ -480,7 +488,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.ListKmsConfigsRequest} */ + /** + * + * + *
+   * ListKmsConfigsRequest lists KMS Configs.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.ListKmsConfigsRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.ListKmsConfigsRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListKmsConfigsResponse.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListKmsConfigsResponse.java index 1c74605830c7..65192a54c892 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListKmsConfigsResponse.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListKmsConfigsResponse.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.ListKmsConfigsResponse} */ +/** + * + * + *
+ * ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.ListKmsConfigsResponse} + */ public final class ListKmsConfigsResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.ListKmsConfigsResponse) @@ -428,7 +436,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.ListKmsConfigsResponse} */ + /** + * + * + *
+   * ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.ListKmsConfigsResponse} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.ListKmsConfigsResponse) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListStoragePoolsRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListStoragePoolsRequest.java index c73485e1b245..8b1e9483a31a 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListStoragePoolsRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListStoragePoolsRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.ListStoragePoolsRequest} */ +/** + * + * + *
+ * ListStoragePoolsRequest lists Storage Pools.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.ListStoragePoolsRequest} + */ public final class ListStoragePoolsRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.ListStoragePoolsRequest) @@ -480,7 +488,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.ListStoragePoolsRequest} */ + /** + * + * + *
+   * ListStoragePoolsRequest lists Storage Pools.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.ListStoragePoolsRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.ListStoragePoolsRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListStoragePoolsResponse.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListStoragePoolsResponse.java index 98800194dcc5..3c3919ef35d8 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListStoragePoolsResponse.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/ListStoragePoolsResponse.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.ListStoragePoolsResponse} */ +/** + * + * + *
+ * ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.ListStoragePoolsResponse} + */ public final class ListStoragePoolsResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.ListStoragePoolsResponse) @@ -428,7 +436,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.ListStoragePoolsResponse} */ + /** + * + * + *
+   * ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.ListStoragePoolsResponse} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.ListStoragePoolsResponse) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/RestrictedAction.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/RestrictedAction.java new file mode 100644 index 000000000000..d1402fd42f8c --- /dev/null +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/RestrictedAction.java @@ -0,0 +1,154 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/netapp/v1/volume.proto + +package com.google.cloud.netapp.v1; + +/** + * + * + *
+ * Actions to be restricted for a volume.
+ * 
+ * + * Protobuf enum {@code google.cloud.netapp.v1.RestrictedAction} + */ +public enum RestrictedAction implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified restricted action
+   * 
+ * + * RESTRICTED_ACTION_UNSPECIFIED = 0; + */ + RESTRICTED_ACTION_UNSPECIFIED(0), + /** + * + * + *
+   * Prevent volume from being deleted when mounted.
+   * 
+ * + * DELETE = 1; + */ + DELETE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified restricted action
+   * 
+ * + * RESTRICTED_ACTION_UNSPECIFIED = 0; + */ + public static final int RESTRICTED_ACTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Prevent volume from being deleted when mounted.
+   * 
+ * + * DELETE = 1; + */ + public static final int DELETE_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RestrictedAction valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RestrictedAction forNumber(int value) { + switch (value) { + case 0: + return RESTRICTED_ACTION_UNSPECIFIED; + case 1: + return DELETE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RestrictedAction findValueByNumber(int number) { + return RestrictedAction.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.netapp.v1.VolumeProto.getDescriptor().getEnumTypes().get(4); + } + + private static final RestrictedAction[] VALUES = values(); + + public static RestrictedAction valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RestrictedAction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.netapp.v1.RestrictedAction) +} diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/Snapshot.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/Snapshot.java index cc74186424cd..5df0aa93cdf7 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/Snapshot.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/Snapshot.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.Snapshot} */ +/** + * + * + *
+ * Snapshot is a point-in-time version of a Volume's content.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.Snapshot} + */ public final class Snapshot extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.Snapshot) @@ -908,7 +916,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.Snapshot} */ + /** + * + * + *
+   * Snapshot is a point-in-time version of a Volume's content.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.Snapshot} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.Snapshot) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/UpdateKmsConfigRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/UpdateKmsConfigRequest.java index 8938ae265a8b..c77aa3883235 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/UpdateKmsConfigRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/UpdateKmsConfigRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.UpdateKmsConfigRequest} */ +/** + * + * + *
+ * UpdateKmsConfigRequest updates a KMS Config.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.UpdateKmsConfigRequest} + */ public final class UpdateKmsConfigRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.UpdateKmsConfigRequest) @@ -347,7 +355,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.UpdateKmsConfigRequest} */ + /** + * + * + *
+   * UpdateKmsConfigRequest updates a KMS Config.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.UpdateKmsConfigRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.UpdateKmsConfigRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/UpdateStoragePoolRequest.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/UpdateStoragePoolRequest.java index 4d05fd6eb7b3..bec3583c33f4 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/UpdateStoragePoolRequest.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/UpdateStoragePoolRequest.java @@ -18,7 +18,15 @@ package com.google.cloud.netapp.v1; -/** Protobuf type {@code google.cloud.netapp.v1.UpdateStoragePoolRequest} */ +/** + * + * + *
+ * UpdateStoragePoolRequest updates a Storage Pool.
+ * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.UpdateStoragePoolRequest} + */ public final class UpdateStoragePoolRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.netapp.v1.UpdateStoragePoolRequest) @@ -347,7 +355,15 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build Builder builder = new Builder(parent); return builder; } - /** Protobuf type {@code google.cloud.netapp.v1.UpdateStoragePoolRequest} */ + /** + * + * + *
+   * UpdateStoragePoolRequest updates a Storage Pool.
+   * 
+ * + * Protobuf type {@code google.cloud.netapp.v1.UpdateStoragePoolRequest} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.netapp.v1.UpdateStoragePoolRequest) diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/Volume.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/Volume.java index ed5d77b60482..5d8160ec4bbe 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/Volume.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/Volume.java @@ -55,6 +55,7 @@ private Volume() { activeDirectory_ = ""; kmsConfig_ = ""; encryptionType_ = 0; + restrictedActions_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -1791,6 +1792,116 @@ public boolean getHasReplication() { return hasReplication_; } + public static final int RESTRICTED_ACTIONS_FIELD_NUMBER = 31; + + @SuppressWarnings("serial") + private java.util.List restrictedActions_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.netapp.v1.RestrictedAction> + restrictedActions_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.netapp.v1.RestrictedAction>() { + public com.google.cloud.netapp.v1.RestrictedAction convert(java.lang.Integer from) { + com.google.cloud.netapp.v1.RestrictedAction result = + com.google.cloud.netapp.v1.RestrictedAction.forNumber(from); + return result == null + ? com.google.cloud.netapp.v1.RestrictedAction.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the restrictedActions. + */ + @java.lang.Override + public java.util.List getRestrictedActionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.netapp.v1.RestrictedAction>( + restrictedActions_, restrictedActions_converter_); + } + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of restrictedActions. + */ + @java.lang.Override + public int getRestrictedActionsCount() { + return restrictedActions_.size(); + } + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The restrictedActions at the given index. + */ + @java.lang.Override + public com.google.cloud.netapp.v1.RestrictedAction getRestrictedActions(int index) { + return restrictedActions_converter_.convert(restrictedActions_.get(index)); + } + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for restrictedActions. + */ + @java.lang.Override + public java.util.List getRestrictedActionsValueList() { + return restrictedActions_; + } + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of restrictedActions at the given index. + */ + @java.lang.Override + public int getRestrictedActionsValue(int index) { + return restrictedActions_.get(index); + } + + private int restrictedActionsMemoizedSerializedSize; + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1903,6 +2014,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (hasReplication_ != false) { output.writeBool(29, hasReplication_); } + if (getRestrictedActionsList().size() > 0) { + output.writeUInt32NoTag(250); + output.writeUInt32NoTag(restrictedActionsMemoizedSerializedSize); + } + for (int i = 0; i < restrictedActions_.size(); i++) { + output.writeEnumNoTag(restrictedActions_.get(i)); + } getUnknownFields().writeTo(output); } @@ -2027,6 +2145,19 @@ public int getSerializedSize() { if (hasReplication_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(29, hasReplication_); } + { + int dataSize = 0; + for (int i = 0; i < restrictedActions_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(restrictedActions_.get(i)); + } + size += dataSize; + if (!getRestrictedActionsList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + restrictedActionsMemoizedSerializedSize = dataSize; + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -2084,6 +2215,7 @@ public boolean equals(final java.lang.Object obj) { if (!getKmsConfig().equals(other.getKmsConfig())) return false; if (encryptionType_ != other.encryptionType_) return false; if (getHasReplication() != other.getHasReplication()) return false; + if (!restrictedActions_.equals(other.restrictedActions_)) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2172,6 +2304,10 @@ public int hashCode() { hash = (53 * hash) + encryptionType_; hash = (37 * hash) + HAS_REPLICATION_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getHasReplication()); + if (getRestrictedActionsCount() > 0) { + hash = (37 * hash) + RESTRICTED_ACTIONS_FIELD_NUMBER; + hash = (53 * hash) + restrictedActions_.hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -2383,6 +2519,8 @@ public Builder clear() { kmsConfig_ = ""; encryptionType_ = 0; hasReplication_ = false; + restrictedActions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x20000000); return this; } @@ -2437,6 +2575,11 @@ private void buildPartialRepeatedFields(com.google.cloud.netapp.v1.Volume result } else { result.mountOptions_ = mountOptionsBuilder_.build(); } + if (((bitField0_ & 0x20000000) != 0)) { + restrictedActions_ = java.util.Collections.unmodifiableList(restrictedActions_); + bitField0_ = (bitField0_ & ~0x20000000); + } + result.restrictedActions_ = restrictedActions_; } private void buildPartial0(com.google.cloud.netapp.v1.Volume result) { @@ -2716,6 +2859,16 @@ public Builder mergeFrom(com.google.cloud.netapp.v1.Volume other) { if (other.getHasReplication() != false) { setHasReplication(other.getHasReplication()); } + if (!other.restrictedActions_.isEmpty()) { + if (restrictedActions_.isEmpty()) { + restrictedActions_ = other.restrictedActions_; + bitField0_ = (bitField0_ & ~0x20000000); + } else { + ensureRestrictedActionsIsMutable(); + restrictedActions_.addAll(other.restrictedActions_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -2956,6 +3109,25 @@ public Builder mergeFrom( bitField0_ |= 0x10000000; break; } // case 232 + case 248: + { + int tmpRaw = input.readEnum(); + ensureRestrictedActionsIsMutable(); + restrictedActions_.add(tmpRaw); + break; + } // case 248 + case 250: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureRestrictedActionsIsMutable(); + restrictedActions_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 250 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -6726,6 +6898,253 @@ public Builder clearHasReplication() { return this; } + private java.util.List restrictedActions_ = + java.util.Collections.emptyList(); + + private void ensureRestrictedActionsIsMutable() { + if (!((bitField0_ & 0x20000000) != 0)) { + restrictedActions_ = new java.util.ArrayList(restrictedActions_); + bitField0_ |= 0x20000000; + } + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the restrictedActions. + */ + public java.util.List getRestrictedActionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.netapp.v1.RestrictedAction>( + restrictedActions_, restrictedActions_converter_); + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of restrictedActions. + */ + public int getRestrictedActionsCount() { + return restrictedActions_.size(); + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The restrictedActions at the given index. + */ + public com.google.cloud.netapp.v1.RestrictedAction getRestrictedActions(int index) { + return restrictedActions_converter_.convert(restrictedActions_.get(index)); + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The restrictedActions to set. + * @return This builder for chaining. + */ + public Builder setRestrictedActions( + int index, com.google.cloud.netapp.v1.RestrictedAction value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedActionsIsMutable(); + restrictedActions_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The restrictedActions to add. + * @return This builder for chaining. + */ + public Builder addRestrictedActions(com.google.cloud.netapp.v1.RestrictedAction value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedActionsIsMutable(); + restrictedActions_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The restrictedActions to add. + * @return This builder for chaining. + */ + public Builder addAllRestrictedActions( + java.lang.Iterable values) { + ensureRestrictedActionsIsMutable(); + for (com.google.cloud.netapp.v1.RestrictedAction value : values) { + restrictedActions_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRestrictedActions() { + restrictedActions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x20000000); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for restrictedActions. + */ + public java.util.List getRestrictedActionsValueList() { + return java.util.Collections.unmodifiableList(restrictedActions_); + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of restrictedActions at the given index. + */ + public int getRestrictedActionsValue(int index) { + return restrictedActions_.get(index); + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for restrictedActions to set. + * @return This builder for chaining. + */ + public Builder setRestrictedActionsValue(int index, int value) { + ensureRestrictedActionsIsMutable(); + restrictedActions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for restrictedActions to add. + * @return This builder for chaining. + */ + public Builder addRestrictedActionsValue(int value) { + ensureRestrictedActionsIsMutable(); + restrictedActions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. List of actions that are restricted on this volume.
+     * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The enum numeric values on the wire for restrictedActions to add. + * @return This builder for chaining. + */ + public Builder addAllRestrictedActionsValue(java.lang.Iterable values) { + ensureRestrictedActionsIsMutable(); + for (int value : values) { + restrictedActions_.add(value); + } + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/VolumeOrBuilder.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/VolumeOrBuilder.java index 9902bce02167..8b0cc2803e6d 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/VolumeOrBuilder.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/VolumeOrBuilder.java @@ -934,4 +934,77 @@ java.lang.String getLabelsOrDefault( * @return The hasReplication. */ boolean getHasReplication(); + + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the restrictedActions. + */ + java.util.List getRestrictedActionsList(); + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of restrictedActions. + */ + int getRestrictedActionsCount(); + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The restrictedActions at the given index. + */ + com.google.cloud.netapp.v1.RestrictedAction getRestrictedActions(int index); + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for restrictedActions. + */ + java.util.List getRestrictedActionsValueList(); + /** + * + * + *
+   * Optional. List of actions that are restricted on this volume.
+   * 
+ * + * + * repeated .google.cloud.netapp.v1.RestrictedAction restricted_actions = 31 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of restrictedActions at the given index. + */ + int getRestrictedActionsValue(int index); } diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/VolumeProto.java b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/VolumeProto.java index dbe2b82105db..88c4d5accaa7 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/VolumeProto.java +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/java/com/google/cloud/netapp/v1/VolumeProto.java @@ -134,7 +134,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "pis.com/Volume\022\r\n\005force\030\002 \001(\010\"e\n\023RevertV" + "olumeRequest\0223\n\004name\030\001 \001(\tB%\342A\001\002\372A\036\n\034net" + "app.googleapis.com/Volume\022\031\n\013snapshot_id" - + "\030\002 \001(\tB\004\342A\001\002\"\232\r\n\006Volume\022\022\n\004name\030\001 \001(\tB\004\342" + + "\030\002 \001(\tB\004\342A\001\002\"\346\r\n\006Volume\022\022\n\004name\030\001 \001(\tB\004\342" + "A\001\003\0229\n\005state\030\002 \001(\0162$.google.cloud.netapp" + ".v1.Volume.StateB\004\342A\001\003\022\033\n\rstate_details\030" + "\003 \001(\tB\004\342A\001\003\0225\n\013create_time\030\004 \001(\0132\032.googl" @@ -170,77 +170,80 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "apis.com/KmsConfig\022E\n\017encryption_type\030\034 " + "\001(\0162&.google.cloud.netapp.v1.EncryptionT" + "ypeB\004\342A\001\003\022\035\n\017has_replication\030\035 \001(\010B\004\342A\001\003" - + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " - + "\001(\t:\0028\001\"{\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022" - + "\t\n\005READY\020\001\022\014\n\010CREATING\020\002\022\014\n\010DELETING\020\003\022\014" - + "\n\010UPDATING\020\004\022\r\n\tRESTORING\020\005\022\014\n\010DISABLED\020" - + "\006\022\t\n\005ERROR\020\007:[\352AX\n\034netapp.googleapis.com" - + "/Volume\0228projects/{project}/locations/{l" - + "ocation}/volumes/{volume}\"S\n\014ExportPolic" - + "y\022C\n\005rules\030\001 \003(\0132..google.cloud.netapp.v" - + "1.SimpleExportPolicyRuleB\004\342A\001\002\"\374\004\n\026Simpl" - + "eExportPolicyRule\022\034\n\017allowed_clients\030\001 \001" - + "(\tH\000\210\001\001\022\034\n\017has_root_access\030\002 \001(\tH\001\210\001\001\022<\n" - + "\013access_type\030\003 \001(\0162\".google.cloud.netapp" - + ".v1.AccessTypeH\002\210\001\001\022\022\n\005nfsv3\030\004 \001(\010H\003\210\001\001\022" - + "\022\n\005nfsv4\030\005 \001(\010H\004\210\001\001\022!\n\024kerberos_5_read_o" - + "nly\030\006 \001(\010H\005\210\001\001\022\"\n\025kerberos_5_read_write\030" - + "\007 \001(\010H\006\210\001\001\022\"\n\025kerberos_5i_read_only\030\010 \001(" - + "\010H\007\210\001\001\022#\n\026kerberos_5i_read_write\030\t \001(\010H\010" - + "\210\001\001\022\"\n\025kerberos_5p_read_only\030\n \001(\010H\t\210\001\001\022" - + "#\n\026kerberos_5p_read_write\030\013 \001(\010H\n\210\001\001B\022\n\020" - + "_allowed_clientsB\022\n\020_has_root_accessB\016\n\014" - + "_access_typeB\010\n\006_nfsv3B\010\n\006_nfsv4B\027\n\025_ker" - + "beros_5_read_onlyB\030\n\026_kerberos_5_read_wr" - + "iteB\030\n\026_kerberos_5i_read_onlyB\031\n\027_kerber" - + "os_5i_read_writeB\030\n\026_kerberos_5p_read_on" - + "lyB\031\n\027_kerberos_5p_read_write\"\232\003\n\016Snapsh" - + "otPolicy\022\024\n\007enabled\030\001 \001(\010H\000\210\001\001\022D\n\017hourly" - + "_schedule\030\002 \001(\0132&.google.cloud.netapp.v1" - + ".HourlyScheduleH\001\210\001\001\022B\n\016daily_schedule\030\003" - + " \001(\0132%.google.cloud.netapp.v1.DailySched" - + "uleH\002\210\001\001\022D\n\017weekly_schedule\030\004 \001(\0132&.goog" - + "le.cloud.netapp.v1.WeeklyScheduleH\003\210\001\001\022F" - + "\n\020monthly_schedule\030\005 \001(\0132\'.google.cloud." - + "netapp.v1.MonthlyScheduleH\004\210\001\001B\n\n\010_enabl" - + "edB\022\n\020_hourly_scheduleB\021\n\017_daily_schedul" - + "eB\022\n\020_weekly_scheduleB\023\n\021_monthly_schedu" - + "le\"f\n\016HourlySchedule\022\036\n\021snapshots_to_kee" - + "p\030\001 \001(\001H\000\210\001\001\022\023\n\006minute\030\002 \001(\001H\001\210\001\001B\024\n\022_sn" - + "apshots_to_keepB\t\n\007_minute\"\201\001\n\rDailySche" - + "dule\022\036\n\021snapshots_to_keep\030\001 \001(\001H\000\210\001\001\022\023\n\006" - + "minute\030\002 \001(\001H\001\210\001\001\022\021\n\004hour\030\003 \001(\001H\002\210\001\001B\024\n\022" - + "_snapshots_to_keepB\t\n\007_minuteB\007\n\005_hour\"\234" - + "\001\n\016WeeklySchedule\022\036\n\021snapshots_to_keep\030\001" - + " \001(\001H\000\210\001\001\022\023\n\006minute\030\002 \001(\001H\001\210\001\001\022\021\n\004hour\030\003" - + " \001(\001H\002\210\001\001\022\020\n\003day\030\004 \001(\tH\003\210\001\001B\024\n\022_snapshot" - + "s_to_keepB\t\n\007_minuteB\007\n\005_hourB\006\n\004_day\"\261\001" - + "\n\017MonthlySchedule\022\036\n\021snapshots_to_keep\030\001" - + " \001(\001H\000\210\001\001\022\023\n\006minute\030\002 \001(\001H\001\210\001\001\022\021\n\004hour\030\003" - + " \001(\001H\002\210\001\001\022\032\n\rdays_of_month\030\004 \001(\tH\003\210\001\001B\024\n" - + "\022_snapshots_to_keepB\t\n\007_minuteB\007\n\005_hourB" - + "\020\n\016_days_of_month\"}\n\013MountOption\022\016\n\006expo" - + "rt\030\001 \001(\t\022\023\n\013export_full\030\002 \001(\t\0223\n\010protoco" - + "l\030\003 \001(\0162!.google.cloud.netapp.v1.Protoco" - + "ls\022\024\n\014instructions\030\004 \001(\t\"8\n\021RestoreParam" - + "eters\022\031\n\017source_snapshot\030\001 \001(\tH\000B\010\n\006sour" - + "ce*E\n\tProtocols\022\031\n\025PROTOCOLS_UNSPECIFIED" - + "\020\000\022\t\n\005NFSV3\020\001\022\t\n\005NFSV4\020\002\022\007\n\003SMB\020\003*W\n\nAcc" - + "essType\022\033\n\027ACCESS_TYPE_UNSPECIFIED\020\000\022\r\n\t" - + "READ_ONLY\020\001\022\016\n\nREAD_WRITE\020\002\022\r\n\tREAD_NONE" - + "\020\003*\350\001\n\013SMBSettings\022\034\n\030SMB_SETTINGS_UNSPE" - + "CIFIED\020\000\022\020\n\014ENCRYPT_DATA\020\001\022\r\n\tBROWSABLE\020" - + "\002\022\021\n\rCHANGE_NOTIFY\020\003\022\021\n\rNON_BROWSABLE\020\004\022" - + "\013\n\007OPLOCKS\020\005\022\021\n\rSHOW_SNAPSHOT\020\006\022\032\n\026SHOW_" - + "PREVIOUS_VERSIONS\020\007\022\034\n\030ACCESS_BASED_ENUM" - + "ERATION\020\010\022\032\n\026CONTINUOUSLY_AVAILABLE\020\t*C\n" - + "\rSecurityStyle\022\036\n\032SECURITY_STYLE_UNSPECI" - + "FIED\020\000\022\010\n\004NTFS\020\001\022\010\n\004UNIX\020\002B\255\001\n\032com.googl" - + "e.cloud.netapp.v1B\013VolumeProtoP\001Z2cloud." - + "google.com/go/netapp/apiv1/netapppb;neta" - + "pppb\252\002\026Google.Cloud.NetApp.V1\312\002\026Google\\C" - + "loud\\NetApp\\V1\352\002\031Google::Cloud::NetApp::" - + "V1b\006proto3" + + "\022J\n\022restricted_actions\030\037 \003(\0162(.google.cl" + + "oud.netapp.v1.RestrictedActionB\004\342A\001\001\032-\n\013" + + "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001\"{\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\t\n\005R" + + "EADY\020\001\022\014\n\010CREATING\020\002\022\014\n\010DELETING\020\003\022\014\n\010UP" + + "DATING\020\004\022\r\n\tRESTORING\020\005\022\014\n\010DISABLED\020\006\022\t\n" + + "\005ERROR\020\007:[\352AX\n\034netapp.googleapis.com/Vol" + + "ume\0228projects/{project}/locations/{locat" + + "ion}/volumes/{volume}\"S\n\014ExportPolicy\022C\n" + + "\005rules\030\001 \003(\0132..google.cloud.netapp.v1.Si" + + "mpleExportPolicyRuleB\004\342A\001\002\"\374\004\n\026SimpleExp" + + "ortPolicyRule\022\034\n\017allowed_clients\030\001 \001(\tH\000" + + "\210\001\001\022\034\n\017has_root_access\030\002 \001(\tH\001\210\001\001\022<\n\013acc" + + "ess_type\030\003 \001(\0162\".google.cloud.netapp.v1." + + "AccessTypeH\002\210\001\001\022\022\n\005nfsv3\030\004 \001(\010H\003\210\001\001\022\022\n\005n" + + "fsv4\030\005 \001(\010H\004\210\001\001\022!\n\024kerberos_5_read_only\030" + + "\006 \001(\010H\005\210\001\001\022\"\n\025kerberos_5_read_write\030\007 \001(" + + "\010H\006\210\001\001\022\"\n\025kerberos_5i_read_only\030\010 \001(\010H\007\210" + + "\001\001\022#\n\026kerberos_5i_read_write\030\t \001(\010H\010\210\001\001\022" + + "\"\n\025kerberos_5p_read_only\030\n \001(\010H\t\210\001\001\022#\n\026k" + + "erberos_5p_read_write\030\013 \001(\010H\n\210\001\001B\022\n\020_all" + + "owed_clientsB\022\n\020_has_root_accessB\016\n\014_acc" + + "ess_typeB\010\n\006_nfsv3B\010\n\006_nfsv4B\027\n\025_kerbero" + + "s_5_read_onlyB\030\n\026_kerberos_5_read_writeB" + + "\030\n\026_kerberos_5i_read_onlyB\031\n\027_kerberos_5" + + "i_read_writeB\030\n\026_kerberos_5p_read_onlyB\031" + + "\n\027_kerberos_5p_read_write\"\232\003\n\016SnapshotPo" + + "licy\022\024\n\007enabled\030\001 \001(\010H\000\210\001\001\022D\n\017hourly_sch" + + "edule\030\002 \001(\0132&.google.cloud.netapp.v1.Hou" + + "rlyScheduleH\001\210\001\001\022B\n\016daily_schedule\030\003 \001(\013" + + "2%.google.cloud.netapp.v1.DailyScheduleH" + + "\002\210\001\001\022D\n\017weekly_schedule\030\004 \001(\0132&.google.c" + + "loud.netapp.v1.WeeklyScheduleH\003\210\001\001\022F\n\020mo" + + "nthly_schedule\030\005 \001(\0132\'.google.cloud.neta" + + "pp.v1.MonthlyScheduleH\004\210\001\001B\n\n\010_enabledB\022" + + "\n\020_hourly_scheduleB\021\n\017_daily_scheduleB\022\n" + + "\020_weekly_scheduleB\023\n\021_monthly_schedule\"f" + + "\n\016HourlySchedule\022\036\n\021snapshots_to_keep\030\001 " + + "\001(\001H\000\210\001\001\022\023\n\006minute\030\002 \001(\001H\001\210\001\001B\024\n\022_snapsh" + + "ots_to_keepB\t\n\007_minute\"\201\001\n\rDailySchedule" + + "\022\036\n\021snapshots_to_keep\030\001 \001(\001H\000\210\001\001\022\023\n\006minu" + + "te\030\002 \001(\001H\001\210\001\001\022\021\n\004hour\030\003 \001(\001H\002\210\001\001B\024\n\022_sna" + + "pshots_to_keepB\t\n\007_minuteB\007\n\005_hour\"\234\001\n\016W" + + "eeklySchedule\022\036\n\021snapshots_to_keep\030\001 \001(\001" + + "H\000\210\001\001\022\023\n\006minute\030\002 \001(\001H\001\210\001\001\022\021\n\004hour\030\003 \001(\001" + + "H\002\210\001\001\022\020\n\003day\030\004 \001(\tH\003\210\001\001B\024\n\022_snapshots_to" + + "_keepB\t\n\007_minuteB\007\n\005_hourB\006\n\004_day\"\261\001\n\017Mo" + + "nthlySchedule\022\036\n\021snapshots_to_keep\030\001 \001(\001" + + "H\000\210\001\001\022\023\n\006minute\030\002 \001(\001H\001\210\001\001\022\021\n\004hour\030\003 \001(\001" + + "H\002\210\001\001\022\032\n\rdays_of_month\030\004 \001(\tH\003\210\001\001B\024\n\022_sn" + + "apshots_to_keepB\t\n\007_minuteB\007\n\005_hourB\020\n\016_" + + "days_of_month\"}\n\013MountOption\022\016\n\006export\030\001" + + " \001(\t\022\023\n\013export_full\030\002 \001(\t\0223\n\010protocol\030\003 " + + "\001(\0162!.google.cloud.netapp.v1.Protocols\022\024" + + "\n\014instructions\030\004 \001(\t\"8\n\021RestoreParameter" + + "s\022\031\n\017source_snapshot\030\001 \001(\tH\000B\010\n\006source*E" + + "\n\tProtocols\022\031\n\025PROTOCOLS_UNSPECIFIED\020\000\022\t" + + "\n\005NFSV3\020\001\022\t\n\005NFSV4\020\002\022\007\n\003SMB\020\003*W\n\nAccessT" + + "ype\022\033\n\027ACCESS_TYPE_UNSPECIFIED\020\000\022\r\n\tREAD" + + "_ONLY\020\001\022\016\n\nREAD_WRITE\020\002\022\r\n\tREAD_NONE\020\003*\350" + + "\001\n\013SMBSettings\022\034\n\030SMB_SETTINGS_UNSPECIFI" + + "ED\020\000\022\020\n\014ENCRYPT_DATA\020\001\022\r\n\tBROWSABLE\020\002\022\021\n" + + "\rCHANGE_NOTIFY\020\003\022\021\n\rNON_BROWSABLE\020\004\022\013\n\007O" + + "PLOCKS\020\005\022\021\n\rSHOW_SNAPSHOT\020\006\022\032\n\026SHOW_PREV" + + "IOUS_VERSIONS\020\007\022\034\n\030ACCESS_BASED_ENUMERAT" + + "ION\020\010\022\032\n\026CONTINUOUSLY_AVAILABLE\020\t*C\n\rSec" + + "urityStyle\022\036\n\032SECURITY_STYLE_UNSPECIFIED" + + "\020\000\022\010\n\004NTFS\020\001\022\010\n\004UNIX\020\002*A\n\020RestrictedActi" + + "on\022!\n\035RESTRICTED_ACTION_UNSPECIFIED\020\000\022\n\n" + + "\006DELETE\020\001B\255\001\n\032com.google.cloud.netapp.v1" + + "B\013VolumeProtoP\001Z2cloud.google.com/go/net" + + "app/apiv1/netapppb;netapppb\252\002\026Google.Clo" + + "ud.NetApp.V1\312\002\026Google\\Cloud\\NetApp\\V1\352\002\031" + + "Google::Cloud::NetApp::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -343,6 +346,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "KmsConfig", "EncryptionType", "HasReplication", + "RestrictedActions", }); internal_static_google_cloud_netapp_v1_Volume_LabelsEntry_descriptor = internal_static_google_cloud_netapp_v1_Volume_descriptor.getNestedTypes().get(0); diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/kms.proto b/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/kms.proto index 97221e3bfb84..0547e49d31dd 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/kms.proto +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/kms.proto @@ -29,6 +29,7 @@ option java_package = "com.google.cloud.netapp.v1"; option php_namespace = "Google\\Cloud\\NetApp\\V1"; option ruby_package = "Google::Cloud::NetApp::V1"; +// GetKmsConfigRequest gets a KMS Config. message GetKmsConfigRequest { // Required. Name of the KmsConfig string name = 1 [ @@ -39,6 +40,7 @@ message GetKmsConfigRequest { ]; } +// ListKmsConfigsRequest lists KMS Configs. message ListKmsConfigsRequest { // Required. Parent value string parent = 1 [ @@ -62,6 +64,7 @@ message ListKmsConfigsRequest { string filter = 5; } +// ListKmsConfigsResponse is the response to a ListKmsConfigsRequest. message ListKmsConfigsResponse { // The list of KmsConfigs repeated KmsConfig kms_configs = 1; @@ -73,6 +76,7 @@ message ListKmsConfigsResponse { repeated string unreachable = 3; } +// CreateKmsConfigRequest creates a KMS Config. message CreateKmsConfigRequest { // Required. Value for parent. string parent = 1 [ @@ -91,6 +95,7 @@ message CreateKmsConfigRequest { KmsConfig kms_config = 3 [(google.api.field_behavior) = REQUIRED]; } +// UpdateKmsConfigRequest updates a KMS Config. message UpdateKmsConfigRequest { // Required. Field mask is used to specify the fields to be overwritten in the // KmsConfig resource by the update. @@ -104,6 +109,7 @@ message UpdateKmsConfigRequest { KmsConfig kms_config = 2 [(google.api.field_behavior) = REQUIRED]; } +// DeleteKmsConfigRequest deletes a KMS Config. message DeleteKmsConfigRequest { // Required. Name of the KmsConfig. string name = 1 [ diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/snapshot.proto b/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/snapshot.proto index 4dd2213ec275..a37ef7dd41d5 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/snapshot.proto +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/snapshot.proto @@ -119,6 +119,7 @@ message UpdateSnapshotRequest { Snapshot snapshot = 2 [(google.api.field_behavior) = REQUIRED]; } +// Snapshot is a point-in-time version of a Volume's content. message Snapshot { option (google.api.resource) = { type: "netapp.googleapis.com/Snapshot" diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/storage_pool.proto b/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/storage_pool.proto index a207204de7fb..1dcdbacf113c 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/storage_pool.proto +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/storage_pool.proto @@ -30,6 +30,7 @@ option java_package = "com.google.cloud.netapp.v1"; option php_namespace = "Google\\Cloud\\NetApp\\V1"; option ruby_package = "Google::Cloud::NetApp::V1"; +// GetStoragePoolRequest gets a Storage Pool. message GetStoragePoolRequest { // Required. Name of the storage pool string name = 1 [ @@ -40,6 +41,7 @@ message GetStoragePoolRequest { ]; } +// ListStoragePoolsRequest lists Storage Pools. message ListStoragePoolsRequest { // Required. Parent value string parent = 1 [ @@ -63,6 +65,7 @@ message ListStoragePoolsRequest { string filter = 5; } +// ListStoragePoolsResponse is the response to a ListStoragePoolsRequest. message ListStoragePoolsResponse { // The list of StoragePools repeated StoragePool storage_pools = 1; @@ -74,6 +77,7 @@ message ListStoragePoolsResponse { repeated string unreachable = 3; } +// CreateStoragePoolRequest creates a Storage Pool. message CreateStoragePoolRequest { // Required. Value for parent. string parent = 1 [ @@ -92,6 +96,7 @@ message CreateStoragePoolRequest { StoragePool storage_pool = 3 [(google.api.field_behavior) = REQUIRED]; } +// UpdateStoragePoolRequest updates a Storage Pool. message UpdateStoragePoolRequest { // Required. Field mask is used to specify the fields to be overwritten in the // StoragePool resource by the update. @@ -105,6 +110,7 @@ message UpdateStoragePoolRequest { StoragePool storage_pool = 2 [(google.api.field_behavior) = REQUIRED]; } +// DeleteStoragePoolRequest deletes a Storage Pool. message DeleteStoragePoolRequest { // Required. Name of the storage pool string name = 1 [ diff --git a/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/volume.proto b/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/volume.proto index e1242e989353..b657dfa0d8e6 100644 --- a/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/volume.proto +++ b/java-netapp/proto-google-cloud-netapp-v1/src/main/proto/google/cloud/netapp/v1/volume.proto @@ -104,6 +104,15 @@ enum SecurityStyle { UNIX = 2; } +// Actions to be restricted for a volume. +enum RestrictedAction { + // Unspecified restricted action + RESTRICTED_ACTION_UNSPECIFIED = 0; + + // Prevent volume from being deleted when mounted. + DELETE = 1; +} + // Message for requesting list of Volumes message ListVolumesRequest { // Required. Parent value for ListVolumesRequest @@ -363,6 +372,10 @@ message Volume { // Output only. Indicates whether the volume is part of a replication // relationship. bool has_replication = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. List of actions that are restricted on this volume. + repeated RestrictedAction restricted_actions = 31 + [(google.api.field_behavior) = OPTIONAL]; } // Defines the export policy for the volume. diff --git a/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/getlocation/AsyncGetLocation.java b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..7706b80c562a --- /dev/null +++ b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.netapp.v1.samples; + +// [START netapp_v1_generated_NetApp_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.netapp.v1.NetAppClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NetAppClient netAppClient = NetAppClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = netAppClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END netapp_v1_generated_NetApp_GetLocation_async] diff --git a/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/getlocation/SyncGetLocation.java b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..11ffe42a12c7 --- /dev/null +++ b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.netapp.v1.samples; + +// [START netapp_v1_generated_NetApp_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.netapp.v1.NetAppClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NetAppClient netAppClient = NetAppClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = netAppClient.getLocation(request); + } + } +} +// [END netapp_v1_generated_NetApp_GetLocation_sync] diff --git a/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/listlocations/AsyncListLocations.java b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..41284d4d9f93 --- /dev/null +++ b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/listlocations/AsyncListLocations.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.netapp.v1.samples; + +// [START netapp_v1_generated_NetApp_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.netapp.v1.NetAppClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NetAppClient netAppClient = NetAppClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = netAppClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END netapp_v1_generated_NetApp_ListLocations_async] diff --git a/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/listlocations/AsyncListLocationsPaged.java b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..d045f75088b3 --- /dev/null +++ b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.netapp.v1.samples; + +// [START netapp_v1_generated_NetApp_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.netapp.v1.NetAppClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NetAppClient netAppClient = NetAppClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = netAppClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END netapp_v1_generated_NetApp_ListLocations_Paged_async] diff --git a/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/listlocations/SyncListLocations.java b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..0f6e5c6e4a48 --- /dev/null +++ b/java-netapp/samples/snippets/generated/com/google/cloud/netapp/v1/netapp/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.netapp.v1.samples; + +// [START netapp_v1_generated_NetApp_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.netapp.v1.NetAppClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (NetAppClient netAppClient = NetAppClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : netAppClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END netapp_v1_generated_NetApp_ListLocations_sync]