+ * The k8s namespace of the Pod. + *+ * + *
string pod_namespace = 7;
+ *
+ * @return The podNamespace.
+ */
+ java.lang.String getPodNamespace();
+ /**
+ *
+ *
+ * + * The k8s namespace of the Pod. + *+ * + *
string pod_namespace = 7;
+ *
+ * @return The bytes for podNamespace.
+ */
+ com.google.protobuf.ByteString getPodNamespaceBytes();
+
/**
*
*
@@ -384,6 +409,7 @@ private ContinuousValidationPodEvent(
}
private ContinuousValidationPodEvent() {
+ podNamespace_ = "";
pod_ = "";
verdict_ = 0;
images_ = java.util.Collections.emptyList();
@@ -479,6 +505,13 @@ private ContinuousValidationPodEvent(
extensionRegistry));
break;
}
+ case 58:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ podNamespace_ = s;
+ break;
+ }
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -1977,6 +2010,55 @@ public com.google.protobuf.Parser+ * The k8s namespace of the Pod. + *+ * + *
string pod_namespace = 7;
+ *
+ * @return The podNamespace.
+ */
+ @java.lang.Override
+ public java.lang.String getPodNamespace() {
+ java.lang.Object ref = podNamespace_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ podNamespace_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * The k8s namespace of the Pod. + *+ * + *
string pod_namespace = 7;
+ *
+ * @return The bytes for podNamespace.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getPodNamespaceBytes() {
+ java.lang.Object ref = podNamespace_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ podNamespace_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
public static final int POD_FIELD_NUMBER = 1;
private volatile java.lang.Object pod_;
/**
@@ -2291,6 +2373,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < images_.size(); i++) {
output.writeMessage(5, images_.get(i));
}
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(podNamespace_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 7, podNamespace_);
+ }
unknownFields.writeTo(output);
}
@@ -2319,6 +2404,9 @@ public int getSerializedSize() {
for (int i = 0; i < images_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, images_.get(i));
}
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(podNamespace_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, podNamespace_);
+ }
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -2342,6 +2430,7 @@ public boolean equals(final java.lang.Object obj) {
.ContinuousValidationPodEvent)
obj;
+ if (!getPodNamespace().equals(other.getPodNamespace())) return false;
if (!getPod().equals(other.getPod())) return false;
if (hasDeployTime() != other.hasDeployTime()) return false;
if (hasDeployTime()) {
@@ -2364,6 +2453,8 @@ public int hashCode() {
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + POD_NAMESPACE_FIELD_NUMBER;
+ hash = (53 * hash) + getPodNamespace().hashCode();
hash = (37 * hash) + POD_FIELD_NUMBER;
hash = (53 * hash) + getPod().hashCode();
if (hasDeployTime()) {
@@ -2555,6 +2646,8 @@ private void maybeForceBuilderInitialization() {
@java.lang.Override
public Builder clear() {
super.clear();
+ podNamespace_ = "";
+
pod_ = "";
if (deployTimeBuilder_ == null) {
@@ -2617,6 +2710,7 @@ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent
.ContinuousValidationPodEvent(this);
int from_bitField0_ = bitField0_;
+ result.podNamespace_ = podNamespace_;
result.pod_ = pod_;
if (deployTimeBuilder_ == null) {
result.deployTime_ = deployTime_;
@@ -2700,6 +2794,10 @@ public Builder mergeFrom(
if (other
== com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent
.ContinuousValidationPodEvent.getDefaultInstance()) return this;
+ if (!other.getPodNamespace().isEmpty()) {
+ podNamespace_ = other.podNamespace_;
+ onChanged();
+ }
if (!other.getPod().isEmpty()) {
pod_ = other.pod_;
onChanged();
@@ -2776,6 +2874,112 @@ public Builder mergeFrom(
private int bitField0_;
+ private java.lang.Object podNamespace_ = "";
+ /**
+ *
+ *
+ * + * The k8s namespace of the Pod. + *+ * + *
string pod_namespace = 7;
+ *
+ * @return The podNamespace.
+ */
+ public java.lang.String getPodNamespace() {
+ java.lang.Object ref = podNamespace_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ podNamespace_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * The k8s namespace of the Pod. + *+ * + *
string pod_namespace = 7;
+ *
+ * @return The bytes for podNamespace.
+ */
+ public com.google.protobuf.ByteString getPodNamespaceBytes() {
+ java.lang.Object ref = podNamespace_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ podNamespace_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * The k8s namespace of the Pod. + *+ * + *
string pod_namespace = 7;
+ *
+ * @param value The podNamespace to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPodNamespace(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ podNamespace_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The k8s namespace of the Pod. + *+ * + *
string pod_namespace = 7;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearPodNamespace() {
+
+ podNamespace_ = getDefaultInstance().getPodNamespace();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The k8s namespace of the Pod. + *+ * + *
string pod_namespace = 7;
+ *
+ * @param value The bytes for podNamespace to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPodNamespaceBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ podNamespace_ = value;
+ onChanged();
+ return this;
+ }
+
private java.lang.Object pod_ = "";
/**
*
diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java
index 7d29c3d0..8c94cdeb 100644
--- a/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java
+++ b/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java
@@ -55,43 +55,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
"\nLgoogle/cloud/binaryauthorization/v1bet"
+ "a1/continuous_validation_logging.proto\022("
+ "google.cloud.binaryauthorization.v1beta1"
- + "\032\037google/protobuf/timestamp.proto\"\310\010\n\031Co"
+ + "\032\037google/protobuf/timestamp.proto\"\337\010\n\031Co"
+ "ntinuousValidationEvent\022u\n\tpod_event\030\001 \001"
+ "(\0132`.google.cloud.binaryauthorization.v1"
+ "beta1.ContinuousValidationEvent.Continuo"
+ "usValidationPodEventH\000\022~\n\030unsupported_po"
+ "licy_event\030\002 \001(\0132Z.google.cloud.binaryau"
+ "thorization.v1beta1.ContinuousValidation"
- + "Event.UnsupportedPolicyEventH\000\032\366\005\n\034Conti"
- + "nuousValidationPodEvent\022\013\n\003pod\030\001 \001(\t\022/\n\013"
- + "deploy_time\030\002 \001(\0132\032.google.protobuf.Time"
- + "stamp\022,\n\010end_time\030\003 \001(\0132\032.google.protobu"
- + "f.Timestamp\022\212\001\n\007verdict\030\004 \001(\0162y.google.c"
- + "loud.binaryauthorization.v1beta1.Continu"
- + "ousValidationEvent.ContinuousValidationP"
- + "odEvent.PolicyConformanceVerdict\022}\n\006imag"
- + "es\030\005 \003(\0132m.google.cloud.binaryauthorizat"
- + "ion.v1beta1.ContinuousValidationEvent.Co"
- + "ntinuousValidationPodEvent.ImageDetails\032"
- + "\200\002\n\014ImageDetails\022\r\n\005image\030\001 \001(\t\022\211\001\n\006resu"
- + "lt\030\002 \001(\0162y.google.cloud.binaryauthorizat"
- + "ion.v1beta1.ContinuousValidationEvent.Co"
- + "ntinuousValidationPodEvent.ImageDetails."
- + "AuditResult\022\023\n\013description\030\003 \001(\t\"@\n\013Audi"
- + "tResult\022\034\n\030AUDIT_RESULT_UNSPECIFIED\020\000\022\t\n"
- + "\005ALLOW\020\001\022\010\n\004DENY\020\002\"[\n\030PolicyConformanceV"
- + "erdict\022*\n&POLICY_CONFORMANCE_VERDICT_UNS"
- + "PECIFIED\020\000\022\023\n\017VIOLATES_POLICY\020\001\032-\n\026Unsup"
- + "portedPolicyEvent\022\023\n\013description\030\001 \001(\tB\014"
- + "\n\nevent_typeB\266\002\n,com.google.cloud.binary"
- + "authorization.v1beta1B ContinuousValidat"
- + "ionLoggingProtoP\001Z[google.golang.org/gen"
- + "proto/googleapis/cloud/binaryauthorizati"
- + "on/v1beta1;binaryauthorization\370\001\001\252\002(Goog"
- + "le.Cloud.BinaryAuthorization.V1Beta1\312\002(G"
- + "oogle\\Cloud\\BinaryAuthorization\\V1beta1\352"
- + "\002+Google::Cloud::BinaryAuthorization::V1"
- + "beta1b\006proto3"
+ + "Event.UnsupportedPolicyEventH\000\032\215\006\n\034Conti"
+ + "nuousValidationPodEvent\022\025\n\rpod_namespace"
+ + "\030\007 \001(\t\022\013\n\003pod\030\001 \001(\t\022/\n\013deploy_time\030\002 \001(\013"
+ + "2\032.google.protobuf.Timestamp\022,\n\010end_time"
+ + "\030\003 \001(\0132\032.google.protobuf.Timestamp\022\212\001\n\007v"
+ + "erdict\030\004 \001(\0162y.google.cloud.binaryauthor"
+ + "ization.v1beta1.ContinuousValidationEven"
+ + "t.ContinuousValidationPodEvent.PolicyCon"
+ + "formanceVerdict\022}\n\006images\030\005 \003(\0132m.google"
+ + ".cloud.binaryauthorization.v1beta1.Conti"
+ + "nuousValidationEvent.ContinuousValidatio"
+ + "nPodEvent.ImageDetails\032\200\002\n\014ImageDetails\022"
+ + "\r\n\005image\030\001 \001(\t\022\211\001\n\006result\030\002 \001(\0162y.google"
+ + ".cloud.binaryauthorization.v1beta1.Conti"
+ + "nuousValidationEvent.ContinuousValidatio"
+ + "nPodEvent.ImageDetails.AuditResult\022\023\n\013de"
+ + "scription\030\003 \001(\t\"@\n\013AuditResult\022\034\n\030AUDIT_"
+ + "RESULT_UNSPECIFIED\020\000\022\t\n\005ALLOW\020\001\022\010\n\004DENY\020"
+ + "\002\"[\n\030PolicyConformanceVerdict\022*\n&POLICY_"
+ + "CONFORMANCE_VERDICT_UNSPECIFIED\020\000\022\023\n\017VIO"
+ + "LATES_POLICY\020\001\032-\n\026UnsupportedPolicyEvent"
+ + "\022\023\n\013description\030\001 \001(\tB\014\n\nevent_typeB\266\002\n,"
+ + "com.google.cloud.binaryauthorization.v1b"
+ + "eta1B ContinuousValidationLoggingProtoP\001"
+ + "Z[google.golang.org/genproto/googleapis/"
+ + "cloud/binaryauthorization/v1beta1;binary"
+ + "authorization\370\001\001\252\002(Google.Cloud.BinaryAu"
+ + "thorization.V1Beta1\312\002(Google\\Cloud\\Binar"
+ + "yAuthorization\\V1beta1\352\002+Google::Cloud::"
+ + "BinaryAuthorization::V1beta1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -115,7 +115,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor,
new java.lang.String[] {
- "Pod", "DeployTime", "EndTime", "Verdict", "Images",
+ "PodNamespace", "Pod", "DeployTime", "EndTime", "Verdict", "Images",
});
internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_descriptor =
internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor
diff --git a/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto b/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto
index 4f7bfdd8..1666b518 100644
--- a/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto
+++ b/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto
@@ -1,4 +1,4 @@
-// Copyright 2021 Google LLC
+// 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.
@@ -31,6 +31,15 @@ option ruby_package = "Google::Cloud::BinaryAuthorization::V1beta1";
message ContinuousValidationEvent {
// An auditing event for one Pod.
message ContinuousValidationPodEvent {
+ // Audit time policy conformance verdict.
+ enum PolicyConformanceVerdict {
+ // We should always have a verdict. This is an error.
+ POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0;
+
+ // The pod violates the policy.
+ VIOLATES_POLICY = 1;
+ }
+
// Container image with auditing details.
message ImageDetails {
// Result of the audit.
@@ -55,14 +64,8 @@ message ContinuousValidationEvent {
string description = 3;
}
- // Audit time policy conformance verdict.
- enum PolicyConformanceVerdict {
- // We should always have a verdict. This is an error.
- POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0;
-
- // The pod violates the policy.
- VIOLATES_POLICY = 1;
- }
+ // The k8s namespace of the Pod.
+ string pod_namespace = 7;
// The name of the Pod.
string pod = 1;
diff --git a/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 00000000..c133323f
--- /dev/null
+++ b/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetCredentialsProvider.java
@@ -0,0 +1,42 @@
+/*
+ * 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.samples;
+
+// [START binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_create_setcredentialsprovider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client;
+import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Settings;
+import com.google.cloud.binaryauthorization.v1beta1.myCredentials;
+
+public class SyncCreateSetCredentialsProvider {
+
+ public static void main(String[] args) throws Exception {
+ syncCreateSetCredentialsProvider();
+ }
+
+ public static void syncCreateSetCredentialsProvider() throws Exception {
+ // This snippet has been automatically generated for illustrative purposes only.
+ // It may require modifications to work in your environment.
+ BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
+ BinauthzManagementServiceV1Beta1Settings.newBuilder()
+ .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ .build();
+ BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
+ BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
+ }
+}
+// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_create_setcredentialsprovider_sync]
diff --git a/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetEndpoint.java
new file mode 100644
index 00000000..6148caad
--- /dev/null
+++ b/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetEndpoint.java
@@ -0,0 +1,39 @@
+/*
+ * 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.samples;
+
+// [START binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_create_setendpoint_sync]
+import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client;
+import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Settings;
+import com.google.cloud.binaryauthorization.v1beta1.myEndpoint;
+
+public class SyncCreateSetEndpoint {
+
+ public static void main(String[] args) throws Exception {
+ syncCreateSetEndpoint();
+ }
+
+ public static void syncCreateSetEndpoint() throws Exception {
+ // This snippet has been automatically generated for illustrative purposes only.
+ // It may require modifications to work in your environment.
+ BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
+ BinauthzManagementServiceV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
+ BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
+ BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
+ }
+}
+// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_create_setendpoint_sync]
diff --git a/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/AsyncCreateAttestor.java b/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/AsyncCreateAttestor.java
new file mode 100644
index 00000000..fe2c587f
--- /dev/null
+++ b/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/AsyncCreateAttestor.java
@@ -0,0 +1,50 @@
+/*
+ * 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.samples;
+
+// [START binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_createattestor_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.binaryauthorization.v1beta1.Attestor;
+import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client;
+import com.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest;
+import com.google.cloud.binaryauthorization.v1beta1.ProjectName;
+
+public class AsyncCreateAttestor {
+
+ public static void main(String[] args) throws Exception {
+ asyncCreateAttestor();
+ }
+
+ public static void asyncCreateAttestor() throws Exception {
+ // This snippet has been automatically generated for illustrative purposes only.
+ // It may require modifications to work in your environment.
+ try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
+ BinauthzManagementServiceV1Beta1Client.create()) {
+ CreateAttestorRequest request =
+ CreateAttestorRequest.newBuilder()
+ .setParent(ProjectName.of("[PROJECT]").toString())
+ .setAttestorId("attestorId2055733027")
+ .setAttestor(Attestor.newBuilder().build())
+ .build();
+ ApiFutureTo 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/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java index 1628c472..46d41dfa 100644 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/BinauthzManagementServiceV1Beta1Settings.java +++ b/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/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Client.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Client.java index 5fb4e062..a3017bbd 100644 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Client.java +++ b/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/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Settings.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Settings.java index b23db1b3..1508441e 100644 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/SystemPolicyV1Beta1Settings.java +++ b/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/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java index 1e95f878..b600d3c5 100644 --- a/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/BinauthzManagementServiceV1Beta1StubSettings.java +++ b/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/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonBinauthzManagementServiceV1Beta1CallableFactory.java b/google-cloud-binary-authorization/src/main/java/com/google/cloud/binaryauthorization/v1beta1/stub/HttpJsonBinauthzManagementServiceV1Beta1CallableFactory.java new file mode 100644 index 00000000..3fdaa60f --- /dev/null +++ b/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 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 This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonSystemPolicyV1Beta1CallableFactory
+ implements HttpJsonStubCallableFactory 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 To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
diff --git a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Settings.java b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Settings.java
index 563d61c5..ec910fbe 100644
--- a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/BinauthzManagementServiceV1Settings.java
+++ b/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/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Client.java b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Client.java
index c55d857e..44852203 100644
--- a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Client.java
+++ b/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:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
diff --git a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Settings.java b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Settings.java
index 1010ea02..85a0e384 100644
--- a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/SystemPolicyV1Settings.java
+++ b/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/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Client.java b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Client.java
index 7375f421..1e86f3ea 100644
--- a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Client.java
+++ b/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:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
diff --git a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java
index d41bb953..5c02ef7c 100644
--- a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java
+++ b/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/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1StubSettings.java b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1StubSettings.java
index 47ddca33..acf472b8 100644
--- a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1StubSettings.java
+++ b/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/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/HttpJsonBinauthzManagementServiceV1CallableFactory.java b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/HttpJsonBinauthzManagementServiceV1CallableFactory.java
new file mode 100644
index 00000000..256e2744
--- /dev/null
+++ b/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 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{@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);
+ * }
+ *
* {@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);
+ * }
+ *
* {@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);
+ * }
+ *
*