diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClient.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClient.java
index 5b0fc97c5503..7df30471aef8 100644
--- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClient.java
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerClient.java
@@ -19,6 +19,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
@@ -31,7 +32,6 @@
import com.google.cloud.filestore.v1.stub.CloudFilestoreManagerStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
@@ -131,13 +131,29 @@
* CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
* }
*
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
+ * CloudFilestoreManagerSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * CloudFilestoreManagerSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ * CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class CloudFilestoreManagerClient implements BackgroundResource {
private final CloudFilestoreManagerSettings settings;
private final CloudFilestoreManagerStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of CloudFilestoreManagerClient with default settings. */
public static final CloudFilestoreManagerClient create() throws IOException {
@@ -169,13 +185,17 @@ public static final CloudFilestoreManagerClient create(CloudFilestoreManagerStub
protected CloudFilestoreManagerClient(CloudFilestoreManagerSettings settings) throws IOException {
this.settings = settings;
this.stub = ((CloudFilestoreManagerStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
protected CloudFilestoreManagerClient(CloudFilestoreManagerStub stub) {
this.settings = null;
this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
public final CloudFilestoreManagerSettings getSettings() {
@@ -190,10 +210,18 @@ public CloudFilestoreManagerStub getStub() {
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
- public final OperationsClient getOperationsClient() {
+ public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists all instances in a project for either a specified location or for all locations.
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerSettings.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerSettings.java
index f1ddc02a1a98..be91e7c1c24b 100644
--- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerSettings.java
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/CloudFilestoreManagerSettings.java
@@ -24,6 +24,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -205,11 +206,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return CloudFilestoreManagerStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return CloudFilestoreManagerStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return CloudFilestoreManagerStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return CloudFilestoreManagerStubSettings.defaultTransportChannelProvider();
}
@@ -219,11 +227,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return CloudFilestoreManagerStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -262,6 +276,11 @@ private static Builder createDefault() {
return new Builder(CloudFilestoreManagerStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(CloudFilestoreManagerStubSettings.newHttpJsonBuilder());
+ }
+
public CloudFilestoreManagerStubSettings.Builder getStubSettingsBuilder() {
return ((CloudFilestoreManagerStubSettings.Builder) getStubSettings());
}
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStub.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStub.java
index 6e32c58ca797..ff6d6eb04976 100644
--- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStub.java
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStub.java
@@ -53,7 +53,11 @@
public abstract class CloudFilestoreManagerStub implements BackgroundResource {
public OperationsStub getOperationsStub() {
- throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
}
public UnaryCallable
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStubSettings.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStubSettings.java
index ae273cd0f890..b6deaf5afb3f 100644
--- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStubSettings.java
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/CloudFilestoreManagerStubSettings.java
@@ -29,6 +29,9 @@
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
@@ -354,6 +357,11 @@ public CloudFilestoreManagerStub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcCloudFilestoreManagerStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonCloudFilestoreManagerStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -386,18 +394,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
.setUseJwtAccessWithScope(true);
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return InstantiatingGrpcChannelProvider.newBuilder()
.setMaxInboundMessageSize(Integer.MAX_VALUE);
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return InstantiatingHttpJsonChannelProvider.newBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return defaultGrpcTransportProviderBuilder().build();
}
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
- public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
return ApiClientHeaderProvider.newBuilder()
.setGeneratedLibToken(
"gapic", GaxProperties.getLibraryVersion(CloudFilestoreManagerStubSettings.class))
@@ -405,11 +420,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
}
- /** Returns a new builder for this class. */
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken(
+ "gapic", GaxProperties.getLibraryVersion(CloudFilestoreManagerStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return CloudFilestoreManagerStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -633,6 +667,19 @@ private static Builder createDefault() {
return initDefaults(builder);
}
+ private static Builder createHttpJsonDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+ builder.setEndpoint(getDefaultEndpoint());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
private static Builder initDefaults(Builder builder) {
builder
.listInstancesSettings()
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/HttpJsonCloudFilestoreManagerCallableFactory.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/HttpJsonCloudFilestoreManagerCallableFactory.java
new file mode 100644
index 000000000000..a7fa0483931e
--- /dev/null
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/HttpJsonCloudFilestoreManagerCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 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.filestore.v1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the CloudFilestoreManager service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonCloudFilestoreManagerCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/HttpJsonCloudFilestoreManagerStub.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/HttpJsonCloudFilestoreManagerStub.java
new file mode 100644
index 000000000000..e36211a8b282
--- /dev/null
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1/stub/HttpJsonCloudFilestoreManagerStub.java
@@ -0,0 +1,875 @@
+/*
+ * Copyright 2022 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.filestore.v1.stub;
+
+import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListBackupsPagedResponse;
+import static com.google.cloud.filestore.v1.CloudFilestoreManagerClient.ListInstancesPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.common.OperationMetadata;
+import com.google.cloud.filestore.v1.Backup;
+import com.google.cloud.filestore.v1.CreateBackupRequest;
+import com.google.cloud.filestore.v1.CreateInstanceRequest;
+import com.google.cloud.filestore.v1.DeleteBackupRequest;
+import com.google.cloud.filestore.v1.DeleteInstanceRequest;
+import com.google.cloud.filestore.v1.GetBackupRequest;
+import com.google.cloud.filestore.v1.GetInstanceRequest;
+import com.google.cloud.filestore.v1.Instance;
+import com.google.cloud.filestore.v1.ListBackupsRequest;
+import com.google.cloud.filestore.v1.ListBackupsResponse;
+import com.google.cloud.filestore.v1.ListInstancesRequest;
+import com.google.cloud.filestore.v1.ListInstancesResponse;
+import com.google.cloud.filestore.v1.RestoreInstanceRequest;
+import com.google.cloud.filestore.v1.UpdateBackupRequest;
+import com.google.cloud.filestore.v1.UpdateInstanceRequest;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the CloudFilestoreManager service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonCloudFilestoreManagerStub extends CloudFilestoreManagerStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(Empty.getDescriptor())
+ .add(OperationMetadata.getDescriptor())
+ .add(Instance.getDescriptor())
+ .add(Backup.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listInstancesMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/ListInstances")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/instances",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "filter", request.getFilter());
+ serializer.putQueryParam(fields, "orderBy", request.getOrderBy());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListInstancesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/GetInstance")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/instances/*}",
+ 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();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Instance.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/CreateInstance")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/instances",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "instanceId", request.getInstanceId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("instance", request.getInstance()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateInstanceRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/UpdateInstance")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{instance.name=projects/*/locations/*/instances/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "instance.name", request.getInstance().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("instance", request.getInstance()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateInstanceRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ restoreInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/RestoreInstance")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/instances/*}:restore",
+ 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();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (RestoreInstanceRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/DeleteInstance")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/instances/*}",
+ 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();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteInstanceRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listBackupsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/ListBackups")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/backups",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "filter", request.getFilter());
+ serializer.putQueryParam(fields, "orderBy", request.getOrderBy());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListBackupsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor getBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/GetBackup")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/backups/*}",
+ 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();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Backup.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/CreateBackup")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/backups",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "backupId", request.getBackupId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("backup", request.getBackup()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateBackupRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/DeleteBackup")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/backups/*}",
+ 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();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteBackupRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1.CloudFilestoreManager/UpdateBackup")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{backup.name=projects/*/locations/*/backups/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "backup.name", request.getBackup().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("backup", request.getBackup()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateBackupRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private final UnaryCallable listInstancesCallable;
+ private final UnaryCallable
+ listInstancesPagedCallable;
+ private final UnaryCallable getInstanceCallable;
+ private final UnaryCallable createInstanceCallable;
+ private final OperationCallable
+ createInstanceOperationCallable;
+ private final UnaryCallable updateInstanceCallable;
+ private final OperationCallable
+ updateInstanceOperationCallable;
+ private final UnaryCallable restoreInstanceCallable;
+ private final OperationCallable
+ restoreInstanceOperationCallable;
+ private final UnaryCallable deleteInstanceCallable;
+ private final OperationCallable
+ deleteInstanceOperationCallable;
+ private final UnaryCallable listBackupsCallable;
+ private final UnaryCallable
+ listBackupsPagedCallable;
+ private final UnaryCallable getBackupCallable;
+ private final UnaryCallable createBackupCallable;
+ private final OperationCallable
+ createBackupOperationCallable;
+ private final UnaryCallable deleteBackupCallable;
+ private final OperationCallable
+ deleteBackupOperationCallable;
+ private final UnaryCallable updateBackupCallable;
+ private final OperationCallable
+ updateBackupOperationCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonOperationsStub httpJsonOperationsStub;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonCloudFilestoreManagerStub create(
+ CloudFilestoreManagerStubSettings settings) throws IOException {
+ return new HttpJsonCloudFilestoreManagerStub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonCloudFilestoreManagerStub create(ClientContext clientContext)
+ throws IOException {
+ return new HttpJsonCloudFilestoreManagerStub(
+ CloudFilestoreManagerStubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonCloudFilestoreManagerStub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonCloudFilestoreManagerStub(
+ CloudFilestoreManagerStubSettings.newHttpJsonBuilder().build(),
+ clientContext,
+ callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonCloudFilestoreManagerStub, using the given settings. This is
+ * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+ * should be preferred.
+ */
+ protected HttpJsonCloudFilestoreManagerStub(
+ CloudFilestoreManagerStubSettings settings, ClientContext clientContext) throws IOException {
+ this(settings, clientContext, new HttpJsonCloudFilestoreManagerCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonCloudFilestoreManagerStub, using the given settings. This is
+ * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+ * should be preferred.
+ */
+ protected HttpJsonCloudFilestoreManagerStub(
+ CloudFilestoreManagerStubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+ this.httpJsonOperationsStub =
+ HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry);
+
+ HttpJsonCallSettings
+ listInstancesTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(listInstancesMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings getInstanceTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getInstanceMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings createInstanceTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(createInstanceMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings updateInstanceTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updateInstanceMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings restoreInstanceTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(restoreInstanceMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings deleteInstanceTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteInstanceMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings listBackupsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(listBackupsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings getBackupTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getBackupMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings createBackupTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(createBackupMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings deleteBackupTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteBackupMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings updateBackupTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updateBackupMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+
+ this.listInstancesCallable =
+ callableFactory.createUnaryCallable(
+ listInstancesTransportSettings, settings.listInstancesSettings(), clientContext);
+ this.listInstancesPagedCallable =
+ callableFactory.createPagedCallable(
+ listInstancesTransportSettings, settings.listInstancesSettings(), clientContext);
+ this.getInstanceCallable =
+ callableFactory.createUnaryCallable(
+ getInstanceTransportSettings, settings.getInstanceSettings(), clientContext);
+ this.createInstanceCallable =
+ callableFactory.createUnaryCallable(
+ createInstanceTransportSettings, settings.createInstanceSettings(), clientContext);
+ this.createInstanceOperationCallable =
+ callableFactory.createOperationCallable(
+ createInstanceTransportSettings,
+ settings.createInstanceOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.updateInstanceCallable =
+ callableFactory.createUnaryCallable(
+ updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext);
+ this.updateInstanceOperationCallable =
+ callableFactory.createOperationCallable(
+ updateInstanceTransportSettings,
+ settings.updateInstanceOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.restoreInstanceCallable =
+ callableFactory.createUnaryCallable(
+ restoreInstanceTransportSettings, settings.restoreInstanceSettings(), clientContext);
+ this.restoreInstanceOperationCallable =
+ callableFactory.createOperationCallable(
+ restoreInstanceTransportSettings,
+ settings.restoreInstanceOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.deleteInstanceCallable =
+ callableFactory.createUnaryCallable(
+ deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext);
+ this.deleteInstanceOperationCallable =
+ callableFactory.createOperationCallable(
+ deleteInstanceTransportSettings,
+ settings.deleteInstanceOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.listBackupsCallable =
+ callableFactory.createUnaryCallable(
+ listBackupsTransportSettings, settings.listBackupsSettings(), clientContext);
+ this.listBackupsPagedCallable =
+ callableFactory.createPagedCallable(
+ listBackupsTransportSettings, settings.listBackupsSettings(), clientContext);
+ this.getBackupCallable =
+ callableFactory.createUnaryCallable(
+ getBackupTransportSettings, settings.getBackupSettings(), clientContext);
+ this.createBackupCallable =
+ callableFactory.createUnaryCallable(
+ createBackupTransportSettings, settings.createBackupSettings(), clientContext);
+ this.createBackupOperationCallable =
+ callableFactory.createOperationCallable(
+ createBackupTransportSettings,
+ settings.createBackupOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.deleteBackupCallable =
+ callableFactory.createUnaryCallable(
+ deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext);
+ this.deleteBackupOperationCallable =
+ callableFactory.createOperationCallable(
+ deleteBackupTransportSettings,
+ settings.deleteBackupOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.updateBackupCallable =
+ callableFactory.createUnaryCallable(
+ updateBackupTransportSettings, settings.updateBackupSettings(), clientContext);
+ this.updateBackupOperationCallable =
+ callableFactory.createOperationCallable(
+ updateBackupTransportSettings,
+ settings.updateBackupOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(listInstancesMethodDescriptor);
+ methodDescriptors.add(getInstanceMethodDescriptor);
+ methodDescriptors.add(createInstanceMethodDescriptor);
+ methodDescriptors.add(updateInstanceMethodDescriptor);
+ methodDescriptors.add(restoreInstanceMethodDescriptor);
+ methodDescriptors.add(deleteInstanceMethodDescriptor);
+ methodDescriptors.add(listBackupsMethodDescriptor);
+ methodDescriptors.add(getBackupMethodDescriptor);
+ methodDescriptors.add(createBackupMethodDescriptor);
+ methodDescriptors.add(deleteBackupMethodDescriptor);
+ methodDescriptors.add(updateBackupMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ public HttpJsonOperationsStub getHttpJsonOperationsStub() {
+ return httpJsonOperationsStub;
+ }
+
+ @Override
+ public UnaryCallable listInstancesCallable() {
+ return listInstancesCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listInstancesPagedCallable() {
+ return listInstancesPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable getInstanceCallable() {
+ return getInstanceCallable;
+ }
+
+ @Override
+ public UnaryCallable createInstanceCallable() {
+ return createInstanceCallable;
+ }
+
+ @Override
+ public OperationCallable
+ createInstanceOperationCallable() {
+ return createInstanceOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable updateInstanceCallable() {
+ return updateInstanceCallable;
+ }
+
+ @Override
+ public OperationCallable
+ updateInstanceOperationCallable() {
+ return updateInstanceOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable restoreInstanceCallable() {
+ return restoreInstanceCallable;
+ }
+
+ @Override
+ public OperationCallable
+ restoreInstanceOperationCallable() {
+ return restoreInstanceOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteInstanceCallable() {
+ return deleteInstanceCallable;
+ }
+
+ @Override
+ public OperationCallable
+ deleteInstanceOperationCallable() {
+ return deleteInstanceOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable listBackupsCallable() {
+ return listBackupsCallable;
+ }
+
+ @Override
+ public UnaryCallable listBackupsPagedCallable() {
+ return listBackupsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable getBackupCallable() {
+ return getBackupCallable;
+ }
+
+ @Override
+ public UnaryCallable createBackupCallable() {
+ return createBackupCallable;
+ }
+
+ @Override
+ public OperationCallable
+ createBackupOperationCallable() {
+ return createBackupOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteBackupCallable() {
+ return deleteBackupCallable;
+ }
+
+ @Override
+ public OperationCallable
+ deleteBackupOperationCallable() {
+ return deleteBackupOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable updateBackupCallable() {
+ return updateBackupCallable;
+ }
+
+ @Override
+ public OperationCallable
+ updateBackupOperationCallable() {
+ return updateBackupOperationCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java
index b86cd6efbece..a5e111fa39b2 100644
--- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerClient.java
@@ -20,6 +20,7 @@
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
@@ -32,7 +33,6 @@
import com.google.cloud.filestore.v1beta1.stub.CloudFilestoreManagerStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
@@ -132,6 +132,21 @@
* CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
* }
*
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
+ * CloudFilestoreManagerSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * CloudFilestoreManagerSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * CloudFilestoreManagerClient cloudFilestoreManagerClient =
+ * CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
@@ -139,7 +154,8 @@
public class CloudFilestoreManagerClient implements BackgroundResource {
private final CloudFilestoreManagerSettings settings;
private final CloudFilestoreManagerStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of CloudFilestoreManagerClient with default settings. */
public static final CloudFilestoreManagerClient create() throws IOException {
@@ -171,13 +187,17 @@ public static final CloudFilestoreManagerClient create(CloudFilestoreManagerStub
protected CloudFilestoreManagerClient(CloudFilestoreManagerSettings settings) throws IOException {
this.settings = settings;
this.stub = ((CloudFilestoreManagerStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
protected CloudFilestoreManagerClient(CloudFilestoreManagerStub stub) {
this.settings = null;
this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
public final CloudFilestoreManagerSettings getSettings() {
@@ -192,10 +212,18 @@ public CloudFilestoreManagerStub getStub() {
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
- public final OperationsClient getOperationsClient() {
+ public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists all instances in a project for either a specified location or for all locations.
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java
index 0476a063573d..798d804337bd 100644
--- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/CloudFilestoreManagerSettings.java
@@ -24,6 +24,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -206,11 +207,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return CloudFilestoreManagerStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return CloudFilestoreManagerStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return CloudFilestoreManagerStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return CloudFilestoreManagerStubSettings.defaultTransportChannelProvider();
}
@@ -220,11 +228,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return CloudFilestoreManagerStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -263,6 +277,11 @@ private static Builder createDefault() {
return new Builder(CloudFilestoreManagerStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(CloudFilestoreManagerStubSettings.newHttpJsonBuilder());
+ }
+
public CloudFilestoreManagerStubSettings.Builder getStubSettingsBuilder() {
return ((CloudFilestoreManagerStubSettings.Builder) getStubSettings());
}
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java
index 50d80a93d7b5..22e27ef5ad94 100644
--- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStub.java
@@ -55,7 +55,11 @@
public abstract class CloudFilestoreManagerStub implements BackgroundResource {
public OperationsStub getOperationsStub() {
- throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
}
public UnaryCallable
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java
index 22302ad22b00..97907a059a8b 100644
--- a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/CloudFilestoreManagerStubSettings.java
@@ -29,6 +29,9 @@
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
@@ -355,6 +358,11 @@ public CloudFilestoreManagerStub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcCloudFilestoreManagerStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonCloudFilestoreManagerStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -387,18 +395,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
.setUseJwtAccessWithScope(true);
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return InstantiatingGrpcChannelProvider.newBuilder()
.setMaxInboundMessageSize(Integer.MAX_VALUE);
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return InstantiatingHttpJsonChannelProvider.newBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return defaultGrpcTransportProviderBuilder().build();
}
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
- public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
return ApiClientHeaderProvider.newBuilder()
.setGeneratedLibToken(
"gapic", GaxProperties.getLibraryVersion(CloudFilestoreManagerStubSettings.class))
@@ -406,11 +421,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
}
- /** Returns a new builder for this class. */
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken(
+ "gapic", GaxProperties.getLibraryVersion(CloudFilestoreManagerStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return CloudFilestoreManagerStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -634,6 +668,19 @@ private static Builder createDefault() {
return initDefaults(builder);
}
+ private static Builder createHttpJsonDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+ builder.setEndpoint(getDefaultEndpoint());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
private static Builder initDefaults(Builder builder) {
builder
.listInstancesSettings()
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerCallableFactory.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerCallableFactory.java
new file mode 100644
index 000000000000..a8e8ca24d3f8
--- /dev/null
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 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.filestore.v1beta1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the CloudFilestoreManager service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonCloudFilestoreManagerCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerStub.java b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerStub.java
new file mode 100644
index 000000000000..a6db15fff283
--- /dev/null
+++ b/java-filestore/google-cloud-filestore/src/main/java/com/google/cloud/filestore/v1beta1/stub/HttpJsonCloudFilestoreManagerStub.java
@@ -0,0 +1,883 @@
+/*
+ * Copyright 2022 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.filestore.v1beta1.stub;
+
+import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListBackupsPagedResponse;
+import static com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClient.ListInstancesPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.common.OperationMetadata;
+import com.google.cloud.filestore.v1beta1.Backup;
+import com.google.cloud.filestore.v1beta1.CreateBackupRequest;
+import com.google.cloud.filestore.v1beta1.CreateInstanceRequest;
+import com.google.cloud.filestore.v1beta1.DeleteBackupRequest;
+import com.google.cloud.filestore.v1beta1.DeleteInstanceRequest;
+import com.google.cloud.filestore.v1beta1.GetBackupRequest;
+import com.google.cloud.filestore.v1beta1.GetInstanceRequest;
+import com.google.cloud.filestore.v1beta1.Instance;
+import com.google.cloud.filestore.v1beta1.ListBackupsRequest;
+import com.google.cloud.filestore.v1beta1.ListBackupsResponse;
+import com.google.cloud.filestore.v1beta1.ListInstancesRequest;
+import com.google.cloud.filestore.v1beta1.ListInstancesResponse;
+import com.google.cloud.filestore.v1beta1.RestoreInstanceRequest;
+import com.google.cloud.filestore.v1beta1.UpdateBackupRequest;
+import com.google.cloud.filestore.v1beta1.UpdateInstanceRequest;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the CloudFilestoreManager service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonCloudFilestoreManagerStub extends CloudFilestoreManagerStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(Empty.getDescriptor())
+ .add(OperationMetadata.getDescriptor())
+ .add(Instance.getDescriptor())
+ .add(Backup.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listInstancesMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.filestore.v1beta1.CloudFilestoreManager/ListInstances")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*}/instances",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "filter", request.getFilter());
+ serializer.putQueryParam(fields, "orderBy", request.getOrderBy());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListInstancesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.filestore.v1beta1.CloudFilestoreManager/GetInstance")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/locations/*/instances/*}",
+ 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();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Instance.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.filestore.v1beta1.CloudFilestoreManager/CreateInstance")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*}/instances",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "instanceId", request.getInstanceId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("instance", request.getInstance()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateInstanceRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.filestore.v1beta1.CloudFilestoreManager/UpdateInstance")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{instance.name=projects/*/locations/*/instances/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "instance.name", request.getInstance().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("instance", request.getInstance()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateInstanceRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ restoreInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.filestore.v1beta1.CloudFilestoreManager/RestoreInstance")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/locations/*/instances/*}:restore",
+ 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();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (RestoreInstanceRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteInstanceMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.filestore.v1beta1.CloudFilestoreManager/DeleteInstance")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/locations/*/instances/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map