diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Client.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Client.java
index ca587ae1b96e..925ebfa049dc 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Client.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Client.java
@@ -110,6 +110,22 @@
* BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
* }
*
+ * 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.
+ * BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
+ * BinauthzManagementServiceV1Beta1Settings.newBuilder()
+ * .setTransportChannelProvider(
+ * BinauthzManagementServiceV1Beta1Settings.defaultHttpJsonTransportProviderBuilder()
+ * .build())
+ * .build();
+ * BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
+ * BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java
index 1628c4727de2..46d41dfa1c1a 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java
@@ -23,6 +23,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;
@@ -143,11 +144,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return BinauthzManagementServiceV1Beta1StubSettings.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 BinauthzManagementServiceV1Beta1StubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return BinauthzManagementServiceV1Beta1StubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return BinauthzManagementServiceV1Beta1StubSettings.defaultTransportChannelProvider();
}
@@ -157,11 +165,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return BinauthzManagementServiceV1Beta1StubSettings.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);
@@ -200,6 +214,11 @@ private static Builder createDefault() {
return new Builder(BinauthzManagementServiceV1Beta1StubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(BinauthzManagementServiceV1Beta1StubSettings.newHttpJsonBuilder());
+ }
+
public BinauthzManagementServiceV1Beta1StubSettings.Builder getStubSettingsBuilder() {
return ((BinauthzManagementServiceV1Beta1StubSettings.Builder) getStubSettings());
}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Client.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Client.java
index 5fb4e06277ab..a3017bbd380b 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Client.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Client.java
@@ -92,6 +92,21 @@
* SystemPolicyV1Beta1Client.create(systemPolicyV1Beta1Settings);
* }
*
+ *
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.
+ * SystemPolicyV1Beta1Settings systemPolicyV1Beta1Settings =
+ * SystemPolicyV1Beta1Settings.newBuilder()
+ * .setTransportChannelProvider(
+ * SystemPolicyV1Beta1Settings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * SystemPolicyV1Beta1Client systemPolicyV1Beta1Client =
+ * SystemPolicyV1Beta1Client.create(systemPolicyV1Beta1Settings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Settings.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Settings.java
index b23db1b3a063..1508441ed2dc 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Settings.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Settings.java
@@ -21,6 +21,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;
@@ -101,11 +102,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return SystemPolicyV1Beta1StubSettings.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 SystemPolicyV1Beta1StubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return SystemPolicyV1Beta1StubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return SystemPolicyV1Beta1StubSettings.defaultTransportChannelProvider();
}
@@ -115,11 +123,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return SystemPolicyV1Beta1StubSettings.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);
@@ -157,6 +171,11 @@ private static Builder createDefault() {
return new Builder(SystemPolicyV1Beta1StubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(SystemPolicyV1Beta1StubSettings.newHttpJsonBuilder());
+ }
+
public SystemPolicyV1Beta1StubSettings.Builder getStubSettingsBuilder() {
return ((SystemPolicyV1Beta1StubSettings.Builder) getStubSettings());
}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java
index 1e95f8787b58..b600d3c5d67f 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java
@@ -27,6 +27,9 @@
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+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.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
@@ -210,6 +213,11 @@ public BinauthzManagementServiceV1Beta1Stub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcBinauthzManagementServiceV1Beta1Stub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonBinauthzManagementServiceV1Beta1Stub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -242,18 +250,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",
@@ -262,11 +277,31 @@ 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(BinauthzManagementServiceV1Beta1StubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return BinauthzManagementServiceV1Beta1StubSettings.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);
@@ -408,6 +443,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
.getPolicySettings()
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonBinauthzManagementServiceV1Beta1CallableFactory.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonBinauthzManagementServiceV1Beta1CallableFactory.java
new file mode 100644
index 000000000000..3fdaa60f235c
--- /dev/null
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonBinauthzManagementServiceV1Beta1CallableFactory.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.binaryauthorization.v1beta1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the BinauthzManagementServiceV1Beta1 service API.
+ *
+ *
This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonBinauthzManagementServiceV1Beta1CallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonBinauthzManagementServiceV1Beta1Stub.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonBinauthzManagementServiceV1Beta1Stub.java
new file mode 100644
index 000000000000..166972014143
--- /dev/null
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonBinauthzManagementServiceV1Beta1Stub.java
@@ -0,0 +1,526 @@
+/*
+ * 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.binaryauthorization.v1beta1.stub;
+
+import static com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse;
+
+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.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.rpc.ClientContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.binaryauthorization.v1beta1.Attestor;
+import com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest;
+import com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest;
+import com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest;
+import com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest;
+import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest;
+import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse;
+import com.google.cloud.binaryauthorization.v1beta1.Policy;
+import com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest;
+import com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest;
+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 BinauthzManagementServiceV1Beta1 service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonBinauthzManagementServiceV1Beta1Stub
+ extends BinauthzManagementServiceV1Beta1Stub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor getPolicyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetPolicy")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/policy}",
+ 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(Policy.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updatePolicyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdatePolicy")
+ .setHttpMethod("PUT")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{policy.name=projects/*/policy}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "policy.name", request.getPolicy().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("policy", request.getPolicy()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Policy.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createAttestorMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/CreateAttestor")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*}/attestors",
+ 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, "attestorId", request.getAttestorId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("attestor", request.getAttestor()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Attestor.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getAttestorMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/GetAttestor")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/attestors/*}",
+ 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(Attestor.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateAttestorMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/UpdateAttestor")
+ .setHttpMethod("PUT")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{attestor.name=projects/*/attestors/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "attestor.name", request.getAttestor().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("attestor", request.getAttestor()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Attestor.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listAttestorsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/ListAttestors")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*}/attestors",
+ 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(ListAttestorsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteAttestorMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1/DeleteAttestor")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/attestors/*}",
+ 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(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private final UnaryCallable getPolicyCallable;
+ private final UnaryCallable updatePolicyCallable;
+ private final UnaryCallable createAttestorCallable;
+ private final UnaryCallable getAttestorCallable;
+ private final UnaryCallable updateAttestorCallable;
+ private final UnaryCallable listAttestorsCallable;
+ private final UnaryCallable
+ listAttestorsPagedCallable;
+ private final UnaryCallable deleteAttestorCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonBinauthzManagementServiceV1Beta1Stub create(
+ BinauthzManagementServiceV1Beta1StubSettings settings) throws IOException {
+ return new HttpJsonBinauthzManagementServiceV1Beta1Stub(
+ settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonBinauthzManagementServiceV1Beta1Stub create(
+ ClientContext clientContext) throws IOException {
+ return new HttpJsonBinauthzManagementServiceV1Beta1Stub(
+ BinauthzManagementServiceV1Beta1StubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonBinauthzManagementServiceV1Beta1Stub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonBinauthzManagementServiceV1Beta1Stub(
+ BinauthzManagementServiceV1Beta1StubSettings.newHttpJsonBuilder().build(),
+ clientContext,
+ callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonBinauthzManagementServiceV1Beta1Stub, 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 HttpJsonBinauthzManagementServiceV1Beta1Stub(
+ BinauthzManagementServiceV1Beta1StubSettings settings, ClientContext clientContext)
+ throws IOException {
+ this(settings, clientContext, new HttpJsonBinauthzManagementServiceV1Beta1CallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonBinauthzManagementServiceV1Beta1Stub, 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 HttpJsonBinauthzManagementServiceV1Beta1Stub(
+ BinauthzManagementServiceV1Beta1StubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+
+ HttpJsonCallSettings getPolicyTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getPolicyMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings updatePolicyTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updatePolicyMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings createAttestorTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(createAttestorMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings getAttestorTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getAttestorMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings updateAttestorTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updateAttestorMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ listAttestorsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(listAttestorsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings deleteAttestorTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteAttestorMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+
+ this.getPolicyCallable =
+ callableFactory.createUnaryCallable(
+ getPolicyTransportSettings, settings.getPolicySettings(), clientContext);
+ this.updatePolicyCallable =
+ callableFactory.createUnaryCallable(
+ updatePolicyTransportSettings, settings.updatePolicySettings(), clientContext);
+ this.createAttestorCallable =
+ callableFactory.createUnaryCallable(
+ createAttestorTransportSettings, settings.createAttestorSettings(), clientContext);
+ this.getAttestorCallable =
+ callableFactory.createUnaryCallable(
+ getAttestorTransportSettings, settings.getAttestorSettings(), clientContext);
+ this.updateAttestorCallable =
+ callableFactory.createUnaryCallable(
+ updateAttestorTransportSettings, settings.updateAttestorSettings(), clientContext);
+ this.listAttestorsCallable =
+ callableFactory.createUnaryCallable(
+ listAttestorsTransportSettings, settings.listAttestorsSettings(), clientContext);
+ this.listAttestorsPagedCallable =
+ callableFactory.createPagedCallable(
+ listAttestorsTransportSettings, settings.listAttestorsSettings(), clientContext);
+ this.deleteAttestorCallable =
+ callableFactory.createUnaryCallable(
+ deleteAttestorTransportSettings, settings.deleteAttestorSettings(), clientContext);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(getPolicyMethodDescriptor);
+ methodDescriptors.add(updatePolicyMethodDescriptor);
+ methodDescriptors.add(createAttestorMethodDescriptor);
+ methodDescriptors.add(getAttestorMethodDescriptor);
+ methodDescriptors.add(updateAttestorMethodDescriptor);
+ methodDescriptors.add(listAttestorsMethodDescriptor);
+ methodDescriptors.add(deleteAttestorMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ @Override
+ public UnaryCallable getPolicyCallable() {
+ return getPolicyCallable;
+ }
+
+ @Override
+ public UnaryCallable updatePolicyCallable() {
+ return updatePolicyCallable;
+ }
+
+ @Override
+ public UnaryCallable createAttestorCallable() {
+ return createAttestorCallable;
+ }
+
+ @Override
+ public UnaryCallable getAttestorCallable() {
+ return getAttestorCallable;
+ }
+
+ @Override
+ public UnaryCallable updateAttestorCallable() {
+ return updateAttestorCallable;
+ }
+
+ @Override
+ public UnaryCallable listAttestorsCallable() {
+ return listAttestorsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listAttestorsPagedCallable() {
+ return listAttestorsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteAttestorCallable() {
+ return deleteAttestorCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonSystemPolicyV1Beta1CallableFactory.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonSystemPolicyV1Beta1CallableFactory.java
new file mode 100644
index 000000000000..8f2ee6041db8
--- /dev/null
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonSystemPolicyV1Beta1CallableFactory.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.binaryauthorization.v1beta1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the SystemPolicyV1Beta1 service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonSystemPolicyV1Beta1CallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonSystemPolicyV1Beta1Stub.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonSystemPolicyV1Beta1Stub.java
new file mode 100644
index 000000000000..9dee319fa011
--- /dev/null
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonSystemPolicyV1Beta1Stub.java
@@ -0,0 +1,194 @@
+/*
+ * 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.binaryauthorization.v1beta1.stub;
+
+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.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.rpc.ClientContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest;
+import com.google.cloud.binaryauthorization.v1beta1.Policy;
+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 SystemPolicyV1Beta1 service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonSystemPolicyV1Beta1Stub extends SystemPolicyV1Beta1Stub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor
+ getSystemPolicyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1/GetSystemPolicy")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=locations/*/policy}",
+ 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(Policy.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private final UnaryCallable getSystemPolicyCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonSystemPolicyV1Beta1Stub create(
+ SystemPolicyV1Beta1StubSettings settings) throws IOException {
+ return new HttpJsonSystemPolicyV1Beta1Stub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonSystemPolicyV1Beta1Stub create(ClientContext clientContext)
+ throws IOException {
+ return new HttpJsonSystemPolicyV1Beta1Stub(
+ SystemPolicyV1Beta1StubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonSystemPolicyV1Beta1Stub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonSystemPolicyV1Beta1Stub(
+ SystemPolicyV1Beta1StubSettings.newHttpJsonBuilder().build(),
+ clientContext,
+ callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonSystemPolicyV1Beta1Stub, 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 HttpJsonSystemPolicyV1Beta1Stub(
+ SystemPolicyV1Beta1StubSettings settings, ClientContext clientContext) throws IOException {
+ this(settings, clientContext, new HttpJsonSystemPolicyV1Beta1CallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonSystemPolicyV1Beta1Stub, 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 HttpJsonSystemPolicyV1Beta1Stub(
+ SystemPolicyV1Beta1StubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+
+ HttpJsonCallSettings getSystemPolicyTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getSystemPolicyMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+
+ this.getSystemPolicyCallable =
+ callableFactory.createUnaryCallable(
+ getSystemPolicyTransportSettings, settings.getSystemPolicySettings(), clientContext);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(getSystemPolicyMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ @Override
+ public UnaryCallable getSystemPolicyCallable() {
+ return getSystemPolicyCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/SystemPolicyV1Beta1StubSettings.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/SystemPolicyV1Beta1StubSettings.java
index a5ba7c019856..2bdfab506c5f 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/SystemPolicyV1Beta1StubSettings.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/SystemPolicyV1Beta1StubSettings.java
@@ -24,6 +24,9 @@
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+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.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
@@ -97,6 +100,11 @@ public SystemPolicyV1Beta1Stub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcSystemPolicyV1Beta1Stub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonSystemPolicyV1Beta1Stub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -129,18 +137,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(SystemPolicyV1Beta1StubSettings.class))
@@ -148,11 +163,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(SystemPolicyV1Beta1StubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return SystemPolicyV1Beta1StubSettings.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);
@@ -230,6 +264,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
.getSystemPolicySettings()
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Client.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Client.java
index dce518a83736..cdff3097651a 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Client.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Client.java
@@ -109,6 +109,22 @@
* BinauthzManagementServiceV1Client.create(binauthzManagementServiceV1Settings);
* }
*
+ * 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.
+ * BinauthzManagementServiceV1Settings binauthzManagementServiceV1Settings =
+ * BinauthzManagementServiceV1Settings.newBuilder()
+ * .setTransportChannelProvider(
+ * BinauthzManagementServiceV1Settings.defaultHttpJsonTransportProviderBuilder()
+ * .build())
+ * .build();
+ * BinauthzManagementServiceV1Client binauthzManagementServiceV1Client =
+ * BinauthzManagementServiceV1Client.create(binauthzManagementServiceV1Settings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Settings.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Settings.java
index 563d61c50869..ec910fbee424 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Settings.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Settings.java
@@ -23,6 +23,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;
@@ -139,11 +140,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return BinauthzManagementServiceV1StubSettings.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 BinauthzManagementServiceV1StubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return BinauthzManagementServiceV1StubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return BinauthzManagementServiceV1StubSettings.defaultTransportChannelProvider();
}
@@ -153,11 +161,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return BinauthzManagementServiceV1StubSettings.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);
@@ -196,6 +210,11 @@ private static Builder createDefault() {
return new Builder(BinauthzManagementServiceV1StubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(BinauthzManagementServiceV1StubSettings.newHttpJsonBuilder());
+ }
+
public BinauthzManagementServiceV1StubSettings.Builder getStubSettingsBuilder() {
return ((BinauthzManagementServiceV1StubSettings.Builder) getStubSettings());
}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Client.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Client.java
index c55d857ecb01..44852203349d 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Client.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Client.java
@@ -88,6 +88,20 @@
* SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create(systemPolicyV1Settings);
* }
*
+ *
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.
+ * SystemPolicyV1Settings systemPolicyV1Settings =
+ * SystemPolicyV1Settings.newBuilder()
+ * .setTransportChannelProvider(
+ * SystemPolicyV1Settings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create(systemPolicyV1Settings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Settings.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Settings.java
index 1010ea0268cd..85a0e384f92c 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Settings.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Settings.java
@@ -21,6 +21,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;
@@ -100,11 +101,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return SystemPolicyV1StubSettings.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 SystemPolicyV1StubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return SystemPolicyV1StubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return SystemPolicyV1StubSettings.defaultTransportChannelProvider();
}
@@ -114,11 +122,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return SystemPolicyV1StubSettings.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);
@@ -156,6 +170,11 @@ private static Builder createDefault() {
return new Builder(SystemPolicyV1StubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(SystemPolicyV1StubSettings.newHttpJsonBuilder());
+ }
+
public SystemPolicyV1StubSettings.Builder getStubSettingsBuilder() {
return ((SystemPolicyV1StubSettings.Builder) getStubSettings());
}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Client.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Client.java
index 7375f421513f..1e86f3ea491b 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Client.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Client.java
@@ -98,6 +98,21 @@
* ValidationHelperV1Client.create(validationHelperV1Settings);
* }
*
+ *
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.
+ * ValidationHelperV1Settings validationHelperV1Settings =
+ * ValidationHelperV1Settings.newBuilder()
+ * .setTransportChannelProvider(
+ * ValidationHelperV1Settings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * ValidationHelperV1Client validationHelperV1Client =
+ * ValidationHelperV1Client.create(validationHelperV1Settings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java
index d41bb9536a4b..5c02ef7cfe60 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java
@@ -21,6 +21,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;
@@ -104,11 +105,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return ValidationHelperV1StubSettings.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 ValidationHelperV1StubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return ValidationHelperV1StubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return ValidationHelperV1StubSettings.defaultTransportChannelProvider();
}
@@ -118,11 +126,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return ValidationHelperV1StubSettings.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);
@@ -160,6 +174,11 @@ private static Builder createDefault() {
return new Builder(ValidationHelperV1StubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(ValidationHelperV1StubSettings.newHttpJsonBuilder());
+ }
+
public ValidationHelperV1StubSettings.Builder getStubSettingsBuilder() {
return ((ValidationHelperV1StubSettings.Builder) getStubSettings());
}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1StubSettings.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1StubSettings.java
index 47ddca330772..acf472b86f50 100644
--- a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1StubSettings.java
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1StubSettings.java
@@ -27,6 +27,9 @@
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+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.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
@@ -218,6 +221,11 @@ public BinauthzManagementServiceV1Stub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcBinauthzManagementServiceV1Stub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonBinauthzManagementServiceV1Stub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -250,18 +258,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(BinauthzManagementServiceV1StubSettings.class))
@@ -269,11 +284,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(BinauthzManagementServiceV1StubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return BinauthzManagementServiceV1StubSettings.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);
@@ -420,6 +454,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
.getPolicySettings()
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/HttpJsonBinauthzManagementServiceV1CallableFactory.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/HttpJsonBinauthzManagementServiceV1CallableFactory.java
new file mode 100644
index 000000000000..256e2744c7cd
--- /dev/null
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/HttpJsonBinauthzManagementServiceV1CallableFactory.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.protos.google.cloud.binaryauthorization.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 BinauthzManagementServiceV1 service API.
+ *
+ *
This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonBinauthzManagementServiceV1CallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/HttpJsonBinauthzManagementServiceV1Stub.java b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/HttpJsonBinauthzManagementServiceV1Stub.java
new file mode 100644
index 000000000000..f94a985f0d0e
--- /dev/null
+++ b/java-binary-authorization/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/HttpJsonBinauthzManagementServiceV1Stub.java
@@ -0,0 +1,528 @@
+/*
+ * 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.protos.google.cloud.binaryauthorization.v1.stub;
+
+import static com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client.ListAttestorsPagedResponse;
+
+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.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.rpc.ClientContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import com.google.protos.google.cloud.binaryauthorization.v1.Resources;
+import com.google.protos.google.cloud.binaryauthorization.v1.Service;
+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 BinauthzManagementServiceV1 service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonBinauthzManagementServiceV1Stub extends BinauthzManagementServiceV1Stub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor
+ getPolicyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetPolicy")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/policy}",
+ 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(Resources.Policy.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updatePolicyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdatePolicy")
+ .setHttpMethod("PUT")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{policy.name=projects/*/policy}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "policy.name", request.getPolicy().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("policy", request.getPolicy()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Resources.Policy.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createAttestorMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/CreateAttestor")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*}/attestors",
+ 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, "attestorId", request.getAttestorId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("attestor", request.getAttestor()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Resources.Attestor.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getAttestorMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/GetAttestor")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/attestors/*}",
+ 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(Resources.Attestor.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateAttestorMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/UpdateAttestor")
+ .setHttpMethod("PUT")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{attestor.name=projects/*/attestors/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "attestor.name", request.getAttestor().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("attestor", request.getAttestor()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Resources.Attestor.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ Service.ListAttestorsRequest, Service.ListAttestorsResponse>
+ listAttestorsMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/ListAttestors")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*}/attestors",
+ 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(Service.ListAttestorsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteAttestorMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1/DeleteAttestor")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/attestors/*}",
+ 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(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private final UnaryCallable getPolicyCallable;
+ private final UnaryCallable updatePolicyCallable;
+ private final UnaryCallable
+ createAttestorCallable;
+ private final UnaryCallable getAttestorCallable;
+ private final UnaryCallable
+ updateAttestorCallable;
+ private final UnaryCallable
+ listAttestorsCallable;
+ private final UnaryCallable
+ listAttestorsPagedCallable;
+ private final UnaryCallable deleteAttestorCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonBinauthzManagementServiceV1Stub create(
+ BinauthzManagementServiceV1StubSettings settings) throws IOException {
+ return new HttpJsonBinauthzManagementServiceV1Stub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonBinauthzManagementServiceV1Stub create(ClientContext clientContext)
+ throws IOException {
+ return new HttpJsonBinauthzManagementServiceV1Stub(
+ BinauthzManagementServiceV1StubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonBinauthzManagementServiceV1Stub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonBinauthzManagementServiceV1Stub(
+ BinauthzManagementServiceV1StubSettings.newHttpJsonBuilder().build(),
+ clientContext,
+ callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonBinauthzManagementServiceV1Stub, 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 HttpJsonBinauthzManagementServiceV1Stub(
+ BinauthzManagementServiceV1StubSettings settings, ClientContext clientContext)
+ throws IOException {
+ this(settings, clientContext, new HttpJsonBinauthzManagementServiceV1CallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonBinauthzManagementServiceV1Stub, 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 HttpJsonBinauthzManagementServiceV1Stub(
+ BinauthzManagementServiceV1StubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+
+ HttpJsonCallSettings getPolicyTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getPolicyMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ updatePolicyTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updatePolicyMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ createAttestorTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(createAttestorMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ getAttestorTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getAttestorMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ updateAttestorTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updateAttestorMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings