diff --git a/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/BackupForGKEClient.java b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/BackupForGKEClient.java
index df8883f..6b2f2b2 100644
--- a/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/BackupForGKEClient.java
+++ b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/BackupForGKEClient.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;
@@ -30,7 +31,6 @@
import com.google.cloud.gkebackup.v1.stub.BackupForGKEStubSettings;
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;
@@ -103,13 +103,28 @@
* BackupForGKEClient backupForGKEClient = BackupForGKEClient.create(backupForGKESettings);
* }
*
+ * 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.
+ * BackupForGKESettings backupForGKESettings =
+ * BackupForGKESettings.newBuilder()
+ * .setTransportChannelProvider(
+ * BackupForGKESettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * BackupForGKEClient backupForGKEClient = BackupForGKEClient.create(backupForGKESettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class BackupForGKEClient implements BackgroundResource {
private final BackupForGKESettings settings;
private final BackupForGKEStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of BackupForGKEClient with default settings. */
public static final BackupForGKEClient create() throws IOException {
@@ -140,13 +155,17 @@ public static final BackupForGKEClient create(BackupForGKEStub stub) {
protected BackupForGKEClient(BackupForGKESettings settings) throws IOException {
this.settings = settings;
this.stub = ((BackupForGKEStubSettings) 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 BackupForGKEClient(BackupForGKEStub 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 BackupForGKESettings getSettings() {
@@ -161,10 +180,18 @@ public BackupForGKEStub 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.
/**
* Creates a new BackupPlan in a given location.
diff --git a/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/BackupForGKESettings.java b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/BackupForGKESettings.java
index 508b0df..c4202fe 100644
--- a/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/BackupForGKESettings.java
+++ b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/BackupForGKESettings.java
@@ -28,6 +28,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;
@@ -305,11 +306,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return BackupForGKEStubSettings.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 BackupForGKEStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return BackupForGKEStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return BackupForGKEStubSettings.defaultTransportChannelProvider();
}
@@ -319,11 +327,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return BackupForGKEStubSettings.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);
@@ -361,6 +375,11 @@ private static Builder createDefault() {
return new Builder(BackupForGKEStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(BackupForGKEStubSettings.newHttpJsonBuilder());
+ }
+
public BackupForGKEStubSettings.Builder getStubSettingsBuilder() {
return ((BackupForGKEStubSettings.Builder) getStubSettings());
}
diff --git a/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/BackupForGKEStub.java b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/BackupForGKEStub.java
index 6d23904..ebe803f 100644
--- a/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/BackupForGKEStub.java
+++ b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/BackupForGKEStub.java
@@ -78,7 +78,11 @@
public abstract class BackupForGKEStub 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 OperationCallable
diff --git a/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/BackupForGKEStubSettings.java b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/BackupForGKEStubSettings.java
index c3f7e52..854c954 100644
--- a/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/BackupForGKEStubSettings.java
+++ b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/BackupForGKEStubSettings.java
@@ -33,6 +33,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;
@@ -748,6 +751,11 @@ public BackupForGKEStub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcBackupForGKEStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonBackupForGKEStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -780,18 +788,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(BackupForGKEStubSettings.class))
@@ -799,11 +814,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(BackupForGKEStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return BackupForGKEStubSettings.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);
@@ -1149,6 +1183,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
.createBackupPlanSettings()
diff --git a/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/HttpJsonBackupForGKECallableFactory.java b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/HttpJsonBackupForGKECallableFactory.java
new file mode 100644
index 0000000..b8fe504
--- /dev/null
+++ b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/HttpJsonBackupForGKECallableFactory.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.gkebackup.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 BackupForGKE service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonBackupForGKECallableFactory
+ 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/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/HttpJsonBackupForGKEStub.java b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/HttpJsonBackupForGKEStub.java
new file mode 100644
index 0000000..a726aa1
--- /dev/null
+++ b/google-cloud-gke-backup/src/main/java/com/google/cloud/gkebackup/v1/stub/HttpJsonBackupForGKEStub.java
@@ -0,0 +1,1713 @@
+/*
+ * 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.gkebackup.v1.stub;
+
+import static com.google.cloud.gkebackup.v1.BackupForGKEClient.ListBackupPlansPagedResponse;
+import static com.google.cloud.gkebackup.v1.BackupForGKEClient.ListBackupsPagedResponse;
+import static com.google.cloud.gkebackup.v1.BackupForGKEClient.ListRestorePlansPagedResponse;
+import static com.google.cloud.gkebackup.v1.BackupForGKEClient.ListRestoresPagedResponse;
+import static com.google.cloud.gkebackup.v1.BackupForGKEClient.ListVolumeBackupsPagedResponse;
+import static com.google.cloud.gkebackup.v1.BackupForGKEClient.ListVolumeRestoresPagedResponse;
+
+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.gkebackup.v1.Backup;
+import com.google.cloud.gkebackup.v1.BackupPlan;
+import com.google.cloud.gkebackup.v1.CreateBackupPlanRequest;
+import com.google.cloud.gkebackup.v1.CreateBackupRequest;
+import com.google.cloud.gkebackup.v1.CreateRestorePlanRequest;
+import com.google.cloud.gkebackup.v1.CreateRestoreRequest;
+import com.google.cloud.gkebackup.v1.DeleteBackupPlanRequest;
+import com.google.cloud.gkebackup.v1.DeleteBackupRequest;
+import com.google.cloud.gkebackup.v1.DeleteRestorePlanRequest;
+import com.google.cloud.gkebackup.v1.DeleteRestoreRequest;
+import com.google.cloud.gkebackup.v1.GetBackupPlanRequest;
+import com.google.cloud.gkebackup.v1.GetBackupRequest;
+import com.google.cloud.gkebackup.v1.GetRestorePlanRequest;
+import com.google.cloud.gkebackup.v1.GetRestoreRequest;
+import com.google.cloud.gkebackup.v1.GetVolumeBackupRequest;
+import com.google.cloud.gkebackup.v1.GetVolumeRestoreRequest;
+import com.google.cloud.gkebackup.v1.ListBackupPlansRequest;
+import com.google.cloud.gkebackup.v1.ListBackupPlansResponse;
+import com.google.cloud.gkebackup.v1.ListBackupsRequest;
+import com.google.cloud.gkebackup.v1.ListBackupsResponse;
+import com.google.cloud.gkebackup.v1.ListRestorePlansRequest;
+import com.google.cloud.gkebackup.v1.ListRestorePlansResponse;
+import com.google.cloud.gkebackup.v1.ListRestoresRequest;
+import com.google.cloud.gkebackup.v1.ListRestoresResponse;
+import com.google.cloud.gkebackup.v1.ListVolumeBackupsRequest;
+import com.google.cloud.gkebackup.v1.ListVolumeBackupsResponse;
+import com.google.cloud.gkebackup.v1.ListVolumeRestoresRequest;
+import com.google.cloud.gkebackup.v1.ListVolumeRestoresResponse;
+import com.google.cloud.gkebackup.v1.OperationMetadata;
+import com.google.cloud.gkebackup.v1.Restore;
+import com.google.cloud.gkebackup.v1.RestorePlan;
+import com.google.cloud.gkebackup.v1.UpdateBackupPlanRequest;
+import com.google.cloud.gkebackup.v1.UpdateBackupRequest;
+import com.google.cloud.gkebackup.v1.UpdateRestorePlanRequest;
+import com.google.cloud.gkebackup.v1.UpdateRestoreRequest;
+import com.google.cloud.gkebackup.v1.VolumeBackup;
+import com.google.cloud.gkebackup.v1.VolumeRestore;
+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 BackupForGKE service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonBackupForGKEStub extends BackupForGKEStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(BackupPlan.getDescriptor())
+ .add(Empty.getDescriptor())
+ .add(Restore.getDescriptor())
+ .add(RestorePlan.getDescriptor())
+ .add(Backup.getDescriptor())
+ .add(OperationMetadata.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createBackupPlanMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/CreateBackupPlan")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/backupPlans",
+ 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, "backupPlanId", request.getBackupPlanId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("backupPlan", request.getBackupPlan()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateBackupPlanRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listBackupPlansMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/ListBackupPlans")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/backupPlans",
+ 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(ListBackupPlansResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getBackupPlanMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/GetBackupPlan")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/backupPlans/*}",
+ 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(BackupPlan.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateBackupPlanMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/UpdateBackupPlan")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{backupPlan.name=projects/*/locations/*/backupPlans/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "backupPlan.name", request.getBackupPlan().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("backupPlan", request.getBackupPlan()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateBackupPlanRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteBackupPlanMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/DeleteBackupPlan")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/backupPlans/*}",
+ 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, "etag", request.getEtag());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteBackupPlanRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ createBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/CreateBackup")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/backupPlans/*}/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
+ listBackupsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/ListBackups")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/backupPlans/*}/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.gkebackup.v1.BackupForGKE/GetBackup")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/backupPlans/*/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
+ updateBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/UpdateBackup")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{backup.name=projects/*/locations/*/backupPlans/*/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 static final ApiMethodDescriptor
+ deleteBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/DeleteBackup")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/backupPlans/*/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();
+ serializer.putQueryParam(fields, "etag", request.getEtag());
+ serializer.putQueryParam(fields, "force", request.getForce());
+ 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
+ listVolumeBackupsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/ListVolumeBackups")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/backupPlans/*/backups/*}/volumeBackups",
+ 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(ListVolumeBackupsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getVolumeBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/GetVolumeBackup")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*}",
+ 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(VolumeBackup.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createRestorePlanMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/CreateRestorePlan")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/restorePlans",
+ 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, "restorePlanId", request.getRestorePlanId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("restorePlan", request.getRestorePlan()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateRestorePlanRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listRestorePlansMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/ListRestorePlans")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/restorePlans",
+ 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(ListRestorePlansResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getRestorePlanMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/GetRestorePlan")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/restorePlans/*}",
+ 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(RestorePlan.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateRestorePlanMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/UpdateRestorePlan")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{restorePlan.name=projects/*/locations/*/restorePlans/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "restorePlan.name", request.getRestorePlan().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("restorePlan", request.getRestorePlan()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateRestorePlanRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteRestorePlanMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/DeleteRestorePlan")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/restorePlans/*}",
+ 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, "etag", request.getEtag());
+ serializer.putQueryParam(fields, "force", request.getForce());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteRestorePlanRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ createRestoreMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/CreateRestore")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/restorePlans/*}/restores",
+ 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, "restoreId", request.getRestoreId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("restore", request.getRestore()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateRestoreRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listRestoresMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/ListRestores")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/restorePlans/*}/restores",
+ 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(ListRestoresResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor getRestoreMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/GetRestore")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*}",
+ 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(Restore.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateRestoreMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/UpdateRestore")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{restore.name=projects/*/locations/*/restorePlans/*/restores/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "restore.name", request.getRestore().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("restore", request.getRestore()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateRestoreRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteRestoreMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/DeleteRestore")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*}",
+ 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, "etag", request.getEtag());
+ serializer.putQueryParam(fields, "force", request.getForce());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteRestoreRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listVolumeRestoresMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/ListVolumeRestores")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/restorePlans/*/restores/*}/volumeRestores",
+ 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(ListVolumeRestoresResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getVolumeRestoreMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkebackup.v1.BackupForGKE/GetVolumeRestore")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*}",
+ 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(VolumeRestore.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private final UnaryCallable createBackupPlanCallable;
+ private final OperationCallable
+ createBackupPlanOperationCallable;
+ private final UnaryCallable
+ listBackupPlansCallable;
+ private final UnaryCallable
+ listBackupPlansPagedCallable;
+ private final UnaryCallable getBackupPlanCallable;
+ private final UnaryCallable updateBackupPlanCallable;
+ private final OperationCallable
+ updateBackupPlanOperationCallable;
+ private final UnaryCallable deleteBackupPlanCallable;
+ private final OperationCallable
+ deleteBackupPlanOperationCallable;
+ private final UnaryCallable createBackupCallable;
+ private final OperationCallable
+ createBackupOperationCallable;
+ private final UnaryCallable listBackupsCallable;
+ private final UnaryCallable
+ listBackupsPagedCallable;
+ private final UnaryCallable getBackupCallable;
+ private final UnaryCallable updateBackupCallable;
+ private final OperationCallable
+ updateBackupOperationCallable;
+ private final UnaryCallable deleteBackupCallable;
+ private final OperationCallable
+ deleteBackupOperationCallable;
+ private final UnaryCallable
+ listVolumeBackupsCallable;
+ private final UnaryCallable
+ listVolumeBackupsPagedCallable;
+ private final UnaryCallable getVolumeBackupCallable;
+ private final UnaryCallable createRestorePlanCallable;
+ private final OperationCallable
+ createRestorePlanOperationCallable;
+ private final UnaryCallable
+ listRestorePlansCallable;
+ private final UnaryCallable
+ listRestorePlansPagedCallable;
+ private final UnaryCallable getRestorePlanCallable;
+ private final UnaryCallable updateRestorePlanCallable;
+ private final OperationCallable
+ updateRestorePlanOperationCallable;
+ private final UnaryCallable deleteRestorePlanCallable;
+ private final OperationCallable
+ deleteRestorePlanOperationCallable;
+ private final UnaryCallable createRestoreCallable;
+ private final OperationCallable
+ createRestoreOperationCallable;
+ private final UnaryCallable listRestoresCallable;
+ private final UnaryCallable