From e1846fe0131cd4b210c91824e9f6a20e2f19c672 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 16:22:21 +0000 Subject: [PATCH] feat: Adds a pod_namespace field to pod events created by Continuous Validation, to distinguish pods with the same name that run in different namespaces (#227) - [ ] Regenerate this pull request now. Committer: @tswift242 PiperOrigin-RevId: 455380856 Source-Link: https://github.com/googleapis/googleapis/commit/1cbacff2f2fe932f91a39d7c1538cb1afc50bd89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb47adfa214e798ee1cb736b52ad386101b096e0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I0N2FkZmEyMTRlNzk4ZWUxY2I3MzZiNTJhZDM4NjEwMWIwOTZlMCJ9 --- .../v1beta1/ContinuousValidationEvent.java | 204 ++++++++++++++++++ .../ContinuousValidationLoggingProto.java | 64 +++--- .../continuous_validation_logging.proto | 21 +- .../SyncCreateSetCredentialsProvider.java | 42 ++++ .../create/SyncCreateSetEndpoint.java | 39 ++++ .../createattestor/AsyncCreateAttestor.java | 50 +++++ .../createattestor/SyncCreateAttestor.java | 46 ++++ ...eateAttestorProjectnameStringAttestor.java | 43 ++++ ...yncCreateAttestorStringStringAttestor.java | 43 ++++ .../deleteattestor/AsyncDeleteAttestor.java | 48 +++++ .../deleteattestor/SyncDeleteAttestor.java | 44 ++++ .../SyncDeleteAttestorAttestorname.java | 40 ++++ .../SyncDeleteAttestorString.java | 40 ++++ .../getattestor/AsyncGetAttestor.java | 48 +++++ .../getattestor/SyncGetAttestor.java | 44 ++++ .../SyncGetAttestorAttestorname.java | 40 ++++ .../getattestor/SyncGetAttestorString.java | 40 ++++ .../getpolicy/AsyncGetPolicy.java | 48 +++++ .../getpolicy/SyncGetPolicy.java | 44 ++++ .../getpolicy/SyncGetPolicyPolicyname.java | 40 ++++ .../getpolicy/SyncGetPolicyString.java | 40 ++++ .../listattestors/AsyncListAttestors.java | 52 +++++ .../AsyncListAttestorsPaged.java | 60 ++++++ .../listattestors/SyncListAttestors.java | 49 +++++ .../SyncListAttestorsProjectname.java | 43 ++++ .../SyncListAttestorsString.java | 43 ++++ .../updateattestor/AsyncUpdateAttestor.java | 45 ++++ .../updateattestor/SyncUpdateAttestor.java | 41 ++++ .../SyncUpdateAttestorAttestor.java | 39 ++++ .../updatepolicy/AsyncUpdatePolicy.java | 45 ++++ .../updatepolicy/SyncUpdatePolicy.java | 41 ++++ .../updatepolicy/SyncUpdatePolicyPolicy.java | 39 ++++ .../getpolicy/SyncGetPolicy.java | 48 +++++ .../getpolicy/SyncGetPolicy.java | 48 +++++ .../getsystempolicy/SyncGetSystemPolicy.java | 47 ++++ .../SyncCreateSetCredentialsProvider.java | 42 ++++ .../create/SyncCreateSetEndpoint.java | 39 ++++ .../getsystempolicy/AsyncGetSystemPolicy.java | 47 ++++ .../getsystempolicy/SyncGetSystemPolicy.java | 43 ++++ .../SyncGetSystemPolicyPolicyname.java | 39 ++++ .../SyncGetSystemPolicyString.java | 39 ++++ .../getsystempolicy/SyncGetSystemPolicy.java | 47 ++++ .../SyncCreateSetCredentialsProvider.java | 42 ++++ .../create/SyncCreateSetEndpoint.java | 39 ++++ .../createattestor/AsyncCreateAttestor.java | 50 +++++ .../createattestor/SyncCreateAttestor.java | 46 ++++ ...torProjectnameStringResourcesattestor.java | 43 ++++ ...AttestorStringStringResourcesattestor.java | 43 ++++ .../deleteattestor/AsyncDeleteAttestor.java | 48 +++++ .../deleteattestor/SyncDeleteAttestor.java | 44 ++++ .../SyncDeleteAttestorAttestorname.java | 40 ++++ .../SyncDeleteAttestorString.java | 40 ++++ .../getattestor/AsyncGetAttestor.java | 48 +++++ .../getattestor/SyncGetAttestor.java | 44 ++++ .../SyncGetAttestorAttestorname.java | 40 ++++ .../getattestor/SyncGetAttestorString.java | 40 ++++ .../getpolicy/AsyncGetPolicy.java | 48 +++++ .../getpolicy/SyncGetPolicy.java | 44 ++++ .../getpolicy/SyncGetPolicyPolicyname.java | 40 ++++ .../getpolicy/SyncGetPolicyString.java | 40 ++++ .../listattestors/AsyncListAttestors.java | 52 +++++ .../AsyncListAttestorsPaged.java | 59 +++++ .../listattestors/SyncListAttestors.java | 49 +++++ .../SyncListAttestorsProjectname.java | 43 ++++ .../SyncListAttestorsString.java | 43 ++++ .../updateattestor/AsyncUpdateAttestor.java | 47 ++++ .../updateattestor/SyncUpdateAttestor.java | 43 ++++ .../SyncUpdateAttestorResourcesattestor.java | 39 ++++ .../updatepolicy/AsyncUpdatePolicy.java | 47 ++++ .../updatepolicy/SyncUpdatePolicy.java | 43 ++++ .../SyncUpdatePolicyResourcespolicy.java | 39 ++++ .../getpolicy/SyncGetPolicy.java | 47 ++++ .../getpolicy/SyncGetPolicy.java | 47 ++++ .../getsystempolicy/SyncGetSystemPolicy.java | 46 ++++ .../SyncValidateAttestationOccurrence.java | 47 ++++ .../SyncCreateSetCredentialsProvider.java | 41 ++++ .../create/SyncCreateSetEndpoint.java | 38 ++++ .../getsystempolicy/AsyncGetSystemPolicy.java | 47 ++++ .../getsystempolicy/SyncGetSystemPolicy.java | 43 ++++ .../SyncGetSystemPolicyPolicyname.java | 39 ++++ .../SyncGetSystemPolicyString.java | 39 ++++ .../getsystempolicy/SyncGetSystemPolicy.java | 46 ++++ .../SyncCreateSetCredentialsProvider.java | 42 ++++ .../create/SyncCreateSetEndpoint.java | 39 ++++ .../AsyncValidateAttestationOccurrence.java | 49 +++++ .../SyncValidateAttestationOccurrence.java | 46 ++++ .../SyncValidateAttestationOccurrence.java | 47 ++++ 87 files changed, 3949 insertions(+), 41 deletions(-) create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetEndpoint.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/AsyncCreateAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestorProjectnameStringAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestorStringStringAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/AsyncDeleteAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestorAttestorname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestorString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/AsyncGetAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestorAttestorname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestorString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/AsyncGetPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicyPolicyname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicyString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/AsyncListAttestors.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/AsyncListAttestorsPaged.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestors.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestorsProjectname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestorsString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/AsyncUpdateAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/SyncUpdateAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/SyncUpdateAttestorAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/AsyncUpdatePolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/SyncUpdatePolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/SyncUpdatePolicyPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1settings/getpolicy/SyncGetPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/stub/binauthzmanagementservicev1beta1stubsettings/getpolicy/SyncGetPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/stub/systempolicyv1beta1stubsettings/getsystempolicy/SyncGetSystemPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/create/SyncCreateSetEndpoint.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/AsyncGetSystemPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicyPolicyname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicyString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1settings/getsystempolicy/SyncGetSystemPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/create/SyncCreateSetEndpoint.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/AsyncCreateAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestorProjectnameStringResourcesattestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestorStringStringResourcesattestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/AsyncDeleteAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestorAttestorname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestorString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/AsyncGetAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestorAttestorname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestorString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/AsyncGetPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicyPolicyname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicyString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/AsyncListAttestors.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/AsyncListAttestorsPaged.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestors.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestorsProjectname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestorsString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/AsyncUpdateAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/SyncUpdateAttestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/SyncUpdateAttestorResourcesattestor.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/AsyncUpdatePolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/SyncUpdatePolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/SyncUpdatePolicyResourcespolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1settings/getpolicy/SyncGetPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/binauthzmanagementservicev1stubsettings/getpolicy/SyncGetPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/systempolicyv1stubsettings/getsystempolicy/SyncGetSystemPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/validationhelperv1stubsettings/validateattestationoccurrence/SyncValidateAttestationOccurrence.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/create/SyncCreateSetEndpoint.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/AsyncGetSystemPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicyPolicyname.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicyString.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1settings/getsystempolicy/SyncGetSystemPolicy.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/create/SyncCreateSetEndpoint.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/validateattestationoccurrence/AsyncValidateAttestationOccurrence.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/validateattestationoccurrence/SyncValidateAttestationOccurrence.java create mode 100644 java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1settings/validateattestationoccurrence/SyncValidateAttestationOccurrence.java diff --git a/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEvent.java b/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEvent.java index e3511994b014..4f694d1fc6ad 100644 --- a/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEvent.java +++ b/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEvent.java @@ -163,6 +163,31 @@ public interface ContinuousValidationPodEventOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
+     * 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 getParserForType() { } } + public static final int POD_NAMESPACE_FIELD_NUMBER = 7; + private volatile java.lang.Object podNamespace_; + /** + * + * + *
+     * 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/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java b/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java index 7d29c3d0cfa2..8c94cdeb7f03 100644 --- a/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java +++ b/java-binary-authorization/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/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto b/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto index 4f7bfdd8c1aa..1666b5189eb0 100644 --- a/java-binary-authorization/proto-google-cloud-binary-authorization-v1beta1/src/main/proto/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto +++ b/java-binary-authorization/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/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetCredentialsProvider.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..c133323f3f4b --- /dev/null +++ b/java-binary-authorization/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/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetEndpoint.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..6148caad2126 --- /dev/null +++ b/java-binary-authorization/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/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/AsyncCreateAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/AsyncCreateAttestor.java new file mode 100644 index 000000000000..fe2c587f2866 --- /dev/null +++ b/java-binary-authorization/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(); + ApiFuture future = + binauthzManagementServiceV1Beta1Client.createAttestorCallable().futureCall(request); + // Do something. + Attestor response = future.get(); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_createattestor_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestor.java new file mode 100644 index 000000000000..02c3d4075f35 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestor.java @@ -0,0 +1,46 @@ +/* + * 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_sync] +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 SyncCreateAttestor { + + public static void main(String[] args) throws Exception { + syncCreateAttestor(); + } + + public static void syncCreateAttestor() 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(); + Attestor response = binauthzManagementServiceV1Beta1Client.createAttestor(request); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_createattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestorProjectnameStringAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestorProjectnameStringAttestor.java new file mode 100644 index 000000000000..e912579e6eed --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestorProjectnameStringAttestor.java @@ -0,0 +1,43 @@ +/* + * 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_projectnamestringattestor_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.ProjectName; + +public class SyncCreateAttestorProjectnameStringAttestor { + + public static void main(String[] args) throws Exception { + syncCreateAttestorProjectnameStringAttestor(); + } + + public static void syncCreateAttestorProjectnameStringAttestor() 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()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + String attestorId = "attestorId2055733027"; + Attestor attestor = Attestor.newBuilder().build(); + Attestor response = + binauthzManagementServiceV1Beta1Client.createAttestor(parent, attestorId, attestor); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_createattestor_projectnamestringattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestorStringStringAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestorStringStringAttestor.java new file mode 100644 index 000000000000..7bb9111010f1 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/createattestor/SyncCreateAttestorStringStringAttestor.java @@ -0,0 +1,43 @@ +/* + * 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_stringstringattestor_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.ProjectName; + +public class SyncCreateAttestorStringStringAttestor { + + public static void main(String[] args) throws Exception { + syncCreateAttestorStringStringAttestor(); + } + + public static void syncCreateAttestorStringStringAttestor() 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()) { + String parent = ProjectName.of("[PROJECT]").toString(); + String attestorId = "attestorId2055733027"; + Attestor attestor = Attestor.newBuilder().build(); + Attestor response = + binauthzManagementServiceV1Beta1Client.createAttestor(parent, attestorId, attestor); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_createattestor_stringstringattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/AsyncDeleteAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/AsyncDeleteAttestor.java new file mode 100644 index 000000000000..57e6a728a002 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/AsyncDeleteAttestor.java @@ -0,0 +1,48 @@ +/* + * 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_deleteattestor_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.binaryauthorization.v1beta1.AttestorName; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteAttestor { + + public static void main(String[] args) throws Exception { + asyncDeleteAttestor(); + } + + public static void asyncDeleteAttestor() 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()) { + DeleteAttestorRequest request = + DeleteAttestorRequest.newBuilder() + .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + .build(); + ApiFuture future = + binauthzManagementServiceV1Beta1Client.deleteAttestorCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_deleteattestor_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestor.java new file mode 100644 index 000000000000..e98a4da2d0e5 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestor.java @@ -0,0 +1,44 @@ +/* + * 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_deleteattestor_sync] +import com.google.cloud.binaryauthorization.v1beta1.AttestorName; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteAttestor { + + public static void main(String[] args) throws Exception { + syncDeleteAttestor(); + } + + public static void syncDeleteAttestor() 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()) { + DeleteAttestorRequest request = + DeleteAttestorRequest.newBuilder() + .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + .build(); + binauthzManagementServiceV1Beta1Client.deleteAttestor(request); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_deleteattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestorAttestorname.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestorAttestorname.java new file mode 100644 index 000000000000..8797a77d180e --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestorAttestorname.java @@ -0,0 +1,40 @@ +/* + * 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_deleteattestor_attestorname_sync] +import com.google.cloud.binaryauthorization.v1beta1.AttestorName; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.protobuf.Empty; + +public class SyncDeleteAttestorAttestorname { + + public static void main(String[] args) throws Exception { + syncDeleteAttestorAttestorname(); + } + + public static void syncDeleteAttestorAttestorname() 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()) { + AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); + binauthzManagementServiceV1Beta1Client.deleteAttestor(name); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_deleteattestor_attestorname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestorString.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestorString.java new file mode 100644 index 000000000000..e5cee1e2b867 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/deleteattestor/SyncDeleteAttestorString.java @@ -0,0 +1,40 @@ +/* + * 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_deleteattestor_string_sync] +import com.google.cloud.binaryauthorization.v1beta1.AttestorName; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.protobuf.Empty; + +public class SyncDeleteAttestorString { + + public static void main(String[] args) throws Exception { + syncDeleteAttestorString(); + } + + public static void syncDeleteAttestorString() 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()) { + String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString(); + binauthzManagementServiceV1Beta1Client.deleteAttestor(name); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_deleteattestor_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/AsyncGetAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/AsyncGetAttestor.java new file mode 100644 index 000000000000..709b38ca6c55 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/AsyncGetAttestor.java @@ -0,0 +1,48 @@ +/* + * 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_getattestor_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.AttestorName; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest; + +public class AsyncGetAttestor { + + public static void main(String[] args) throws Exception { + asyncGetAttestor(); + } + + public static void asyncGetAttestor() 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()) { + GetAttestorRequest request = + GetAttestorRequest.newBuilder() + .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + .build(); + ApiFuture future = + binauthzManagementServiceV1Beta1Client.getAttestorCallable().futureCall(request); + // Do something. + Attestor response = future.get(); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_getattestor_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestor.java new file mode 100644 index 000000000000..55a763a78e92 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestor.java @@ -0,0 +1,44 @@ +/* + * 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_getattestor_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.AttestorName; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest; + +public class SyncGetAttestor { + + public static void main(String[] args) throws Exception { + syncGetAttestor(); + } + + public static void syncGetAttestor() 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()) { + GetAttestorRequest request = + GetAttestorRequest.newBuilder() + .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + .build(); + Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(request); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_getattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestorAttestorname.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestorAttestorname.java new file mode 100644 index 000000000000..c120c3747e24 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestorAttestorname.java @@ -0,0 +1,40 @@ +/* + * 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_getattestor_attestorname_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.AttestorName; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; + +public class SyncGetAttestorAttestorname { + + public static void main(String[] args) throws Exception { + syncGetAttestorAttestorname(); + } + + public static void syncGetAttestorAttestorname() 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()) { + AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); + Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(name); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_getattestor_attestorname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestorString.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestorString.java new file mode 100644 index 000000000000..b0a4417a4f25 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getattestor/SyncGetAttestorString.java @@ -0,0 +1,40 @@ +/* + * 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_getattestor_string_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.AttestorName; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; + +public class SyncGetAttestorString { + + public static void main(String[] args) throws Exception { + syncGetAttestorString(); + } + + public static void syncGetAttestorString() 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()) { + String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString(); + Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(name); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_getattestor_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/AsyncGetPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/AsyncGetPolicy.java new file mode 100644 index 000000000000..bccfea7443a1 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/AsyncGetPolicy.java @@ -0,0 +1,48 @@ +/* + * 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_getpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest; +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.PolicyName; + +public class AsyncGetPolicy { + + public static void main(String[] args) throws Exception { + asyncGetPolicy(); + } + + public static void asyncGetPolicy() 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()) { + GetPolicyRequest request = + GetPolicyRequest.newBuilder() + .setName(PolicyName.ofProjectName("[PROJECT]").toString()) + .build(); + ApiFuture future = + binauthzManagementServiceV1Beta1Client.getPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_getpolicy_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicy.java new file mode 100644 index 000000000000..8aad9831786f --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicy.java @@ -0,0 +1,44 @@ +/* + * 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_getpolicy_sync] +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest; +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.PolicyName; + +public class SyncGetPolicy { + + public static void main(String[] args) throws Exception { + syncGetPolicy(); + } + + public static void syncGetPolicy() 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()) { + GetPolicyRequest request = + GetPolicyRequest.newBuilder() + .setName(PolicyName.ofProjectName("[PROJECT]").toString()) + .build(); + Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(request); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_getpolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicyPolicyname.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicyPolicyname.java new file mode 100644 index 000000000000..57c31c38720d --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicyPolicyname.java @@ -0,0 +1,40 @@ +/* + * 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_getpolicy_policyname_sync] +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.PolicyName; + +public class SyncGetPolicyPolicyname { + + public static void main(String[] args) throws Exception { + syncGetPolicyPolicyname(); + } + + public static void syncGetPolicyPolicyname() 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()) { + PolicyName name = PolicyName.ofProjectName("[PROJECT]"); + Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_getpolicy_policyname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicyString.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicyString.java new file mode 100644 index 000000000000..9485d66db9a9 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/getpolicy/SyncGetPolicyString.java @@ -0,0 +1,40 @@ +/* + * 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_getpolicy_string_sync] +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.PolicyName; + +public class SyncGetPolicyString { + + public static void main(String[] args) throws Exception { + syncGetPolicyString(); + } + + public static void syncGetPolicyString() 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()) { + String name = PolicyName.ofProjectName("[PROJECT]").toString(); + Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_getpolicy_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/AsyncListAttestors.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/AsyncListAttestors.java new file mode 100644 index 000000000000..84f78f986513 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/AsyncListAttestors.java @@ -0,0 +1,52 @@ +/* + * 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_listattestors_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.ListAttestorsRequest; +import com.google.cloud.binaryauthorization.v1beta1.ProjectName; + +public class AsyncListAttestors { + + public static void main(String[] args) throws Exception { + asyncListAttestors(); + } + + public static void asyncListAttestors() 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()) { + ListAttestorsRequest request = + ListAttestorsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + binauthzManagementServiceV1Beta1Client.listAttestorsPagedCallable().futureCall(request); + // Do something. + for (Attestor element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_listattestors_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/AsyncListAttestorsPaged.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/AsyncListAttestorsPaged.java new file mode 100644 index 000000000000..3539418f80ed --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/AsyncListAttestorsPaged.java @@ -0,0 +1,60 @@ +/* + * 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_listattestors_paged_async] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest; +import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse; +import com.google.cloud.binaryauthorization.v1beta1.ProjectName; +import com.google.common.base.Strings; + +public class AsyncListAttestorsPaged { + + public static void main(String[] args) throws Exception { + asyncListAttestorsPaged(); + } + + public static void asyncListAttestorsPaged() 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()) { + ListAttestorsRequest request = + ListAttestorsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListAttestorsResponse response = + binauthzManagementServiceV1Beta1Client.listAttestorsCallable().call(request); + for (Attestor element : response.getAttestorsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_listattestors_paged_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestors.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestors.java new file mode 100644 index 000000000000..c3d0466de22c --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestors.java @@ -0,0 +1,49 @@ +/* + * 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_listattestors_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest; +import com.google.cloud.binaryauthorization.v1beta1.ProjectName; + +public class SyncListAttestors { + + public static void main(String[] args) throws Exception { + syncListAttestors(); + } + + public static void syncListAttestors() 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()) { + ListAttestorsRequest request = + ListAttestorsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Attestor element : + binauthzManagementServiceV1Beta1Client.listAttestors(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_listattestors_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestorsProjectname.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestorsProjectname.java new file mode 100644 index 000000000000..4cce9cc42930 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestorsProjectname.java @@ -0,0 +1,43 @@ +/* + * 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_listattestors_projectname_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.ProjectName; + +public class SyncListAttestorsProjectname { + + public static void main(String[] args) throws Exception { + syncListAttestorsProjectname(); + } + + public static void syncListAttestorsProjectname() 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()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (Attestor element : + binauthzManagementServiceV1Beta1Client.listAttestors(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_listattestors_projectname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestorsString.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestorsString.java new file mode 100644 index 000000000000..843f2e632335 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/listattestors/SyncListAttestorsString.java @@ -0,0 +1,43 @@ +/* + * 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_listattestors_string_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.ProjectName; + +public class SyncListAttestorsString { + + public static void main(String[] args) throws Exception { + syncListAttestorsString(); + } + + public static void syncListAttestorsString() 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()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (Attestor element : + binauthzManagementServiceV1Beta1Client.listAttestors(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_listattestors_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/AsyncUpdateAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/AsyncUpdateAttestor.java new file mode 100644 index 000000000000..4386ed51d681 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/AsyncUpdateAttestor.java @@ -0,0 +1,45 @@ +/* + * 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_updateattestor_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.UpdateAttestorRequest; + +public class AsyncUpdateAttestor { + + public static void main(String[] args) throws Exception { + asyncUpdateAttestor(); + } + + public static void asyncUpdateAttestor() 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()) { + UpdateAttestorRequest request = + UpdateAttestorRequest.newBuilder().setAttestor(Attestor.newBuilder().build()).build(); + ApiFuture future = + binauthzManagementServiceV1Beta1Client.updateAttestorCallable().futureCall(request); + // Do something. + Attestor response = future.get(); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_updateattestor_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/SyncUpdateAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/SyncUpdateAttestor.java new file mode 100644 index 000000000000..7e98ef5d670e --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/SyncUpdateAttestor.java @@ -0,0 +1,41 @@ +/* + * 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_updateattestor_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest; + +public class SyncUpdateAttestor { + + public static void main(String[] args) throws Exception { + syncUpdateAttestor(); + } + + public static void syncUpdateAttestor() 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()) { + UpdateAttestorRequest request = + UpdateAttestorRequest.newBuilder().setAttestor(Attestor.newBuilder().build()).build(); + Attestor response = binauthzManagementServiceV1Beta1Client.updateAttestor(request); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_updateattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/SyncUpdateAttestorAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/SyncUpdateAttestorAttestor.java new file mode 100644 index 000000000000..ab2c58f32393 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updateattestor/SyncUpdateAttestorAttestor.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_updateattestor_attestor_sync] +import com.google.cloud.binaryauthorization.v1beta1.Attestor; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; + +public class SyncUpdateAttestorAttestor { + + public static void main(String[] args) throws Exception { + syncUpdateAttestorAttestor(); + } + + public static void syncUpdateAttestorAttestor() 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()) { + Attestor attestor = Attestor.newBuilder().build(); + Attestor response = binauthzManagementServiceV1Beta1Client.updateAttestor(attestor); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_updateattestor_attestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/AsyncUpdatePolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/AsyncUpdatePolicy.java new file mode 100644 index 000000000000..4a95a96451e7 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/AsyncUpdatePolicy.java @@ -0,0 +1,45 @@ +/* + * 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_updatepolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest; + +public class AsyncUpdatePolicy { + + public static void main(String[] args) throws Exception { + asyncUpdatePolicy(); + } + + public static void asyncUpdatePolicy() 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()) { + UpdatePolicyRequest request = + UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build(); + ApiFuture future = + binauthzManagementServiceV1Beta1Client.updatePolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_updatepolicy_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/SyncUpdatePolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/SyncUpdatePolicy.java new file mode 100644 index 000000000000..36447e067ed4 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/SyncUpdatePolicy.java @@ -0,0 +1,41 @@ +/* + * 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_updatepolicy_sync] +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest; + +public class SyncUpdatePolicy { + + public static void main(String[] args) throws Exception { + syncUpdatePolicy(); + } + + public static void syncUpdatePolicy() 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()) { + UpdatePolicyRequest request = + UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build(); + Policy response = binauthzManagementServiceV1Beta1Client.updatePolicy(request); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_updatepolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/SyncUpdatePolicyPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/SyncUpdatePolicyPolicy.java new file mode 100644 index 000000000000..6afce8dcbebd --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1client/updatepolicy/SyncUpdatePolicyPolicy.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_updatepolicy_policy_sync] +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.Policy; + +public class SyncUpdatePolicyPolicy { + + public static void main(String[] args) throws Exception { + syncUpdatePolicyPolicy(); + } + + public static void syncUpdatePolicyPolicy() 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()) { + Policy policy = Policy.newBuilder().build(); + Policy response = binauthzManagementServiceV1Beta1Client.updatePolicy(policy); + } + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1client_updatepolicy_policy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1settings/getpolicy/SyncGetPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1settings/getpolicy/SyncGetPolicy.java new file mode 100644 index 000000000000..5a0305e6211d --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/binauthzmanagementservicev1beta1settings/getpolicy/SyncGetPolicy.java @@ -0,0 +1,48 @@ +/* + * 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_binauthzmanagementservicev1beta1settings_getpolicy_sync] +import com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Settings; +import java.time.Duration; + +public class SyncGetPolicy { + + public static void main(String[] args) throws Exception { + syncGetPolicy(); + } + + public static void syncGetPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BinauthzManagementServiceV1Beta1Settings.Builder + binauthzManagementServiceV1Beta1SettingsBuilder = + BinauthzManagementServiceV1Beta1Settings.newBuilder(); + binauthzManagementServiceV1Beta1SettingsBuilder + .getPolicySettings() + .setRetrySettings( + binauthzManagementServiceV1Beta1SettingsBuilder + .getPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings = + binauthzManagementServiceV1Beta1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1settings_getpolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/stub/binauthzmanagementservicev1beta1stubsettings/getpolicy/SyncGetPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/stub/binauthzmanagementservicev1beta1stubsettings/getpolicy/SyncGetPolicy.java new file mode 100644 index 000000000000..1d32c2b4daca --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/stub/binauthzmanagementservicev1beta1stubsettings/getpolicy/SyncGetPolicy.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1stubsettings_getpolicy_sync] +import com.google.cloud.binaryauthorization.v1beta1.stub.BinauthzManagementServiceV1Beta1StubSettings; +import java.time.Duration; + +public class SyncGetPolicy { + + public static void main(String[] args) throws Exception { + syncGetPolicy(); + } + + public static void syncGetPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BinauthzManagementServiceV1Beta1StubSettings.Builder + binauthzManagementServiceV1Beta1SettingsBuilder = + BinauthzManagementServiceV1Beta1StubSettings.newBuilder(); + binauthzManagementServiceV1Beta1SettingsBuilder + .getPolicySettings() + .setRetrySettings( + binauthzManagementServiceV1Beta1SettingsBuilder + .getPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + BinauthzManagementServiceV1Beta1StubSettings binauthzManagementServiceV1Beta1Settings = + binauthzManagementServiceV1Beta1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1beta1_generated_binauthzmanagementservicev1beta1stubsettings_getpolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/stub/systempolicyv1beta1stubsettings/getsystempolicy/SyncGetSystemPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/stub/systempolicyv1beta1stubsettings/getsystempolicy/SyncGetSystemPolicy.java new file mode 100644 index 000000000000..2135225b55c6 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/stub/systempolicyv1beta1stubsettings/getsystempolicy/SyncGetSystemPolicy.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1beta1_generated_systempolicyv1beta1stubsettings_getsystempolicy_sync] +import com.google.cloud.binaryauthorization.v1beta1.stub.SystemPolicyV1Beta1StubSettings; +import java.time.Duration; + +public class SyncGetSystemPolicy { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicy(); + } + + public static void syncGetSystemPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + SystemPolicyV1Beta1StubSettings.Builder systemPolicyV1Beta1SettingsBuilder = + SystemPolicyV1Beta1StubSettings.newBuilder(); + systemPolicyV1Beta1SettingsBuilder + .getSystemPolicySettings() + .setRetrySettings( + systemPolicyV1Beta1SettingsBuilder + .getSystemPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SystemPolicyV1Beta1StubSettings systemPolicyV1Beta1Settings = + systemPolicyV1Beta1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1beta1_generated_systempolicyv1beta1stubsettings_getsystempolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/create/SyncCreateSetCredentialsProvider.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..dda6b1b37836 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/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_systempolicyv1beta1client_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1Settings; +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. + SystemPolicyV1Beta1Settings systemPolicyV1Beta1Settings = + SystemPolicyV1Beta1Settings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = + SystemPolicyV1Beta1Client.create(systemPolicyV1Beta1Settings); + } +} +// [END binaryauthorization_v1beta1_generated_systempolicyv1beta1client_create_setcredentialsprovider_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/create/SyncCreateSetEndpoint.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..e4061a8d7e29 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/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_systempolicyv1beta1client_create_setendpoint_sync] +import com.google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1Client; +import com.google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1Settings; +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. + SystemPolicyV1Beta1Settings systemPolicyV1Beta1Settings = + SystemPolicyV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build(); + SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = + SystemPolicyV1Beta1Client.create(systemPolicyV1Beta1Settings); + } +} +// [END binaryauthorization_v1beta1_generated_systempolicyv1beta1client_create_setendpoint_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/AsyncGetSystemPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/AsyncGetSystemPolicy.java new file mode 100644 index 000000000000..6a38cc92aa8d --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/AsyncGetSystemPolicy.java @@ -0,0 +1,47 @@ +/* + * 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_systempolicyv1beta1client_getsystempolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest; +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.PolicyName; +import com.google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1Client; + +public class AsyncGetSystemPolicy { + + public static void main(String[] args) throws Exception { + asyncGetSystemPolicy(); + } + + public static void asyncGetSystemPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.create()) { + GetSystemPolicyRequest request = + GetSystemPolicyRequest.newBuilder() + .setName(PolicyName.ofLocationName("[LOCATION]").toString()) + .build(); + ApiFuture future = + systemPolicyV1Beta1Client.getSystemPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END binaryauthorization_v1beta1_generated_systempolicyv1beta1client_getsystempolicy_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicy.java new file mode 100644 index 000000000000..738cb1d2f80b --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicy.java @@ -0,0 +1,43 @@ +/* + * 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_systempolicyv1beta1client_getsystempolicy_sync] +import com.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest; +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.PolicyName; +import com.google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1Client; + +public class SyncGetSystemPolicy { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicy(); + } + + public static void syncGetSystemPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.create()) { + GetSystemPolicyRequest request = + GetSystemPolicyRequest.newBuilder() + .setName(PolicyName.ofLocationName("[LOCATION]").toString()) + .build(); + Policy response = systemPolicyV1Beta1Client.getSystemPolicy(request); + } + } +} +// [END binaryauthorization_v1beta1_generated_systempolicyv1beta1client_getsystempolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicyPolicyname.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicyPolicyname.java new file mode 100644 index 000000000000..d9f74fd53870 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicyPolicyname.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_systempolicyv1beta1client_getsystempolicy_policyname_sync] +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.PolicyName; +import com.google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1Client; + +public class SyncGetSystemPolicyPolicyname { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicyPolicyname(); + } + + public static void syncGetSystemPolicyPolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.create()) { + PolicyName name = PolicyName.ofLocationName("[LOCATION]"); + Policy response = systemPolicyV1Beta1Client.getSystemPolicy(name); + } + } +} +// [END binaryauthorization_v1beta1_generated_systempolicyv1beta1client_getsystempolicy_policyname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicyString.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicyString.java new file mode 100644 index 000000000000..8732b004699b --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1client/getsystempolicy/SyncGetSystemPolicyString.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_systempolicyv1beta1client_getsystempolicy_string_sync] +import com.google.cloud.binaryauthorization.v1beta1.Policy; +import com.google.cloud.binaryauthorization.v1beta1.PolicyName; +import com.google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1Client; + +public class SyncGetSystemPolicyString { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicyString(); + } + + public static void syncGetSystemPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.create()) { + String name = PolicyName.ofProjectName("[PROJECT]").toString(); + Policy response = systemPolicyV1Beta1Client.getSystemPolicy(name); + } + } +} +// [END binaryauthorization_v1beta1_generated_systempolicyv1beta1client_getsystempolicy_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1settings/getsystempolicy/SyncGetSystemPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1settings/getsystempolicy/SyncGetSystemPolicy.java new file mode 100644 index 000000000000..b906e114cb55 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/cloud/binaryauthorization/v1beta1/systempolicyv1beta1settings/getsystempolicy/SyncGetSystemPolicy.java @@ -0,0 +1,47 @@ +/* + * 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_systempolicyv1beta1settings_getsystempolicy_sync] +import com.google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1Settings; +import java.time.Duration; + +public class SyncGetSystemPolicy { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicy(); + } + + public static void syncGetSystemPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + SystemPolicyV1Beta1Settings.Builder systemPolicyV1Beta1SettingsBuilder = + SystemPolicyV1Beta1Settings.newBuilder(); + systemPolicyV1Beta1SettingsBuilder + .getSystemPolicySettings() + .setRetrySettings( + systemPolicyV1Beta1SettingsBuilder + .getSystemPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SystemPolicyV1Beta1Settings systemPolicyV1Beta1Settings = + systemPolicyV1Beta1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1beta1_generated_systempolicyv1beta1settings_getsystempolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/create/SyncCreateSetCredentialsProvider.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..1765407d5ee9 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/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.protos.google.cloud.binaryauthorization.v1.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Settings; +import com.google.protos.google.cloud.binaryauthorization.v1.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. + BinauthzManagementServiceV1Settings binauthzManagementServiceV1Settings = + BinauthzManagementServiceV1Settings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create(binauthzManagementServiceV1Settings); + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_create_setcredentialsprovider_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/create/SyncCreateSetEndpoint.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..e2b5d11ffa39 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/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.protos.google.cloud.binaryauthorization.v1.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_create_setendpoint_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Settings; +import com.google.protos.google.cloud.binaryauthorization.v1.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. + BinauthzManagementServiceV1Settings binauthzManagementServiceV1Settings = + BinauthzManagementServiceV1Settings.newBuilder().setEndpoint(myEndpoint).build(); + BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create(binauthzManagementServiceV1Settings); + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_create_setendpoint_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/AsyncCreateAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/AsyncCreateAttestor.java new file mode 100644 index 000000000000..5029b0d70ea5 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/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.protos.google.cloud.binaryauthorization.v1.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_createattestor_async] +import com.google.api.core.ApiFuture; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ProjectName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +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 (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.CreateAttestorRequest request = + Service.CreateAttestorRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setAttestorId("attestorId2055733027") + .setAttestor(Resources.Attestor.newBuilder().build()) + .build(); + ApiFuture future = + binauthzManagementServiceV1Client.createAttestorCallable().futureCall(request); + // Do something. + Resources.Attestor response = future.get(); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_createattestor_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestor.java new file mode 100644 index 000000000000..efbc973be0a9 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestor.java @@ -0,0 +1,46 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_createattestor_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ProjectName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class SyncCreateAttestor { + + public static void main(String[] args) throws Exception { + syncCreateAttestor(); + } + + public static void syncCreateAttestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.CreateAttestorRequest request = + Service.CreateAttestorRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setAttestorId("attestorId2055733027") + .setAttestor(Resources.Attestor.newBuilder().build()) + .build(); + Resources.Attestor response = binauthzManagementServiceV1Client.createAttestor(request); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_createattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestorProjectnameStringResourcesattestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestorProjectnameStringResourcesattestor.java new file mode 100644 index 000000000000..6715ecc80f38 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestorProjectnameStringResourcesattestor.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_createattestor_projectnamestringresourcesattestor_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ProjectName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncCreateAttestorProjectnameStringResourcesattestor { + + public static void main(String[] args) throws Exception { + syncCreateAttestorProjectnameStringResourcesattestor(); + } + + public static void syncCreateAttestorProjectnameStringResourcesattestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + String attestorId = "attestorId2055733027"; + Resources.Attestor attestor = Resources.Attestor.newBuilder().build(); + Resources.Attestor response = + binauthzManagementServiceV1Client.createAttestor(parent, attestorId, attestor); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_createattestor_projectnamestringresourcesattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestorStringStringResourcesattestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestorStringStringResourcesattestor.java new file mode 100644 index 000000000000..8b4ce8e00a1f --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/createattestor/SyncCreateAttestorStringStringResourcesattestor.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_createattestor_stringstringresourcesattestor_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ProjectName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncCreateAttestorStringStringResourcesattestor { + + public static void main(String[] args) throws Exception { + syncCreateAttestorStringStringResourcesattestor(); + } + + public static void syncCreateAttestorStringStringResourcesattestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + String attestorId = "attestorId2055733027"; + Resources.Attestor attestor = Resources.Attestor.newBuilder().build(); + Resources.Attestor response = + binauthzManagementServiceV1Client.createAttestor(parent, attestorId, attestor); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_createattestor_stringstringresourcesattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/AsyncDeleteAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/AsyncDeleteAttestor.java new file mode 100644 index 000000000000..e5e63a9bd7e9 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/AsyncDeleteAttestor.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_deleteattestor_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.protos.google.cloud.binaryauthorization.v1.AttestorName; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class AsyncDeleteAttestor { + + public static void main(String[] args) throws Exception { + asyncDeleteAttestor(); + } + + public static void asyncDeleteAttestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.DeleteAttestorRequest request = + Service.DeleteAttestorRequest.newBuilder() + .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + .build(); + ApiFuture future = + binauthzManagementServiceV1Client.deleteAttestorCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_deleteattestor_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestor.java new file mode 100644 index 000000000000..2d3578b9f734 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestor.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_deleteattestor_sync] +import com.google.protobuf.Empty; +import com.google.protos.google.cloud.binaryauthorization.v1.AttestorName; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class SyncDeleteAttestor { + + public static void main(String[] args) throws Exception { + syncDeleteAttestor(); + } + + public static void syncDeleteAttestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.DeleteAttestorRequest request = + Service.DeleteAttestorRequest.newBuilder() + .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + .build(); + binauthzManagementServiceV1Client.deleteAttestor(request); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_deleteattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestorAttestorname.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestorAttestorname.java new file mode 100644 index 000000000000..b93043cc936f --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestorAttestorname.java @@ -0,0 +1,40 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_deleteattestor_attestorname_sync] +import com.google.protobuf.Empty; +import com.google.protos.google.cloud.binaryauthorization.v1.AttestorName; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; + +public class SyncDeleteAttestorAttestorname { + + public static void main(String[] args) throws Exception { + syncDeleteAttestorAttestorname(); + } + + public static void syncDeleteAttestorAttestorname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); + binauthzManagementServiceV1Client.deleteAttestor(name); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_deleteattestor_attestorname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestorString.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestorString.java new file mode 100644 index 000000000000..ce17ef3f8360 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/deleteattestor/SyncDeleteAttestorString.java @@ -0,0 +1,40 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_deleteattestor_string_sync] +import com.google.protobuf.Empty; +import com.google.protos.google.cloud.binaryauthorization.v1.AttestorName; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; + +public class SyncDeleteAttestorString { + + public static void main(String[] args) throws Exception { + syncDeleteAttestorString(); + } + + public static void syncDeleteAttestorString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString(); + binauthzManagementServiceV1Client.deleteAttestor(name); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_deleteattestor_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/AsyncGetAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/AsyncGetAttestor.java new file mode 100644 index 000000000000..cdf2a792ca51 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/AsyncGetAttestor.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_getattestor_async] +import com.google.api.core.ApiFuture; +import com.google.protos.google.cloud.binaryauthorization.v1.AttestorName; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class AsyncGetAttestor { + + public static void main(String[] args) throws Exception { + asyncGetAttestor(); + } + + public static void asyncGetAttestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.GetAttestorRequest request = + Service.GetAttestorRequest.newBuilder() + .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + .build(); + ApiFuture future = + binauthzManagementServiceV1Client.getAttestorCallable().futureCall(request); + // Do something. + Resources.Attestor response = future.get(); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_getattestor_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestor.java new file mode 100644 index 000000000000..f3f8d3322af1 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestor.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_getattestor_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.AttestorName; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class SyncGetAttestor { + + public static void main(String[] args) throws Exception { + syncGetAttestor(); + } + + public static void syncGetAttestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.GetAttestorRequest request = + Service.GetAttestorRequest.newBuilder() + .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + .build(); + Resources.Attestor response = binauthzManagementServiceV1Client.getAttestor(request); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_getattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestorAttestorname.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestorAttestorname.java new file mode 100644 index 000000000000..b27bef94751d --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestorAttestorname.java @@ -0,0 +1,40 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_getattestor_attestorname_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.AttestorName; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncGetAttestorAttestorname { + + public static void main(String[] args) throws Exception { + syncGetAttestorAttestorname(); + } + + public static void syncGetAttestorAttestorname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); + Resources.Attestor response = binauthzManagementServiceV1Client.getAttestor(name); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_getattestor_attestorname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestorString.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestorString.java new file mode 100644 index 000000000000..35d8b2c4bfd0 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getattestor/SyncGetAttestorString.java @@ -0,0 +1,40 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_getattestor_string_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.AttestorName; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncGetAttestorString { + + public static void main(String[] args) throws Exception { + syncGetAttestorString(); + } + + public static void syncGetAttestorString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString(); + Resources.Attestor response = binauthzManagementServiceV1Client.getAttestor(name); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_getattestor_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/AsyncGetPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/AsyncGetPolicy.java new file mode 100644 index 000000000000..6859b9c451ae --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/AsyncGetPolicy.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_getpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.PolicyName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class AsyncGetPolicy { + + public static void main(String[] args) throws Exception { + asyncGetPolicy(); + } + + public static void asyncGetPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.GetPolicyRequest request = + Service.GetPolicyRequest.newBuilder() + .setName(PolicyName.ofProjectName("[PROJECT]").toString()) + .build(); + ApiFuture future = + binauthzManagementServiceV1Client.getPolicyCallable().futureCall(request); + // Do something. + Resources.Policy response = future.get(); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_getpolicy_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicy.java new file mode 100644 index 000000000000..ed902a516ad1 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicy.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_getpolicy_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.PolicyName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class SyncGetPolicy { + + public static void main(String[] args) throws Exception { + syncGetPolicy(); + } + + public static void syncGetPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.GetPolicyRequest request = + Service.GetPolicyRequest.newBuilder() + .setName(PolicyName.ofProjectName("[PROJECT]").toString()) + .build(); + Resources.Policy response = binauthzManagementServiceV1Client.getPolicy(request); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_getpolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicyPolicyname.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicyPolicyname.java new file mode 100644 index 000000000000..09157171564e --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicyPolicyname.java @@ -0,0 +1,40 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_getpolicy_policyname_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.PolicyName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncGetPolicyPolicyname { + + public static void main(String[] args) throws Exception { + syncGetPolicyPolicyname(); + } + + public static void syncGetPolicyPolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + PolicyName name = PolicyName.ofProjectName("[PROJECT]"); + Resources.Policy response = binauthzManagementServiceV1Client.getPolicy(name); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_getpolicy_policyname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicyString.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicyString.java new file mode 100644 index 000000000000..f4e2634e539c --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/getpolicy/SyncGetPolicyString.java @@ -0,0 +1,40 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_getpolicy_string_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.PolicyName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncGetPolicyString { + + public static void main(String[] args) throws Exception { + syncGetPolicyString(); + } + + public static void syncGetPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + String name = PolicyName.ofProjectName("[PROJECT]").toString(); + Resources.Policy response = binauthzManagementServiceV1Client.getPolicy(name); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_getpolicy_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/AsyncListAttestors.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/AsyncListAttestors.java new file mode 100644 index 000000000000..63686ef4e63d --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/AsyncListAttestors.java @@ -0,0 +1,52 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_async] +import com.google.api.core.ApiFuture; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ProjectName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class AsyncListAttestors { + + public static void main(String[] args) throws Exception { + asyncListAttestors(); + } + + public static void asyncListAttestors() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.ListAttestorsRequest request = + Service.ListAttestorsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + binauthzManagementServiceV1Client.listAttestorsPagedCallable().futureCall(request); + // Do something. + for (Resources.Attestor element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/AsyncListAttestorsPaged.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/AsyncListAttestorsPaged.java new file mode 100644 index 000000000000..c5969466a8de --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/AsyncListAttestorsPaged.java @@ -0,0 +1,59 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_paged_async] +import com.google.common.base.Strings; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ProjectName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class AsyncListAttestorsPaged { + + public static void main(String[] args) throws Exception { + asyncListAttestorsPaged(); + } + + public static void asyncListAttestorsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.ListAttestorsRequest request = + Service.ListAttestorsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + Service.ListAttestorsResponse response = + binauthzManagementServiceV1Client.listAttestorsCallable().call(request); + for (Resources.Attestor element : response.getAttestorsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_paged_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestors.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestors.java new file mode 100644 index 000000000000..dd43c17014ac --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestors.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ProjectName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class SyncListAttestors { + + public static void main(String[] args) throws Exception { + syncListAttestors(); + } + + public static void syncListAttestors() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.ListAttestorsRequest request = + Service.ListAttestorsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Resources.Attestor element : + binauthzManagementServiceV1Client.listAttestors(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestorsProjectname.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestorsProjectname.java new file mode 100644 index 000000000000..150506380105 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestorsProjectname.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_projectname_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ProjectName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncListAttestorsProjectname { + + public static void main(String[] args) throws Exception { + syncListAttestorsProjectname(); + } + + public static void syncListAttestorsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (Resources.Attestor element : + binauthzManagementServiceV1Client.listAttestors(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_projectname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestorsString.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestorsString.java new file mode 100644 index 000000000000..808f6f71c877 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/listattestors/SyncListAttestorsString.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_string_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ProjectName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncListAttestorsString { + + public static void main(String[] args) throws Exception { + syncListAttestorsString(); + } + + public static void syncListAttestorsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (Resources.Attestor element : + binauthzManagementServiceV1Client.listAttestors(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_listattestors_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/AsyncUpdateAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/AsyncUpdateAttestor.java new file mode 100644 index 000000000000..3758acf93b02 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/AsyncUpdateAttestor.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_updateattestor_async] +import com.google.api.core.ApiFuture; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class AsyncUpdateAttestor { + + public static void main(String[] args) throws Exception { + asyncUpdateAttestor(); + } + + public static void asyncUpdateAttestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.UpdateAttestorRequest request = + Service.UpdateAttestorRequest.newBuilder() + .setAttestor(Resources.Attestor.newBuilder().build()) + .build(); + ApiFuture future = + binauthzManagementServiceV1Client.updateAttestorCallable().futureCall(request); + // Do something. + Resources.Attestor response = future.get(); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_updateattestor_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/SyncUpdateAttestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/SyncUpdateAttestor.java new file mode 100644 index 000000000000..6dbc775274e5 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/SyncUpdateAttestor.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_updateattestor_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class SyncUpdateAttestor { + + public static void main(String[] args) throws Exception { + syncUpdateAttestor(); + } + + public static void syncUpdateAttestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.UpdateAttestorRequest request = + Service.UpdateAttestorRequest.newBuilder() + .setAttestor(Resources.Attestor.newBuilder().build()) + .build(); + Resources.Attestor response = binauthzManagementServiceV1Client.updateAttestor(request); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_updateattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/SyncUpdateAttestorResourcesattestor.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/SyncUpdateAttestorResourcesattestor.java new file mode 100644 index 000000000000..50a220e7049d --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updateattestor/SyncUpdateAttestorResourcesattestor.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.protos.google.cloud.binaryauthorization.v1.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_updateattestor_resourcesattestor_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncUpdateAttestorResourcesattestor { + + public static void main(String[] args) throws Exception { + syncUpdateAttestorResourcesattestor(); + } + + public static void syncUpdateAttestorResourcesattestor() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Resources.Attestor attestor = Resources.Attestor.newBuilder().build(); + Resources.Attestor response = binauthzManagementServiceV1Client.updateAttestor(attestor); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_updateattestor_resourcesattestor_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/AsyncUpdatePolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/AsyncUpdatePolicy.java new file mode 100644 index 000000000000..4687b1a8cf9e --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/AsyncUpdatePolicy.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_updatepolicy_async] +import com.google.api.core.ApiFuture; +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class AsyncUpdatePolicy { + + public static void main(String[] args) throws Exception { + asyncUpdatePolicy(); + } + + public static void asyncUpdatePolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.UpdatePolicyRequest request = + Service.UpdatePolicyRequest.newBuilder() + .setPolicy(Resources.Policy.newBuilder().build()) + .build(); + ApiFuture future = + binauthzManagementServiceV1Client.updatePolicyCallable().futureCall(request); + // Do something. + Resources.Policy response = future.get(); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_updatepolicy_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/SyncUpdatePolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/SyncUpdatePolicy.java new file mode 100644 index 000000000000..c8d27d99b46a --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/SyncUpdatePolicy.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_updatepolicy_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; + +public class SyncUpdatePolicy { + + public static void main(String[] args) throws Exception { + syncUpdatePolicy(); + } + + public static void syncUpdatePolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Service.UpdatePolicyRequest request = + Service.UpdatePolicyRequest.newBuilder() + .setPolicy(Resources.Policy.newBuilder().build()) + .build(); + Resources.Policy response = binauthzManagementServiceV1Client.updatePolicy(request); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_updatepolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/SyncUpdatePolicyResourcespolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/SyncUpdatePolicyResourcespolicy.java new file mode 100644 index 000000000000..9c3e1249c89d --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1client/updatepolicy/SyncUpdatePolicyResourcespolicy.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.protos.google.cloud.binaryauthorization.v1.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1client_updatepolicy_resourcespolicy_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; + +public class SyncUpdatePolicyResourcespolicy { + + public static void main(String[] args) throws Exception { + syncUpdatePolicyResourcespolicy(); + } + + public static void syncUpdatePolicyResourcespolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + BinauthzManagementServiceV1Client.create()) { + Resources.Policy policy = Resources.Policy.newBuilder().build(); + Resources.Policy response = binauthzManagementServiceV1Client.updatePolicy(policy); + } + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1client_updatepolicy_resourcespolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1settings/getpolicy/SyncGetPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1settings/getpolicy/SyncGetPolicy.java new file mode 100644 index 000000000000..2a67ee6dd395 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/binauthzmanagementservicev1settings/getpolicy/SyncGetPolicy.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1settings_getpolicy_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Settings; +import java.time.Duration; + +public class SyncGetPolicy { + + public static void main(String[] args) throws Exception { + syncGetPolicy(); + } + + public static void syncGetPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BinauthzManagementServiceV1Settings.Builder binauthzManagementServiceV1SettingsBuilder = + BinauthzManagementServiceV1Settings.newBuilder(); + binauthzManagementServiceV1SettingsBuilder + .getPolicySettings() + .setRetrySettings( + binauthzManagementServiceV1SettingsBuilder + .getPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + BinauthzManagementServiceV1Settings binauthzManagementServiceV1Settings = + binauthzManagementServiceV1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1settings_getpolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/binauthzmanagementservicev1stubsettings/getpolicy/SyncGetPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/binauthzmanagementservicev1stubsettings/getpolicy/SyncGetPolicy.java new file mode 100644 index 000000000000..5bce85cb8d8b --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/binauthzmanagementservicev1stubsettings/getpolicy/SyncGetPolicy.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_binauthzmanagementservicev1stubsettings_getpolicy_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.stub.BinauthzManagementServiceV1StubSettings; +import java.time.Duration; + +public class SyncGetPolicy { + + public static void main(String[] args) throws Exception { + syncGetPolicy(); + } + + public static void syncGetPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BinauthzManagementServiceV1StubSettings.Builder binauthzManagementServiceV1SettingsBuilder = + BinauthzManagementServiceV1StubSettings.newBuilder(); + binauthzManagementServiceV1SettingsBuilder + .getPolicySettings() + .setRetrySettings( + binauthzManagementServiceV1SettingsBuilder + .getPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + BinauthzManagementServiceV1StubSettings binauthzManagementServiceV1Settings = + binauthzManagementServiceV1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1_generated_binauthzmanagementservicev1stubsettings_getpolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/systempolicyv1stubsettings/getsystempolicy/SyncGetSystemPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/systempolicyv1stubsettings/getsystempolicy/SyncGetSystemPolicy.java new file mode 100644 index 000000000000..9145bf2445b3 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/systempolicyv1stubsettings/getsystempolicy/SyncGetSystemPolicy.java @@ -0,0 +1,46 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_systempolicyv1stubsettings_getsystempolicy_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.stub.SystemPolicyV1StubSettings; +import java.time.Duration; + +public class SyncGetSystemPolicy { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicy(); + } + + public static void syncGetSystemPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + SystemPolicyV1StubSettings.Builder systemPolicyV1SettingsBuilder = + SystemPolicyV1StubSettings.newBuilder(); + systemPolicyV1SettingsBuilder + .getSystemPolicySettings() + .setRetrySettings( + systemPolicyV1SettingsBuilder + .getSystemPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SystemPolicyV1StubSettings systemPolicyV1Settings = systemPolicyV1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1_generated_systempolicyv1stubsettings_getsystempolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/validationhelperv1stubsettings/validateattestationoccurrence/SyncValidateAttestationOccurrence.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/validationhelperv1stubsettings/validateattestationoccurrence/SyncValidateAttestationOccurrence.java new file mode 100644 index 000000000000..39ade3546109 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/stub/validationhelperv1stubsettings/validateattestationoccurrence/SyncValidateAttestationOccurrence.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_validationhelperv1stubsettings_validateattestationoccurrence_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.stub.ValidationHelperV1StubSettings; +import java.time.Duration; + +public class SyncValidateAttestationOccurrence { + + public static void main(String[] args) throws Exception { + syncValidateAttestationOccurrence(); + } + + public static void syncValidateAttestationOccurrence() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ValidationHelperV1StubSettings.Builder validationHelperV1SettingsBuilder = + ValidationHelperV1StubSettings.newBuilder(); + validationHelperV1SettingsBuilder + .validateAttestationOccurrenceSettings() + .setRetrySettings( + validationHelperV1SettingsBuilder + .validateAttestationOccurrenceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ValidationHelperV1StubSettings validationHelperV1Settings = + validationHelperV1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1_generated_validationhelperv1stubsettings_validateattestationoccurrence_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/create/SyncCreateSetCredentialsProvider.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..7421d9e162a4 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,41 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_systempolicyv1client_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.protos.google.cloud.binaryauthorization.v1.SystemPolicyV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.SystemPolicyV1Settings; +import com.google.protos.google.cloud.binaryauthorization.v1.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. + SystemPolicyV1Settings systemPolicyV1Settings = + SystemPolicyV1Settings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create(systemPolicyV1Settings); + } +} +// [END binaryauthorization_v1_generated_systempolicyv1client_create_setcredentialsprovider_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/create/SyncCreateSetEndpoint.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..e27dedbb478b --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/create/SyncCreateSetEndpoint.java @@ -0,0 +1,38 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_systempolicyv1client_create_setendpoint_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.SystemPolicyV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.SystemPolicyV1Settings; +import com.google.protos.google.cloud.binaryauthorization.v1.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. + SystemPolicyV1Settings systemPolicyV1Settings = + SystemPolicyV1Settings.newBuilder().setEndpoint(myEndpoint).build(); + SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create(systemPolicyV1Settings); + } +} +// [END binaryauthorization_v1_generated_systempolicyv1client_create_setendpoint_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/AsyncGetSystemPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/AsyncGetSystemPolicy.java new file mode 100644 index 000000000000..a8fa3b9a67bd --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/AsyncGetSystemPolicy.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_systempolicyv1client_getsystempolicy_async] +import com.google.api.core.ApiFuture; +import com.google.protos.google.cloud.binaryauthorization.v1.PolicyName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; +import com.google.protos.google.cloud.binaryauthorization.v1.SystemPolicyV1Client; + +public class AsyncGetSystemPolicy { + + public static void main(String[] args) throws Exception { + asyncGetSystemPolicy(); + } + + public static void asyncGetSystemPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) { + Service.GetSystemPolicyRequest request = + Service.GetSystemPolicyRequest.newBuilder() + .setName(PolicyName.ofLocationName("[LOCATION]").toString()) + .build(); + ApiFuture future = + systemPolicyV1Client.getSystemPolicyCallable().futureCall(request); + // Do something. + Resources.Policy response = future.get(); + } + } +} +// [END binaryauthorization_v1_generated_systempolicyv1client_getsystempolicy_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicy.java new file mode 100644 index 000000000000..e6c64fc51c98 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicy.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_systempolicyv1client_getsystempolicy_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.PolicyName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; +import com.google.protos.google.cloud.binaryauthorization.v1.SystemPolicyV1Client; + +public class SyncGetSystemPolicy { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicy(); + } + + public static void syncGetSystemPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) { + Service.GetSystemPolicyRequest request = + Service.GetSystemPolicyRequest.newBuilder() + .setName(PolicyName.ofLocationName("[LOCATION]").toString()) + .build(); + Resources.Policy response = systemPolicyV1Client.getSystemPolicy(request); + } + } +} +// [END binaryauthorization_v1_generated_systempolicyv1client_getsystempolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicyPolicyname.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicyPolicyname.java new file mode 100644 index 000000000000..9332dafb3093 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicyPolicyname.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.protos.google.cloud.binaryauthorization.v1.samples; + +// [START binaryauthorization_v1_generated_systempolicyv1client_getsystempolicy_policyname_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.PolicyName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.SystemPolicyV1Client; + +public class SyncGetSystemPolicyPolicyname { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicyPolicyname(); + } + + public static void syncGetSystemPolicyPolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) { + PolicyName name = PolicyName.ofLocationName("[LOCATION]"); + Resources.Policy response = systemPolicyV1Client.getSystemPolicy(name); + } + } +} +// [END binaryauthorization_v1_generated_systempolicyv1client_getsystempolicy_policyname_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicyString.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicyString.java new file mode 100644 index 000000000000..1f2ccc341d35 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1client/getsystempolicy/SyncGetSystemPolicyString.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.protos.google.cloud.binaryauthorization.v1.samples; + +// [START binaryauthorization_v1_generated_systempolicyv1client_getsystempolicy_string_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.PolicyName; +import com.google.protos.google.cloud.binaryauthorization.v1.Resources; +import com.google.protos.google.cloud.binaryauthorization.v1.SystemPolicyV1Client; + +public class SyncGetSystemPolicyString { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicyString(); + } + + public static void syncGetSystemPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) { + String name = PolicyName.ofProjectName("[PROJECT]").toString(); + Resources.Policy response = systemPolicyV1Client.getSystemPolicy(name); + } + } +} +// [END binaryauthorization_v1_generated_systempolicyv1client_getsystempolicy_string_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1settings/getsystempolicy/SyncGetSystemPolicy.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1settings/getsystempolicy/SyncGetSystemPolicy.java new file mode 100644 index 000000000000..dcbb731c5994 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/systempolicyv1settings/getsystempolicy/SyncGetSystemPolicy.java @@ -0,0 +1,46 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_systempolicyv1settings_getsystempolicy_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.SystemPolicyV1Settings; +import java.time.Duration; + +public class SyncGetSystemPolicy { + + public static void main(String[] args) throws Exception { + syncGetSystemPolicy(); + } + + public static void syncGetSystemPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + SystemPolicyV1Settings.Builder systemPolicyV1SettingsBuilder = + SystemPolicyV1Settings.newBuilder(); + systemPolicyV1SettingsBuilder + .getSystemPolicySettings() + .setRetrySettings( + systemPolicyV1SettingsBuilder + .getSystemPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SystemPolicyV1Settings systemPolicyV1Settings = systemPolicyV1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1_generated_systempolicyv1settings_getsystempolicy_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/create/SyncCreateSetCredentialsProvider.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..472d96cbd2e5 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/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.protos.google.cloud.binaryauthorization.v1.samples; + +// [START binaryauthorization_v1_generated_validationhelperv1client_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.protos.google.cloud.binaryauthorization.v1.ValidationHelperV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ValidationHelperV1Settings; +import com.google.protos.google.cloud.binaryauthorization.v1.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. + ValidationHelperV1Settings validationHelperV1Settings = + ValidationHelperV1Settings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ValidationHelperV1Client validationHelperV1Client = + ValidationHelperV1Client.create(validationHelperV1Settings); + } +} +// [END binaryauthorization_v1_generated_validationhelperv1client_create_setcredentialsprovider_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/create/SyncCreateSetEndpoint.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..cb4e8914ec70 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/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.protos.google.cloud.binaryauthorization.v1.samples; + +// [START binaryauthorization_v1_generated_validationhelperv1client_create_setendpoint_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.ValidationHelperV1Client; +import com.google.protos.google.cloud.binaryauthorization.v1.ValidationHelperV1Settings; +import com.google.protos.google.cloud.binaryauthorization.v1.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. + ValidationHelperV1Settings validationHelperV1Settings = + ValidationHelperV1Settings.newBuilder().setEndpoint(myEndpoint).build(); + ValidationHelperV1Client validationHelperV1Client = + ValidationHelperV1Client.create(validationHelperV1Settings); + } +} +// [END binaryauthorization_v1_generated_validationhelperv1client_create_setendpoint_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/validateattestationoccurrence/AsyncValidateAttestationOccurrence.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/validateattestationoccurrence/AsyncValidateAttestationOccurrence.java new file mode 100644 index 000000000000..fd89b8ff8b82 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/validateattestationoccurrence/AsyncValidateAttestationOccurrence.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_validationhelperv1client_validateattestationoccurrence_async] +import com.google.api.core.ApiFuture; +import com.google.protos.google.cloud.binaryauthorization.v1.Service; +import com.google.protos.google.cloud.binaryauthorization.v1.ValidationHelperV1Client; +import io.grafeas.v1.AttestationOccurrence; + +public class AsyncValidateAttestationOccurrence { + + public static void main(String[] args) throws Exception { + asyncValidateAttestationOccurrence(); + } + + public static void asyncValidateAttestationOccurrence() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ValidationHelperV1Client validationHelperV1Client = ValidationHelperV1Client.create()) { + Service.ValidateAttestationOccurrenceRequest request = + Service.ValidateAttestationOccurrenceRequest.newBuilder() + .setAttestor("attestor542920680") + .setAttestation(AttestationOccurrence.newBuilder().build()) + .setOccurrenceNote("occurrenceNote1722072419") + .setOccurrenceResourceUri("occurrenceResourceUri1001424877") + .build(); + ApiFuture future = + validationHelperV1Client.validateAttestationOccurrenceCallable().futureCall(request); + // Do something. + Service.ValidateAttestationOccurrenceResponse response = future.get(); + } + } +} +// [END binaryauthorization_v1_generated_validationhelperv1client_validateattestationoccurrence_async] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/validateattestationoccurrence/SyncValidateAttestationOccurrence.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/validateattestationoccurrence/SyncValidateAttestationOccurrence.java new file mode 100644 index 000000000000..f2c8445841e9 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1client/validateattestationoccurrence/SyncValidateAttestationOccurrence.java @@ -0,0 +1,46 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_validationhelperv1client_validateattestationoccurrence_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.Service; +import com.google.protos.google.cloud.binaryauthorization.v1.ValidationHelperV1Client; +import io.grafeas.v1.AttestationOccurrence; + +public class SyncValidateAttestationOccurrence { + + public static void main(String[] args) throws Exception { + syncValidateAttestationOccurrence(); + } + + public static void syncValidateAttestationOccurrence() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ValidationHelperV1Client validationHelperV1Client = ValidationHelperV1Client.create()) { + Service.ValidateAttestationOccurrenceRequest request = + Service.ValidateAttestationOccurrenceRequest.newBuilder() + .setAttestor("attestor542920680") + .setAttestation(AttestationOccurrence.newBuilder().build()) + .setOccurrenceNote("occurrenceNote1722072419") + .setOccurrenceResourceUri("occurrenceResourceUri1001424877") + .build(); + Service.ValidateAttestationOccurrenceResponse response = + validationHelperV1Client.validateAttestationOccurrence(request); + } + } +} +// [END binaryauthorization_v1_generated_validationhelperv1client_validateattestationoccurrence_sync] diff --git a/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1settings/validateattestationoccurrence/SyncValidateAttestationOccurrence.java b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1settings/validateattestationoccurrence/SyncValidateAttestationOccurrence.java new file mode 100644 index 000000000000..da529e3d84a1 --- /dev/null +++ b/java-binary-authorization/samples/snippets/generated/com/google/protos/google/cloud/binaryauthorization/v1/validationhelperv1settings/validateattestationoccurrence/SyncValidateAttestationOccurrence.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START binaryauthorization_v1_generated_validationhelperv1settings_validateattestationoccurrence_sync] +import com.google.protos.google.cloud.binaryauthorization.v1.ValidationHelperV1Settings; +import java.time.Duration; + +public class SyncValidateAttestationOccurrence { + + public static void main(String[] args) throws Exception { + syncValidateAttestationOccurrence(); + } + + public static void syncValidateAttestationOccurrence() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ValidationHelperV1Settings.Builder validationHelperV1SettingsBuilder = + ValidationHelperV1Settings.newBuilder(); + validationHelperV1SettingsBuilder + .validateAttestationOccurrenceSettings() + .setRetrySettings( + validationHelperV1SettingsBuilder + .validateAttestationOccurrenceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ValidationHelperV1Settings validationHelperV1Settings = + validationHelperV1SettingsBuilder.build(); + } +} +// [END binaryauthorization_v1_generated_validationhelperv1settings_validateattestationoccurrence_sync]