diff --git a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AwsClustersClient.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AwsClustersClient.java
index fe73a5a..b03b742 100644
--- a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AwsClustersClient.java
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AwsClustersClient.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.gkemulticloud.v1.stub.AwsClustersStubSettings;
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 @@
* AwsClustersClient awsClustersClient = AwsClustersClient.create(awsClustersSettings);
* }
*
+ * 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.
+ * AwsClustersSettings awsClustersSettings =
+ * AwsClustersSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * AwsClustersSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * AwsClustersClient awsClustersClient = AwsClustersClient.create(awsClustersSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class AwsClustersClient implements BackgroundResource {
private final AwsClustersSettings settings;
private final AwsClustersStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of AwsClustersClient with default settings. */
public static final AwsClustersClient create() throws IOException {
@@ -140,13 +155,17 @@ public static final AwsClustersClient create(AwsClustersStub stub) {
protected AwsClustersClient(AwsClustersSettings settings) throws IOException {
this.settings = settings;
this.stub = ((AwsClustersStubSettings) 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 AwsClustersClient(AwsClustersStub 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 AwsClustersSettings getSettings() {
@@ -161,10 +180,18 @@ public AwsClustersStub 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 [AwsCluster][google.cloud.gkemulticloud.v1.AwsCluster] resource on a given GCP
diff --git a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AwsClustersSettings.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AwsClustersSettings.java
index 2361c6d..5a8579a 100644
--- a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AwsClustersSettings.java
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AwsClustersSettings.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;
@@ -200,11 +201,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return AwsClustersStubSettings.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 AwsClustersStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return AwsClustersStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return AwsClustersStubSettings.defaultTransportChannelProvider();
}
@@ -214,11 +222,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return AwsClustersStubSettings.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);
@@ -256,6 +270,11 @@ private static Builder createDefault() {
return new Builder(AwsClustersStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(AwsClustersStubSettings.newHttpJsonBuilder());
+ }
+
public AwsClustersStubSettings.Builder getStubSettingsBuilder() {
return ((AwsClustersStubSettings.Builder) getStubSettings());
}
diff --git a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AzureClustersClient.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AzureClustersClient.java
index 91e8551..bc36485 100644
--- a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AzureClustersClient.java
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AzureClustersClient.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.gkemulticloud.v1.stub.AzureClustersStubSettings;
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 @@
* AzureClustersClient azureClustersClient = AzureClustersClient.create(azureClustersSettings);
* }
*
+ *
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.
+ * AzureClustersSettings azureClustersSettings =
+ * AzureClustersSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * AzureClustersSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * AzureClustersClient azureClustersClient = AzureClustersClient.create(azureClustersSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class AzureClustersClient implements BackgroundResource {
private final AzureClustersSettings settings;
private final AzureClustersStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of AzureClustersClient with default settings. */
public static final AzureClustersClient create() throws IOException {
@@ -141,13 +156,17 @@ public static final AzureClustersClient create(AzureClustersStub stub) {
protected AzureClustersClient(AzureClustersSettings settings) throws IOException {
this.settings = settings;
this.stub = ((AzureClustersStubSettings) 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 AzureClustersClient(AzureClustersStub 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 AzureClustersSettings getSettings() {
@@ -162,10 +181,18 @@ public AzureClustersStub 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 [AzureClient][google.cloud.gkemulticloud.v1.AzureClient] resource on a given
diff --git a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AzureClustersSettings.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AzureClustersSettings.java
index 9d08bfd..77c4b90 100644
--- a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AzureClustersSettings.java
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/AzureClustersSettings.java
@@ -25,6 +25,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;
@@ -236,11 +237,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return AzureClustersStubSettings.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 AzureClustersStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return AzureClustersStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return AzureClustersStubSettings.defaultTransportChannelProvider();
}
@@ -250,11 +258,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return AzureClustersStubSettings.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);
@@ -292,6 +306,11 @@ private static Builder createDefault() {
return new Builder(AzureClustersStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(AzureClustersStubSettings.newHttpJsonBuilder());
+ }
+
public AzureClustersStubSettings.Builder getStubSettingsBuilder() {
return ((AzureClustersStubSettings.Builder) getStubSettings());
}
diff --git a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AwsClustersStub.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AwsClustersStub.java
index fac79eb..0c26029 100644
--- a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AwsClustersStub.java
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AwsClustersStub.java
@@ -56,7 +56,11 @@
public abstract class AwsClustersStub 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-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AwsClustersStubSettings.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AwsClustersStubSettings.java
index eeaa39c..2a33709 100644
--- a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AwsClustersStubSettings.java
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AwsClustersStubSettings.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;
@@ -369,6 +372,11 @@ public AwsClustersStub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcAwsClustersStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonAwsClustersStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -401,18 +409,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(AwsClustersStubSettings.class))
@@ -420,11 +435,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(AwsClustersStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return AwsClustersStubSettings.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);
@@ -641,6 +675,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
.createAwsClusterSettings()
diff --git a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AzureClustersStub.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AzureClustersStub.java
index a3ade7e..e3f73eb 100644
--- a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AzureClustersStub.java
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AzureClustersStub.java
@@ -63,7 +63,11 @@
public abstract class AzureClustersStub 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-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AzureClustersStubSettings.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AzureClustersStubSettings.java
index 8d13287..359848f 100644
--- a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AzureClustersStubSettings.java
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/AzureClustersStubSettings.java
@@ -30,6 +30,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;
@@ -489,6 +492,11 @@ public AzureClustersStub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcAzureClustersStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonAzureClustersStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -521,18 +529,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(AzureClustersStubSettings.class))
@@ -540,11 +555,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(AzureClustersStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return AzureClustersStubSettings.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);
@@ -815,6 +849,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
.createAzureClientSettings()
diff --git a/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAwsClustersCallableFactory.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAwsClustersCallableFactory.java
new file mode 100644
index 0000000..9a5a634
--- /dev/null
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAwsClustersCallableFactory.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.gkemulticloud.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 AwsClusters service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonAwsClustersCallableFactory
+ 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-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAwsClustersStub.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAwsClustersStub.java
new file mode 100644
index 0000000..7bf2af1
--- /dev/null
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAwsClustersStub.java
@@ -0,0 +1,946 @@
+/*
+ * 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.gkemulticloud.v1.stub;
+
+import static com.google.cloud.gkemulticloud.v1.AwsClustersClient.ListAwsClustersPagedResponse;
+import static com.google.cloud.gkemulticloud.v1.AwsClustersClient.ListAwsNodePoolsPagedResponse;
+
+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.gkemulticloud.v1.AwsCluster;
+import com.google.cloud.gkemulticloud.v1.AwsNodePool;
+import com.google.cloud.gkemulticloud.v1.AwsServerConfig;
+import com.google.cloud.gkemulticloud.v1.CreateAwsClusterRequest;
+import com.google.cloud.gkemulticloud.v1.CreateAwsNodePoolRequest;
+import com.google.cloud.gkemulticloud.v1.DeleteAwsClusterRequest;
+import com.google.cloud.gkemulticloud.v1.DeleteAwsNodePoolRequest;
+import com.google.cloud.gkemulticloud.v1.GenerateAwsAccessTokenRequest;
+import com.google.cloud.gkemulticloud.v1.GenerateAwsAccessTokenResponse;
+import com.google.cloud.gkemulticloud.v1.GetAwsClusterRequest;
+import com.google.cloud.gkemulticloud.v1.GetAwsNodePoolRequest;
+import com.google.cloud.gkemulticloud.v1.GetAwsServerConfigRequest;
+import com.google.cloud.gkemulticloud.v1.ListAwsClustersRequest;
+import com.google.cloud.gkemulticloud.v1.ListAwsClustersResponse;
+import com.google.cloud.gkemulticloud.v1.ListAwsNodePoolsRequest;
+import com.google.cloud.gkemulticloud.v1.ListAwsNodePoolsResponse;
+import com.google.cloud.gkemulticloud.v1.OperationMetadata;
+import com.google.cloud.gkemulticloud.v1.UpdateAwsClusterRequest;
+import com.google.cloud.gkemulticloud.v1.UpdateAwsNodePoolRequest;
+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 AwsClusters service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonAwsClustersStub extends AwsClustersStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(OperationMetadata.getDescriptor())
+ .add(Empty.getDescriptor())
+ .add(AwsCluster.getDescriptor())
+ .add(AwsNodePool.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createAwsClusterMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/CreateAwsCluster")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/awsClusters",
+ 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, "awsClusterId", request.getAwsClusterId());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("awsCluster", request.getAwsCluster()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateAwsClusterRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateAwsClusterMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/UpdateAwsCluster")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{awsCluster.name=projects/*/locations/*/awsClusters/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "awsCluster.name", request.getAwsCluster().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("awsCluster", request.getAwsCluster()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateAwsClusterRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ getAwsClusterMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/GetAwsCluster")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/awsClusters/*}",
+ 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(AwsCluster.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listAwsClustersMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/ListAwsClusters")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/awsClusters",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListAwsClustersResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteAwsClusterMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/DeleteAwsCluster")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/awsClusters/*}",
+ 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, "allowMissing", request.getAllowMissing());
+ serializer.putQueryParam(fields, "etag", request.getEtag());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteAwsClusterRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor<
+ GenerateAwsAccessTokenRequest, GenerateAwsAccessTokenResponse>
+ generateAwsAccessTokenMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/GenerateAwsAccessToken")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{awsCluster=projects/*/locations/*/awsClusters/*}:generateAwsAccessToken",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "awsCluster", request.getAwsCluster());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(GenerateAwsAccessTokenResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createAwsNodePoolMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/CreateAwsNodePool")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/awsClusters/*}/awsNodePools",
+ 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, "awsNodePoolId", request.getAwsNodePoolId());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("awsNodePool", request.getAwsNodePool()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateAwsNodePoolRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateAwsNodePoolMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/UpdateAwsNodePool")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{awsNodePool.name=projects/*/locations/*/awsClusters/*/awsNodePools/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "awsNodePool.name", request.getAwsNodePool().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("awsNodePool", request.getAwsNodePool()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateAwsNodePoolRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ getAwsNodePoolMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/GetAwsNodePool")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/awsClusters/*/awsNodePools/*}",
+ 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(AwsNodePool.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listAwsNodePoolsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/ListAwsNodePools")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/awsClusters/*}/awsNodePools",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListAwsNodePoolsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteAwsNodePoolMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/DeleteAwsNodePool")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/awsClusters/*/awsNodePools/*}",
+ 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, "allowMissing", request.getAllowMissing());
+ serializer.putQueryParam(fields, "etag", request.getEtag());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteAwsNodePoolRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ getAwsServerConfigMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AwsClusters/GetAwsServerConfig")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/awsServerConfig}",
+ 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(AwsServerConfig.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private final UnaryCallable createAwsClusterCallable;
+ private final OperationCallable
+ createAwsClusterOperationCallable;
+ private final UnaryCallable updateAwsClusterCallable;
+ private final OperationCallable
+ updateAwsClusterOperationCallable;
+ private final UnaryCallable getAwsClusterCallable;
+ private final UnaryCallable
+ listAwsClustersCallable;
+ private final UnaryCallable
+ listAwsClustersPagedCallable;
+ private final UnaryCallable deleteAwsClusterCallable;
+ private final OperationCallable
+ deleteAwsClusterOperationCallable;
+ private final UnaryCallable
+ generateAwsAccessTokenCallable;
+ private final UnaryCallable createAwsNodePoolCallable;
+ private final OperationCallable
+ createAwsNodePoolOperationCallable;
+ private final UnaryCallable updateAwsNodePoolCallable;
+ private final OperationCallable
+ updateAwsNodePoolOperationCallable;
+ private final UnaryCallable getAwsNodePoolCallable;
+ private final UnaryCallable
+ listAwsNodePoolsCallable;
+ private final UnaryCallable
+ listAwsNodePoolsPagedCallable;
+ private final UnaryCallable deleteAwsNodePoolCallable;
+ private final OperationCallable
+ deleteAwsNodePoolOperationCallable;
+ private final UnaryCallable
+ getAwsServerConfigCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonOperationsStub httpJsonOperationsStub;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonAwsClustersStub create(AwsClustersStubSettings settings)
+ throws IOException {
+ return new HttpJsonAwsClustersStub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonAwsClustersStub create(ClientContext clientContext)
+ throws IOException {
+ return new HttpJsonAwsClustersStub(
+ AwsClustersStubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonAwsClustersStub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonAwsClustersStub(
+ AwsClustersStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonAwsClustersStub, 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 HttpJsonAwsClustersStub(AwsClustersStubSettings settings, ClientContext clientContext)
+ throws IOException {
+ this(settings, clientContext, new HttpJsonAwsClustersCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonAwsClustersStub, 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 HttpJsonAwsClustersStub(
+ AwsClustersStubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+ this.httpJsonOperationsStub =
+ HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry);
+
+ HttpJsonCallSettings createAwsClusterTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(createAwsClusterMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings updateAwsClusterTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updateAwsClusterMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings getAwsClusterTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getAwsClusterMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ listAwsClustersTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(listAwsClustersMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings deleteAwsClusterTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteAwsClusterMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ generateAwsAccessTokenTransportSettings =
+ HttpJsonCallSettings
+ .newBuilder()
+ .setMethodDescriptor(generateAwsAccessTokenMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings createAwsNodePoolTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(createAwsNodePoolMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings updateAwsNodePoolTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updateAwsNodePoolMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings getAwsNodePoolTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getAwsNodePoolMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ listAwsNodePoolsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(listAwsNodePoolsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings deleteAwsNodePoolTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteAwsNodePoolMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ getAwsServerConfigTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getAwsServerConfigMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+
+ this.createAwsClusterCallable =
+ callableFactory.createUnaryCallable(
+ createAwsClusterTransportSettings, settings.createAwsClusterSettings(), clientContext);
+ this.createAwsClusterOperationCallable =
+ callableFactory.createOperationCallable(
+ createAwsClusterTransportSettings,
+ settings.createAwsClusterOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.updateAwsClusterCallable =
+ callableFactory.createUnaryCallable(
+ updateAwsClusterTransportSettings, settings.updateAwsClusterSettings(), clientContext);
+ this.updateAwsClusterOperationCallable =
+ callableFactory.createOperationCallable(
+ updateAwsClusterTransportSettings,
+ settings.updateAwsClusterOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.getAwsClusterCallable =
+ callableFactory.createUnaryCallable(
+ getAwsClusterTransportSettings, settings.getAwsClusterSettings(), clientContext);
+ this.listAwsClustersCallable =
+ callableFactory.createUnaryCallable(
+ listAwsClustersTransportSettings, settings.listAwsClustersSettings(), clientContext);
+ this.listAwsClustersPagedCallable =
+ callableFactory.createPagedCallable(
+ listAwsClustersTransportSettings, settings.listAwsClustersSettings(), clientContext);
+ this.deleteAwsClusterCallable =
+ callableFactory.createUnaryCallable(
+ deleteAwsClusterTransportSettings, settings.deleteAwsClusterSettings(), clientContext);
+ this.deleteAwsClusterOperationCallable =
+ callableFactory.createOperationCallable(
+ deleteAwsClusterTransportSettings,
+ settings.deleteAwsClusterOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.generateAwsAccessTokenCallable =
+ callableFactory.createUnaryCallable(
+ generateAwsAccessTokenTransportSettings,
+ settings.generateAwsAccessTokenSettings(),
+ clientContext);
+ this.createAwsNodePoolCallable =
+ callableFactory.createUnaryCallable(
+ createAwsNodePoolTransportSettings,
+ settings.createAwsNodePoolSettings(),
+ clientContext);
+ this.createAwsNodePoolOperationCallable =
+ callableFactory.createOperationCallable(
+ createAwsNodePoolTransportSettings,
+ settings.createAwsNodePoolOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.updateAwsNodePoolCallable =
+ callableFactory.createUnaryCallable(
+ updateAwsNodePoolTransportSettings,
+ settings.updateAwsNodePoolSettings(),
+ clientContext);
+ this.updateAwsNodePoolOperationCallable =
+ callableFactory.createOperationCallable(
+ updateAwsNodePoolTransportSettings,
+ settings.updateAwsNodePoolOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.getAwsNodePoolCallable =
+ callableFactory.createUnaryCallable(
+ getAwsNodePoolTransportSettings, settings.getAwsNodePoolSettings(), clientContext);
+ this.listAwsNodePoolsCallable =
+ callableFactory.createUnaryCallable(
+ listAwsNodePoolsTransportSettings, settings.listAwsNodePoolsSettings(), clientContext);
+ this.listAwsNodePoolsPagedCallable =
+ callableFactory.createPagedCallable(
+ listAwsNodePoolsTransportSettings, settings.listAwsNodePoolsSettings(), clientContext);
+ this.deleteAwsNodePoolCallable =
+ callableFactory.createUnaryCallable(
+ deleteAwsNodePoolTransportSettings,
+ settings.deleteAwsNodePoolSettings(),
+ clientContext);
+ this.deleteAwsNodePoolOperationCallable =
+ callableFactory.createOperationCallable(
+ deleteAwsNodePoolTransportSettings,
+ settings.deleteAwsNodePoolOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.getAwsServerConfigCallable =
+ callableFactory.createUnaryCallable(
+ getAwsServerConfigTransportSettings,
+ settings.getAwsServerConfigSettings(),
+ clientContext);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(createAwsClusterMethodDescriptor);
+ methodDescriptors.add(updateAwsClusterMethodDescriptor);
+ methodDescriptors.add(getAwsClusterMethodDescriptor);
+ methodDescriptors.add(listAwsClustersMethodDescriptor);
+ methodDescriptors.add(deleteAwsClusterMethodDescriptor);
+ methodDescriptors.add(generateAwsAccessTokenMethodDescriptor);
+ methodDescriptors.add(createAwsNodePoolMethodDescriptor);
+ methodDescriptors.add(updateAwsNodePoolMethodDescriptor);
+ methodDescriptors.add(getAwsNodePoolMethodDescriptor);
+ methodDescriptors.add(listAwsNodePoolsMethodDescriptor);
+ methodDescriptors.add(deleteAwsNodePoolMethodDescriptor);
+ methodDescriptors.add(getAwsServerConfigMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ public HttpJsonOperationsStub getHttpJsonOperationsStub() {
+ return httpJsonOperationsStub;
+ }
+
+ @Override
+ public UnaryCallable createAwsClusterCallable() {
+ return createAwsClusterCallable;
+ }
+
+ @Override
+ public OperationCallable
+ createAwsClusterOperationCallable() {
+ return createAwsClusterOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable updateAwsClusterCallable() {
+ return updateAwsClusterCallable;
+ }
+
+ @Override
+ public OperationCallable
+ updateAwsClusterOperationCallable() {
+ return updateAwsClusterOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable getAwsClusterCallable() {
+ return getAwsClusterCallable;
+ }
+
+ @Override
+ public UnaryCallable listAwsClustersCallable() {
+ return listAwsClustersCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listAwsClustersPagedCallable() {
+ return listAwsClustersPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteAwsClusterCallable() {
+ return deleteAwsClusterCallable;
+ }
+
+ @Override
+ public OperationCallable
+ deleteAwsClusterOperationCallable() {
+ return deleteAwsClusterOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ generateAwsAccessTokenCallable() {
+ return generateAwsAccessTokenCallable;
+ }
+
+ @Override
+ public UnaryCallable createAwsNodePoolCallable() {
+ return createAwsNodePoolCallable;
+ }
+
+ @Override
+ public OperationCallable
+ createAwsNodePoolOperationCallable() {
+ return createAwsNodePoolOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable updateAwsNodePoolCallable() {
+ return updateAwsNodePoolCallable;
+ }
+
+ @Override
+ public OperationCallable
+ updateAwsNodePoolOperationCallable() {
+ return updateAwsNodePoolOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable getAwsNodePoolCallable() {
+ return getAwsNodePoolCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listAwsNodePoolsCallable() {
+ return listAwsNodePoolsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listAwsNodePoolsPagedCallable() {
+ return listAwsNodePoolsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteAwsNodePoolCallable() {
+ return deleteAwsNodePoolCallable;
+ }
+
+ @Override
+ public OperationCallable
+ deleteAwsNodePoolOperationCallable() {
+ return deleteAwsNodePoolOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable getAwsServerConfigCallable() {
+ return getAwsServerConfigCallable;
+ }
+
+ @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/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAzureClustersCallableFactory.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAzureClustersCallableFactory.java
new file mode 100644
index 0000000..39086ef
--- /dev/null
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAzureClustersCallableFactory.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.gkemulticloud.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 AzureClusters service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonAzureClustersCallableFactory
+ 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-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAzureClustersStub.java b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAzureClustersStub.java
new file mode 100644
index 0000000..6855663
--- /dev/null
+++ b/google-cloud-gke-multi-cloud/src/main/java/com/google/cloud/gkemulticloud/v1/stub/HttpJsonAzureClustersStub.java
@@ -0,0 +1,1232 @@
+/*
+ * 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.gkemulticloud.v1.stub;
+
+import static com.google.cloud.gkemulticloud.v1.AzureClustersClient.ListAzureClientsPagedResponse;
+import static com.google.cloud.gkemulticloud.v1.AzureClustersClient.ListAzureClustersPagedResponse;
+import static com.google.cloud.gkemulticloud.v1.AzureClustersClient.ListAzureNodePoolsPagedResponse;
+
+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.gkemulticloud.v1.AzureClient;
+import com.google.cloud.gkemulticloud.v1.AzureCluster;
+import com.google.cloud.gkemulticloud.v1.AzureNodePool;
+import com.google.cloud.gkemulticloud.v1.AzureServerConfig;
+import com.google.cloud.gkemulticloud.v1.CreateAzureClientRequest;
+import com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest;
+import com.google.cloud.gkemulticloud.v1.CreateAzureNodePoolRequest;
+import com.google.cloud.gkemulticloud.v1.DeleteAzureClientRequest;
+import com.google.cloud.gkemulticloud.v1.DeleteAzureClusterRequest;
+import com.google.cloud.gkemulticloud.v1.DeleteAzureNodePoolRequest;
+import com.google.cloud.gkemulticloud.v1.GenerateAzureAccessTokenRequest;
+import com.google.cloud.gkemulticloud.v1.GenerateAzureAccessTokenResponse;
+import com.google.cloud.gkemulticloud.v1.GetAzureClientRequest;
+import com.google.cloud.gkemulticloud.v1.GetAzureClusterRequest;
+import com.google.cloud.gkemulticloud.v1.GetAzureNodePoolRequest;
+import com.google.cloud.gkemulticloud.v1.GetAzureServerConfigRequest;
+import com.google.cloud.gkemulticloud.v1.ListAzureClientsRequest;
+import com.google.cloud.gkemulticloud.v1.ListAzureClientsResponse;
+import com.google.cloud.gkemulticloud.v1.ListAzureClustersRequest;
+import com.google.cloud.gkemulticloud.v1.ListAzureClustersResponse;
+import com.google.cloud.gkemulticloud.v1.ListAzureNodePoolsRequest;
+import com.google.cloud.gkemulticloud.v1.ListAzureNodePoolsResponse;
+import com.google.cloud.gkemulticloud.v1.OperationMetadata;
+import com.google.cloud.gkemulticloud.v1.UpdateAzureClusterRequest;
+import com.google.cloud.gkemulticloud.v1.UpdateAzureNodePoolRequest;
+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 AzureClusters service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonAzureClustersStub extends AzureClustersStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(OperationMetadata.getDescriptor())
+ .add(Empty.getDescriptor())
+ .add(AzureNodePool.getDescriptor())
+ .add(AzureCluster.getDescriptor())
+ .add(AzureClient.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createAzureClientMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/CreateAzureClient")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/azureClients",
+ 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, "azureClientId", request.getAzureClientId());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("azureClient", request.getAzureClient()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateAzureClientRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ getAzureClientMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/GetAzureClient")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/azureClients/*}",
+ 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(AzureClient.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listAzureClientsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/ListAzureClients")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/azureClients",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListAzureClientsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteAzureClientMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/DeleteAzureClient")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/azureClients/*}",
+ 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, "allowMissing", request.getAllowMissing());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteAzureClientRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ createAzureClusterMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/CreateAzureCluster")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/azureClusters",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map