From acba70b2d64eb3d511e30dd6804477a39ae2311a Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:33:49 -0400 Subject: [PATCH] chore: Update generation configuration at Wed Aug 21 02:16:07 UTC 2024 (#11088) * chore: Update generation configuration at Wed Aug 21 02:16:07 UTC 2024 * chore: generate libraries at Wed Aug 21 02:19:34 UTC 2024 --- generation_config.yaml | 2 +- .../com/google/cloud/batch/v1/Runnable.java | 84 +- .../cloud/batch/v1/RunnableOrBuilder.java | 21 +- .../com/google/cloud/batch/v1/TaskSpec.java | 334 ++-- .../cloud/batch/v1/TaskSpecOrBuilder.java | 80 +- .../proto/google/cloud/batch/v1/task.proto | 35 +- .../google/cloud/batch/v1alpha/Runnable.java | 84 +- .../batch/v1alpha/RunnableOrBuilder.java | 21 +- .../google/cloud/batch/v1alpha/TaskSpec.java | 334 ++-- .../batch/v1alpha/TaskSpecOrBuilder.java | 80 +- .../google/cloud/batch/v1alpha/task.proto | 35 +- .../gateway/v1beta1/GatewayControlClient.java | 263 +++ ...tings.java => GatewayControlSettings.java} | 117 +- .../gateway/v1beta1/GatewayServiceClient.java | 553 ------ .../gateway/v1beta1/gapic_metadata.json | 20 +- .../gateway/v1beta1/package-info.java | 24 +- ...rviceStub.java => GatewayControlStub.java} | 28 +- ...s.java => GatewayControlStubSettings.java} | 185 +- ...=> GrpcGatewayControlCallableFactory.java} | 4 +- .../v1beta1/stub/GrpcGatewayControlStub.java | 171 ++ .../v1beta1/stub/GrpcGatewayServiceStub.java | 239 --- .../reflect-config.json | 50 +- .../v1beta1/GatewayControlClientTest.java | 133 ++ .../v1beta1/GatewayServiceClientTest.java | 341 ---- ...ayService.java => MockGatewayControl.java} | 8 +- .../v1beta1/MockGatewayControlImpl.java | 82 + .../v1beta1/MockGatewayServiceImpl.java | 161 -- .../gateway/v1beta1/GatewayControlGrpc.java | 390 +++++ .../gateway/v1beta1/GatewayServiceGrpc.java | 800 --------- .../gateway/v1beta1/ControlProto.java | 118 ++ .../gateway/v1beta1/GatewayProto.java | 85 - .../v1beta1/GenerateCredentialsRequest.java | 1482 +++++++++++++++++ .../GenerateCredentialsRequestOrBuilder.java | 161 ++ .../v1beta1/GenerateCredentialsResponse.java | 744 +++++++++ .../GenerateCredentialsResponseOrBuilder.java | 66 + .../gkeconnect/gateway/v1beta1/control.proto | 95 ++ .../gkeconnect/gateway/v1beta1/gateway.proto | 75 - .../SyncCreateSetCredentialsProvider.java | 14 +- .../create/SyncCreateSetEndpoint.java | 14 +- .../AsyncGenerateCredentials.java} | 36 +- .../SyncGenerateCredentials.java} | 33 +- .../SyncGenerateCredentials.java} | 26 +- .../getresource/AsyncGetResource.java | 52 - .../getresource/SyncGetResource.java | 49 - .../patchresource/SyncPatchResource.java | 49 - .../postresource/AsyncPostResource.java | 52 - .../postresource/SyncPostResource.java | 49 - .../putresource/AsyncPutResource.java | 52 - .../putresource/SyncPutResource.java | 49 - .../SyncGenerateCredentials.java} | 26 +- .../v1/RecaptchaEnterpriseServiceClient.java | 177 ++ .../RecaptchaEnterpriseServiceSettings.java | 13 + .../v1/gapic_metadata.json | 3 + .../GrpcRecaptchaEnterpriseServiceStub.java | 33 + .../stub/RecaptchaEnterpriseServiceStub.java | 6 + ...ecaptchaEnterpriseServiceStubSettings.java | 27 + .../reflect-config.json | 81 + .../MockRecaptchaEnterpriseServiceImpl.java | 23 + .../RecaptchaEnterpriseServiceClientTest.java | 79 + .../v1/RecaptchaEnterpriseServiceGrpc.java | 154 +- .../v1/AccountVerificationInfo.java | 14 +- .../v1/AccountVerificationInfoOrBuilder.java | 4 +- .../v1/AddIpOverrideRequest.java | 953 +++++++++++ .../v1/AddIpOverrideRequestOrBuilder.java | 98 ++ .../v1/AddIpOverrideResponse.java | 433 +++++ .../v1/AddIpOverrideResponseOrBuilder.java | 25 + .../google/recaptchaenterprise/v1/Event.java | 20 +- .../v1/EventOrBuilder.java | 5 +- .../v1/ExpressKeySettings.java | 432 +++++ .../v1/ExpressKeySettingsOrBuilder.java | 25 + .../v1/IpOverrideData.java | 989 +++++++++++ .../v1/IpOverrideDataOrBuilder.java | 96 ++ .../google/recaptchaenterprise/v1/Key.java | 394 ++++- .../recaptchaenterprise/v1/KeyOrBuilder.java | 45 +- .../v1/MigrateKeyRequest.java | 16 +- .../v1/MigrateKeyRequestOrBuilder.java | 4 +- .../v1/RecaptchaEnterpriseProto.java | 591 ++++--- .../v1/RelatedAccountGroupMembership.java | 8 +- ...elatedAccountGroupMembershipOrBuilder.java | 2 +- ...RelatedAccountGroupMembershipsRequest.java | 8 +- ...countGroupMembershipsRequestOrBuilder.java | 2 +- .../recaptchaenterprise/v1/WafSettings.java | 2 +- .../v1/recaptchaenterprise.proto | 75 +- .../addipoverride/AsyncAddIpOverride.java | 53 + .../addipoverride/SyncAddIpOverride.java | 40 +- ...yncAddIpOverrideKeynameIpoverridedata.java | 46 + ...SyncAddIpOverrideStringIpoverridedata.java | 46 + .../google/shopping/css/v1/Certification.java | 90 +- .../css/v1/CertificationOrBuilder.java | 24 +- .../shopping/css/v1/css_product_common.proto | 15 +- 90 files changed, 9219 insertions(+), 3938 deletions(-) create mode 100644 java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlClient.java rename java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/{GatewayServiceSettings.java => GatewayControlSettings.java} (54%) delete mode 100644 java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceClient.java rename java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/{GatewayServiceStub.java => GatewayControlStub.java} (55%) rename java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/{GatewayServiceStubSettings.java => GatewayControlStubSettings.java} (55%) rename java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/{GrpcGatewayServiceCallableFactory.java => GrpcGatewayControlCallableFactory.java} (97%) create mode 100644 java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayControlStub.java delete mode 100644 java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayServiceStub.java create mode 100644 java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlClientTest.java delete mode 100644 java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceClientTest.java rename java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/{MockGatewayService.java => MockGatewayControl.java} (88%) create mode 100644 java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayControlImpl.java delete mode 100644 java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayServiceImpl.java create mode 100644 java-gke-connect-gateway/grpc-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlGrpc.java delete mode 100644 java-gke-connect-gateway/grpc-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceGrpc.java create mode 100644 java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/ControlProto.java delete mode 100644 java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayProto.java create mode 100644 java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsRequest.java create mode 100644 java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsRequestOrBuilder.java create mode 100644 java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsResponse.java create mode 100644 java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsResponseOrBuilder.java create mode 100644 java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/proto/google/cloud/gkeconnect/gateway/v1beta1/control.proto delete mode 100644 java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/proto/google/cloud/gkeconnect/gateway/v1beta1/gateway.proto rename java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/{gatewayservice => gatewaycontrol}/create/SyncCreateSetCredentialsProvider.java (77%) rename java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/{gatewayservice => gatewaycontrol}/create/SyncCreateSetEndpoint.java (73%) rename java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/{gatewayservice/patchresource/AsyncPatchResource.java => gatewaycontrol/generatecredentials/AsyncGenerateCredentials.java} (52%) rename java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/{gatewayservice/deleteresource/SyncDeleteResource.java => gatewaycontrol/generatecredentials/SyncGenerateCredentials.java} (53%) rename java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/{gatewayservicesettings/getresource/SyncGetResource.java => gatewaycontrolsettings/generatecredentials/SyncGenerateCredentials.java} (64%) delete mode 100644 java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/getresource/AsyncGetResource.java delete mode 100644 java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/getresource/SyncGetResource.java delete mode 100644 java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/patchresource/SyncPatchResource.java delete mode 100644 java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/postresource/AsyncPostResource.java delete mode 100644 java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/postresource/SyncPostResource.java delete mode 100644 java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/putresource/AsyncPutResource.java delete mode 100644 java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/putresource/SyncPutResource.java rename java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/{gatewayservicestubsettings/getresource/SyncGetResource.java => gatewaycontrolstubsettings/generatecredentials/SyncGenerateCredentials.java} (63%) create mode 100644 java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideRequest.java create mode 100644 java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideRequestOrBuilder.java create mode 100644 java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideResponse.java create mode 100644 java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideResponseOrBuilder.java create mode 100644 java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ExpressKeySettings.java create mode 100644 java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ExpressKeySettingsOrBuilder.java create mode 100644 java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IpOverrideData.java create mode 100644 java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IpOverrideDataOrBuilder.java create mode 100644 java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/AsyncAddIpOverride.java rename java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/deleteresource/AsyncDeleteResource.java => java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverride.java (50%) create mode 100644 java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverrideKeynameIpoverridedata.java create mode 100644 java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverrideStringIpoverridedata.java diff --git a/generation_config.yaml b/generation_config.yaml index 53768db9ae72..1c89f1030f34 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.44.0 -googleapis_commitish: b678386866ca6ee40c84c9043beb70992309343e +googleapis_commitish: 54d659d0ae74f39e92755948b821a1495b3cb3c8 libraries_bom_version: 26.44.0 # the libraries are ordered with respect to library name, which is diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java index 0ec564f685bc..ce3b0522e85a 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java @@ -5193,8 +5193,10 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { * * *
-   * Normally, a non-zero exit status causes the Task to fail. This flag allows
-   * execution of other Runnables to continue instead.
+   * Normally, a runnable that returns a non-zero exit status fails and causes
+   * the task to fail. However, you can set this field to `true` to allow the
+   * task to continue executing its other runnables even if this runnable
+   * fails.
    * 
* * bool ignore_exit_status = 3; @@ -5212,9 +5214,18 @@ public boolean getIgnoreExitStatus() { * * *
-   * This flag allows a Runnable to continue running in the background while the
-   * Task executes subsequent Runnables. This is useful to provide services to
-   * other Runnables (or to provide debugging support tools like SSH servers).
+   * Normally, a runnable that doesn't exit causes its task to fail. However,
+   * you can set this field to `true` to configure a background runnable.
+   * Background runnables are allowed continue running in the background while
+   * the task executes subsequent runnables. For example, background runnables
+   * are useful for providing services to other runnables or providing
+   * debugging-support tools like SSH servers.
+   *
+   * Specifically, background runnables are killed automatically (if they have
+   * not already exited) a short time after all foreground runnables have
+   * completed. Even though this is likely to result in a non-zero exit status
+   * for the background runnable, these automatic kills are not treated as task
+   * failures.
    * 
* * bool background = 4; @@ -6876,8 +6887,10 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Normally, a non-zero exit status causes the Task to fail. This flag allows
-     * execution of other Runnables to continue instead.
+     * Normally, a runnable that returns a non-zero exit status fails and causes
+     * the task to fail. However, you can set this field to `true` to allow the
+     * task to continue executing its other runnables even if this runnable
+     * fails.
      * 
* * bool ignore_exit_status = 3; @@ -6892,8 +6905,10 @@ public boolean getIgnoreExitStatus() { * * *
-     * Normally, a non-zero exit status causes the Task to fail. This flag allows
-     * execution of other Runnables to continue instead.
+     * Normally, a runnable that returns a non-zero exit status fails and causes
+     * the task to fail. However, you can set this field to `true` to allow the
+     * task to continue executing its other runnables even if this runnable
+     * fails.
      * 
* * bool ignore_exit_status = 3; @@ -6912,8 +6927,10 @@ public Builder setIgnoreExitStatus(boolean value) { * * *
-     * Normally, a non-zero exit status causes the Task to fail. This flag allows
-     * execution of other Runnables to continue instead.
+     * Normally, a runnable that returns a non-zero exit status fails and causes
+     * the task to fail. However, you can set this field to `true` to allow the
+     * task to continue executing its other runnables even if this runnable
+     * fails.
      * 
* * bool ignore_exit_status = 3; @@ -6932,9 +6949,18 @@ public Builder clearIgnoreExitStatus() { * * *
-     * This flag allows a Runnable to continue running in the background while the
-     * Task executes subsequent Runnables. This is useful to provide services to
-     * other Runnables (or to provide debugging support tools like SSH servers).
+     * Normally, a runnable that doesn't exit causes its task to fail. However,
+     * you can set this field to `true` to configure a background runnable.
+     * Background runnables are allowed continue running in the background while
+     * the task executes subsequent runnables. For example, background runnables
+     * are useful for providing services to other runnables or providing
+     * debugging-support tools like SSH servers.
+     *
+     * Specifically, background runnables are killed automatically (if they have
+     * not already exited) a short time after all foreground runnables have
+     * completed. Even though this is likely to result in a non-zero exit status
+     * for the background runnable, these automatic kills are not treated as task
+     * failures.
      * 
* * bool background = 4; @@ -6949,9 +6975,18 @@ public boolean getBackground() { * * *
-     * This flag allows a Runnable to continue running in the background while the
-     * Task executes subsequent Runnables. This is useful to provide services to
-     * other Runnables (or to provide debugging support tools like SSH servers).
+     * Normally, a runnable that doesn't exit causes its task to fail. However,
+     * you can set this field to `true` to configure a background runnable.
+     * Background runnables are allowed continue running in the background while
+     * the task executes subsequent runnables. For example, background runnables
+     * are useful for providing services to other runnables or providing
+     * debugging-support tools like SSH servers.
+     *
+     * Specifically, background runnables are killed automatically (if they have
+     * not already exited) a short time after all foreground runnables have
+     * completed. Even though this is likely to result in a non-zero exit status
+     * for the background runnable, these automatic kills are not treated as task
+     * failures.
      * 
* * bool background = 4; @@ -6970,9 +7005,18 @@ public Builder setBackground(boolean value) { * * *
-     * This flag allows a Runnable to continue running in the background while the
-     * Task executes subsequent Runnables. This is useful to provide services to
-     * other Runnables (or to provide debugging support tools like SSH servers).
+     * Normally, a runnable that doesn't exit causes its task to fail. However,
+     * you can set this field to `true` to configure a background runnable.
+     * Background runnables are allowed continue running in the background while
+     * the task executes subsequent runnables. For example, background runnables
+     * are useful for providing services to other runnables or providing
+     * debugging-support tools like SSH servers.
+     *
+     * Specifically, background runnables are killed automatically (if they have
+     * not already exited) a short time after all foreground runnables have
+     * completed. Even though this is likely to result in a non-zero exit status
+     * for the background runnable, these automatic kills are not treated as task
+     * failures.
      * 
* * bool background = 4; diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/RunnableOrBuilder.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/RunnableOrBuilder.java index 60832a170c52..e294bd4d8850 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/RunnableOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/RunnableOrBuilder.java @@ -164,8 +164,10 @@ public interface RunnableOrBuilder * * *
-   * Normally, a non-zero exit status causes the Task to fail. This flag allows
-   * execution of other Runnables to continue instead.
+   * Normally, a runnable that returns a non-zero exit status fails and causes
+   * the task to fail. However, you can set this field to `true` to allow the
+   * task to continue executing its other runnables even if this runnable
+   * fails.
    * 
* * bool ignore_exit_status = 3; @@ -178,9 +180,18 @@ public interface RunnableOrBuilder * * *
-   * This flag allows a Runnable to continue running in the background while the
-   * Task executes subsequent Runnables. This is useful to provide services to
-   * other Runnables (or to provide debugging support tools like SSH servers).
+   * Normally, a runnable that doesn't exit causes its task to fail. However,
+   * you can set this field to `true` to configure a background runnable.
+   * Background runnables are allowed continue running in the background while
+   * the task executes subsequent runnables. For example, background runnables
+   * are useful for providing services to other runnables or providing
+   * debugging-support tools like SSH servers.
+   *
+   * Specifically, background runnables are killed automatically (if they have
+   * not already exited) a short time after all foreground runnables have
+   * completed. Even though this is likely to result in a non-zero exit status
+   * for the background runnable, these automatic kills are not treated as task
+   * failures.
    * 
* * bool background = 4; diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java index 794a1bffa8f0..ca4541d239fb 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java @@ -89,15 +89,13 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldRefl * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -113,15 +111,13 @@ public java.util.List getRunnablesList() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -138,15 +134,13 @@ public java.util.List getRunnablesList() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -162,15 +156,13 @@ public int getRunnablesCount() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -186,15 +178,13 @@ public com.google.cloud.batch.v1.Runnable getRunnables(int index) { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1422,15 +1412,13 @@ private void ensureRunnablesIsMutable() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1449,15 +1437,13 @@ public java.util.List getRunnablesList() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1476,15 +1462,13 @@ public int getRunnablesCount() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1503,15 +1487,13 @@ public com.google.cloud.batch.v1.Runnable getRunnables(int index) { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1536,15 +1518,13 @@ public Builder setRunnables(int index, com.google.cloud.batch.v1.Runnable value) * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1567,15 +1547,13 @@ public Builder setRunnables( * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1600,15 +1578,13 @@ public Builder addRunnables(com.google.cloud.batch.v1.Runnable value) { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1633,15 +1609,13 @@ public Builder addRunnables(int index, com.google.cloud.batch.v1.Runnable value) * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1663,15 +1637,13 @@ public Builder addRunnables(com.google.cloud.batch.v1.Runnable.Builder builderFo * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1694,15 +1666,13 @@ public Builder addRunnables( * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1725,15 +1695,13 @@ public Builder addAllRunnables( * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1755,15 +1723,13 @@ public Builder clearRunnables() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1785,15 +1751,13 @@ public Builder removeRunnables(int index) { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1808,15 +1772,13 @@ public com.google.cloud.batch.v1.Runnable.Builder getRunnablesBuilder(int index) * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1835,15 +1797,13 @@ public com.google.cloud.batch.v1.RunnableOrBuilder getRunnablesOrBuilder(int ind * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1863,15 +1823,13 @@ public com.google.cloud.batch.v1.RunnableOrBuilder getRunnablesOrBuilder(int ind * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1887,15 +1845,13 @@ public com.google.cloud.batch.v1.Runnable.Builder addRunnablesBuilder() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -1911,15 +1867,13 @@ public com.google.cloud.batch.v1.Runnable.Builder addRunnablesBuilder(int index) * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java index 67be4a8dc4d4..21417cf34f5f 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java @@ -31,15 +31,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -52,15 +50,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -73,15 +69,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -94,15 +88,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; @@ -115,15 +107,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1.Runnable runnables = 8; diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto b/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto index 5aba9c8a5097..f9edabb2b6a0 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto +++ b/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto @@ -304,13 +304,24 @@ message Runnable { // provided the index of the runnable will be used for outputs. string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; - // Normally, a non-zero exit status causes the Task to fail. This flag allows - // execution of other Runnables to continue instead. + // Normally, a runnable that returns a non-zero exit status fails and causes + // the task to fail. However, you can set this field to `true` to allow the + // task to continue executing its other runnables even if this runnable + // fails. bool ignore_exit_status = 3; - // This flag allows a Runnable to continue running in the background while the - // Task executes subsequent Runnables. This is useful to provide services to - // other Runnables (or to provide debugging support tools like SSH servers). + // Normally, a runnable that doesn't exit causes its task to fail. However, + // you can set this field to `true` to configure a background runnable. + // Background runnables are allowed continue running in the background while + // the task executes subsequent runnables. For example, background runnables + // are useful for providing services to other runnables or providing + // debugging-support tools like SSH servers. + // + // Specifically, background runnables are killed automatically (if they have + // not already exited) a short time after all foreground runnables have + // completed. Even though this is likely to result in a non-zero exit status + // for the background runnable, these automatic kills are not treated as task + // failures. bool background = 4; // By default, after a Runnable fails, no further Runnable are executed. This @@ -339,15 +350,13 @@ message TaskSpec { // Required. The sequence of one or more runnables (executable scripts, // executable containers, and/or barriers) for each task in this task group to // run. Each task runs this list of runnables in order. For a task to succeed, - // all of its script and container runnables each must either exit with a zero - // status or enable the `ignore_exit_status` subfield and exit with any - // status. + // all of its script and container runnables each must meet at least one of + // the following conditions: // - // Background runnables are killed automatically (if they have not already - // exited) a short time after all foreground runnables have completed. Even - // though this is likely to result in a non-zero exit status for the - // background runnable, these automatic kills are not treated as Task - // failures. + // + The runnable exited with a zero status. + // + The runnable didn't finish, but you enabled its `background` subfield. + // + The runnable exited with a non-zero status, but you enabled its + // `ignore_exit_status` subfield. repeated Runnable runnables = 8; // ComputeResource requirements. diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java index a14c6f971a18..aaeeaeb131d2 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java @@ -5196,8 +5196,10 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { * * *
-   * Normally, a non-zero exit status causes the Task to fail. This flag allows
-   * execution of other Runnables to continue instead.
+   * Normally, a runnable that returns a non-zero exit status fails and causes
+   * the task to fail. However, you can set this field to `true` to allow the
+   * task to continue executing its other runnables even if this runnable
+   * fails.
    * 
* * bool ignore_exit_status = 3; @@ -5215,9 +5217,18 @@ public boolean getIgnoreExitStatus() { * * *
-   * This flag allows a Runnable to continue running in the background while the
-   * Task executes subsequent Runnables. This is useful to provide services to
-   * other Runnables (or to provide debugging support tools like SSH servers).
+   * Normally, a runnable that doesn't exit causes its task to fail. However,
+   * you can set this field to `true` to configure a background runnable.
+   * Background runnables are allowed continue running in the background while
+   * the task executes subsequent runnables. For example, background runnables
+   * are useful for providing services to other runnables or providing
+   * debugging-support tools like SSH servers.
+   *
+   * Specifically, background runnables are killed automatically (if they have
+   * not already exited) a short time after all foreground runnables have
+   * completed. Even though this is likely to result in a non-zero exit status
+   * for the background runnable, these automatic kills are not treated as task
+   * failures.
    * 
* * bool background = 4; @@ -6885,8 +6896,10 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Normally, a non-zero exit status causes the Task to fail. This flag allows
-     * execution of other Runnables to continue instead.
+     * Normally, a runnable that returns a non-zero exit status fails and causes
+     * the task to fail. However, you can set this field to `true` to allow the
+     * task to continue executing its other runnables even if this runnable
+     * fails.
      * 
* * bool ignore_exit_status = 3; @@ -6901,8 +6914,10 @@ public boolean getIgnoreExitStatus() { * * *
-     * Normally, a non-zero exit status causes the Task to fail. This flag allows
-     * execution of other Runnables to continue instead.
+     * Normally, a runnable that returns a non-zero exit status fails and causes
+     * the task to fail. However, you can set this field to `true` to allow the
+     * task to continue executing its other runnables even if this runnable
+     * fails.
      * 
* * bool ignore_exit_status = 3; @@ -6921,8 +6936,10 @@ public Builder setIgnoreExitStatus(boolean value) { * * *
-     * Normally, a non-zero exit status causes the Task to fail. This flag allows
-     * execution of other Runnables to continue instead.
+     * Normally, a runnable that returns a non-zero exit status fails and causes
+     * the task to fail. However, you can set this field to `true` to allow the
+     * task to continue executing its other runnables even if this runnable
+     * fails.
      * 
* * bool ignore_exit_status = 3; @@ -6941,9 +6958,18 @@ public Builder clearIgnoreExitStatus() { * * *
-     * This flag allows a Runnable to continue running in the background while the
-     * Task executes subsequent Runnables. This is useful to provide services to
-     * other Runnables (or to provide debugging support tools like SSH servers).
+     * Normally, a runnable that doesn't exit causes its task to fail. However,
+     * you can set this field to `true` to configure a background runnable.
+     * Background runnables are allowed continue running in the background while
+     * the task executes subsequent runnables. For example, background runnables
+     * are useful for providing services to other runnables or providing
+     * debugging-support tools like SSH servers.
+     *
+     * Specifically, background runnables are killed automatically (if they have
+     * not already exited) a short time after all foreground runnables have
+     * completed. Even though this is likely to result in a non-zero exit status
+     * for the background runnable, these automatic kills are not treated as task
+     * failures.
      * 
* * bool background = 4; @@ -6958,9 +6984,18 @@ public boolean getBackground() { * * *
-     * This flag allows a Runnable to continue running in the background while the
-     * Task executes subsequent Runnables. This is useful to provide services to
-     * other Runnables (or to provide debugging support tools like SSH servers).
+     * Normally, a runnable that doesn't exit causes its task to fail. However,
+     * you can set this field to `true` to configure a background runnable.
+     * Background runnables are allowed continue running in the background while
+     * the task executes subsequent runnables. For example, background runnables
+     * are useful for providing services to other runnables or providing
+     * debugging-support tools like SSH servers.
+     *
+     * Specifically, background runnables are killed automatically (if they have
+     * not already exited) a short time after all foreground runnables have
+     * completed. Even though this is likely to result in a non-zero exit status
+     * for the background runnable, these automatic kills are not treated as task
+     * failures.
      * 
* * bool background = 4; @@ -6979,9 +7014,18 @@ public Builder setBackground(boolean value) { * * *
-     * This flag allows a Runnable to continue running in the background while the
-     * Task executes subsequent Runnables. This is useful to provide services to
-     * other Runnables (or to provide debugging support tools like SSH servers).
+     * Normally, a runnable that doesn't exit causes its task to fail. However,
+     * you can set this field to `true` to configure a background runnable.
+     * Background runnables are allowed continue running in the background while
+     * the task executes subsequent runnables. For example, background runnables
+     * are useful for providing services to other runnables or providing
+     * debugging-support tools like SSH servers.
+     *
+     * Specifically, background runnables are killed automatically (if they have
+     * not already exited) a short time after all foreground runnables have
+     * completed. Even though this is likely to result in a non-zero exit status
+     * for the background runnable, these automatic kills are not treated as task
+     * failures.
      * 
* * bool background = 4; diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/RunnableOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/RunnableOrBuilder.java index 0e1b5fbe3372..e0fbf1509775 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/RunnableOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/RunnableOrBuilder.java @@ -164,8 +164,10 @@ public interface RunnableOrBuilder * * *
-   * Normally, a non-zero exit status causes the Task to fail. This flag allows
-   * execution of other Runnables to continue instead.
+   * Normally, a runnable that returns a non-zero exit status fails and causes
+   * the task to fail. However, you can set this field to `true` to allow the
+   * task to continue executing its other runnables even if this runnable
+   * fails.
    * 
* * bool ignore_exit_status = 3; @@ -178,9 +180,18 @@ public interface RunnableOrBuilder * * *
-   * This flag allows a Runnable to continue running in the background while the
-   * Task executes subsequent Runnables. This is useful to provide services to
-   * other Runnables (or to provide debugging support tools like SSH servers).
+   * Normally, a runnable that doesn't exit causes its task to fail. However,
+   * you can set this field to `true` to configure a background runnable.
+   * Background runnables are allowed continue running in the background while
+   * the task executes subsequent runnables. For example, background runnables
+   * are useful for providing services to other runnables or providing
+   * debugging-support tools like SSH servers.
+   *
+   * Specifically, background runnables are killed automatically (if they have
+   * not already exited) a short time after all foreground runnables have
+   * completed. Even though this is likely to result in a non-zero exit status
+   * for the background runnable, these automatic kills are not treated as task
+   * failures.
    * 
* * bool background = 4; diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpec.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpec.java index e020f83540a3..de4bda8eea83 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpec.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpec.java @@ -89,15 +89,13 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldRefl * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -113,15 +111,13 @@ public java.util.List getRunnablesList( * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -138,15 +134,13 @@ public java.util.List getRunnablesList( * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -162,15 +156,13 @@ public int getRunnablesCount() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -186,15 +178,13 @@ public com.google.cloud.batch.v1alpha.Runnable getRunnables(int index) { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1425,15 +1415,13 @@ private void ensureRunnablesIsMutable() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1452,15 +1440,13 @@ public java.util.List getRunnablesList( * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1479,15 +1465,13 @@ public int getRunnablesCount() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1506,15 +1490,13 @@ public com.google.cloud.batch.v1alpha.Runnable getRunnables(int index) { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1539,15 +1521,13 @@ public Builder setRunnables(int index, com.google.cloud.batch.v1alpha.Runnable v * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1570,15 +1550,13 @@ public Builder setRunnables( * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1603,15 +1581,13 @@ public Builder addRunnables(com.google.cloud.batch.v1alpha.Runnable value) { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1636,15 +1612,13 @@ public Builder addRunnables(int index, com.google.cloud.batch.v1alpha.Runnable v * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1666,15 +1640,13 @@ public Builder addRunnables(com.google.cloud.batch.v1alpha.Runnable.Builder buil * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1697,15 +1669,13 @@ public Builder addRunnables( * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1728,15 +1698,13 @@ public Builder addAllRunnables( * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1758,15 +1726,13 @@ public Builder clearRunnables() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1788,15 +1754,13 @@ public Builder removeRunnables(int index) { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1811,15 +1775,13 @@ public com.google.cloud.batch.v1alpha.Runnable.Builder getRunnablesBuilder(int i * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1838,15 +1800,13 @@ public com.google.cloud.batch.v1alpha.RunnableOrBuilder getRunnablesOrBuilder(in * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1866,15 +1826,13 @@ public com.google.cloud.batch.v1alpha.RunnableOrBuilder getRunnablesOrBuilder(in * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1890,15 +1848,13 @@ public com.google.cloud.batch.v1alpha.Runnable.Builder addRunnablesBuilder() { * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. + * all of its script and container runnables each must meet at least one of + * the following conditions: * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -1914,15 +1870,13 @@ public com.google.cloud.batch.v1alpha.Runnable.Builder addRunnablesBuilder(int i * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpecOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpecOrBuilder.java index 4c7b45db83b8..6e10b2e6401e 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpecOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpecOrBuilder.java @@ -31,15 +31,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -52,15 +50,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -73,15 +69,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -94,15 +88,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; @@ -116,15 +108,13 @@ public interface TaskSpecOrBuilder * Required. The sequence of one or more runnables (executable scripts, * executable containers, and/or barriers) for each task in this task group to * run. Each task runs this list of runnables in order. For a task to succeed, - * all of its script and container runnables each must either exit with a zero - * status or enable the `ignore_exit_status` subfield and exit with any - * status. - * - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. + * all of its script and container runnables each must meet at least one of + * the following conditions: + * + * + The runnable exited with a zero status. + * + The runnable didn't finish, but you enabled its `background` subfield. + * + The runnable exited with a non-zero status, but you enabled its + * `ignore_exit_status` subfield. * * * repeated .google.cloud.batch.v1alpha.Runnable runnables = 8; diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/task.proto b/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/task.proto index 073e77e71422..08a20f499dd1 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/task.proto +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/task.proto @@ -323,13 +323,24 @@ message Runnable { // provided the index of the runnable will be used for outputs. string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; - // Normally, a non-zero exit status causes the Task to fail. This flag allows - // execution of other Runnables to continue instead. + // Normally, a runnable that returns a non-zero exit status fails and causes + // the task to fail. However, you can set this field to `true` to allow the + // task to continue executing its other runnables even if this runnable + // fails. bool ignore_exit_status = 3; - // This flag allows a Runnable to continue running in the background while the - // Task executes subsequent Runnables. This is useful to provide services to - // other Runnables (or to provide debugging support tools like SSH servers). + // Normally, a runnable that doesn't exit causes its task to fail. However, + // you can set this field to `true` to configure a background runnable. + // Background runnables are allowed continue running in the background while + // the task executes subsequent runnables. For example, background runnables + // are useful for providing services to other runnables or providing + // debugging-support tools like SSH servers. + // + // Specifically, background runnables are killed automatically (if they have + // not already exited) a short time after all foreground runnables have + // completed. Even though this is likely to result in a non-zero exit status + // for the background runnable, these automatic kills are not treated as task + // failures. bool background = 4; // By default, after a Runnable fails, no further Runnable are executed. This @@ -358,15 +369,13 @@ message TaskSpec { // Required. The sequence of one or more runnables (executable scripts, // executable containers, and/or barriers) for each task in this task group to // run. Each task runs this list of runnables in order. For a task to succeed, - // all of its script and container runnables each must either exit with a zero - // status or enable the `ignore_exit_status` subfield and exit with any - // status. + // all of its script and container runnables each must meet at least one of + // the following conditions: // - // Background runnables are killed automatically (if they have not already - // exited) a short time after all foreground runnables have completed. Even - // though this is likely to result in a non-zero exit status for the - // background runnable, these automatic kills are not treated as Task - // failures. + // + The runnable exited with a zero status. + // + The runnable didn't finish, but you enabled its `background` subfield. + // + The runnable exited with a non-zero status, but you enabled its + // `ignore_exit_status` subfield. repeated Runnable runnables = 8; // ComputeResource requirements. diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlClient.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlClient.java new file mode 100644 index 000000000000..9fb7bb3f77f0 --- /dev/null +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlClient.java @@ -0,0 +1,263 @@ +/* + * Copyright 2024 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.gkeconnect.gateway.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gkeconnect.gateway.v1beta1.stub.GatewayControlStub; +import com.google.cloud.gkeconnect.gateway.v1beta1.stub.GatewayControlStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: GatewayControl is the control plane API for Connect Gateway. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GatewayControlClient gatewayControlClient = GatewayControlClient.create()) {
+ *   GenerateCredentialsRequest request =
+ *       GenerateCredentialsRequest.newBuilder()
+ *           .setName("name3373707")
+ *           .setForceUseAgent(true)
+ *           .setVersion("version351608024")
+ *           .setKubernetesNamespace("kubernetesNamespace-1862862667")
+ *           .build();
+ *   GenerateCredentialsResponse response = gatewayControlClient.generateCredentials(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the GatewayControlClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

GenerateCredentials

GenerateCredentials provides connection information that allows a user to access the specified membership using Connect Gateway.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • generateCredentials(GenerateCredentialsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • generateCredentialsCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of GatewayControlSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * GatewayControlSettings gatewayControlSettings =
+ *     GatewayControlSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * GatewayControlClient gatewayControlClient = GatewayControlClient.create(gatewayControlSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * GatewayControlSettings gatewayControlSettings =
+ *     GatewayControlSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * GatewayControlClient gatewayControlClient = GatewayControlClient.create(gatewayControlSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GatewayControlClient implements BackgroundResource { + private final GatewayControlSettings settings; + private final GatewayControlStub stub; + + /** Constructs an instance of GatewayControlClient with default settings. */ + public static final GatewayControlClient create() throws IOException { + return create(GatewayControlSettings.newBuilder().build()); + } + + /** + * Constructs an instance of GatewayControlClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final GatewayControlClient create(GatewayControlSettings settings) + throws IOException { + return new GatewayControlClient(settings); + } + + /** + * Constructs an instance of GatewayControlClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(GatewayControlSettings). + */ + public static final GatewayControlClient create(GatewayControlStub stub) { + return new GatewayControlClient(stub); + } + + /** + * Constructs an instance of GatewayControlClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GatewayControlClient(GatewayControlSettings settings) throws IOException { + this.settings = settings; + this.stub = ((GatewayControlStubSettings) settings.getStubSettings()).createStub(); + } + + protected GatewayControlClient(GatewayControlStub stub) { + this.settings = null; + this.stub = stub; + } + + public final GatewayControlSettings getSettings() { + return settings; + } + + public GatewayControlStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * GenerateCredentials provides connection information that allows a user to access the specified + * membership using Connect Gateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (GatewayControlClient gatewayControlClient = GatewayControlClient.create()) {
+   *   GenerateCredentialsRequest request =
+   *       GenerateCredentialsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setForceUseAgent(true)
+   *           .setVersion("version351608024")
+   *           .setKubernetesNamespace("kubernetesNamespace-1862862667")
+   *           .build();
+   *   GenerateCredentialsResponse response = gatewayControlClient.generateCredentials(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateCredentialsResponse generateCredentials(GenerateCredentialsRequest request) { + return generateCredentialsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * GenerateCredentials provides connection information that allows a user to access the specified + * membership using Connect Gateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (GatewayControlClient gatewayControlClient = GatewayControlClient.create()) {
+   *   GenerateCredentialsRequest request =
+   *       GenerateCredentialsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setForceUseAgent(true)
+   *           .setVersion("version351608024")
+   *           .setKubernetesNamespace("kubernetesNamespace-1862862667")
+   *           .build();
+   *   ApiFuture future =
+   *       gatewayControlClient.generateCredentialsCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateCredentialsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateCredentialsCallable() { + return stub.generateCredentialsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceSettings.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlSettings.java similarity index 54% rename from java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceSettings.java rename to java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlSettings.java index e94aec6ec611..7bb420c61920 100644 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceSettings.java +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlSettings.java @@ -16,7 +16,6 @@ package com.google.cloud.gkeconnect.gateway.v1beta1; -import com.google.api.HttpBody; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; @@ -27,14 +26,14 @@ import com.google.api.gax.rpc.ClientSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.gkeconnect.gateway.v1beta1.stub.GatewayServiceStubSettings; +import com.google.cloud.gkeconnect.gateway.v1beta1.stub.GatewayControlStubSettings; import java.io.IOException; import java.util.List; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Settings class to configure an instance of {@link GatewayServiceClient}. + * Settings class to configure an instance of {@link GatewayControlClient}. * *

The default instance has everything set to sensible defaults: * @@ -48,7 +47,7 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of getResource to 30 seconds: + *

For example, to set the total timeout of generateCredentials to 30 seconds: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -56,85 +55,66 @@
  * // - It may require correct/in-range values for request initialization.
  * // - It may require specifying regional endpoints when creating the service client as shown in
  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * GatewayServiceSettings.Builder gatewayServiceSettingsBuilder =
- *     GatewayServiceSettings.newBuilder();
- * gatewayServiceSettingsBuilder
- *     .getResourceSettings()
+ * GatewayControlSettings.Builder gatewayControlSettingsBuilder =
+ *     GatewayControlSettings.newBuilder();
+ * gatewayControlSettingsBuilder
+ *     .generateCredentialsSettings()
  *     .setRetrySettings(
- *         gatewayServiceSettingsBuilder
- *             .getResourceSettings()
+ *         gatewayControlSettingsBuilder
+ *             .generateCredentialsSettings()
  *             .getRetrySettings()
  *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * GatewayServiceSettings gatewayServiceSettings = gatewayServiceSettingsBuilder.build();
+ * GatewayControlSettings gatewayControlSettings = gatewayControlSettingsBuilder.build();
  * }
*/ @BetaApi @Generated("by gapic-generator-java") -public class GatewayServiceSettings extends ClientSettings { +public class GatewayControlSettings extends ClientSettings { - /** Returns the object with the settings used for calls to getResource. */ - public UnaryCallSettings getResourceSettings() { - return ((GatewayServiceStubSettings) getStubSettings()).getResourceSettings(); + /** Returns the object with the settings used for calls to generateCredentials. */ + public UnaryCallSettings + generateCredentialsSettings() { + return ((GatewayControlStubSettings) getStubSettings()).generateCredentialsSettings(); } - /** Returns the object with the settings used for calls to postResource. */ - public UnaryCallSettings postResourceSettings() { - return ((GatewayServiceStubSettings) getStubSettings()).postResourceSettings(); - } - - /** Returns the object with the settings used for calls to deleteResource. */ - public UnaryCallSettings deleteResourceSettings() { - return ((GatewayServiceStubSettings) getStubSettings()).deleteResourceSettings(); - } - - /** Returns the object with the settings used for calls to putResource. */ - public UnaryCallSettings putResourceSettings() { - return ((GatewayServiceStubSettings) getStubSettings()).putResourceSettings(); - } - - /** Returns the object with the settings used for calls to patchResource. */ - public UnaryCallSettings patchResourceSettings() { - return ((GatewayServiceStubSettings) getStubSettings()).patchResourceSettings(); - } - - public static final GatewayServiceSettings create(GatewayServiceStubSettings stub) + public static final GatewayControlSettings create(GatewayControlStubSettings stub) throws IOException { - return new GatewayServiceSettings.Builder(stub.toBuilder()).build(); + return new GatewayControlSettings.Builder(stub.toBuilder()).build(); } /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return GatewayServiceStubSettings.defaultExecutorProviderBuilder(); + return GatewayControlStubSettings.defaultExecutorProviderBuilder(); } /** Returns the default service endpoint. */ public static String getDefaultEndpoint() { - return GatewayServiceStubSettings.getDefaultEndpoint(); + return GatewayControlStubSettings.getDefaultEndpoint(); } /** Returns the default service scopes. */ public static List getDefaultServiceScopes() { - return GatewayServiceStubSettings.getDefaultServiceScopes(); + return GatewayControlStubSettings.getDefaultServiceScopes(); } /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GatewayServiceStubSettings.defaultCredentialsProviderBuilder(); + return GatewayControlStubSettings.defaultCredentialsProviderBuilder(); } /** Returns a builder for the default ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return GatewayServiceStubSettings.defaultGrpcTransportProviderBuilder(); + return GatewayControlStubSettings.defaultGrpcTransportProviderBuilder(); } public static TransportChannelProvider defaultTransportChannelProvider() { - return GatewayServiceStubSettings.defaultTransportChannelProvider(); + return GatewayControlStubSettings.defaultTransportChannelProvider(); } public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return GatewayServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + return GatewayControlStubSettings.defaultApiClientHeaderProviderBuilder(); } /** Returns a new builder for this class. */ @@ -152,35 +132,35 @@ public Builder toBuilder() { return new Builder(this); } - protected GatewayServiceSettings(Builder settingsBuilder) throws IOException { + protected GatewayControlSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); } - /** Builder for GatewayServiceSettings. */ - public static class Builder extends ClientSettings.Builder { + /** Builder for GatewayControlSettings. */ + public static class Builder extends ClientSettings.Builder { protected Builder() throws IOException { this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { - super(GatewayServiceStubSettings.newBuilder(clientContext)); + super(GatewayControlStubSettings.newBuilder(clientContext)); } - protected Builder(GatewayServiceSettings settings) { + protected Builder(GatewayControlSettings settings) { super(settings.getStubSettings().toBuilder()); } - protected Builder(GatewayServiceStubSettings.Builder stubSettings) { + protected Builder(GatewayControlStubSettings.Builder stubSettings) { super(stubSettings); } private static Builder createDefault() { - return new Builder(GatewayServiceStubSettings.newBuilder()); + return new Builder(GatewayControlStubSettings.newBuilder()); } - public GatewayServiceStubSettings.Builder getStubSettingsBuilder() { - return ((GatewayServiceStubSettings.Builder) getStubSettings()); + public GatewayControlStubSettings.Builder getStubSettingsBuilder() { + return ((GatewayControlStubSettings.Builder) getStubSettings()); } /** @@ -195,34 +175,15 @@ public Builder applyToAllUnaryMethods( return this; } - /** Returns the builder for the settings used for calls to getResource. */ - public UnaryCallSettings.Builder getResourceSettings() { - return getStubSettingsBuilder().getResourceSettings(); - } - - /** Returns the builder for the settings used for calls to postResource. */ - public UnaryCallSettings.Builder postResourceSettings() { - return getStubSettingsBuilder().postResourceSettings(); - } - - /** Returns the builder for the settings used for calls to deleteResource. */ - public UnaryCallSettings.Builder deleteResourceSettings() { - return getStubSettingsBuilder().deleteResourceSettings(); - } - - /** Returns the builder for the settings used for calls to putResource. */ - public UnaryCallSettings.Builder putResourceSettings() { - return getStubSettingsBuilder().putResourceSettings(); - } - - /** Returns the builder for the settings used for calls to patchResource. */ - public UnaryCallSettings.Builder patchResourceSettings() { - return getStubSettingsBuilder().patchResourceSettings(); + /** Returns the builder for the settings used for calls to generateCredentials. */ + public UnaryCallSettings.Builder + generateCredentialsSettings() { + return getStubSettingsBuilder().generateCredentialsSettings(); } @Override - public GatewayServiceSettings build() throws IOException { - return new GatewayServiceSettings(this); + public GatewayControlSettings build() throws IOException { + return new GatewayControlSettings(this); } } } diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceClient.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceClient.java deleted file mode 100644 index ba29d847ab8c..000000000000 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceClient.java +++ /dev/null @@ -1,553 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1; - -import com.google.api.HttpBody; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.gkeconnect.gateway.v1beta1.stub.GatewayServiceStub; -import com.google.cloud.gkeconnect.gateway.v1beta1.stub.GatewayServiceStubSettings; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: Gateway service is a public API which works as a Kubernetes resource model - * proxy between end users and registered Kubernetes clusters. Each RPC in this service matches with - * an HTTP verb. End user will initiate kubectl commands against the Gateway service, and Gateway - * service will forward user requests to clusters. - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
- *   HttpBody request =
- *       HttpBody.newBuilder()
- *           .setContentType("contentType-389131437")
- *           .setData(ByteString.EMPTY)
- *           .addAllExtensions(new ArrayList())
- *           .build();
- *   HttpBody response = gatewayServiceClient.getResource(request);
- * }
- * }
- * - *

Note: close() needs to be called on the GatewayServiceClient object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls close(). - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Methods
MethodDescriptionMethod Variants

GetResource

GetResource performs an HTTP GET request on the Kubernetes API Server.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • getResource(HttpBody request) - *

- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • getResourceCallable() - *

- *

PostResource

PostResource performs an HTTP POST on the Kubernetes API Server.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • postResource(HttpBody request) - *

- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • postResourceCallable() - *

- *

DeleteResource

DeleteResource performs an HTTP DELETE on the Kubernetes API Server.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • deleteResource(HttpBody request) - *

- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • deleteResourceCallable() - *

- *

PutResource

PutResource performs an HTTP PUT on the Kubernetes API Server.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • putResource(HttpBody request) - *

- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • putResourceCallable() - *

- *

PatchResource

PatchResource performs an HTTP PATCH on the Kubernetes API Server.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • patchResource(HttpBody request) - *

- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • patchResourceCallable() - *

- *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *

This class can be customized by passing in a custom instance of GatewayServiceSettings to - * create(). For example: - * - *

To customize credentials: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * GatewayServiceSettings gatewayServiceSettings =
- *     GatewayServiceSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create(gatewayServiceSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * GatewayServiceSettings gatewayServiceSettings =
- *     GatewayServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create(gatewayServiceSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GatewayServiceClient implements BackgroundResource { - private final GatewayServiceSettings settings; - private final GatewayServiceStub stub; - - /** Constructs an instance of GatewayServiceClient with default settings. */ - public static final GatewayServiceClient create() throws IOException { - return create(GatewayServiceSettings.newBuilder().build()); - } - - /** - * Constructs an instance of GatewayServiceClient, using the given settings. The channels are - * created based on the settings passed in, or defaults for any settings that are not set. - */ - public static final GatewayServiceClient create(GatewayServiceSettings settings) - throws IOException { - return new GatewayServiceClient(settings); - } - - /** - * Constructs an instance of GatewayServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer using create(GatewayServiceSettings). - */ - public static final GatewayServiceClient create(GatewayServiceStub stub) { - return new GatewayServiceClient(stub); - } - - /** - * Constructs an instance of GatewayServiceClient, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected GatewayServiceClient(GatewayServiceSettings settings) throws IOException { - this.settings = settings; - this.stub = ((GatewayServiceStubSettings) settings.getStubSettings()).createStub(); - } - - protected GatewayServiceClient(GatewayServiceStub stub) { - this.settings = null; - this.stub = stub; - } - - public final GatewayServiceSettings getSettings() { - return settings; - } - - public GatewayServiceStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * GetResource performs an HTTP GET request on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   HttpBody response = gatewayServiceClient.getResource(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HttpBody getResource(HttpBody request) { - return getResourceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * GetResource performs an HTTP GET request on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   ApiFuture future = gatewayServiceClient.getResourceCallable().futureCall(request);
-   *   // Do something.
-   *   HttpBody response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getResourceCallable() { - return stub.getResourceCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * PostResource performs an HTTP POST on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   HttpBody response = gatewayServiceClient.postResource(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HttpBody postResource(HttpBody request) { - return postResourceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * PostResource performs an HTTP POST on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   ApiFuture future = gatewayServiceClient.postResourceCallable().futureCall(request);
-   *   // Do something.
-   *   HttpBody response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable postResourceCallable() { - return stub.postResourceCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * DeleteResource performs an HTTP DELETE on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   HttpBody response = gatewayServiceClient.deleteResource(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HttpBody deleteResource(HttpBody request) { - return deleteResourceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * DeleteResource performs an HTTP DELETE on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   ApiFuture future =
-   *       gatewayServiceClient.deleteResourceCallable().futureCall(request);
-   *   // Do something.
-   *   HttpBody response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteResourceCallable() { - return stub.deleteResourceCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * PutResource performs an HTTP PUT on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   HttpBody response = gatewayServiceClient.putResource(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HttpBody putResource(HttpBody request) { - return putResourceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * PutResource performs an HTTP PUT on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   ApiFuture future = gatewayServiceClient.putResourceCallable().futureCall(request);
-   *   // Do something.
-   *   HttpBody response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable putResourceCallable() { - return stub.putResourceCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * PatchResource performs an HTTP PATCH on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   HttpBody response = gatewayServiceClient.patchResource(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final HttpBody patchResource(HttpBody request) { - return patchResourceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * PatchResource performs an HTTP PATCH on the Kubernetes API Server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
-   *   HttpBody request =
-   *       HttpBody.newBuilder()
-   *           .setContentType("contentType-389131437")
-   *           .setData(ByteString.EMPTY)
-   *           .addAllExtensions(new ArrayList())
-   *           .build();
-   *   ApiFuture future = gatewayServiceClient.patchResourceCallable().futureCall(request);
-   *   // Do something.
-   *   HttpBody response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable patchResourceCallable() { - return stub.patchResourceCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } -} diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/gapic_metadata.json b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/gapic_metadata.json index 3bde4f0288e6..83add4560b83 100644 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/gapic_metadata.json +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/gapic_metadata.json @@ -5,25 +5,13 @@ "protoPackage": "google.cloud.gkeconnect.gateway.v1beta1", "libraryPackage": "com.google.cloud.gkeconnect.gateway.v1beta1", "services": { - "GatewayService": { + "GatewayControl": { "clients": { "grpc": { - "libraryClient": "GatewayServiceClient", + "libraryClient": "GatewayControlClient", "rpcs": { - "DeleteResource": { - "methods": ["deleteResource", "deleteResourceCallable"] - }, - "GetResource": { - "methods": ["getResource", "getResourceCallable"] - }, - "PatchResource": { - "methods": ["patchResource", "patchResourceCallable"] - }, - "PostResource": { - "methods": ["postResource", "postResourceCallable"] - }, - "PutResource": { - "methods": ["putResource", "putResourceCallable"] + "GenerateCredentials": { + "methods": ["generateCredentials", "generateCredentialsCallable"] } } } diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/package-info.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/package-info.java index 71878fd01fc2..16786e03a9c7 100644 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/package-info.java +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/package-info.java @@ -19,14 +19,11 @@ * *

The interfaces provided are listed below, along with usage samples. * - *

======================= GatewayServiceClient ======================= + *

======================= GatewayControlClient ======================= * - *

Service Description: Gateway service is a public API which works as a Kubernetes resource - * model proxy between end users and registered Kubernetes clusters. Each RPC in this service - * matches with an HTTP verb. End user will initiate kubectl commands against the Gateway service, - * and Gateway service will forward user requests to clusters. + *

Service Description: GatewayControl is the control plane API for Connect Gateway. * - *

Sample for GatewayServiceClient: + *

Sample for GatewayControlClient: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -34,14 +31,15 @@
  * // - It may require correct/in-range values for request initialization.
  * // - It may require specifying regional endpoints when creating the service client as shown in
  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
- *   HttpBody request =
- *       HttpBody.newBuilder()
- *           .setContentType("contentType-389131437")
- *           .setData(ByteString.EMPTY)
- *           .addAllExtensions(new ArrayList())
+ * try (GatewayControlClient gatewayControlClient = GatewayControlClient.create()) {
+ *   GenerateCredentialsRequest request =
+ *       GenerateCredentialsRequest.newBuilder()
+ *           .setName("name3373707")
+ *           .setForceUseAgent(true)
+ *           .setVersion("version351608024")
+ *           .setKubernetesNamespace("kubernetesNamespace-1862862667")
  *           .build();
- *   HttpBody response = gatewayServiceClient.getResource(request);
+ *   GenerateCredentialsResponse response = gatewayControlClient.generateCredentials(request);
  * }
  * }
*/ diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayServiceStub.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayControlStub.java similarity index 55% rename from java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayServiceStub.java rename to java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayControlStub.java index 0ed62ceb76f1..be146b4eaef5 100644 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayServiceStub.java +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayControlStub.java @@ -16,40 +16,26 @@ package com.google.cloud.gkeconnect.gateway.v1beta1.stub; -import com.google.api.HttpBody; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for the GatewayService service API. + * Base stub class for the GatewayControl service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @BetaApi @Generated("by gapic-generator-java") -public abstract class GatewayServiceStub implements BackgroundResource { +public abstract class GatewayControlStub implements BackgroundResource { - public UnaryCallable getResourceCallable() { - throw new UnsupportedOperationException("Not implemented: getResourceCallable()"); - } - - public UnaryCallable postResourceCallable() { - throw new UnsupportedOperationException("Not implemented: postResourceCallable()"); - } - - public UnaryCallable deleteResourceCallable() { - throw new UnsupportedOperationException("Not implemented: deleteResourceCallable()"); - } - - public UnaryCallable putResourceCallable() { - throw new UnsupportedOperationException("Not implemented: putResourceCallable()"); - } - - public UnaryCallable patchResourceCallable() { - throw new UnsupportedOperationException("Not implemented: patchResourceCallable()"); + public UnaryCallable + generateCredentialsCallable() { + throw new UnsupportedOperationException("Not implemented: generateCredentialsCallable()"); } @Override diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayServiceStubSettings.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayControlStubSettings.java similarity index 55% rename from java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayServiceStubSettings.java rename to java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayControlStubSettings.java index ca38dfc08dd8..3a1a1fc650b6 100644 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayServiceStubSettings.java +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GatewayControlStubSettings.java @@ -16,7 +16,6 @@ package com.google.cloud.gkeconnect.gateway.v1beta1.stub; -import com.google.api.HttpBody; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.core.ObsoleteApi; @@ -33,6 +32,8 @@ import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -40,10 +41,11 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; +import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Settings class to configure an instance of {@link GatewayServiceStub}. + * Settings class to configure an instance of {@link GatewayControlStub}. * *

The default instance has everything set to sensible defaults: * @@ -57,7 +59,7 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of getResource to 30 seconds: + *

For example, to set the total timeout of generateCredentials to 30 seconds: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -65,63 +67,41 @@
  * // - It may require correct/in-range values for request initialization.
  * // - It may require specifying regional endpoints when creating the service client as shown in
  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * GatewayServiceStubSettings.Builder gatewayServiceSettingsBuilder =
- *     GatewayServiceStubSettings.newBuilder();
- * gatewayServiceSettingsBuilder
- *     .getResourceSettings()
+ * GatewayControlStubSettings.Builder gatewayControlSettingsBuilder =
+ *     GatewayControlStubSettings.newBuilder();
+ * gatewayControlSettingsBuilder
+ *     .generateCredentialsSettings()
  *     .setRetrySettings(
- *         gatewayServiceSettingsBuilder
- *             .getResourceSettings()
+ *         gatewayControlSettingsBuilder
+ *             .generateCredentialsSettings()
  *             .getRetrySettings()
  *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * GatewayServiceStubSettings gatewayServiceSettings = gatewayServiceSettingsBuilder.build();
+ * GatewayControlStubSettings gatewayControlSettings = gatewayControlSettingsBuilder.build();
  * }
*/ @BetaApi @Generated("by gapic-generator-java") -public class GatewayServiceStubSettings extends StubSettings { +public class GatewayControlStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - private final UnaryCallSettings getResourceSettings; - private final UnaryCallSettings postResourceSettings; - private final UnaryCallSettings deleteResourceSettings; - private final UnaryCallSettings putResourceSettings; - private final UnaryCallSettings patchResourceSettings; + private final UnaryCallSettings + generateCredentialsSettings; - /** Returns the object with the settings used for calls to getResource. */ - public UnaryCallSettings getResourceSettings() { - return getResourceSettings; + /** Returns the object with the settings used for calls to generateCredentials. */ + public UnaryCallSettings + generateCredentialsSettings() { + return generateCredentialsSettings; } - /** Returns the object with the settings used for calls to postResource. */ - public UnaryCallSettings postResourceSettings() { - return postResourceSettings; - } - - /** Returns the object with the settings used for calls to deleteResource. */ - public UnaryCallSettings deleteResourceSettings() { - return deleteResourceSettings; - } - - /** Returns the object with the settings used for calls to putResource. */ - public UnaryCallSettings putResourceSettings() { - return putResourceSettings; - } - - /** Returns the object with the settings used for calls to patchResource. */ - public UnaryCallSettings patchResourceSettings() { - return patchResourceSettings; - } - - public GatewayServiceStub createStub() throws IOException { + public GatewayControlStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcGatewayServiceStub.create(this); + return GrpcGatewayControlStub.create(this); } throw new UnsupportedOperationException( String.format( @@ -175,7 +155,7 @@ public static TransportChannelProvider defaultTransportChannelProvider() { public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(GatewayServiceStubSettings.class)) + "gapic", GaxProperties.getLibraryVersion(GatewayControlStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } @@ -195,31 +175,26 @@ public Builder toBuilder() { return new Builder(this); } - protected GatewayServiceStubSettings(Builder settingsBuilder) throws IOException { + protected GatewayControlStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); - getResourceSettings = settingsBuilder.getResourceSettings().build(); - postResourceSettings = settingsBuilder.postResourceSettings().build(); - deleteResourceSettings = settingsBuilder.deleteResourceSettings().build(); - putResourceSettings = settingsBuilder.putResourceSettings().build(); - patchResourceSettings = settingsBuilder.patchResourceSettings().build(); + generateCredentialsSettings = settingsBuilder.generateCredentialsSettings().build(); } - /** Builder for GatewayServiceStubSettings. */ - public static class Builder extends StubSettings.Builder { + /** Builder for GatewayControlStubSettings. */ + public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder getResourceSettings; - private final UnaryCallSettings.Builder postResourceSettings; - private final UnaryCallSettings.Builder deleteResourceSettings; - private final UnaryCallSettings.Builder putResourceSettings; - private final UnaryCallSettings.Builder patchResourceSettings; + private final UnaryCallSettings.Builder + generateCredentialsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; static { ImmutableMap.Builder> definitions = ImmutableMap.builder(); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -228,8 +203,17 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -240,38 +224,20 @@ protected Builder() { protected Builder(ClientContext clientContext) { super(clientContext); - getResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - postResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - putResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - patchResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + generateCredentialsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = - ImmutableList.>of( - getResourceSettings, - postResourceSettings, - deleteResourceSettings, - putResourceSettings, - patchResourceSettings); + ImmutableList.>of(generateCredentialsSettings); initDefaults(this); } - protected Builder(GatewayServiceStubSettings settings) { + protected Builder(GatewayControlStubSettings settings) { super(settings); - getResourceSettings = settings.getResourceSettings.toBuilder(); - postResourceSettings = settings.postResourceSettings.toBuilder(); - deleteResourceSettings = settings.deleteResourceSettings.toBuilder(); - putResourceSettings = settings.putResourceSettings.toBuilder(); - patchResourceSettings = settings.patchResourceSettings.toBuilder(); + generateCredentialsSettings = settings.generateCredentialsSettings.toBuilder(); unaryMethodSettingsBuilders = - ImmutableList.>of( - getResourceSettings, - postResourceSettings, - deleteResourceSettings, - putResourceSettings, - patchResourceSettings); + ImmutableList.>of(generateCredentialsSettings); } private static Builder createDefault() { @@ -288,29 +254,9 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder - .getResourceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .postResourceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deleteResourceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .putResourceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .patchResourceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .generateCredentialsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } @@ -330,34 +276,15 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } - /** Returns the builder for the settings used for calls to getResource. */ - public UnaryCallSettings.Builder getResourceSettings() { - return getResourceSettings; - } - - /** Returns the builder for the settings used for calls to postResource. */ - public UnaryCallSettings.Builder postResourceSettings() { - return postResourceSettings; - } - - /** Returns the builder for the settings used for calls to deleteResource. */ - public UnaryCallSettings.Builder deleteResourceSettings() { - return deleteResourceSettings; - } - - /** Returns the builder for the settings used for calls to putResource. */ - public UnaryCallSettings.Builder putResourceSettings() { - return putResourceSettings; - } - - /** Returns the builder for the settings used for calls to patchResource. */ - public UnaryCallSettings.Builder patchResourceSettings() { - return patchResourceSettings; + /** Returns the builder for the settings used for calls to generateCredentials. */ + public UnaryCallSettings.Builder + generateCredentialsSettings() { + return generateCredentialsSettings; } @Override - public GatewayServiceStubSettings build() throws IOException { - return new GatewayServiceStubSettings(this); + public GatewayControlStubSettings build() throws IOException { + return new GatewayControlStubSettings(this); } } } diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayServiceCallableFactory.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayControlCallableFactory.java similarity index 97% rename from java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayServiceCallableFactory.java rename to java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayControlCallableFactory.java index 8422f1af4f48..11d6fd79e44d 100644 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayServiceCallableFactory.java +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayControlCallableFactory.java @@ -38,13 +38,13 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for the GatewayService service API. + * gRPC callable factory implementation for the GatewayControl service API. * *

This class is for advanced usage. */ @BetaApi @Generated("by gapic-generator-java") -public class GrpcGatewayServiceCallableFactory implements GrpcStubCallableFactory { +public class GrpcGatewayControlCallableFactory implements GrpcStubCallableFactory { @Override public UnaryCallable createUnaryCallable( diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayControlStub.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayControlStub.java new file mode 100644 index 000000000000..60c5e4b1471e --- /dev/null +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayControlStub.java @@ -0,0 +1,171 @@ +/* + * Copyright 2024 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.gkeconnect.gateway.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the GatewayControl service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcGatewayControlStub extends GatewayControlStub { + private static final MethodDescriptor + generateCredentialsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gkeconnect.gateway.v1beta1.GatewayControl/GenerateCredentials") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateCredentialsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateCredentialsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + generateCredentialsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcGatewayControlStub create(GatewayControlStubSettings settings) + throws IOException { + return new GrpcGatewayControlStub(settings, ClientContext.create(settings)); + } + + public static final GrpcGatewayControlStub create(ClientContext clientContext) + throws IOException { + return new GrpcGatewayControlStub( + GatewayControlStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcGatewayControlStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcGatewayControlStub( + GatewayControlStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcGatewayControlStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcGatewayControlStub(GatewayControlStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcGatewayControlCallableFactory()); + } + + /** + * Constructs an instance of GrpcGatewayControlStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcGatewayControlStub( + GatewayControlStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + generateCredentialsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateCredentialsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.generateCredentialsCallable = + callableFactory.createUnaryCallable( + generateCredentialsTransportSettings, + settings.generateCredentialsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + generateCredentialsCallable() { + return generateCredentialsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayServiceStub.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayServiceStub.java deleted file mode 100644 index 40a075c47576..000000000000 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/stub/GrpcGatewayServiceStub.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1.stub; - -import com.google.api.HttpBody; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.stub.GrpcOperationsStub; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the GatewayService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcGatewayServiceStub extends GatewayServiceStub { - private static final MethodDescriptor getResourceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.gkeconnect.gateway.v1beta1.GatewayService/GetResource") - .setRequestMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .build(); - - private static final MethodDescriptor postResourceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.gkeconnect.gateway.v1beta1.GatewayService/PostResource") - .setRequestMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteResourceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.gkeconnect.gateway.v1beta1.GatewayService/DeleteResource") - .setRequestMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .build(); - - private static final MethodDescriptor putResourceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.gkeconnect.gateway.v1beta1.GatewayService/PutResource") - .setRequestMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .build(); - - private static final MethodDescriptor patchResourceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.gkeconnect.gateway.v1beta1.GatewayService/PatchResource") - .setRequestMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) - .build(); - - private final UnaryCallable getResourceCallable; - private final UnaryCallable postResourceCallable; - private final UnaryCallable deleteResourceCallable; - private final UnaryCallable putResourceCallable; - private final UnaryCallable patchResourceCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcGatewayServiceStub create(GatewayServiceStubSettings settings) - throws IOException { - return new GrpcGatewayServiceStub(settings, ClientContext.create(settings)); - } - - public static final GrpcGatewayServiceStub create(ClientContext clientContext) - throws IOException { - return new GrpcGatewayServiceStub( - GatewayServiceStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcGatewayServiceStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcGatewayServiceStub( - GatewayServiceStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcGatewayServiceStub, using the given settings. This is protected - * so that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected GrpcGatewayServiceStub(GatewayServiceStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcGatewayServiceCallableFactory()); - } - - /** - * Constructs an instance of GrpcGatewayServiceStub, using the given settings. This is protected - * so that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected GrpcGatewayServiceStub( - GatewayServiceStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings getResourceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getResourceMethodDescriptor) - .build(); - GrpcCallSettings postResourceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(postResourceMethodDescriptor) - .build(); - GrpcCallSettings deleteResourceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteResourceMethodDescriptor) - .build(); - GrpcCallSettings putResourceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(putResourceMethodDescriptor) - .build(); - GrpcCallSettings patchResourceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(patchResourceMethodDescriptor) - .build(); - - this.getResourceCallable = - callableFactory.createUnaryCallable( - getResourceTransportSettings, settings.getResourceSettings(), clientContext); - this.postResourceCallable = - callableFactory.createUnaryCallable( - postResourceTransportSettings, settings.postResourceSettings(), clientContext); - this.deleteResourceCallable = - callableFactory.createUnaryCallable( - deleteResourceTransportSettings, settings.deleteResourceSettings(), clientContext); - this.putResourceCallable = - callableFactory.createUnaryCallable( - putResourceTransportSettings, settings.putResourceSettings(), clientContext); - this.patchResourceCallable = - callableFactory.createUnaryCallable( - patchResourceTransportSettings, settings.patchResourceSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable getResourceCallable() { - return getResourceCallable; - } - - @Override - public UnaryCallable postResourceCallable() { - return postResourceCallable; - } - - @Override - public UnaryCallable deleteResourceCallable() { - return deleteResourceCallable; - } - - @Override - public UnaryCallable putResourceCallable() { - return putResourceCallable; - } - - @Override - public UnaryCallable patchResourceCallable() { - return patchResourceCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/resources/META-INF/native-image/com.google.cloud.gkeconnect.gateway.v1beta1/reflect-config.json b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/resources/META-INF/native-image/com.google.cloud.gkeconnect.gateway.v1beta1/reflect-config.json index a065a75b27c0..24e007c389cc 100644 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/resources/META-INF/native-image/com.google.cloud.gkeconnect.gateway.v1beta1/reflect-config.json +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/main/resources/META-INF/native-image/com.google.cloud.gkeconnect.gateway.v1beta1/reflect-config.json @@ -108,16 +108,7 @@ "allPublicClasses": true }, { - "name": "com.google.api.GoSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.GoSettings$Builder", + "name": "com.google.api.FieldBehavior", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -126,7 +117,7 @@ "allPublicClasses": true }, { - "name": "com.google.api.Http", + "name": "com.google.api.GoSettings", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -135,7 +126,7 @@ "allPublicClasses": true }, { - "name": "com.google.api.Http$Builder", + "name": "com.google.api.GoSettings$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -144,7 +135,7 @@ "allPublicClasses": true }, { - "name": "com.google.api.HttpBody", + "name": "com.google.api.Http", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -153,7 +144,7 @@ "allPublicClasses": true }, { - "name": "com.google.api.HttpBody$Builder", + "name": "com.google.api.Http$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -387,7 +378,34 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.Any", + "name": "com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest$OperatingSystem", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -396,7 +414,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.Any$Builder", + "name": "com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlClientTest.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlClientTest.java new file mode 100644 index 000000000000..4aa092289791 --- /dev/null +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlClientTest.java @@ -0,0 +1,133 @@ +/* + * Copyright 2024 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.gkeconnect.gateway.v1beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class GatewayControlClientTest { + private static MockGatewayControl mockGatewayControl; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private GatewayControlClient client; + + @BeforeClass + public static void startStaticServer() { + mockGatewayControl = new MockGatewayControl(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockGatewayControl)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + GatewayControlSettings settings = + GatewayControlSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GatewayControlClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void generateCredentialsTest() throws Exception { + GenerateCredentialsResponse expectedResponse = + GenerateCredentialsResponse.newBuilder() + .setKubeconfig(ByteString.EMPTY) + .setEndpoint("endpoint1741102485") + .build(); + mockGatewayControl.addResponse(expectedResponse); + + GenerateCredentialsRequest request = + GenerateCredentialsRequest.newBuilder() + .setName("name3373707") + .setForceUseAgent(true) + .setVersion("version351608024") + .setKubernetesNamespace("kubernetesNamespace-1862862667") + .build(); + + GenerateCredentialsResponse actualResponse = client.generateCredentials(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGatewayControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateCredentialsRequest actualRequest = ((GenerateCredentialsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getForceUseAgent(), actualRequest.getForceUseAgent()); + Assert.assertEquals(request.getVersion(), actualRequest.getVersion()); + Assert.assertEquals(request.getKubernetesNamespace(), actualRequest.getKubernetesNamespace()); + Assert.assertEquals(request.getOperatingSystem(), actualRequest.getOperatingSystem()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateCredentialsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGatewayControl.addException(exception); + + try { + GenerateCredentialsRequest request = + GenerateCredentialsRequest.newBuilder() + .setName("name3373707") + .setForceUseAgent(true) + .setVersion("version351608024") + .setKubernetesNamespace("kubernetesNamespace-1862862667") + .build(); + client.generateCredentials(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceClientTest.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceClientTest.java deleted file mode 100644 index d2b04ec82e3f..000000000000 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceClientTest.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1; - -import com.google.api.HttpBody; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class GatewayServiceClientTest { - private static MockGatewayService mockGatewayService; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private GatewayServiceClient client; - - @BeforeClass - public static void startStaticServer() { - mockGatewayService = new MockGatewayService(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockGatewayService)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - GatewayServiceSettings settings = - GatewayServiceSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = GatewayServiceClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void getResourceTest() throws Exception { - HttpBody expectedResponse = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - mockGatewayService.addResponse(expectedResponse); - - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - - HttpBody actualResponse = client.getResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockGatewayService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - HttpBody actualRequest = ((HttpBody) actualRequests.get(0)); - - Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); - Assert.assertEquals(request.getData(), actualRequest.getData()); - Assert.assertEquals(request.getExtensionsList(), actualRequest.getExtensionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getResourceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockGatewayService.addException(exception); - - try { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - client.getResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void postResourceTest() throws Exception { - HttpBody expectedResponse = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - mockGatewayService.addResponse(expectedResponse); - - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - - HttpBody actualResponse = client.postResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockGatewayService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - HttpBody actualRequest = ((HttpBody) actualRequests.get(0)); - - Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); - Assert.assertEquals(request.getData(), actualRequest.getData()); - Assert.assertEquals(request.getExtensionsList(), actualRequest.getExtensionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void postResourceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockGatewayService.addException(exception); - - try { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - client.postResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteResourceTest() throws Exception { - HttpBody expectedResponse = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - mockGatewayService.addResponse(expectedResponse); - - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - - HttpBody actualResponse = client.deleteResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockGatewayService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - HttpBody actualRequest = ((HttpBody) actualRequests.get(0)); - - Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); - Assert.assertEquals(request.getData(), actualRequest.getData()); - Assert.assertEquals(request.getExtensionsList(), actualRequest.getExtensionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteResourceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockGatewayService.addException(exception); - - try { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - client.deleteResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void putResourceTest() throws Exception { - HttpBody expectedResponse = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - mockGatewayService.addResponse(expectedResponse); - - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - - HttpBody actualResponse = client.putResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockGatewayService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - HttpBody actualRequest = ((HttpBody) actualRequests.get(0)); - - Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); - Assert.assertEquals(request.getData(), actualRequest.getData()); - Assert.assertEquals(request.getExtensionsList(), actualRequest.getExtensionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void putResourceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockGatewayService.addException(exception); - - try { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - client.putResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void patchResourceTest() throws Exception { - HttpBody expectedResponse = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - mockGatewayService.addResponse(expectedResponse); - - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - - HttpBody actualResponse = client.patchResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockGatewayService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - HttpBody actualRequest = ((HttpBody) actualRequests.get(0)); - - Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); - Assert.assertEquals(request.getData(), actualRequest.getData()); - Assert.assertEquals(request.getExtensionsList(), actualRequest.getExtensionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void patchResourceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockGatewayService.addException(exception); - - try { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - client.patchResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayService.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayControl.java similarity index 88% rename from java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayService.java rename to java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayControl.java index b6f786ac9349..b7ffe9cf27f9 100644 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayService.java +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayControl.java @@ -25,11 +25,11 @@ @BetaApi @Generated("by gapic-generator-java") -public class MockGatewayService implements MockGrpcService { - private final MockGatewayServiceImpl serviceImpl; +public class MockGatewayControl implements MockGrpcService { + private final MockGatewayControlImpl serviceImpl; - public MockGatewayService() { - serviceImpl = new MockGatewayServiceImpl(); + public MockGatewayControl() { + serviceImpl = new MockGatewayControlImpl(); } @Override diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayControlImpl.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayControlImpl.java new file mode 100644 index 000000000000..338114969cd4 --- /dev/null +++ b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayControlImpl.java @@ -0,0 +1,82 @@ +/* + * Copyright 2024 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.gkeconnect.gateway.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayControlGrpc.GatewayControlImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockGatewayControlImpl extends GatewayControlImplBase { + private List requests; + private Queue responses; + + public MockGatewayControlImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void generateCredentials( + GenerateCredentialsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateCredentialsResponse) { + requests.add(request); + responseObserver.onNext(((GenerateCredentialsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateCredentials, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateCredentialsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayServiceImpl.java b/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayServiceImpl.java deleted file mode 100644 index 41fb22d2e05a..000000000000 --- a/java-gke-connect-gateway/google-cloud-gke-connect-gateway/src/test/java/com/google/cloud/gkeconnect/gateway/v1beta1/MockGatewayServiceImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1; - -import com.google.api.HttpBody; -import com.google.api.core.BetaApi; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceGrpc.GatewayServiceImplBase; -import com.google.protobuf.AbstractMessage; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockGatewayServiceImpl extends GatewayServiceImplBase { - private List requests; - private Queue responses; - - public MockGatewayServiceImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void getResource(HttpBody request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof HttpBody) { - requests.add(request); - responseObserver.onNext(((HttpBody) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetResource, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - HttpBody.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void postResource(HttpBody request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof HttpBody) { - requests.add(request); - responseObserver.onNext(((HttpBody) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method PostResource, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - HttpBody.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteResource(HttpBody request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof HttpBody) { - requests.add(request); - responseObserver.onNext(((HttpBody) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeleteResource, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - HttpBody.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void putResource(HttpBody request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof HttpBody) { - requests.add(request); - responseObserver.onNext(((HttpBody) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method PutResource, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - HttpBody.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void patchResource(HttpBody request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof HttpBody) { - requests.add(request); - responseObserver.onNext(((HttpBody) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method PatchResource, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - HttpBody.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/java-gke-connect-gateway/grpc-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlGrpc.java b/java-gke-connect-gateway/grpc-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlGrpc.java new file mode 100644 index 000000000000..be9ae9e01a79 --- /dev/null +++ b/java-gke-connect-gateway/grpc-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayControlGrpc.java @@ -0,0 +1,390 @@ +/* + * Copyright 2024 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.gkeconnect.gateway.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * GatewayControl is the control plane API for Connect Gateway.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/gkeconnect/gateway/v1beta1/control.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class GatewayControlGrpc { + + private GatewayControlGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.gkeconnect.gateway.v1beta1.GatewayControl"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest, + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse> + getGenerateCredentialsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateCredentials", + requestType = com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.class, + responseType = com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest, + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse> + getGenerateCredentialsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest, + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse> + getGenerateCredentialsMethod; + if ((getGenerateCredentialsMethod = GatewayControlGrpc.getGenerateCredentialsMethod) == null) { + synchronized (GatewayControlGrpc.class) { + if ((getGenerateCredentialsMethod = GatewayControlGrpc.getGenerateCredentialsMethod) + == null) { + GatewayControlGrpc.getGenerateCredentialsMethod = + getGenerateCredentialsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateCredentials")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gkeconnect.gateway.v1beta1 + .GenerateCredentialsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new GatewayControlMethodDescriptorSupplier("GenerateCredentials")) + .build(); + } + } + } + return getGenerateCredentialsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static GatewayControlStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public GatewayControlStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GatewayControlStub(channel, callOptions); + } + }; + return GatewayControlStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static GatewayControlBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public GatewayControlBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GatewayControlBlockingStub(channel, callOptions); + } + }; + return GatewayControlBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static GatewayControlFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public GatewayControlFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GatewayControlFutureStub(channel, callOptions); + } + }; + return GatewayControlFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * GatewayControl is the control plane API for Connect Gateway.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * GenerateCredentials provides connection information that allows a user to
+     * access the specified membership using Connect Gateway.
+     * 
+ */ + default void generateCredentials( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateCredentialsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service GatewayControl. + * + *
+   * GatewayControl is the control plane API for Connect Gateway.
+   * 
+ */ + public abstract static class GatewayControlImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return GatewayControlGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service GatewayControl. + * + *
+   * GatewayControl is the control plane API for Connect Gateway.
+   * 
+ */ + public static final class GatewayControlStub + extends io.grpc.stub.AbstractAsyncStub { + private GatewayControlStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GatewayControlStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GatewayControlStub(channel, callOptions); + } + + /** + * + * + *
+     * GenerateCredentials provides connection information that allows a user to
+     * access the specified membership using Connect Gateway.
+     * 
+ */ + public void generateCredentials( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateCredentialsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service GatewayControl. + * + *
+   * GatewayControl is the control plane API for Connect Gateway.
+   * 
+ */ + public static final class GatewayControlBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private GatewayControlBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GatewayControlBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GatewayControlBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * GenerateCredentials provides connection information that allows a user to
+     * access the specified membership using Connect Gateway.
+     * 
+ */ + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + generateCredentials( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateCredentialsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service GatewayControl. + * + *
+   * GatewayControl is the control plane API for Connect Gateway.
+   * 
+ */ + public static final class GatewayControlFutureStub + extends io.grpc.stub.AbstractFutureStub { + private GatewayControlFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GatewayControlFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GatewayControlFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * GenerateCredentials provides connection information that allows a user to
+     * access the specified membership using Connect Gateway.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse> + generateCredentials( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateCredentialsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GENERATE_CREDENTIALS = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GENERATE_CREDENTIALS: + serviceImpl.generateCredentials( + (com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGenerateCredentialsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest, + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse>( + service, METHODID_GENERATE_CREDENTIALS))) + .build(); + } + + private abstract static class GatewayControlBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + GatewayControlBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("GatewayControl"); + } + } + + private static final class GatewayControlFileDescriptorSupplier + extends GatewayControlBaseDescriptorSupplier { + GatewayControlFileDescriptorSupplier() {} + } + + private static final class GatewayControlMethodDescriptorSupplier + extends GatewayControlBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + GatewayControlMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (GatewayControlGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new GatewayControlFileDescriptorSupplier()) + .addMethod(getGenerateCredentialsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-gke-connect-gateway/grpc-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceGrpc.java b/java-gke-connect-gateway/grpc-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceGrpc.java deleted file mode 100644 index 3b4efdcd9e21..000000000000 --- a/java-gke-connect-gateway/grpc-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceGrpc.java +++ /dev/null @@ -1,800 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - * - * - *
- * Gateway service is a public API which works as a Kubernetes resource model
- * proxy between end users and registered Kubernetes clusters. Each RPC in this
- * service matches with an HTTP verb. End user will initiate kubectl commands
- * against the Gateway service, and Gateway service will forward user requests
- * to clusters.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/gkeconnect/gateway/v1beta1/gateway.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class GatewayServiceGrpc { - - private GatewayServiceGrpc() {} - - public static final java.lang.String SERVICE_NAME = - "google.cloud.gkeconnect.gateway.v1beta1.GatewayService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor - getGetResourceMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetResource", - requestType = com.google.api.HttpBody.class, - responseType = com.google.api.HttpBody.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor - getGetResourceMethod() { - io.grpc.MethodDescriptor getGetResourceMethod; - if ((getGetResourceMethod = GatewayServiceGrpc.getGetResourceMethod) == null) { - synchronized (GatewayServiceGrpc.class) { - if ((getGetResourceMethod = GatewayServiceGrpc.getGetResourceMethod) == null) { - GatewayServiceGrpc.getGetResourceMethod = - getGetResourceMethod = - io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetResource")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setSchemaDescriptor( - new GatewayServiceMethodDescriptorSupplier("GetResource")) - .build(); - } - } - } - return getGetResourceMethod; - } - - private static volatile io.grpc.MethodDescriptor - getPostResourceMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PostResource", - requestType = com.google.api.HttpBody.class, - responseType = com.google.api.HttpBody.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor - getPostResourceMethod() { - io.grpc.MethodDescriptor - getPostResourceMethod; - if ((getPostResourceMethod = GatewayServiceGrpc.getPostResourceMethod) == null) { - synchronized (GatewayServiceGrpc.class) { - if ((getPostResourceMethod = GatewayServiceGrpc.getPostResourceMethod) == null) { - GatewayServiceGrpc.getPostResourceMethod = - getPostResourceMethod = - io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PostResource")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setSchemaDescriptor( - new GatewayServiceMethodDescriptorSupplier("PostResource")) - .build(); - } - } - } - return getPostResourceMethod; - } - - private static volatile io.grpc.MethodDescriptor - getDeleteResourceMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteResource", - requestType = com.google.api.HttpBody.class, - responseType = com.google.api.HttpBody.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor - getDeleteResourceMethod() { - io.grpc.MethodDescriptor - getDeleteResourceMethod; - if ((getDeleteResourceMethod = GatewayServiceGrpc.getDeleteResourceMethod) == null) { - synchronized (GatewayServiceGrpc.class) { - if ((getDeleteResourceMethod = GatewayServiceGrpc.getDeleteResourceMethod) == null) { - GatewayServiceGrpc.getDeleteResourceMethod = - getDeleteResourceMethod = - io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteResource")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setSchemaDescriptor( - new GatewayServiceMethodDescriptorSupplier("DeleteResource")) - .build(); - } - } - } - return getDeleteResourceMethod; - } - - private static volatile io.grpc.MethodDescriptor - getPutResourceMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PutResource", - requestType = com.google.api.HttpBody.class, - responseType = com.google.api.HttpBody.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor - getPutResourceMethod() { - io.grpc.MethodDescriptor getPutResourceMethod; - if ((getPutResourceMethod = GatewayServiceGrpc.getPutResourceMethod) == null) { - synchronized (GatewayServiceGrpc.class) { - if ((getPutResourceMethod = GatewayServiceGrpc.getPutResourceMethod) == null) { - GatewayServiceGrpc.getPutResourceMethod = - getPutResourceMethod = - io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PutResource")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setSchemaDescriptor( - new GatewayServiceMethodDescriptorSupplier("PutResource")) - .build(); - } - } - } - return getPutResourceMethod; - } - - private static volatile io.grpc.MethodDescriptor - getPatchResourceMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PatchResource", - requestType = com.google.api.HttpBody.class, - responseType = com.google.api.HttpBody.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor - getPatchResourceMethod() { - io.grpc.MethodDescriptor - getPatchResourceMethod; - if ((getPatchResourceMethod = GatewayServiceGrpc.getPatchResourceMethod) == null) { - synchronized (GatewayServiceGrpc.class) { - if ((getPatchResourceMethod = GatewayServiceGrpc.getPatchResourceMethod) == null) { - GatewayServiceGrpc.getPatchResourceMethod = - getPatchResourceMethod = - io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PatchResource")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.api.HttpBody.getDefaultInstance())) - .setSchemaDescriptor( - new GatewayServiceMethodDescriptorSupplier("PatchResource")) - .build(); - } - } - } - return getPatchResourceMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static GatewayServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public GatewayServiceStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new GatewayServiceStub(channel, callOptions); - } - }; - return GatewayServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static GatewayServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public GatewayServiceBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new GatewayServiceBlockingStub(channel, callOptions); - } - }; - return GatewayServiceBlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static GatewayServiceFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public GatewayServiceFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new GatewayServiceFutureStub(channel, callOptions); - } - }; - return GatewayServiceFutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * Gateway service is a public API which works as a Kubernetes resource model
-   * proxy between end users and registered Kubernetes clusters. Each RPC in this
-   * service matches with an HTTP verb. End user will initiate kubectl commands
-   * against the Gateway service, and Gateway service will forward user requests
-   * to clusters.
-   * 
- */ - public interface AsyncService { - - /** - * - * - *
-     * GetResource performs an HTTP GET request on the Kubernetes API Server.
-     * 
- */ - default void getResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetResourceMethod(), responseObserver); - } - - /** - * - * - *
-     * PostResource performs an HTTP POST on the Kubernetes API Server.
-     * 
- */ - default void postResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getPostResourceMethod(), responseObserver); - } - - /** - * - * - *
-     * DeleteResource performs an HTTP DELETE on the Kubernetes API Server.
-     * 
- */ - default void deleteResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteResourceMethod(), responseObserver); - } - - /** - * - * - *
-     * PutResource performs an HTTP PUT on the Kubernetes API Server.
-     * 
- */ - default void putResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getPutResourceMethod(), responseObserver); - } - - /** - * - * - *
-     * PatchResource performs an HTTP PATCH on the Kubernetes API Server.
-     * 
- */ - default void patchResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getPatchResourceMethod(), responseObserver); - } - } - - /** - * Base class for the server implementation of the service GatewayService. - * - *
-   * Gateway service is a public API which works as a Kubernetes resource model
-   * proxy between end users and registered Kubernetes clusters. Each RPC in this
-   * service matches with an HTTP verb. End user will initiate kubectl commands
-   * against the Gateway service, and Gateway service will forward user requests
-   * to clusters.
-   * 
- */ - public abstract static class GatewayServiceImplBase - implements io.grpc.BindableService, AsyncService { - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return GatewayServiceGrpc.bindService(this); - } - } - - /** - * A stub to allow clients to do asynchronous rpc calls to service GatewayService. - * - *
-   * Gateway service is a public API which works as a Kubernetes resource model
-   * proxy between end users and registered Kubernetes clusters. Each RPC in this
-   * service matches with an HTTP verb. End user will initiate kubectl commands
-   * against the Gateway service, and Gateway service will forward user requests
-   * to clusters.
-   * 
- */ - public static final class GatewayServiceStub - extends io.grpc.stub.AbstractAsyncStub { - private GatewayServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected GatewayServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new GatewayServiceStub(channel, callOptions); - } - - /** - * - * - *
-     * GetResource performs an HTTP GET request on the Kubernetes API Server.
-     * 
- */ - public void getResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetResourceMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * PostResource performs an HTTP POST on the Kubernetes API Server.
-     * 
- */ - public void postResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPostResourceMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * DeleteResource performs an HTTP DELETE on the Kubernetes API Server.
-     * 
- */ - public void deleteResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteResourceMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * PutResource performs an HTTP PUT on the Kubernetes API Server.
-     * 
- */ - public void putResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPutResourceMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * PatchResource performs an HTTP PATCH on the Kubernetes API Server.
-     * 
- */ - public void patchResource( - com.google.api.HttpBody request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPatchResourceMethod(), getCallOptions()), - request, - responseObserver); - } - } - - /** - * A stub to allow clients to do synchronous rpc calls to service GatewayService. - * - *
-   * Gateway service is a public API which works as a Kubernetes resource model
-   * proxy between end users and registered Kubernetes clusters. Each RPC in this
-   * service matches with an HTTP verb. End user will initiate kubectl commands
-   * against the Gateway service, and Gateway service will forward user requests
-   * to clusters.
-   * 
- */ - public static final class GatewayServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private GatewayServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected GatewayServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new GatewayServiceBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * GetResource performs an HTTP GET request on the Kubernetes API Server.
-     * 
- */ - public com.google.api.HttpBody getResource(com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetResourceMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * PostResource performs an HTTP POST on the Kubernetes API Server.
-     * 
- */ - public com.google.api.HttpBody postResource(com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPostResourceMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * DeleteResource performs an HTTP DELETE on the Kubernetes API Server.
-     * 
- */ - public com.google.api.HttpBody deleteResource(com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteResourceMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * PutResource performs an HTTP PUT on the Kubernetes API Server.
-     * 
- */ - public com.google.api.HttpBody putResource(com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPutResourceMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * PatchResource performs an HTTP PATCH on the Kubernetes API Server.
-     * 
- */ - public com.google.api.HttpBody patchResource(com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPatchResourceMethod(), getCallOptions(), request); - } - } - - /** - * A stub to allow clients to do ListenableFuture-style rpc calls to service GatewayService. - * - *
-   * Gateway service is a public API which works as a Kubernetes resource model
-   * proxy between end users and registered Kubernetes clusters. Each RPC in this
-   * service matches with an HTTP verb. End user will initiate kubectl commands
-   * against the Gateway service, and Gateway service will forward user requests
-   * to clusters.
-   * 
- */ - public static final class GatewayServiceFutureStub - extends io.grpc.stub.AbstractFutureStub { - private GatewayServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected GatewayServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new GatewayServiceFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * GetResource performs an HTTP GET request on the Kubernetes API Server.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture getResource( - com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetResourceMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * PostResource performs an HTTP POST on the Kubernetes API Server.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture postResource( - com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPostResourceMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * DeleteResource performs an HTTP DELETE on the Kubernetes API Server.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteResource(com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteResourceMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * PutResource performs an HTTP PUT on the Kubernetes API Server.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture putResource( - com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPutResourceMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * PatchResource performs an HTTP PATCH on the Kubernetes API Server.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - patchResource(com.google.api.HttpBody request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPatchResourceMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_GET_RESOURCE = 0; - private static final int METHODID_POST_RESOURCE = 1; - private static final int METHODID_DELETE_RESOURCE = 2; - private static final int METHODID_PUT_RESOURCE = 3; - private static final int METHODID_PATCH_RESOURCE = 4; - - private static final class MethodHandlers - implements io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final AsyncService serviceImpl; - private final int methodId; - - MethodHandlers(AsyncService serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_GET_RESOURCE: - serviceImpl.getResource( - (com.google.api.HttpBody) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_POST_RESOURCE: - serviceImpl.postResource( - (com.google.api.HttpBody) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_RESOURCE: - serviceImpl.deleteResource( - (com.google.api.HttpBody) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PUT_RESOURCE: - serviceImpl.putResource( - (com.google.api.HttpBody) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PATCH_RESOURCE: - serviceImpl.patchResource( - (com.google.api.HttpBody) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetResourceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - service, METHODID_GET_RESOURCE))) - .addMethod( - getPostResourceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - service, METHODID_POST_RESOURCE))) - .addMethod( - getDeleteResourceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - service, METHODID_DELETE_RESOURCE))) - .addMethod( - getPutResourceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - service, METHODID_PUT_RESOURCE))) - .addMethod( - getPatchResourceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - service, METHODID_PATCH_RESOURCE))) - .build(); - } - - private abstract static class GatewayServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - GatewayServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.gkeconnect.gateway.v1beta1.GatewayProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("GatewayService"); - } - } - - private static final class GatewayServiceFileDescriptorSupplier - extends GatewayServiceBaseDescriptorSupplier { - GatewayServiceFileDescriptorSupplier() {} - } - - private static final class GatewayServiceMethodDescriptorSupplier - extends GatewayServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final java.lang.String methodName; - - GatewayServiceMethodDescriptorSupplier(java.lang.String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (GatewayServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new GatewayServiceFileDescriptorSupplier()) - .addMethod(getGetResourceMethod()) - .addMethod(getPostResourceMethod()) - .addMethod(getDeleteResourceMethod()) - .addMethod(getPutResourceMethod()) - .addMethod(getPatchResourceMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/ControlProto.java b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/ControlProto.java new file mode 100644 index 000000000000..d9e317f23cc2 --- /dev/null +++ b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/ControlProto.java @@ -0,0 +1,118 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gkeconnect/gateway/v1beta1/control.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.gkeconnect.gateway.v1beta1; + +public final class ControlProto { + private ControlProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/gkeconnect/gateway/v1beta" + + "1/control.proto\022\'google.cloud.gkeconnect" + + ".gateway.v1beta1\032\034google/api/annotations" + + ".proto\032\027google/api/client.proto\032\037google/" + + "api/field_behavior.proto\"\315\002\n\032GenerateCre" + + "dentialsRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\034\n\017fo" + + "rce_use_agent\030\002 \001(\010B\003\340A\001\022\024\n\007version\030\003 \001(" + + "\tB\003\340A\001\022!\n\024kubernetes_namespace\030\004 \001(\tB\003\340A" + + "\001\022r\n\020operating_system\030\005 \001(\0162S.google.clo" + + "ud.gkeconnect.gateway.v1beta1.GenerateCr" + + "edentialsRequest.OperatingSystemB\003\340A\001\"Q\n" + + "\017OperatingSystem\022 \n\034OPERATING_SYSTEM_UNS" + + "PECIFIED\020\000\022\034\n\030OPERATING_SYSTEM_WINDOWS\020\001" + + "\"C\n\033GenerateCredentialsResponse\022\022\n\nkubec" + + "onfig\030\001 \001(\014\022\020\n\010endpoint\030\002 \001(\t2\330\002\n\016Gatewa" + + "yControl\022\362\001\n\023GenerateCredentials\022C.googl" + + "e.cloud.gkeconnect.gateway.v1beta1.Gener" + + "ateCredentialsRequest\032D.google.cloud.gke" + + "connect.gateway.v1beta1.GenerateCredenti" + + "alsResponse\"P\202\323\344\223\002J\022H/v1beta1/{name=proj" + + "ects/*/locations/*/memberships/*}:genera" + + "teCredentials\032Q\312A\035connectgateway.googlea" + + "pis.com\322A.https://www.googleapis.com/aut" + + "h/cloud-platformB\206\002\n+com.google.cloud.gk" + + "econnect.gateway.v1beta1B\014ControlProtoP\001" + + "ZEcloud.google.com/go/gkeconnect/gateway" + + "/apiv1beta1/gatewaypb;gatewaypb\252\002\'Google" + + ".Cloud.GkeConnect.Gateway.V1Beta1\312\002\'Goog" + + "le\\Cloud\\GkeConnect\\Gateway\\V1beta1\352\002+Go" + + "ogle::Cloud::GkeConnect::Gateway::V1beta" + + "1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_descriptor, + new java.lang.String[] { + "Name", "ForceUseAgent", "Version", "KubernetesNamespace", "OperatingSystem", + }); + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_descriptor, + new java.lang.String[] { + "Kubeconfig", "Endpoint", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayProto.java b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayProto.java deleted file mode 100644 index e0a81717538c..000000000000 --- a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayProto.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2024 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/gkeconnect/gateway/v1beta1/gateway.proto - -// Protobuf Java Version: 3.25.4 -package com.google.cloud.gkeconnect.gateway.v1beta1; - -public final class GatewayProto { - private GatewayProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n5google/cloud/gkeconnect/gateway/v1beta" - + "1/gateway.proto\022\'google.cloud.gkeconnect" - + ".gateway.v1beta1\032\034google/api/annotations" - + ".proto\032\027google/api/client.proto\032\031google/" - + "api/httpbody.proto2\371\003\n\016GatewayService\022N\n" - + "\013GetResource\022\024.google.api.HttpBody\032\024.goo" - + "gle.api.HttpBody\"\023\202\323\344\223\002\r\022\013/v1beta1/**\022O\n" - + "\014PostResource\022\024.google.api.HttpBody\032\024.go" - + "ogle.api.HttpBody\"\023\202\323\344\223\002\r\"\013/v1beta1/**\022Q" - + "\n\016DeleteResource\022\024.google.api.HttpBody\032\024" - + ".google.api.HttpBody\"\023\202\323\344\223\002\r*\013/v1beta1/*" - + "*\022N\n\013PutResource\022\024.google.api.HttpBody\032\024" - + ".google.api.HttpBody\"\023\202\323\344\223\002\r\032\013/v1beta1/*" - + "*\022P\n\rPatchResource\022\024.google.api.HttpBody" - + "\032\024.google.api.HttpBody\"\023\202\323\344\223\002\r2\013/v1beta1" - + "/**\032Q\312A\035connectgateway.googleapis.com\322A." - + "https://www.googleapis.com/auth/cloud-pl" - + "atformB\206\002\n+com.google.cloud.gkeconnect.g" - + "ateway.v1beta1B\014GatewayProtoP\001ZEcloud.go" - + "ogle.com/go/gkeconnect/gateway/apiv1beta" - + "1/gatewaypb;gatewaypb\252\002\'Google.Cloud.Gke" - + "Connect.Gateway.V1Beta1\312\002\'Google\\Cloud\\G" - + "keConnect\\Gateway\\V1beta1\352\002+Google::Clou" - + "d::GkeConnect::Gateway::V1beta1b\006proto3" - }; - descriptor = - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - com.google.api.HttpBodyProto.getDescriptor(), - }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.AnnotationsProto.http); - registry.add(com.google.api.ClientProto.oauthScopes); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - com.google.api.HttpBodyProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsRequest.java b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsRequest.java new file mode 100644 index 000000000000..cf1d4a86a672 --- /dev/null +++ b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsRequest.java @@ -0,0 +1,1482 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gkeconnect/gateway/v1beta1/control.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.gkeconnect.gateway.v1beta1; + +/** + * + * + *
+ * A request for connection information for a particular membership.
+ * 
+ * + * Protobuf type {@code google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest} + */ +public final class GenerateCredentialsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) + GenerateCredentialsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateCredentialsRequest.newBuilder() to construct. + private GenerateCredentialsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateCredentialsRequest() { + name_ = ""; + version_ = ""; + kubernetesNamespace_ = ""; + operatingSystem_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateCredentialsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.class, + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.Builder.class); + } + + /** + * + * + *
+   * Operating systems requiring specialized kubeconfigs.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem} + */ + public enum OperatingSystem implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Generates a kubeconfig that works for all operating systems not defined
+     * below.
+     * 
+ * + * OPERATING_SYSTEM_UNSPECIFIED = 0; + */ + OPERATING_SYSTEM_UNSPECIFIED(0), + /** + * + * + *
+     * Generates a kubeconfig that is specifically designed to work with
+     * Windows.
+     * 
+ * + * OPERATING_SYSTEM_WINDOWS = 1; + */ + OPERATING_SYSTEM_WINDOWS(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Generates a kubeconfig that works for all operating systems not defined
+     * below.
+     * 
+ * + * OPERATING_SYSTEM_UNSPECIFIED = 0; + */ + public static final int OPERATING_SYSTEM_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Generates a kubeconfig that is specifically designed to work with
+     * Windows.
+     * 
+ * + * OPERATING_SYSTEM_WINDOWS = 1; + */ + public static final int OPERATING_SYSTEM_WINDOWS_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OperatingSystem valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static OperatingSystem forNumber(int value) { + switch (value) { + case 0: + return OPERATING_SYSTEM_UNSPECIFIED; + case 1: + return OPERATING_SYSTEM_WINDOWS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public OperatingSystem findValueByNumber(int number) { + return OperatingSystem.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final OperatingSystem[] VALUES = values(); + + public static OperatingSystem valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private OperatingSystem(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The Fleet membership resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Fleet membership resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_USE_AGENT_FIELD_NUMBER = 2; + private boolean forceUseAgent_ = false; + /** + * + * + *
+   * Optional. Whether to force the use of Connect Agent-based transport.
+   *
+   * This will return a configuration that uses Connect Agent as the underlying
+   * transport mechanism for cluster types that would otherwise have used a
+   * different transport. Requires that Connect Agent be installed on the
+   * cluster. Setting this field to false is equivalent to not setting it.
+   * 
+ * + * bool force_use_agent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The forceUseAgent. + */ + @java.lang.Override + public boolean getForceUseAgent() { + return forceUseAgent_; + } + + public static final int VERSION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object version_ = ""; + /** + * + * + *
+   * Optional. The Connect Gateway version to be used in the resulting
+   * configuration.
+   *
+   * Leave this field blank to let the server choose the version (recommended).
+   * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The Connect Gateway version to be used in the resulting
+   * configuration.
+   *
+   * Leave this field blank to let the server choose the version (recommended).
+   * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KUBERNETES_NAMESPACE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kubernetesNamespace_ = ""; + /** + * + * + *
+   * Optional. The namespace to use in the kubeconfig context.
+   *
+   * If this field is specified, the server will set the `namespace` field in
+   * kubeconfig context. If not specified, the `namespace` field is omitted.
+   * 
+ * + * string kubernetes_namespace = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kubernetesNamespace. + */ + @java.lang.Override + public java.lang.String getKubernetesNamespace() { + java.lang.Object ref = kubernetesNamespace_; + 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(); + kubernetesNamespace_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The namespace to use in the kubeconfig context.
+   *
+   * If this field is specified, the server will set the `namespace` field in
+   * kubeconfig context. If not specified, the `namespace` field is omitted.
+   * 
+ * + * string kubernetes_namespace = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kubernetesNamespace. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKubernetesNamespaceBytes() { + java.lang.Object ref = kubernetesNamespace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kubernetesNamespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATING_SYSTEM_FIELD_NUMBER = 5; + private int operatingSystem_ = 0; + /** + * + * + *
+   * Optional. The operating system where the kubeconfig will be used.
+   * 
+ * + * + * .google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem operating_system = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for operatingSystem. + */ + @java.lang.Override + public int getOperatingSystemValue() { + return operatingSystem_; + } + /** + * + * + *
+   * Optional. The operating system where the kubeconfig will be used.
+   * 
+ * + * + * .google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem operating_system = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The operatingSystem. + */ + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + getOperatingSystem() { + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem result = + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + .forNumber(operatingSystem_); + return result == null + ? com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + .UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (forceUseAgent_ != false) { + output.writeBool(2, forceUseAgent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kubernetesNamespace_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, kubernetesNamespace_); + } + if (operatingSystem_ + != com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + .OPERATING_SYSTEM_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, operatingSystem_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (forceUseAgent_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, forceUseAgent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kubernetesNamespace_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, kubernetesNamespace_); + } + if (operatingSystem_ + != com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + .OPERATING_SYSTEM_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, operatingSystem_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest)) { + return super.equals(obj); + } + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest other = + (com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getForceUseAgent() != other.getForceUseAgent()) return false; + if (!getVersion().equals(other.getVersion())) return false; + if (!getKubernetesNamespace().equals(other.getKubernetesNamespace())) return false; + if (operatingSystem_ != other.operatingSystem_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FORCE_USE_AGENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForceUseAgent()); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + KUBERNETES_NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getKubernetesNamespace().hashCode(); + hash = (37 * hash) + OPERATING_SYSTEM_FIELD_NUMBER; + hash = (53 * hash) + operatingSystem_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A request for connection information for a particular membership.
+   * 
+ * + * Protobuf type {@code google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.class, + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + forceUseAgent_ = false; + version_ = ""; + kubernetesNamespace_ = ""; + operatingSystem_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + getDefaultInstanceForType() { + return com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest build() { + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest buildPartial() { + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest result = + new com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.forceUseAgent_ = forceUseAgent_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kubernetesNamespace_ = kubernetesNamespace_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.operatingSystem_ = operatingSystem_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) { + return mergeFrom( + (com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest other) { + if (other + == com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getForceUseAgent() != false) { + setForceUseAgent(other.getForceUseAgent()); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getKubernetesNamespace().isEmpty()) { + kubernetesNamespace_ = other.kubernetesNamespace_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.operatingSystem_ != 0) { + setOperatingSystemValue(other.getOperatingSystemValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + forceUseAgent_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + version_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + kubernetesNamespace_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + operatingSystem_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The Fleet membership resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Fleet membership resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Fleet membership resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Fleet membership resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Fleet membership resource.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean forceUseAgent_; + /** + * + * + *
+     * Optional. Whether to force the use of Connect Agent-based transport.
+     *
+     * This will return a configuration that uses Connect Agent as the underlying
+     * transport mechanism for cluster types that would otherwise have used a
+     * different transport. Requires that Connect Agent be installed on the
+     * cluster. Setting this field to false is equivalent to not setting it.
+     * 
+ * + * bool force_use_agent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The forceUseAgent. + */ + @java.lang.Override + public boolean getForceUseAgent() { + return forceUseAgent_; + } + /** + * + * + *
+     * Optional. Whether to force the use of Connect Agent-based transport.
+     *
+     * This will return a configuration that uses Connect Agent as the underlying
+     * transport mechanism for cluster types that would otherwise have used a
+     * different transport. Requires that Connect Agent be installed on the
+     * cluster. Setting this field to false is equivalent to not setting it.
+     * 
+ * + * bool force_use_agent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The forceUseAgent to set. + * @return This builder for chaining. + */ + public Builder setForceUseAgent(boolean value) { + + forceUseAgent_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Whether to force the use of Connect Agent-based transport.
+     *
+     * This will return a configuration that uses Connect Agent as the underlying
+     * transport mechanism for cluster types that would otherwise have used a
+     * different transport. Requires that Connect Agent be installed on the
+     * cluster. Setting this field to false is equivalent to not setting it.
+     * 
+ * + * bool force_use_agent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForceUseAgent() { + bitField0_ = (bitField0_ & ~0x00000002); + forceUseAgent_ = false; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * Optional. The Connect Gateway version to be used in the resulting
+     * configuration.
+     *
+     * Leave this field blank to let the server choose the version (recommended).
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The Connect Gateway version to be used in the resulting
+     * configuration.
+     *
+     * Leave this field blank to let the server choose the version (recommended).
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The Connect Gateway version to be used in the resulting
+     * configuration.
+     *
+     * Leave this field blank to let the server choose the version (recommended).
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The Connect Gateway version to be used in the resulting
+     * configuration.
+     *
+     * Leave this field blank to let the server choose the version (recommended).
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + version_ = getDefaultInstance().getVersion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The Connect Gateway version to be used in the resulting
+     * configuration.
+     *
+     * Leave this field blank to let the server choose the version (recommended).
+     * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + version_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object kubernetesNamespace_ = ""; + /** + * + * + *
+     * Optional. The namespace to use in the kubeconfig context.
+     *
+     * If this field is specified, the server will set the `namespace` field in
+     * kubeconfig context. If not specified, the `namespace` field is omitted.
+     * 
+ * + * string kubernetes_namespace = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kubernetesNamespace. + */ + public java.lang.String getKubernetesNamespace() { + java.lang.Object ref = kubernetesNamespace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kubernetesNamespace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The namespace to use in the kubeconfig context.
+     *
+     * If this field is specified, the server will set the `namespace` field in
+     * kubeconfig context. If not specified, the `namespace` field is omitted.
+     * 
+ * + * string kubernetes_namespace = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kubernetesNamespace. + */ + public com.google.protobuf.ByteString getKubernetesNamespaceBytes() { + java.lang.Object ref = kubernetesNamespace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kubernetesNamespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The namespace to use in the kubeconfig context.
+     *
+     * If this field is specified, the server will set the `namespace` field in
+     * kubeconfig context. If not specified, the `namespace` field is omitted.
+     * 
+ * + * string kubernetes_namespace = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The kubernetesNamespace to set. + * @return This builder for chaining. + */ + public Builder setKubernetesNamespace(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kubernetesNamespace_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The namespace to use in the kubeconfig context.
+     *
+     * If this field is specified, the server will set the `namespace` field in
+     * kubeconfig context. If not specified, the `namespace` field is omitted.
+     * 
+ * + * string kubernetes_namespace = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKubernetesNamespace() { + kubernetesNamespace_ = getDefaultInstance().getKubernetesNamespace(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The namespace to use in the kubeconfig context.
+     *
+     * If this field is specified, the server will set the `namespace` field in
+     * kubeconfig context. If not specified, the `namespace` field is omitted.
+     * 
+ * + * string kubernetes_namespace = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for kubernetesNamespace to set. + * @return This builder for chaining. + */ + public Builder setKubernetesNamespaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kubernetesNamespace_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int operatingSystem_ = 0; + /** + * + * + *
+     * Optional. The operating system where the kubeconfig will be used.
+     * 
+ * + * + * .google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem operating_system = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for operatingSystem. + */ + @java.lang.Override + public int getOperatingSystemValue() { + return operatingSystem_; + } + /** + * + * + *
+     * Optional. The operating system where the kubeconfig will be used.
+     * 
+ * + * + * .google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem operating_system = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for operatingSystem to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystemValue(int value) { + operatingSystem_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The operating system where the kubeconfig will be used.
+     * 
+ * + * + * .google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem operating_system = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The operatingSystem. + */ + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + getOperatingSystem() { + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + result = + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + .forNumber(operatingSystem_); + return result == null + ? com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The operating system where the kubeconfig will be used.
+     * 
+ * + * + * .google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem operating_system = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The operatingSystem to set. + * @return This builder for chaining. + */ + public Builder setOperatingSystem( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + operatingSystem_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The operating system where the kubeconfig will be used.
+     * 
+ * + * + * .google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem operating_system = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearOperatingSystem() { + bitField0_ = (bitField0_ & ~0x00000010); + operatingSystem_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) + private static final com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest(); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateCredentialsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsRequestOrBuilder.java b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsRequestOrBuilder.java new file mode 100644 index 000000000000..5ff85af0dfed --- /dev/null +++ b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsRequestOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gkeconnect/gateway/v1beta1/control.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.gkeconnect.gateway.v1beta1; + +public interface GenerateCredentialsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Fleet membership resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The Fleet membership resource.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Whether to force the use of Connect Agent-based transport.
+   *
+   * This will return a configuration that uses Connect Agent as the underlying
+   * transport mechanism for cluster types that would otherwise have used a
+   * different transport. Requires that Connect Agent be installed on the
+   * cluster. Setting this field to false is equivalent to not setting it.
+   * 
+ * + * bool force_use_agent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The forceUseAgent. + */ + boolean getForceUseAgent(); + + /** + * + * + *
+   * Optional. The Connect Gateway version to be used in the resulting
+   * configuration.
+   *
+   * Leave this field blank to let the server choose the version (recommended).
+   * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * Optional. The Connect Gateway version to be used in the resulting
+   * configuration.
+   *
+   * Leave this field blank to let the server choose the version (recommended).
+   * 
+ * + * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
+   * Optional. The namespace to use in the kubeconfig context.
+   *
+   * If this field is specified, the server will set the `namespace` field in
+   * kubeconfig context. If not specified, the `namespace` field is omitted.
+   * 
+ * + * string kubernetes_namespace = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kubernetesNamespace. + */ + java.lang.String getKubernetesNamespace(); + /** + * + * + *
+   * Optional. The namespace to use in the kubeconfig context.
+   *
+   * If this field is specified, the server will set the `namespace` field in
+   * kubeconfig context. If not specified, the `namespace` field is omitted.
+   * 
+ * + * string kubernetes_namespace = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kubernetesNamespace. + */ + com.google.protobuf.ByteString getKubernetesNamespaceBytes(); + + /** + * + * + *
+   * Optional. The operating system where the kubeconfig will be used.
+   * 
+ * + * + * .google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem operating_system = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for operatingSystem. + */ + int getOperatingSystemValue(); + /** + * + * + *
+   * Optional. The operating system where the kubeconfig will be used.
+   * 
+ * + * + * .google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem operating_system = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The operatingSystem. + */ + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem + getOperatingSystem(); +} diff --git a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsResponse.java b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsResponse.java new file mode 100644 index 000000000000..4e0fd85f4f3f --- /dev/null +++ b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsResponse.java @@ -0,0 +1,744 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gkeconnect/gateway/v1beta1/control.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.gkeconnect.gateway.v1beta1; + +/** + * + * + *
+ * Connection information for a particular membership.
+ * 
+ * + * Protobuf type {@code google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse} + */ +public final class GenerateCredentialsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) + GenerateCredentialsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateCredentialsResponse.newBuilder() to construct. + private GenerateCredentialsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateCredentialsResponse() { + kubeconfig_ = com.google.protobuf.ByteString.EMPTY; + endpoint_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateCredentialsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.class, + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.Builder.class); + } + + public static final int KUBECONFIG_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString kubeconfig_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * A full YAML kubeconfig in serialized format.
+   * 
+ * + * bytes kubeconfig = 1; + * + * @return The kubeconfig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKubeconfig() { + return kubeconfig_; + } + + public static final int ENDPOINT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * The generated URI of the cluster as accessed through the Connect Gateway
+   * API.
+   * 
+ * + * string endpoint = 2; + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + 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(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * The generated URI of the cluster as accessed through the Connect Gateway
+   * API.
+   * 
+ * + * string endpoint = 2; + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!kubeconfig_.isEmpty()) { + output.writeBytes(1, kubeconfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, endpoint_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!kubeconfig_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, kubeconfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, endpoint_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse)) { + return super.equals(obj); + } + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse other = + (com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) obj; + + if (!getKubeconfig().equals(other.getKubeconfig())) return false; + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KUBECONFIG_FIELD_NUMBER; + hash = (53 * hash) + getKubeconfig().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Connection information for a particular membership.
+   * 
+ * + * Protobuf type {@code google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.class, + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kubeconfig_ = com.google.protobuf.ByteString.EMPTY; + endpoint_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkeconnect.gateway.v1beta1.ControlProto + .internal_static_google_cloud_gkeconnect_gateway_v1beta1_GenerateCredentialsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + getDefaultInstanceForType() { + return com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse build() { + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse buildPartial() { + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse result = + new com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kubeconfig_ = kubeconfig_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endpoint_ = endpoint_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) { + return mergeFrom( + (com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse other) { + if (other + == com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + .getDefaultInstance()) return this; + if (other.getKubeconfig() != com.google.protobuf.ByteString.EMPTY) { + setKubeconfig(other.getKubeconfig()); + } + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kubeconfig_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString kubeconfig_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * A full YAML kubeconfig in serialized format.
+     * 
+ * + * bytes kubeconfig = 1; + * + * @return The kubeconfig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKubeconfig() { + return kubeconfig_; + } + /** + * + * + *
+     * A full YAML kubeconfig in serialized format.
+     * 
+ * + * bytes kubeconfig = 1; + * + * @param value The kubeconfig to set. + * @return This builder for chaining. + */ + public Builder setKubeconfig(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + kubeconfig_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A full YAML kubeconfig in serialized format.
+     * 
+ * + * bytes kubeconfig = 1; + * + * @return This builder for chaining. + */ + public Builder clearKubeconfig() { + bitField0_ = (bitField0_ & ~0x00000001); + kubeconfig_ = getDefaultInstance().getKubeconfig(); + onChanged(); + return this; + } + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * The generated URI of the cluster as accessed through the Connect Gateway
+     * API.
+     * 
+ * + * string endpoint = 2; + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The generated URI of the cluster as accessed through the Connect Gateway
+     * API.
+     * 
+ * + * string endpoint = 2; + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The generated URI of the cluster as accessed through the Connect Gateway
+     * API.
+     * 
+ * + * string endpoint = 2; + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The generated URI of the cluster as accessed through the Connect Gateway
+     * API.
+     * 
+ * + * string endpoint = 2; + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The generated URI of the cluster as accessed through the Connect Gateway
+     * API.
+     * 
+ * + * string endpoint = 2; + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) + private static final com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse(); + } + + public static com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateCredentialsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsResponseOrBuilder.java b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsResponseOrBuilder.java new file mode 100644 index 000000000000..59487d8c5ef0 --- /dev/null +++ b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GenerateCredentialsResponseOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gkeconnect/gateway/v1beta1/control.proto + +// Protobuf Java Version: 3.25.4 +package com.google.cloud.gkeconnect.gateway.v1beta1; + +public interface GenerateCredentialsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A full YAML kubeconfig in serialized format.
+   * 
+ * + * bytes kubeconfig = 1; + * + * @return The kubeconfig. + */ + com.google.protobuf.ByteString getKubeconfig(); + + /** + * + * + *
+   * The generated URI of the cluster as accessed through the Connect Gateway
+   * API.
+   * 
+ * + * string endpoint = 2; + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * The generated URI of the cluster as accessed through the Connect Gateway
+   * API.
+   * 
+ * + * string endpoint = 2; + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); +} diff --git a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/proto/google/cloud/gkeconnect/gateway/v1beta1/control.proto b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/proto/google/cloud/gkeconnect/gateway/v1beta1/control.proto new file mode 100644 index 000000000000..3458153b20bf --- /dev/null +++ b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/proto/google/cloud/gkeconnect/gateway/v1beta1/control.proto @@ -0,0 +1,95 @@ +// Copyright 2024 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.gkeconnect.gateway.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.GkeConnect.Gateway.V1Beta1"; +option go_package = "cloud.google.com/go/gkeconnect/gateway/apiv1beta1/gatewaypb;gatewaypb"; +option java_multiple_files = true; +option java_outer_classname = "ControlProto"; +option java_package = "com.google.cloud.gkeconnect.gateway.v1beta1"; +option php_namespace = "Google\\Cloud\\GkeConnect\\Gateway\\V1beta1"; +option ruby_package = "Google::Cloud::GkeConnect::Gateway::V1beta1"; + +// GatewayControl is the control plane API for Connect Gateway. +service GatewayControl { + option (google.api.default_host) = "connectgateway.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // GenerateCredentials provides connection information that allows a user to + // access the specified membership using Connect Gateway. + rpc GenerateCredentials(GenerateCredentialsRequest) + returns (GenerateCredentialsResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateCredentials" + }; + } +} + +// A request for connection information for a particular membership. +message GenerateCredentialsRequest { + // Operating systems requiring specialized kubeconfigs. + enum OperatingSystem { + // Generates a kubeconfig that works for all operating systems not defined + // below. + OPERATING_SYSTEM_UNSPECIFIED = 0; + + // Generates a kubeconfig that is specifically designed to work with + // Windows. + OPERATING_SYSTEM_WINDOWS = 1; + } + + // Required. The Fleet membership resource. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether to force the use of Connect Agent-based transport. + // + // This will return a configuration that uses Connect Agent as the underlying + // transport mechanism for cluster types that would otherwise have used a + // different transport. Requires that Connect Agent be installed on the + // cluster. Setting this field to false is equivalent to not setting it. + bool force_use_agent = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Connect Gateway version to be used in the resulting + // configuration. + // + // Leave this field blank to let the server choose the version (recommended). + string version = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The namespace to use in the kubeconfig context. + // + // If this field is specified, the server will set the `namespace` field in + // kubeconfig context. If not specified, the `namespace` field is omitted. + string kubernetes_namespace = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The operating system where the kubeconfig will be used. + OperatingSystem operating_system = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Connection information for a particular membership. +message GenerateCredentialsResponse { + // A full YAML kubeconfig in serialized format. + bytes kubeconfig = 1; + + // The generated URI of the cluster as accessed through the Connect Gateway + // API. + string endpoint = 2; +} diff --git a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/proto/google/cloud/gkeconnect/gateway/v1beta1/gateway.proto b/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/proto/google/cloud/gkeconnect/gateway/v1beta1/gateway.proto deleted file mode 100644 index b1fd9dea0312..000000000000 --- a/java-gke-connect-gateway/proto-google-cloud-gke-connect-gateway-v1beta1/src/main/proto/google/cloud/gkeconnect/gateway/v1beta1/gateway.proto +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2024 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.gkeconnect.gateway.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/httpbody.proto"; - -option csharp_namespace = "Google.Cloud.GkeConnect.Gateway.V1Beta1"; -option go_package = "cloud.google.com/go/gkeconnect/gateway/apiv1beta1/gatewaypb;gatewaypb"; -option java_multiple_files = true; -option java_outer_classname = "GatewayProto"; -option java_package = "com.google.cloud.gkeconnect.gateway.v1beta1"; -option php_namespace = "Google\\Cloud\\GkeConnect\\Gateway\\V1beta1"; -option ruby_package = "Google::Cloud::GkeConnect::Gateway::V1beta1"; - -// Gateway service is a public API which works as a Kubernetes resource model -// proxy between end users and registered Kubernetes clusters. Each RPC in this -// service matches with an HTTP verb. End user will initiate kubectl commands -// against the Gateway service, and Gateway service will forward user requests -// to clusters. -service GatewayService { - option (google.api.default_host) = "connectgateway.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // GetResource performs an HTTP GET request on the Kubernetes API Server. - rpc GetResource(google.api.HttpBody) returns (google.api.HttpBody) { - option (google.api.http) = { - get: "/v1beta1/**" - }; - } - - // PostResource performs an HTTP POST on the Kubernetes API Server. - rpc PostResource(google.api.HttpBody) returns (google.api.HttpBody) { - option (google.api.http) = { - post: "/v1beta1/**" - }; - } - - // DeleteResource performs an HTTP DELETE on the Kubernetes API Server. - rpc DeleteResource(google.api.HttpBody) returns (google.api.HttpBody) { - option (google.api.http) = { - delete: "/v1beta1/**" - }; - } - - // PutResource performs an HTTP PUT on the Kubernetes API Server. - rpc PutResource(google.api.HttpBody) returns (google.api.HttpBody) { - option (google.api.http) = { - put: "/v1beta1/**" - }; - } - - // PatchResource performs an HTTP PATCH on the Kubernetes API Server. - rpc PatchResource(google.api.HttpBody) returns (google.api.HttpBody) { - option (google.api.http) = { - patch: "/v1beta1/**" - }; - } -} diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/create/SyncCreateSetCredentialsProvider.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/create/SyncCreateSetCredentialsProvider.java similarity index 77% rename from java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/create/SyncCreateSetCredentialsProvider.java rename to java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/create/SyncCreateSetCredentialsProvider.java index cf5ed87f0935..e14da0ad22f1 100644 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/create/SyncCreateSetCredentialsProvider.java +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/create/SyncCreateSetCredentialsProvider.java @@ -16,10 +16,10 @@ package com.google.cloud.gkeconnect.gateway.v1beta1.samples; -// [START connectgateway_v1beta1_generated_GatewayService_Create_SetCredentialsProvider_sync] +// [START connectgateway_v1beta1_generated_GatewayControl_Create_SetCredentialsProvider_sync] import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceSettings; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayControlClient; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayControlSettings; import com.google.cloud.gkeconnect.gateway.v1beta1.myCredentials; public class SyncCreateSetCredentialsProvider { @@ -34,11 +34,11 @@ public static void syncCreateSetCredentialsProvider() throws Exception { // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - GatewayServiceSettings gatewayServiceSettings = - GatewayServiceSettings.newBuilder() + GatewayControlSettings gatewayControlSettings = + GatewayControlSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); - GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create(gatewayServiceSettings); + GatewayControlClient gatewayControlClient = GatewayControlClient.create(gatewayControlSettings); } } -// [END connectgateway_v1beta1_generated_GatewayService_Create_SetCredentialsProvider_sync] +// [END connectgateway_v1beta1_generated_GatewayControl_Create_SetCredentialsProvider_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/create/SyncCreateSetEndpoint.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/create/SyncCreateSetEndpoint.java similarity index 73% rename from java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/create/SyncCreateSetEndpoint.java rename to java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/create/SyncCreateSetEndpoint.java index ec981cb4c110..5fcf26c8e196 100644 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/create/SyncCreateSetEndpoint.java +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/create/SyncCreateSetEndpoint.java @@ -16,9 +16,9 @@ package com.google.cloud.gkeconnect.gateway.v1beta1.samples; -// [START connectgateway_v1beta1_generated_GatewayService_Create_SetEndpoint_sync] -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceSettings; +// [START connectgateway_v1beta1_generated_GatewayControl_Create_SetEndpoint_sync] +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayControlClient; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayControlSettings; import com.google.cloud.gkeconnect.gateway.v1beta1.myEndpoint; public class SyncCreateSetEndpoint { @@ -33,9 +33,9 @@ public static void syncCreateSetEndpoint() throws Exception { // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - GatewayServiceSettings gatewayServiceSettings = - GatewayServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); - GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create(gatewayServiceSettings); + GatewayControlSettings gatewayControlSettings = + GatewayControlSettings.newBuilder().setEndpoint(myEndpoint).build(); + GatewayControlClient gatewayControlClient = GatewayControlClient.create(gatewayControlSettings); } } -// [END connectgateway_v1beta1_generated_GatewayService_Create_SetEndpoint_sync] +// [END connectgateway_v1beta1_generated_GatewayControl_Create_SetEndpoint_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/patchresource/AsyncPatchResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/generatecredentials/AsyncGenerateCredentials.java similarity index 52% rename from java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/patchresource/AsyncPatchResource.java rename to java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/generatecredentials/AsyncGenerateCredentials.java index aa8884b0d070..2134cb2cf6b1 100644 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/patchresource/AsyncPatchResource.java +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/generatecredentials/AsyncGenerateCredentials.java @@ -16,37 +16,37 @@ package com.google.cloud.gkeconnect.gateway.v1beta1.samples; -// [START connectgateway_v1beta1_generated_GatewayService_PatchResource_async] -import com.google.api.HttpBody; +// [START connectgateway_v1beta1_generated_GatewayControl_GenerateCredentials_async] import com.google.api.core.ApiFuture; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayControlClient; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse; -public class AsyncPatchResource { +public class AsyncGenerateCredentials { public static void main(String[] args) throws Exception { - asyncPatchResource(); + asyncGenerateCredentials(); } - public static void asyncPatchResource() throws Exception { + public static void asyncGenerateCredentials() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) + try (GatewayControlClient gatewayControlClient = GatewayControlClient.create()) { + GenerateCredentialsRequest request = + GenerateCredentialsRequest.newBuilder() + .setName("name3373707") + .setForceUseAgent(true) + .setVersion("version351608024") + .setKubernetesNamespace("kubernetesNamespace-1862862667") .build(); - ApiFuture future = gatewayServiceClient.patchResourceCallable().futureCall(request); + ApiFuture future = + gatewayControlClient.generateCredentialsCallable().futureCall(request); // Do something. - HttpBody response = future.get(); + GenerateCredentialsResponse response = future.get(); } } } -// [END connectgateway_v1beta1_generated_GatewayService_PatchResource_async] +// [END connectgateway_v1beta1_generated_GatewayControl_GenerateCredentials_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/deleteresource/SyncDeleteResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/generatecredentials/SyncGenerateCredentials.java similarity index 53% rename from java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/deleteresource/SyncDeleteResource.java rename to java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/generatecredentials/SyncGenerateCredentials.java index b7f2c585d1f3..2a279f7ab343 100644 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/deleteresource/SyncDeleteResource.java +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrol/generatecredentials/SyncGenerateCredentials.java @@ -16,34 +16,33 @@ package com.google.cloud.gkeconnect.gateway.v1beta1.samples; -// [START connectgateway_v1beta1_generated_GatewayService_DeleteResource_sync] -import com.google.api.HttpBody; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; +// [START connectgateway_v1beta1_generated_GatewayControl_GenerateCredentials_sync] +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayControlClient; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest; +import com.google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsResponse; -public class SyncDeleteResource { +public class SyncGenerateCredentials { public static void main(String[] args) throws Exception { - syncDeleteResource(); + syncGenerateCredentials(); } - public static void syncDeleteResource() throws Exception { + public static void syncGenerateCredentials() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) + try (GatewayControlClient gatewayControlClient = GatewayControlClient.create()) { + GenerateCredentialsRequest request = + GenerateCredentialsRequest.newBuilder() + .setName("name3373707") + .setForceUseAgent(true) + .setVersion("version351608024") + .setKubernetesNamespace("kubernetesNamespace-1862862667") .build(); - HttpBody response = gatewayServiceClient.deleteResource(request); + GenerateCredentialsResponse response = gatewayControlClient.generateCredentials(request); } } } -// [END connectgateway_v1beta1_generated_GatewayService_DeleteResource_sync] +// [END connectgateway_v1beta1_generated_GatewayControl_GenerateCredentials_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservicesettings/getresource/SyncGetResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrolsettings/generatecredentials/SyncGenerateCredentials.java similarity index 64% rename from java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservicesettings/getresource/SyncGetResource.java rename to java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrolsettings/generatecredentials/SyncGenerateCredentials.java index 753d1fb775ca..27ed376e1c92 100644 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservicesettings/getresource/SyncGetResource.java +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewaycontrolsettings/generatecredentials/SyncGenerateCredentials.java @@ -16,34 +16,34 @@ package com.google.cloud.gkeconnect.gateway.v1beta1.samples; -// [START connectgateway_v1beta1_generated_GatewayServiceSettings_GetResource_sync] -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceSettings; +// [START connectgateway_v1beta1_generated_GatewayControlSettings_GenerateCredentials_sync] +import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayControlSettings; import java.time.Duration; -public class SyncGetResource { +public class SyncGenerateCredentials { public static void main(String[] args) throws Exception { - syncGetResource(); + syncGenerateCredentials(); } - public static void syncGetResource() throws Exception { + public static void syncGenerateCredentials() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - GatewayServiceSettings.Builder gatewayServiceSettingsBuilder = - GatewayServiceSettings.newBuilder(); - gatewayServiceSettingsBuilder - .getResourceSettings() + GatewayControlSettings.Builder gatewayControlSettingsBuilder = + GatewayControlSettings.newBuilder(); + gatewayControlSettingsBuilder + .generateCredentialsSettings() .setRetrySettings( - gatewayServiceSettingsBuilder - .getResourceSettings() + gatewayControlSettingsBuilder + .generateCredentialsSettings() .getRetrySettings() .toBuilder() .setTotalTimeout(Duration.ofSeconds(30)) .build()); - GatewayServiceSettings gatewayServiceSettings = gatewayServiceSettingsBuilder.build(); + GatewayControlSettings gatewayControlSettings = gatewayControlSettingsBuilder.build(); } } -// [END connectgateway_v1beta1_generated_GatewayServiceSettings_GetResource_sync] +// [END connectgateway_v1beta1_generated_GatewayControlSettings_GenerateCredentials_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/getresource/AsyncGetResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/getresource/AsyncGetResource.java deleted file mode 100644 index cfa38d4e8479..000000000000 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/getresource/AsyncGetResource.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1.samples; - -// [START connectgateway_v1beta1_generated_GatewayService_GetResource_async] -import com.google.api.HttpBody; -import com.google.api.core.ApiFuture; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; - -public class AsyncGetResource { - - public static void main(String[] args) throws Exception { - asyncGetResource(); - } - - public static void asyncGetResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - ApiFuture future = gatewayServiceClient.getResourceCallable().futureCall(request); - // Do something. - HttpBody response = future.get(); - } - } -} -// [END connectgateway_v1beta1_generated_GatewayService_GetResource_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/getresource/SyncGetResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/getresource/SyncGetResource.java deleted file mode 100644 index 8b1cda116632..000000000000 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/getresource/SyncGetResource.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1.samples; - -// [START connectgateway_v1beta1_generated_GatewayService_GetResource_sync] -import com.google.api.HttpBody; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; - -public class SyncGetResource { - - public static void main(String[] args) throws Exception { - syncGetResource(); - } - - public static void syncGetResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - HttpBody response = gatewayServiceClient.getResource(request); - } - } -} -// [END connectgateway_v1beta1_generated_GatewayService_GetResource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/patchresource/SyncPatchResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/patchresource/SyncPatchResource.java deleted file mode 100644 index 02d396007d2e..000000000000 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/patchresource/SyncPatchResource.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1.samples; - -// [START connectgateway_v1beta1_generated_GatewayService_PatchResource_sync] -import com.google.api.HttpBody; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; - -public class SyncPatchResource { - - public static void main(String[] args) throws Exception { - syncPatchResource(); - } - - public static void syncPatchResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - HttpBody response = gatewayServiceClient.patchResource(request); - } - } -} -// [END connectgateway_v1beta1_generated_GatewayService_PatchResource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/postresource/AsyncPostResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/postresource/AsyncPostResource.java deleted file mode 100644 index 27419f72478d..000000000000 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/postresource/AsyncPostResource.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1.samples; - -// [START connectgateway_v1beta1_generated_GatewayService_PostResource_async] -import com.google.api.HttpBody; -import com.google.api.core.ApiFuture; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; - -public class AsyncPostResource { - - public static void main(String[] args) throws Exception { - asyncPostResource(); - } - - public static void asyncPostResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - ApiFuture future = gatewayServiceClient.postResourceCallable().futureCall(request); - // Do something. - HttpBody response = future.get(); - } - } -} -// [END connectgateway_v1beta1_generated_GatewayService_PostResource_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/postresource/SyncPostResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/postresource/SyncPostResource.java deleted file mode 100644 index fafd466cf868..000000000000 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/postresource/SyncPostResource.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1.samples; - -// [START connectgateway_v1beta1_generated_GatewayService_PostResource_sync] -import com.google.api.HttpBody; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; - -public class SyncPostResource { - - public static void main(String[] args) throws Exception { - syncPostResource(); - } - - public static void syncPostResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - HttpBody response = gatewayServiceClient.postResource(request); - } - } -} -// [END connectgateway_v1beta1_generated_GatewayService_PostResource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/putresource/AsyncPutResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/putresource/AsyncPutResource.java deleted file mode 100644 index a86b9dfd7b45..000000000000 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/putresource/AsyncPutResource.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1.samples; - -// [START connectgateway_v1beta1_generated_GatewayService_PutResource_async] -import com.google.api.HttpBody; -import com.google.api.core.ApiFuture; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; - -public class AsyncPutResource { - - public static void main(String[] args) throws Exception { - asyncPutResource(); - } - - public static void asyncPutResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - ApiFuture future = gatewayServiceClient.putResourceCallable().futureCall(request); - // Do something. - HttpBody response = future.get(); - } - } -} -// [END connectgateway_v1beta1_generated_GatewayService_PutResource_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/putresource/SyncPutResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/putresource/SyncPutResource.java deleted file mode 100644 index 5c03d3d0c547..000000000000 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/putresource/SyncPutResource.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2024 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.gkeconnect.gateway.v1beta1.samples; - -// [START connectgateway_v1beta1_generated_GatewayService_PutResource_sync] -import com.google.api.HttpBody; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; - -public class SyncPutResource { - - public static void main(String[] args) throws Exception { - syncPutResource(); - } - - public static void syncPutResource() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) - .build(); - HttpBody response = gatewayServiceClient.putResource(request); - } - } -} -// [END connectgateway_v1beta1_generated_GatewayService_PutResource_sync] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/gatewayservicestubsettings/getresource/SyncGetResource.java b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/gatewaycontrolstubsettings/generatecredentials/SyncGenerateCredentials.java similarity index 63% rename from java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/gatewayservicestubsettings/getresource/SyncGetResource.java rename to java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/gatewaycontrolstubsettings/generatecredentials/SyncGenerateCredentials.java index f06fb8f0fcb8..ae5da1a90a79 100644 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/gatewayservicestubsettings/getresource/SyncGetResource.java +++ b/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/stub/gatewaycontrolstubsettings/generatecredentials/SyncGenerateCredentials.java @@ -16,34 +16,34 @@ package com.google.cloud.gkeconnect.gateway.v1beta1.stub.samples; -// [START connectgateway_v1beta1_generated_GatewayServiceStubSettings_GetResource_sync] -import com.google.cloud.gkeconnect.gateway.v1beta1.stub.GatewayServiceStubSettings; +// [START connectgateway_v1beta1_generated_GatewayControlStubSettings_GenerateCredentials_sync] +import com.google.cloud.gkeconnect.gateway.v1beta1.stub.GatewayControlStubSettings; import java.time.Duration; -public class SyncGetResource { +public class SyncGenerateCredentials { public static void main(String[] args) throws Exception { - syncGetResource(); + syncGenerateCredentials(); } - public static void syncGetResource() throws Exception { + public static void syncGenerateCredentials() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - GatewayServiceStubSettings.Builder gatewayServiceSettingsBuilder = - GatewayServiceStubSettings.newBuilder(); - gatewayServiceSettingsBuilder - .getResourceSettings() + GatewayControlStubSettings.Builder gatewayControlSettingsBuilder = + GatewayControlStubSettings.newBuilder(); + gatewayControlSettingsBuilder + .generateCredentialsSettings() .setRetrySettings( - gatewayServiceSettingsBuilder - .getResourceSettings() + gatewayControlSettingsBuilder + .generateCredentialsSettings() .getRetrySettings() .toBuilder() .setTotalTimeout(Duration.ofSeconds(30)) .build()); - GatewayServiceStubSettings gatewayServiceSettings = gatewayServiceSettingsBuilder.build(); + GatewayControlStubSettings gatewayControlSettings = gatewayControlSettingsBuilder.build(); } } -// [END connectgateway_v1beta1_generated_GatewayServiceStubSettings_GetResource_sync] +// [END connectgateway_v1beta1_generated_GatewayControlStubSettings_GenerateCredentials_sync] diff --git a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient.java b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient.java index d4cf8d5800d5..e93be9987914 100644 --- a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient.java +++ b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient.java @@ -30,6 +30,8 @@ import com.google.protobuf.ByteString; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; +import com.google.recaptchaenterprise.v1.AddIpOverrideRequest; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; import com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest; import com.google.recaptchaenterprise.v1.AnnotateAssessmentResponse; import com.google.recaptchaenterprise.v1.Assessment; @@ -44,6 +46,7 @@ import com.google.recaptchaenterprise.v1.GetFirewallPolicyRequest; import com.google.recaptchaenterprise.v1.GetKeyRequest; import com.google.recaptchaenterprise.v1.GetMetricsRequest; +import com.google.recaptchaenterprise.v1.IpOverrideData; import com.google.recaptchaenterprise.v1.Key; import com.google.recaptchaenterprise.v1.KeyName; import com.google.recaptchaenterprise.v1.ListFirewallPoliciesRequest; @@ -273,6 +276,29 @@ * * * + *

AddIpOverride + *

Adds an IP override to a key. The following restrictions hold: + *

    + *
  • The maximum number of IP overrides per key is 100. + *
  • For any conflict (such as IP already exists or IP part of an existing IP range), an error will be returned. + *
+ * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • addIpOverride(AddIpOverrideRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • addIpOverride(KeyName name, IpOverrideData ipOverrideData) + *

  • addIpOverride(String name, IpOverrideData ipOverrideData) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • addIpOverrideCallable() + *

+ * + * + * *

GetMetrics *

Get some aggregated metrics for a Key. This data can be used to build dashboards. * @@ -1632,6 +1658,157 @@ public final UnaryCallable migrateKeyCallable() { return stub.migrateKeyCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an IP override to a key. The following restrictions hold: + * + *

    + *
  • The maximum number of IP overrides per key is 100. + *
  • For any conflict (such as IP already exists or IP part of an existing IP range), an error + * will be returned. + *
+ * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   KeyName name = KeyName.of("[PROJECT]", "[KEY]");
+   *   IpOverrideData ipOverrideData = IpOverrideData.newBuilder().build();
+   *   AddIpOverrideResponse response =
+   *       recaptchaEnterpriseServiceClient.addIpOverride(name, ipOverrideData);
+   * }
+   * }
+ * + * @param name Required. The name of the key to which the IP override is added, in the format + * `projects/{project}/keys/{key}`. + * @param ipOverrideData Required. IP override added to the key. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AddIpOverrideResponse addIpOverride(KeyName name, IpOverrideData ipOverrideData) { + AddIpOverrideRequest request = + AddIpOverrideRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setIpOverrideData(ipOverrideData) + .build(); + return addIpOverride(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an IP override to a key. The following restrictions hold: + * + *
    + *
  • The maximum number of IP overrides per key is 100. + *
  • For any conflict (such as IP already exists or IP part of an existing IP range), an error + * will be returned. + *
+ * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   String name = KeyName.of("[PROJECT]", "[KEY]").toString();
+   *   IpOverrideData ipOverrideData = IpOverrideData.newBuilder().build();
+   *   AddIpOverrideResponse response =
+   *       recaptchaEnterpriseServiceClient.addIpOverride(name, ipOverrideData);
+   * }
+   * }
+ * + * @param name Required. The name of the key to which the IP override is added, in the format + * `projects/{project}/keys/{key}`. + * @param ipOverrideData Required. IP override added to the key. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AddIpOverrideResponse addIpOverride(String name, IpOverrideData ipOverrideData) { + AddIpOverrideRequest request = + AddIpOverrideRequest.newBuilder().setName(name).setIpOverrideData(ipOverrideData).build(); + return addIpOverride(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an IP override to a key. The following restrictions hold: + * + *
    + *
  • The maximum number of IP overrides per key is 100. + *
  • For any conflict (such as IP already exists or IP part of an existing IP range), an error + * will be returned. + *
+ * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   AddIpOverrideRequest request =
+   *       AddIpOverrideRequest.newBuilder()
+   *           .setName(KeyName.of("[PROJECT]", "[KEY]").toString())
+   *           .setIpOverrideData(IpOverrideData.newBuilder().build())
+   *           .build();
+   *   AddIpOverrideResponse response = recaptchaEnterpriseServiceClient.addIpOverride(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AddIpOverrideResponse addIpOverride(AddIpOverrideRequest request) { + return addIpOverrideCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds an IP override to a key. The following restrictions hold: + * + *
    + *
  • The maximum number of IP overrides per key is 100. + *
  • For any conflict (such as IP already exists or IP part of an existing IP range), an error + * will be returned. + *
+ * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   AddIpOverrideRequest request =
+   *       AddIpOverrideRequest.newBuilder()
+   *           .setName(KeyName.of("[PROJECT]", "[KEY]").toString())
+   *           .setIpOverrideData(IpOverrideData.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       recaptchaEnterpriseServiceClient.addIpOverrideCallable().futureCall(request);
+   *   // Do something.
+   *   AddIpOverrideResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable addIpOverrideCallable() { + return stub.addIpOverrideCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get some aggregated metrics for a Key. This data can be used to build dashboards. diff --git a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceSettings.java b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceSettings.java index a8de103ab103..3dea908eb4b9 100644 --- a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceSettings.java +++ b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceSettings.java @@ -34,6 +34,8 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.recaptchaenterprise.v1.stub.RecaptchaEnterpriseServiceStubSettings; import com.google.protobuf.Empty; +import com.google.recaptchaenterprise.v1.AddIpOverrideRequest; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; import com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest; import com.google.recaptchaenterprise.v1.AnnotateAssessmentResponse; import com.google.recaptchaenterprise.v1.Assessment; @@ -162,6 +164,11 @@ public UnaryCallSettings migrateKeySettings() { return ((RecaptchaEnterpriseServiceStubSettings) getStubSettings()).migrateKeySettings(); } + /** Returns the object with the settings used for calls to addIpOverride. */ + public UnaryCallSettings addIpOverrideSettings() { + return ((RecaptchaEnterpriseServiceStubSettings) getStubSettings()).addIpOverrideSettings(); + } + /** Returns the object with the settings used for calls to getMetrics. */ public UnaryCallSettings getMetricsSettings() { return ((RecaptchaEnterpriseServiceStubSettings) getStubSettings()).getMetricsSettings(); @@ -388,6 +395,12 @@ public UnaryCallSettings.Builder migrateKeySettings() { return getStubSettingsBuilder().migrateKeySettings(); } + /** Returns the builder for the settings used for calls to addIpOverride. */ + public UnaryCallSettings.Builder + addIpOverrideSettings() { + return getStubSettingsBuilder().addIpOverrideSettings(); + } + /** Returns the builder for the settings used for calls to getMetrics. */ public UnaryCallSettings.Builder getMetricsSettings() { return getStubSettingsBuilder().getMetricsSettings(); diff --git a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/gapic_metadata.json b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/gapic_metadata.json index 0c173472f339..e4942004a83b 100644 --- a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/gapic_metadata.json +++ b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/gapic_metadata.json @@ -10,6 +10,9 @@ "grpc": { "libraryClient": "RecaptchaEnterpriseServiceClient", "rpcs": { + "AddIpOverride": { + "methods": ["addIpOverride", "addIpOverride", "addIpOverride", "addIpOverrideCallable"] + }, "AnnotateAssessment": { "methods": ["annotateAssessment", "annotateAssessment", "annotateAssessment", "annotateAssessmentCallable"] }, diff --git a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/GrpcRecaptchaEnterpriseServiceStub.java b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/GrpcRecaptchaEnterpriseServiceStub.java index 11582fe489d5..0c0d04fda742 100644 --- a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/GrpcRecaptchaEnterpriseServiceStub.java +++ b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/GrpcRecaptchaEnterpriseServiceStub.java @@ -31,6 +31,8 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; +import com.google.recaptchaenterprise.v1.AddIpOverrideRequest; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; import com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest; import com.google.recaptchaenterprise.v1.AnnotateAssessmentResponse; import com.google.recaptchaenterprise.v1.Assessment; @@ -168,6 +170,18 @@ public class GrpcRecaptchaEnterpriseServiceStub extends RecaptchaEnterpriseServi .setResponseMarshaller(ProtoUtils.marshaller(Key.getDefaultInstance())) .build(); + private static final MethodDescriptor + addIpOverrideMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/AddIpOverride") + .setRequestMarshaller( + ProtoUtils.marshaller(AddIpOverrideRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AddIpOverrideResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getMetricsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -309,6 +323,7 @@ public class GrpcRecaptchaEnterpriseServiceStub extends RecaptchaEnterpriseServi private final UnaryCallable updateKeyCallable; private final UnaryCallable deleteKeyCallable; private final UnaryCallable migrateKeyCallable; + private final UnaryCallable addIpOverrideCallable; private final UnaryCallable getMetricsCallable; private final UnaryCallable createFirewallPolicyCallable; @@ -482,6 +497,16 @@ protected GrpcRecaptchaEnterpriseServiceStub( return builder.build(); }) .build(); + GrpcCallSettings addIpOverrideTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(addIpOverrideMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); GrpcCallSettings getMetricsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getMetricsMethodDescriptor) @@ -637,6 +662,9 @@ protected GrpcRecaptchaEnterpriseServiceStub( this.migrateKeyCallable = callableFactory.createUnaryCallable( migrateKeyTransportSettings, settings.migrateKeySettings(), clientContext); + this.addIpOverrideCallable = + callableFactory.createUnaryCallable( + addIpOverrideTransportSettings, settings.addIpOverrideSettings(), clientContext); this.getMetricsCallable = callableFactory.createUnaryCallable( getMetricsTransportSettings, settings.getMetricsSettings(), clientContext); @@ -766,6 +794,11 @@ public UnaryCallable migrateKeyCallable() { return migrateKeyCallable; } + @Override + public UnaryCallable addIpOverrideCallable() { + return addIpOverrideCallable; + } + @Override public UnaryCallable getMetricsCallable() { return getMetricsCallable; diff --git a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStub.java b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStub.java index cc98f73d7fc7..8443c4502361 100644 --- a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStub.java +++ b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStub.java @@ -25,6 +25,8 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.protobuf.Empty; +import com.google.recaptchaenterprise.v1.AddIpOverrideRequest; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; import com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest; import com.google.recaptchaenterprise.v1.AnnotateAssessmentResponse; import com.google.recaptchaenterprise.v1.Assessment; @@ -109,6 +111,10 @@ public UnaryCallable migrateKeyCallable() { throw new UnsupportedOperationException("Not implemented: migrateKeyCallable()"); } + public UnaryCallable addIpOverrideCallable() { + throw new UnsupportedOperationException("Not implemented: addIpOverrideCallable()"); + } + public UnaryCallable getMetricsCallable() { throw new UnsupportedOperationException("Not implemented: getMetricsCallable()"); } diff --git a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStubSettings.java b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStubSettings.java index e48fe9b62b8f..496bcbd993a6 100644 --- a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStubSettings.java +++ b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStubSettings.java @@ -49,6 +49,8 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.protobuf.Empty; +import com.google.recaptchaenterprise.v1.AddIpOverrideRequest; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; import com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest; import com.google.recaptchaenterprise.v1.AnnotateAssessmentResponse; import com.google.recaptchaenterprise.v1.Assessment; @@ -145,6 +147,8 @@ public class RecaptchaEnterpriseServiceStubSettings private final UnaryCallSettings updateKeySettings; private final UnaryCallSettings deleteKeySettings; private final UnaryCallSettings migrateKeySettings; + private final UnaryCallSettings + addIpOverrideSettings; private final UnaryCallSettings getMetricsSettings; private final UnaryCallSettings createFirewallPolicySettings; @@ -579,6 +583,11 @@ public UnaryCallSettings migrateKeySettings() { return migrateKeySettings; } + /** Returns the object with the settings used for calls to addIpOverride. */ + public UnaryCallSettings addIpOverrideSettings() { + return addIpOverrideSettings; + } + /** Returns the object with the settings used for calls to getMetrics. */ public UnaryCallSettings getMetricsSettings() { return getMetricsSettings; @@ -740,6 +749,7 @@ protected RecaptchaEnterpriseServiceStubSettings(Builder settingsBuilder) throws updateKeySettings = settingsBuilder.updateKeySettings().build(); deleteKeySettings = settingsBuilder.deleteKeySettings().build(); migrateKeySettings = settingsBuilder.migrateKeySettings().build(); + addIpOverrideSettings = settingsBuilder.addIpOverrideSettings().build(); getMetricsSettings = settingsBuilder.getMetricsSettings().build(); createFirewallPolicySettings = settingsBuilder.createFirewallPolicySettings().build(); listFirewallPoliciesSettings = settingsBuilder.listFirewallPoliciesSettings().build(); @@ -773,6 +783,8 @@ public static class Builder private final UnaryCallSettings.Builder updateKeySettings; private final UnaryCallSettings.Builder deleteKeySettings; private final UnaryCallSettings.Builder migrateKeySettings; + private final UnaryCallSettings.Builder + addIpOverrideSettings; private final UnaryCallSettings.Builder getMetricsSettings; private final UnaryCallSettings.Builder createFirewallPolicySettings; @@ -851,6 +863,7 @@ protected Builder(ClientContext clientContext) { updateKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); migrateKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + addIpOverrideSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getMetricsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createFirewallPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listFirewallPoliciesSettings = @@ -877,6 +890,7 @@ protected Builder(ClientContext clientContext) { updateKeySettings, deleteKeySettings, migrateKeySettings, + addIpOverrideSettings, getMetricsSettings, createFirewallPolicySettings, listFirewallPoliciesSettings, @@ -902,6 +916,7 @@ protected Builder(RecaptchaEnterpriseServiceStubSettings settings) { updateKeySettings = settings.updateKeySettings.toBuilder(); deleteKeySettings = settings.deleteKeySettings.toBuilder(); migrateKeySettings = settings.migrateKeySettings.toBuilder(); + addIpOverrideSettings = settings.addIpOverrideSettings.toBuilder(); getMetricsSettings = settings.getMetricsSettings.toBuilder(); createFirewallPolicySettings = settings.createFirewallPolicySettings.toBuilder(); listFirewallPoliciesSettings = settings.listFirewallPoliciesSettings.toBuilder(); @@ -926,6 +941,7 @@ protected Builder(RecaptchaEnterpriseServiceStubSettings settings) { updateKeySettings, deleteKeySettings, migrateKeySettings, + addIpOverrideSettings, getMetricsSettings, createFirewallPolicySettings, listFirewallPoliciesSettings, @@ -996,6 +1012,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .addIpOverrideSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .getMetricsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) @@ -1114,6 +1135,12 @@ public UnaryCallSettings.Builder migrateKeySettings() { return migrateKeySettings; } + /** Returns the builder for the settings used for calls to addIpOverride. */ + public UnaryCallSettings.Builder + addIpOverrideSettings() { + return addIpOverrideSettings; + } + /** Returns the builder for the settings used for calls to getMetrics. */ public UnaryCallSettings.Builder getMetricsSettings() { return getMetricsSettings; diff --git a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/resources/META-INF/native-image/com.google.cloud.recaptchaenterprise.v1/reflect-config.json b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/resources/META-INF/native-image/com.google.cloud.recaptchaenterprise.v1/reflect-config.json index 5d3de94f6459..a973d1d6daa3 100644 --- a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/resources/META-INF/native-image/com.google.cloud.recaptchaenterprise.v1/reflect-config.json +++ b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/resources/META-INF/native-image/com.google.cloud.recaptchaenterprise.v1/reflect-config.json @@ -1295,6 +1295,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.recaptchaenterprise.v1.AddIpOverrideRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.recaptchaenterprise.v1.AddIpOverrideRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.recaptchaenterprise.v1.AddIpOverrideResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.recaptchaenterprise.v1.AddIpOverrideResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.recaptchaenterprise.v1.AndroidKeySettings", "queryAllDeclaredConstructors": true, @@ -1556,6 +1592,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.recaptchaenterprise.v1.ExpressKeySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.recaptchaenterprise.v1.ExpressKeySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.recaptchaenterprise.v1.FirewallAction", "queryAllDeclaredConstructors": true, @@ -1925,6 +1979,33 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.recaptchaenterprise.v1.IpOverrideData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.recaptchaenterprise.v1.IpOverrideData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.recaptchaenterprise.v1.IpOverrideData$OverrideType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.recaptchaenterprise.v1.Key", "queryAllDeclaredConstructors": true, diff --git a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/MockRecaptchaEnterpriseServiceImpl.java b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/MockRecaptchaEnterpriseServiceImpl.java index 5b8c6422c393..4281d17243b2 100644 --- a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/MockRecaptchaEnterpriseServiceImpl.java +++ b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/MockRecaptchaEnterpriseServiceImpl.java @@ -19,6 +19,8 @@ import com.google.api.core.BetaApi; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; +import com.google.recaptchaenterprise.v1.AddIpOverrideRequest; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; import com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest; import com.google.recaptchaenterprise.v1.AnnotateAssessmentResponse; import com.google.recaptchaenterprise.v1.Assessment; @@ -275,6 +277,27 @@ public void migrateKey(MigrateKeyRequest request, StreamObserver responseOb } } + @Override + public void addIpOverride( + AddIpOverrideRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AddIpOverrideResponse) { + requests.add(request); + responseObserver.onNext(((AddIpOverrideResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AddIpOverride, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AddIpOverrideResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void getMetrics(GetMetricsRequest request, StreamObserver responseObserver) { Object response = responses.poll(); diff --git a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClientTest.java b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClientTest.java index ed125699c3b9..f050069da652 100644 --- a/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClientTest.java +++ b/java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClientTest.java @@ -37,6 +37,8 @@ import com.google.protobuf.Timestamp; import com.google.recaptchaenterprise.v1.AccountDefenderAssessment; import com.google.recaptchaenterprise.v1.AccountVerificationInfo; +import com.google.recaptchaenterprise.v1.AddIpOverrideRequest; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; import com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest; import com.google.recaptchaenterprise.v1.AnnotateAssessmentResponse; import com.google.recaptchaenterprise.v1.Assessment; @@ -57,6 +59,7 @@ import com.google.recaptchaenterprise.v1.GetFirewallPolicyRequest; import com.google.recaptchaenterprise.v1.GetKeyRequest; import com.google.recaptchaenterprise.v1.GetMetricsRequest; +import com.google.recaptchaenterprise.v1.IpOverrideData; import com.google.recaptchaenterprise.v1.Key; import com.google.recaptchaenterprise.v1.KeyName; import com.google.recaptchaenterprise.v1.ListFirewallPoliciesRequest; @@ -837,6 +840,82 @@ public void migrateKeyExceptionTest() throws Exception { } } + @Test + public void addIpOverrideTest() throws Exception { + AddIpOverrideResponse expectedResponse = AddIpOverrideResponse.newBuilder().build(); + mockRecaptchaEnterpriseService.addResponse(expectedResponse); + + KeyName name = KeyName.of("[PROJECT]", "[KEY]"); + IpOverrideData ipOverrideData = IpOverrideData.newBuilder().build(); + + AddIpOverrideResponse actualResponse = client.addIpOverride(name, ipOverrideData); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRecaptchaEnterpriseService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddIpOverrideRequest actualRequest = ((AddIpOverrideRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(ipOverrideData, actualRequest.getIpOverrideData()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addIpOverrideExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRecaptchaEnterpriseService.addException(exception); + + try { + KeyName name = KeyName.of("[PROJECT]", "[KEY]"); + IpOverrideData ipOverrideData = IpOverrideData.newBuilder().build(); + client.addIpOverride(name, ipOverrideData); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void addIpOverrideTest2() throws Exception { + AddIpOverrideResponse expectedResponse = AddIpOverrideResponse.newBuilder().build(); + mockRecaptchaEnterpriseService.addResponse(expectedResponse); + + String name = "name3373707"; + IpOverrideData ipOverrideData = IpOverrideData.newBuilder().build(); + + AddIpOverrideResponse actualResponse = client.addIpOverride(name, ipOverrideData); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRecaptchaEnterpriseService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AddIpOverrideRequest actualRequest = ((AddIpOverrideRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(ipOverrideData, actualRequest.getIpOverrideData()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void addIpOverrideExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRecaptchaEnterpriseService.addException(exception); + + try { + String name = "name3373707"; + IpOverrideData ipOverrideData = IpOverrideData.newBuilder().build(); + client.addIpOverride(name, ipOverrideData); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void getMetricsTest() throws Exception { Metrics expectedResponse = diff --git a/java-recaptchaenterprise/grpc-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseServiceGrpc.java b/java-recaptchaenterprise/grpc-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseServiceGrpc.java index 0c5ff8e3d29d..8bd9af6a89d1 100644 --- a/java-recaptchaenterprise/grpc-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseServiceGrpc.java +++ b/java-recaptchaenterprise/grpc-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseServiceGrpc.java @@ -455,6 +455,54 @@ private RecaptchaEnterpriseServiceGrpc() {} return getMigrateKeyMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1.AddIpOverrideRequest, + com.google.recaptchaenterprise.v1.AddIpOverrideResponse> + getAddIpOverrideMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AddIpOverride", + requestType = com.google.recaptchaenterprise.v1.AddIpOverrideRequest.class, + responseType = com.google.recaptchaenterprise.v1.AddIpOverrideResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1.AddIpOverrideRequest, + com.google.recaptchaenterprise.v1.AddIpOverrideResponse> + getAddIpOverrideMethod() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1.AddIpOverrideRequest, + com.google.recaptchaenterprise.v1.AddIpOverrideResponse> + getAddIpOverrideMethod; + if ((getAddIpOverrideMethod = RecaptchaEnterpriseServiceGrpc.getAddIpOverrideMethod) == null) { + synchronized (RecaptchaEnterpriseServiceGrpc.class) { + if ((getAddIpOverrideMethod = RecaptchaEnterpriseServiceGrpc.getAddIpOverrideMethod) + == null) { + RecaptchaEnterpriseServiceGrpc.getAddIpOverrideMethod = + getAddIpOverrideMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AddIpOverride")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1.AddIpOverrideRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1.AddIpOverrideResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceMethodDescriptorSupplier("AddIpOverride")) + .build(); + } + } + } + return getAddIpOverrideMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.recaptchaenterprise.v1.GetMetricsRequest, com.google.recaptchaenterprise.v1.Metrics> @@ -1166,6 +1214,24 @@ default void migrateKey( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMigrateKeyMethod(), responseObserver); } + /** + * + * + *
+     * Adds an IP override to a key. The following restrictions hold:
+     * * The maximum number of IP overrides per key is 100.
+     * * For any conflict (such as IP already exists or IP part of an existing
+     *   IP range), an error will be returned.
+     * 
+ */ + default void addIpOverride( + com.google.recaptchaenterprise.v1.AddIpOverrideRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAddIpOverrideMethod(), responseObserver); + } + /** * * @@ -1502,6 +1568,26 @@ public void migrateKey( getChannel().newCall(getMigrateKeyMethod(), getCallOptions()), request, responseObserver); } + /** + * + * + *
+     * Adds an IP override to a key. The following restrictions hold:
+     * * The maximum number of IP overrides per key is 100.
+     * * For any conflict (such as IP already exists or IP part of an existing
+     *   IP range), an error will be returned.
+     * 
+ */ + public void addIpOverride( + com.google.recaptchaenterprise.v1.AddIpOverrideRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAddIpOverrideMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1822,6 +1908,22 @@ public com.google.recaptchaenterprise.v1.Key migrateKey( getChannel(), getMigrateKeyMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Adds an IP override to a key. The following restrictions hold:
+     * * The maximum number of IP overrides per key is 100.
+     * * For any conflict (such as IP already exists or IP part of an existing
+     *   IP range), an error will be returned.
+     * 
+ */ + public com.google.recaptchaenterprise.v1.AddIpOverrideResponse addIpOverride( + com.google.recaptchaenterprise.v1.AddIpOverrideRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAddIpOverrideMethod(), getCallOptions(), request); + } + /** * * @@ -2111,6 +2213,23 @@ public com.google.common.util.concurrent.ListenableFuture + * Adds an IP override to a key. The following restrictions hold: + * * The maximum number of IP overrides per key is 100. + * * For any conflict (such as IP already exists or IP part of an existing + * IP range), an error will be returned. + * + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.recaptchaenterprise.v1.AddIpOverrideResponse> + addIpOverride(com.google.recaptchaenterprise.v1.AddIpOverrideRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAddIpOverrideMethod(), getCallOptions()), request); + } + /** * * @@ -2273,16 +2392,17 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2356,6 +2476,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_ADD_IP_OVERRIDE: + serviceImpl.addIpOverride( + (com.google.recaptchaenterprise.v1.AddIpOverrideRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; case METHODID_GET_METRICS: serviceImpl.getMetrics( (com.google.recaptchaenterprise.v1.GetMetricsRequest) request, @@ -2498,6 +2624,13 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.recaptchaenterprise.v1.MigrateKeyRequest, com.google.recaptchaenterprise.v1.Key>(service, METHODID_MIGRATE_KEY))) + .addMethod( + getAddIpOverrideMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1.AddIpOverrideRequest, + com.google.recaptchaenterprise.v1.AddIpOverrideResponse>( + service, METHODID_ADD_IP_OVERRIDE))) .addMethod( getGetMetricsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -2626,6 +2759,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getUpdateKeyMethod()) .addMethod(getDeleteKeyMethod()) .addMethod(getMigrateKeyMethod()) + .addMethod(getAddIpOverrideMethod()) .addMethod(getGetMetricsMethod()) .addMethod(getCreateFirewallPolicyMethod()) .addMethod(getListFirewallPoliciesMethod()) diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AccountVerificationInfo.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AccountVerificationInfo.java index ef233b8c8086..03d31b79810e 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AccountVerificationInfo.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AccountVerificationInfo.java @@ -593,7 +593,7 @@ public int getLatestVerificationResultValue() { * string username = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.username is deprecated. - * See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=567 + * See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=579 * @return The username. */ @java.lang.Override @@ -620,7 +620,7 @@ public java.lang.String getUsername() { * string username = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.username is deprecated. - * See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=567 + * See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=579 * @return The bytes for username. */ @java.lang.Override @@ -1733,7 +1733,7 @@ public Builder clearLatestVerificationResult() { * string username = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.username is - * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=567 + * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=579 * @return The username. */ @java.lang.Deprecated @@ -1759,7 +1759,7 @@ public java.lang.String getUsername() { * string username = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.username is - * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=567 + * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=579 * @return The bytes for username. */ @java.lang.Deprecated @@ -1785,7 +1785,7 @@ public com.google.protobuf.ByteString getUsernameBytes() { * string username = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.username is - * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=567 + * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=579 * @param value The username to set. * @return This builder for chaining. */ @@ -1810,7 +1810,7 @@ public Builder setUsername(java.lang.String value) { * string username = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.username is - * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=567 + * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=579 * @return This builder for chaining. */ @java.lang.Deprecated @@ -1831,7 +1831,7 @@ public Builder clearUsername() { * string username = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.username is - * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=567 + * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=579 * @param value The bytes for username to set. * @return This builder for chaining. */ diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AccountVerificationInfoOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AccountVerificationInfoOrBuilder.java index 0b74155b80bb..17336c79f2af 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AccountVerificationInfoOrBuilder.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AccountVerificationInfoOrBuilder.java @@ -154,7 +154,7 @@ com.google.recaptchaenterprise.v1.EndpointVerificationInfoOrBuilder getEndpoints * string username = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.username is deprecated. - * See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=567 + * See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=579 * @return The username. */ @java.lang.Deprecated @@ -170,7 +170,7 @@ com.google.recaptchaenterprise.v1.EndpointVerificationInfoOrBuilder getEndpoints * string username = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.username is deprecated. - * See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=567 + * See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=579 * @return The bytes for username. */ @java.lang.Deprecated diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideRequest.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideRequest.java new file mode 100644 index 000000000000..94ff836a805d --- /dev/null +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideRequest.java @@ -0,0 +1,953 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto + +// Protobuf Java Version: 3.25.4 +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * The AddIpOverride request message.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest} + */ +public final class AddIpOverrideRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest) + AddIpOverrideRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddIpOverrideRequest.newBuilder() to construct. + private AddIpOverrideRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddIpOverrideRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddIpOverrideRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.AddIpOverrideRequest.class, + com.google.recaptchaenterprise.v1.AddIpOverrideRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the key to which the IP override is added, in the
+   * format `projects/{project}/keys/{key}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the key to which the IP override is added, in the
+   * format `projects/{project}/keys/{key}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_OVERRIDE_DATA_FIELD_NUMBER = 2; + private com.google.recaptchaenterprise.v1.IpOverrideData ipOverrideData_; + /** + * + * + *
+   * Required. IP override added to the key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the ipOverrideData field is set. + */ + @java.lang.Override + public boolean hasIpOverrideData() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. IP override added to the key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ipOverrideData. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.IpOverrideData getIpOverrideData() { + return ipOverrideData_ == null + ? com.google.recaptchaenterprise.v1.IpOverrideData.getDefaultInstance() + : ipOverrideData_; + } + /** + * + * + *
+   * Required. IP override added to the key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.IpOverrideDataOrBuilder getIpOverrideDataOrBuilder() { + return ipOverrideData_ == null + ? com.google.recaptchaenterprise.v1.IpOverrideData.getDefaultInstance() + : ipOverrideData_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getIpOverrideData()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIpOverrideData()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1.AddIpOverrideRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.AddIpOverrideRequest other = + (com.google.recaptchaenterprise.v1.AddIpOverrideRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasIpOverrideData() != other.hasIpOverrideData()) return false; + if (hasIpOverrideData()) { + if (!getIpOverrideData().equals(other.getIpOverrideData())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasIpOverrideData()) { + hash = (37 * hash) + IP_OVERRIDE_DATA_FIELD_NUMBER; + hash = (53 * hash) + getIpOverrideData().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.recaptchaenterprise.v1.AddIpOverrideRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The AddIpOverride request message.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest) + com.google.recaptchaenterprise.v1.AddIpOverrideRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.AddIpOverrideRequest.class, + com.google.recaptchaenterprise.v1.AddIpOverrideRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.AddIpOverrideRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIpOverrideDataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + ipOverrideData_ = null; + if (ipOverrideDataBuilder_ != null) { + ipOverrideDataBuilder_.dispose(); + ipOverrideDataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.AddIpOverrideRequest getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.AddIpOverrideRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.AddIpOverrideRequest build() { + com.google.recaptchaenterprise.v1.AddIpOverrideRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.AddIpOverrideRequest buildPartial() { + com.google.recaptchaenterprise.v1.AddIpOverrideRequest result = + new com.google.recaptchaenterprise.v1.AddIpOverrideRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.recaptchaenterprise.v1.AddIpOverrideRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ipOverrideData_ = + ipOverrideDataBuilder_ == null ? ipOverrideData_ : ipOverrideDataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1.AddIpOverrideRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1.AddIpOverrideRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.AddIpOverrideRequest other) { + if (other == com.google.recaptchaenterprise.v1.AddIpOverrideRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasIpOverrideData()) { + mergeIpOverrideData(other.getIpOverrideData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getIpOverrideDataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the key to which the IP override is added, in the
+     * format `projects/{project}/keys/{key}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the key to which the IP override is added, in the
+     * format `projects/{project}/keys/{key}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the key to which the IP override is added, in the
+     * format `projects/{project}/keys/{key}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the key to which the IP override is added, in the
+     * format `projects/{project}/keys/{key}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the key to which the IP override is added, in the
+     * format `projects/{project}/keys/{key}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.recaptchaenterprise.v1.IpOverrideData ipOverrideData_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.IpOverrideData, + com.google.recaptchaenterprise.v1.IpOverrideData.Builder, + com.google.recaptchaenterprise.v1.IpOverrideDataOrBuilder> + ipOverrideDataBuilder_; + /** + * + * + *
+     * Required. IP override added to the key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the ipOverrideData field is set. + */ + public boolean hasIpOverrideData() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. IP override added to the key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ipOverrideData. + */ + public com.google.recaptchaenterprise.v1.IpOverrideData getIpOverrideData() { + if (ipOverrideDataBuilder_ == null) { + return ipOverrideData_ == null + ? com.google.recaptchaenterprise.v1.IpOverrideData.getDefaultInstance() + : ipOverrideData_; + } else { + return ipOverrideDataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. IP override added to the key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setIpOverrideData(com.google.recaptchaenterprise.v1.IpOverrideData value) { + if (ipOverrideDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ipOverrideData_ = value; + } else { + ipOverrideDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. IP override added to the key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setIpOverrideData( + com.google.recaptchaenterprise.v1.IpOverrideData.Builder builderForValue) { + if (ipOverrideDataBuilder_ == null) { + ipOverrideData_ = builderForValue.build(); + } else { + ipOverrideDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. IP override added to the key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeIpOverrideData(com.google.recaptchaenterprise.v1.IpOverrideData value) { + if (ipOverrideDataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && ipOverrideData_ != null + && ipOverrideData_ + != com.google.recaptchaenterprise.v1.IpOverrideData.getDefaultInstance()) { + getIpOverrideDataBuilder().mergeFrom(value); + } else { + ipOverrideData_ = value; + } + } else { + ipOverrideDataBuilder_.mergeFrom(value); + } + if (ipOverrideData_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. IP override added to the key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearIpOverrideData() { + bitField0_ = (bitField0_ & ~0x00000002); + ipOverrideData_ = null; + if (ipOverrideDataBuilder_ != null) { + ipOverrideDataBuilder_.dispose(); + ipOverrideDataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. IP override added to the key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.recaptchaenterprise.v1.IpOverrideData.Builder getIpOverrideDataBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getIpOverrideDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. IP override added to the key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.recaptchaenterprise.v1.IpOverrideDataOrBuilder getIpOverrideDataOrBuilder() { + if (ipOverrideDataBuilder_ != null) { + return ipOverrideDataBuilder_.getMessageOrBuilder(); + } else { + return ipOverrideData_ == null + ? com.google.recaptchaenterprise.v1.IpOverrideData.getDefaultInstance() + : ipOverrideData_; + } + } + /** + * + * + *
+     * Required. IP override added to the key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.IpOverrideData, + com.google.recaptchaenterprise.v1.IpOverrideData.Builder, + com.google.recaptchaenterprise.v1.IpOverrideDataOrBuilder> + getIpOverrideDataFieldBuilder() { + if (ipOverrideDataBuilder_ == null) { + ipOverrideDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.IpOverrideData, + com.google.recaptchaenterprise.v1.IpOverrideData.Builder, + com.google.recaptchaenterprise.v1.IpOverrideDataOrBuilder>( + getIpOverrideData(), getParentForChildren(), isClean()); + ipOverrideData_ = null; + } + return ipOverrideDataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest) + private static final com.google.recaptchaenterprise.v1.AddIpOverrideRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.AddIpOverrideRequest(); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddIpOverrideRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.AddIpOverrideRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideRequestOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideRequestOrBuilder.java new file mode 100644 index 000000000000..7c567c9438b3 --- /dev/null +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto + +// Protobuf Java Version: 3.25.4 +package com.google.recaptchaenterprise.v1; + +public interface AddIpOverrideRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the key to which the IP override is added, in the
+   * format `projects/{project}/keys/{key}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the key to which the IP override is added, in the
+   * format `projects/{project}/keys/{key}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. IP override added to the key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the ipOverrideData field is set. + */ + boolean hasIpOverrideData(); + /** + * + * + *
+   * Required. IP override added to the key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ipOverrideData. + */ + com.google.recaptchaenterprise.v1.IpOverrideData getIpOverrideData(); + /** + * + * + *
+   * Required. IP override added to the key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData ip_override_data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.recaptchaenterprise.v1.IpOverrideDataOrBuilder getIpOverrideDataOrBuilder(); +} diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideResponse.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideResponse.java new file mode 100644 index 000000000000..db7c2f6b07af --- /dev/null +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideResponse.java @@ -0,0 +1,433 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto + +// Protobuf Java Version: 3.25.4 +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * Response for AddIpOverride.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse} + */ +public final class AddIpOverrideResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse) + AddIpOverrideResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddIpOverrideResponse.newBuilder() to construct. + private AddIpOverrideResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddIpOverrideResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddIpOverrideResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.AddIpOverrideResponse.class, + com.google.recaptchaenterprise.v1.AddIpOverrideResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1.AddIpOverrideResponse)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.AddIpOverrideResponse other = + (com.google.recaptchaenterprise.v1.AddIpOverrideResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.recaptchaenterprise.v1.AddIpOverrideResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for AddIpOverride.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse) + com.google.recaptchaenterprise.v1.AddIpOverrideResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.AddIpOverrideResponse.class, + com.google.recaptchaenterprise.v1.AddIpOverrideResponse.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.AddIpOverrideResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.AddIpOverrideResponse getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.AddIpOverrideResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.AddIpOverrideResponse build() { + com.google.recaptchaenterprise.v1.AddIpOverrideResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.AddIpOverrideResponse buildPartial() { + com.google.recaptchaenterprise.v1.AddIpOverrideResponse result = + new com.google.recaptchaenterprise.v1.AddIpOverrideResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1.AddIpOverrideResponse) { + return mergeFrom((com.google.recaptchaenterprise.v1.AddIpOverrideResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.AddIpOverrideResponse other) { + if (other == com.google.recaptchaenterprise.v1.AddIpOverrideResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse) + private static final com.google.recaptchaenterprise.v1.AddIpOverrideResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.AddIpOverrideResponse(); + } + + public static com.google.recaptchaenterprise.v1.AddIpOverrideResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddIpOverrideResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.AddIpOverrideResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideResponseOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideResponseOrBuilder.java new file mode 100644 index 000000000000..32a4c53ec8cd --- /dev/null +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AddIpOverrideResponseOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto + +// Protobuf Java Version: 3.25.4 +package com.google.recaptchaenterprise.v1; + +public interface AddIpOverrideResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Event.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Event.java index 95efc02ffa21..a0db1f32aa44 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Event.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Event.java @@ -530,7 +530,7 @@ public com.google.protobuf.ByteString getExpectedActionBytes() { * * * @deprecated google.cloud.recaptchaenterprise.v1.Event.hashed_account_id is deprecated. See - * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=706 + * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=718 * @return The hashedAccountId. */ @java.lang.Override @@ -546,8 +546,7 @@ public com.google.protobuf.ByteString getHashedAccountId() { * *
    * Optional. Flag for a reCAPTCHA express request for an assessment without a
-   * token. If enabled, `site_key` must reference a SCORE key with WAF feature
-   * set to EXPRESS.
+   * token. If enabled, `site_key` must reference an Express site key.
    * 
* * bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; @@ -2231,7 +2230,7 @@ public Builder setExpectedActionBytes(com.google.protobuf.ByteString value) { * * * @deprecated google.cloud.recaptchaenterprise.v1.Event.hashed_account_id is deprecated. See - * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=706 + * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=718 * @return The hashedAccountId. */ @java.lang.Override @@ -2253,7 +2252,7 @@ public com.google.protobuf.ByteString getHashedAccountId() { * * * @deprecated google.cloud.recaptchaenterprise.v1.Event.hashed_account_id is deprecated. See - * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=706 + * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=718 * @param value The hashedAccountId to set. * @return This builder for chaining. */ @@ -2281,7 +2280,7 @@ public Builder setHashedAccountId(com.google.protobuf.ByteString value) { * * * @deprecated google.cloud.recaptchaenterprise.v1.Event.hashed_account_id is deprecated. See - * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=706 + * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=718 * @return This builder for chaining. */ @java.lang.Deprecated @@ -2298,8 +2297,7 @@ public Builder clearHashedAccountId() { * *
      * Optional. Flag for a reCAPTCHA express request for an assessment without a
-     * token. If enabled, `site_key` must reference a SCORE key with WAF feature
-     * set to EXPRESS.
+     * token. If enabled, `site_key` must reference an Express site key.
      * 
* * bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; @@ -2315,8 +2313,7 @@ public boolean getExpress() { * *
      * Optional. Flag for a reCAPTCHA express request for an assessment without a
-     * token. If enabled, `site_key` must reference a SCORE key with WAF feature
-     * set to EXPRESS.
+     * token. If enabled, `site_key` must reference an Express site key.
      * 
* * bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; @@ -2336,8 +2333,7 @@ public Builder setExpress(boolean value) { * *
      * Optional. Flag for a reCAPTCHA express request for an assessment without a
-     * token. If enabled, `site_key` must reference a SCORE key with WAF feature
-     * set to EXPRESS.
+     * token. If enabled, `site_key` must reference an Express site key.
      * 
* * bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/EventOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/EventOrBuilder.java index 7f5eab075909..ad8beb244125 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/EventOrBuilder.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/EventOrBuilder.java @@ -178,7 +178,7 @@ public interface EventOrBuilder * * * @deprecated google.cloud.recaptchaenterprise.v1.Event.hashed_account_id is deprecated. See - * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=706 + * google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=718 * @return The hashedAccountId. */ @java.lang.Deprecated @@ -189,8 +189,7 @@ public interface EventOrBuilder * *
    * Optional. Flag for a reCAPTCHA express request for an assessment without a
-   * token. If enabled, `site_key` must reference a SCORE key with WAF feature
-   * set to EXPRESS.
+   * token. If enabled, `site_key` must reference an Express site key.
    * 
* * bool express = 14 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ExpressKeySettings.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ExpressKeySettings.java new file mode 100644 index 000000000000..3656701dde60 --- /dev/null +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ExpressKeySettings.java @@ -0,0 +1,432 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto + +// Protobuf Java Version: 3.25.4 +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * Settings specific to keys that can be used for reCAPTCHA Express.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.ExpressKeySettings} + */ +public final class ExpressKeySettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.ExpressKeySettings) + ExpressKeySettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExpressKeySettings.newBuilder() to construct. + private ExpressKeySettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExpressKeySettings() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExpressKeySettings(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.ExpressKeySettings.class, + com.google.recaptchaenterprise.v1.ExpressKeySettings.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1.ExpressKeySettings)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.ExpressKeySettings other = + (com.google.recaptchaenterprise.v1.ExpressKeySettings) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.recaptchaenterprise.v1.ExpressKeySettings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Settings specific to keys that can be used for reCAPTCHA Express.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.ExpressKeySettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.ExpressKeySettings) + com.google.recaptchaenterprise.v1.ExpressKeySettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.ExpressKeySettings.class, + com.google.recaptchaenterprise.v1.ExpressKeySettings.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.ExpressKeySettings.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ExpressKeySettings getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.ExpressKeySettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ExpressKeySettings build() { + com.google.recaptchaenterprise.v1.ExpressKeySettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ExpressKeySettings buildPartial() { + com.google.recaptchaenterprise.v1.ExpressKeySettings result = + new com.google.recaptchaenterprise.v1.ExpressKeySettings(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1.ExpressKeySettings) { + return mergeFrom((com.google.recaptchaenterprise.v1.ExpressKeySettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.ExpressKeySettings other) { + if (other == com.google.recaptchaenterprise.v1.ExpressKeySettings.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1.ExpressKeySettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.ExpressKeySettings) + private static final com.google.recaptchaenterprise.v1.ExpressKeySettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.ExpressKeySettings(); + } + + public static com.google.recaptchaenterprise.v1.ExpressKeySettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExpressKeySettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ExpressKeySettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ExpressKeySettingsOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ExpressKeySettingsOrBuilder.java new file mode 100644 index 000000000000..d582dd95e97d --- /dev/null +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ExpressKeySettingsOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto + +// Protobuf Java Version: 3.25.4 +package com.google.recaptchaenterprise.v1; + +public interface ExpressKeySettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.ExpressKeySettings) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IpOverrideData.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IpOverrideData.java new file mode 100644 index 000000000000..942fb30fcb96 --- /dev/null +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IpOverrideData.java @@ -0,0 +1,989 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto + +// Protobuf Java Version: 3.25.4 +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * Information about the IP or IP range override.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.IpOverrideData} + */ +public final class IpOverrideData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.IpOverrideData) + IpOverrideDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use IpOverrideData.newBuilder() to construct. + private IpOverrideData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IpOverrideData() { + ip_ = ""; + overrideType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IpOverrideData(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.IpOverrideData.class, + com.google.recaptchaenterprise.v1.IpOverrideData.Builder.class); + } + + /** + * + * + *
+   * Enum that represents the type of IP override.
+   * 
+ * + * Protobuf enum {@code google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType} + */ + public enum OverrideType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default override type that indicates this enum hasn't been specified.
+     * 
+ * + * OVERRIDE_TYPE_UNSPECIFIED = 0; + */ + OVERRIDE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Allowlist the IP address; i.e. give a `risk_analysis.score` of 0.9 for
+     * all valid assessments.
+     * 
+ * + * ALLOW = 1; + */ + ALLOW(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default override type that indicates this enum hasn't been specified.
+     * 
+ * + * OVERRIDE_TYPE_UNSPECIFIED = 0; + */ + public static final int OVERRIDE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Allowlist the IP address; i.e. give a `risk_analysis.score` of 0.9 for
+     * all valid assessments.
+     * 
+ * + * ALLOW = 1; + */ + public static final int ALLOW_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OverrideType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static OverrideType forNumber(int value) { + switch (value) { + case 0: + return OVERRIDE_TYPE_UNSPECIFIED; + case 1: + return ALLOW; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public OverrideType findValueByNumber(int number) { + return OverrideType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.IpOverrideData.getDescriptor().getEnumTypes().get(0); + } + + private static final OverrideType[] VALUES = values(); + + public static OverrideType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private OverrideType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType) + } + + public static final int IP_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object ip_ = ""; + /** + * + * + *
+   * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
+   * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
+   * The IP override must be a public IP address.
+   * Example of IPv4: 168.192.5.6
+   * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
+   * Example of IPv4 with CIDR: 168.192.5.0/24
+   * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
+   * 
+ * + * + * string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The ip. + */ + @java.lang.Override + public java.lang.String getIp() { + java.lang.Object ref = ip_; + 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(); + ip_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
+   * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
+   * The IP override must be a public IP address.
+   * Example of IPv4: 168.192.5.6
+   * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
+   * Example of IPv4 with CIDR: 168.192.5.0/24
+   * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
+   * 
+ * + * + * string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ip. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OVERRIDE_TYPE_FIELD_NUMBER = 3; + private int overrideType_ = 0; + /** + * + * + *
+   * Required. Describes the type of IP override.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for overrideType. + */ + @java.lang.Override + public int getOverrideTypeValue() { + return overrideType_; + } + /** + * + * + *
+   * Required. Describes the type of IP override.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The overrideType. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType getOverrideType() { + com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType result = + com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType.forNumber(overrideType_); + return result == null + ? com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ip_); + } + if (overrideType_ + != com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType.OVERRIDE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, overrideType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ip_); + } + if (overrideType_ + != com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType.OVERRIDE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, overrideType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1.IpOverrideData)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.IpOverrideData other = + (com.google.recaptchaenterprise.v1.IpOverrideData) obj; + + if (!getIp().equals(other.getIp())) return false; + if (overrideType_ != other.overrideType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + IP_FIELD_NUMBER; + hash = (53 * hash) + getIp().hashCode(); + hash = (37 * hash) + OVERRIDE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + overrideType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.recaptchaenterprise.v1.IpOverrideData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information about the IP or IP range override.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.IpOverrideData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.IpOverrideData) + com.google.recaptchaenterprise.v1.IpOverrideDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.IpOverrideData.class, + com.google.recaptchaenterprise.v1.IpOverrideData.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.IpOverrideData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ip_ = ""; + overrideType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.IpOverrideData getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.IpOverrideData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.IpOverrideData build() { + com.google.recaptchaenterprise.v1.IpOverrideData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.IpOverrideData buildPartial() { + com.google.recaptchaenterprise.v1.IpOverrideData result = + new com.google.recaptchaenterprise.v1.IpOverrideData(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.recaptchaenterprise.v1.IpOverrideData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ip_ = ip_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.overrideType_ = overrideType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1.IpOverrideData) { + return mergeFrom((com.google.recaptchaenterprise.v1.IpOverrideData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.IpOverrideData other) { + if (other == com.google.recaptchaenterprise.v1.IpOverrideData.getDefaultInstance()) + return this; + if (!other.getIp().isEmpty()) { + ip_ = other.ip_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.overrideType_ != 0) { + setOverrideTypeValue(other.getOverrideTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + ip_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 24: + { + overrideType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object ip_ = ""; + /** + * + * + *
+     * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
+     * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
+     * The IP override must be a public IP address.
+     * Example of IPv4: 168.192.5.6
+     * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
+     * Example of IPv4 with CIDR: 168.192.5.0/24
+     * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
+     * 
+ * + * + * string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The ip. + */ + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
+     * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
+     * The IP override must be a public IP address.
+     * Example of IPv4: 168.192.5.6
+     * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
+     * Example of IPv4 with CIDR: 168.192.5.0/24
+     * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
+     * 
+ * + * + * string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ip. + */ + public com.google.protobuf.ByteString getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
+     * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
+     * The IP override must be a public IP address.
+     * Example of IPv4: 168.192.5.6
+     * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
+     * Example of IPv4 with CIDR: 168.192.5.0/24
+     * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
+     * 
+ * + * + * string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @param value The ip to set. + * @return This builder for chaining. + */ + public Builder setIp(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ip_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
+     * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
+     * The IP override must be a public IP address.
+     * Example of IPv4: 168.192.5.6
+     * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
+     * Example of IPv4 with CIDR: 168.192.5.0/24
+     * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
+     * 
+ * + * + * string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearIp() { + ip_ = getDefaultInstance().getIp(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
+     * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
+     * The IP override must be a public IP address.
+     * Example of IPv4: 168.192.5.6
+     * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
+     * Example of IPv4 with CIDR: 168.192.5.0/24
+     * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
+     * 
+ * + * + * string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for ip to set. + * @return This builder for chaining. + */ + public Builder setIpBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ip_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int overrideType_ = 0; + /** + * + * + *
+     * Required. Describes the type of IP override.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for overrideType. + */ + @java.lang.Override + public int getOverrideTypeValue() { + return overrideType_; + } + /** + * + * + *
+     * Required. Describes the type of IP override.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for overrideType to set. + * @return This builder for chaining. + */ + public Builder setOverrideTypeValue(int value) { + overrideType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Describes the type of IP override.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The overrideType. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType getOverrideType() { + com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType result = + com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType.forNumber(overrideType_); + return result == null + ? com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. Describes the type of IP override.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The overrideType to set. + * @return This builder for chaining. + */ + public Builder setOverrideType( + com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + overrideType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Describes the type of IP override.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearOverrideType() { + bitField0_ = (bitField0_ & ~0x00000002); + overrideType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1.IpOverrideData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.IpOverrideData) + private static final com.google.recaptchaenterprise.v1.IpOverrideData DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.IpOverrideData(); + } + + public static com.google.recaptchaenterprise.v1.IpOverrideData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IpOverrideData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.IpOverrideData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IpOverrideDataOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IpOverrideDataOrBuilder.java new file mode 100644 index 000000000000..e9805af3ce51 --- /dev/null +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IpOverrideDataOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto + +// Protobuf Java Version: 3.25.4 +package com.google.recaptchaenterprise.v1; + +public interface IpOverrideDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.IpOverrideData) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
+   * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
+   * The IP override must be a public IP address.
+   * Example of IPv4: 168.192.5.6
+   * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
+   * Example of IPv4 with CIDR: 168.192.5.0/24
+   * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
+   * 
+ * + * + * string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The ip. + */ + java.lang.String getIp(); + /** + * + * + *
+   * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
+   * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
+   * The IP override must be a public IP address.
+   * Example of IPv4: 168.192.5.6
+   * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
+   * Example of IPv4 with CIDR: 168.192.5.0/24
+   * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
+   * 
+ * + * + * string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ip. + */ + com.google.protobuf.ByteString getIpBytes(); + + /** + * + * + *
+   * Required. Describes the type of IP override.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for overrideType. + */ + int getOverrideTypeValue(); + /** + * + * + *
+   * Required. Describes the type of IP override.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The overrideType. + */ + com.google.recaptchaenterprise.v1.IpOverrideData.OverrideType getOverrideType(); +} diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Key.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Key.java index c73fa04aeda9..416264147958 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Key.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Key.java @@ -90,6 +90,7 @@ public enum PlatformSettingsCase WEB_SETTINGS(3), ANDROID_SETTINGS(4), IOS_SETTINGS(5), + EXPRESS_SETTINGS(11), PLATFORMSETTINGS_NOT_SET(0); private final int value; @@ -114,6 +115,8 @@ public static PlatformSettingsCase forNumber(int value) { return ANDROID_SETTINGS; case 5: return IOS_SETTINGS; + case 11: + return EXPRESS_SETTINGS; case 0: return PLATFORMSETTINGS_NOT_SET; default: @@ -388,6 +391,58 @@ public com.google.recaptchaenterprise.v1.IOSKeySettingsOrBuilder getIosSettingsO return com.google.recaptchaenterprise.v1.IOSKeySettings.getDefaultInstance(); } + public static final int EXPRESS_SETTINGS_FIELD_NUMBER = 11; + /** + * + * + *
+   * Settings for keys that can be used by reCAPTCHA Express.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + * + * @return Whether the expressSettings field is set. + */ + @java.lang.Override + public boolean hasExpressSettings() { + return platformSettingsCase_ == 11; + } + /** + * + * + *
+   * Settings for keys that can be used by reCAPTCHA Express.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + * + * @return The expressSettings. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ExpressKeySettings getExpressSettings() { + if (platformSettingsCase_ == 11) { + return (com.google.recaptchaenterprise.v1.ExpressKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1.ExpressKeySettings.getDefaultInstance(); + } + /** + * + * + *
+   * Settings for keys that can be used by reCAPTCHA Express.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ExpressKeySettingsOrBuilder + getExpressSettingsOrBuilder() { + if (platformSettingsCase_ == 11) { + return (com.google.recaptchaenterprise.v1.ExpressKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1.ExpressKeySettings.getDefaultInstance(); + } + public static final int LABELS_FIELD_NUMBER = 6; private static final class LabelsDefaultEntryHolder { @@ -419,7 +474,7 @@ public int getLabelsCount() { * *
    * Optional. See [Creating and managing labels]
-   * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+   * (https://cloud.google.com/recaptcha/docs/labels).
    * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -442,7 +497,7 @@ public java.util.Map getLabels() { * *
    * Optional. See [Creating and managing labels]
-   * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+   * (https://cloud.google.com/recaptcha/docs/labels).
    * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -456,7 +511,7 @@ public java.util.Map getLabelsMap() { * *
    * Optional. See [Creating and managing labels]
-   * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+   * (https://cloud.google.com/recaptcha/docs/labels).
    * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -477,7 +532,7 @@ public java.util.Map getLabelsMap() { * *
    * Optional. See [Creating and managing labels]
-   * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+   * (https://cloud.google.com/recaptcha/docs/labels).
    * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -696,6 +751,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(10, getWafSettings()); } + if (platformSettingsCase_ == 11) { + output.writeMessage( + 11, (com.google.recaptchaenterprise.v1.ExpressKeySettings) platformSettings_); + } getUnknownFields().writeTo(output); } @@ -745,6 +804,11 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getWafSettings()); } + if (platformSettingsCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.recaptchaenterprise.v1.ExpressKeySettings) platformSettings_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -786,6 +850,9 @@ public boolean equals(final java.lang.Object obj) { case 5: if (!getIosSettings().equals(other.getIosSettings())) return false; break; + case 11: + if (!getExpressSettings().equals(other.getExpressSettings())) return false; + break; case 0: default: } @@ -833,6 +900,10 @@ public int hashCode() { hash = (37 * hash) + IOS_SETTINGS_FIELD_NUMBER; hash = (53 * hash) + getIosSettings().hashCode(); break; + case 11: + hash = (37 * hash) + EXPRESS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getExpressSettings().hashCode(); + break; case 0: default: } @@ -1019,6 +1090,9 @@ public Builder clear() { if (iosSettingsBuilder_ != null) { iosSettingsBuilder_.clear(); } + if (expressSettingsBuilder_ != null) { + expressSettingsBuilder_.clear(); + } internalGetMutableLabels().clear(); createTime_ = null; if (createTimeBuilder_ != null) { @@ -1080,21 +1154,21 @@ private void buildPartial0(com.google.recaptchaenterprise.v1.Key result) { if (((from_bitField0_ & 0x00000002) != 0)) { result.displayName_ = displayName_; } - if (((from_bitField0_ & 0x00000020) != 0)) { + if (((from_bitField0_ & 0x00000040) != 0)) { result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); } int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000040) != 0)) { + if (((from_bitField0_ & 0x00000080) != 0)) { result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); to_bitField0_ |= 0x00000001; } - if (((from_bitField0_ & 0x00000080) != 0)) { + if (((from_bitField0_ & 0x00000100) != 0)) { result.testingOptions_ = testingOptionsBuilder_ == null ? testingOptions_ : testingOptionsBuilder_.build(); to_bitField0_ |= 0x00000002; } - if (((from_bitField0_ & 0x00000100) != 0)) { + if (((from_bitField0_ & 0x00000200) != 0)) { result.wafSettings_ = wafSettingsBuilder_ == null ? wafSettings_ : wafSettingsBuilder_.build(); to_bitField0_ |= 0x00000004; @@ -1114,6 +1188,9 @@ private void buildPartialOneofs(com.google.recaptchaenterprise.v1.Key result) { if (platformSettingsCase_ == 5 && iosSettingsBuilder_ != null) { result.platformSettings_ = iosSettingsBuilder_.build(); } + if (platformSettingsCase_ == 11 && expressSettingsBuilder_ != null) { + result.platformSettings_ = expressSettingsBuilder_.build(); + } } @java.lang.Override @@ -1172,7 +1249,7 @@ public Builder mergeFrom(com.google.recaptchaenterprise.v1.Key other) { onChanged(); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } @@ -1198,6 +1275,11 @@ public Builder mergeFrom(com.google.recaptchaenterprise.v1.Key other) { mergeIosSettings(other.getIosSettings()); break; } + case EXPRESS_SETTINGS: + { + mergeExpressSettings(other.getExpressSettings()); + break; + } case PLATFORMSETTINGS_NOT_SET: { break; @@ -1268,27 +1350,33 @@ public Builder mergeFrom( internalGetMutableLabels() .getMutableMap() .put(labels__.getKey(), labels__.getValue()); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; break; } // case 50 case 58: { input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; break; } // case 58 case 74: { input.readMessage(getTestingOptionsFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; break; } // case 74 case 82: { input.readMessage(getWafSettingsFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; break; } // case 82 + case 90: + { + input.readMessage(getExpressSettingsFieldBuilder().getBuilder(), extensionRegistry); + platformSettingsCase_ = 11; + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2173,6 +2261,220 @@ public com.google.recaptchaenterprise.v1.IOSKeySettingsOrBuilder getIosSettingsO return iosSettingsBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.ExpressKeySettings, + com.google.recaptchaenterprise.v1.ExpressKeySettings.Builder, + com.google.recaptchaenterprise.v1.ExpressKeySettingsOrBuilder> + expressSettingsBuilder_; + /** + * + * + *
+     * Settings for keys that can be used by reCAPTCHA Express.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + * + * @return Whether the expressSettings field is set. + */ + @java.lang.Override + public boolean hasExpressSettings() { + return platformSettingsCase_ == 11; + } + /** + * + * + *
+     * Settings for keys that can be used by reCAPTCHA Express.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + * + * @return The expressSettings. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ExpressKeySettings getExpressSettings() { + if (expressSettingsBuilder_ == null) { + if (platformSettingsCase_ == 11) { + return (com.google.recaptchaenterprise.v1.ExpressKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1.ExpressKeySettings.getDefaultInstance(); + } else { + if (platformSettingsCase_ == 11) { + return expressSettingsBuilder_.getMessage(); + } + return com.google.recaptchaenterprise.v1.ExpressKeySettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Settings for keys that can be used by reCAPTCHA Express.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + */ + public Builder setExpressSettings(com.google.recaptchaenterprise.v1.ExpressKeySettings value) { + if (expressSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + platformSettings_ = value; + onChanged(); + } else { + expressSettingsBuilder_.setMessage(value); + } + platformSettingsCase_ = 11; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by reCAPTCHA Express.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + */ + public Builder setExpressSettings( + com.google.recaptchaenterprise.v1.ExpressKeySettings.Builder builderForValue) { + if (expressSettingsBuilder_ == null) { + platformSettings_ = builderForValue.build(); + onChanged(); + } else { + expressSettingsBuilder_.setMessage(builderForValue.build()); + } + platformSettingsCase_ = 11; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by reCAPTCHA Express.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + */ + public Builder mergeExpressSettings( + com.google.recaptchaenterprise.v1.ExpressKeySettings value) { + if (expressSettingsBuilder_ == null) { + if (platformSettingsCase_ == 11 + && platformSettings_ + != com.google.recaptchaenterprise.v1.ExpressKeySettings.getDefaultInstance()) { + platformSettings_ = + com.google.recaptchaenterprise.v1.ExpressKeySettings.newBuilder( + (com.google.recaptchaenterprise.v1.ExpressKeySettings) platformSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + platformSettings_ = value; + } + onChanged(); + } else { + if (platformSettingsCase_ == 11) { + expressSettingsBuilder_.mergeFrom(value); + } else { + expressSettingsBuilder_.setMessage(value); + } + } + platformSettingsCase_ = 11; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by reCAPTCHA Express.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + */ + public Builder clearExpressSettings() { + if (expressSettingsBuilder_ == null) { + if (platformSettingsCase_ == 11) { + platformSettingsCase_ = 0; + platformSettings_ = null; + onChanged(); + } + } else { + if (platformSettingsCase_ == 11) { + platformSettingsCase_ = 0; + platformSettings_ = null; + } + expressSettingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by reCAPTCHA Express.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + */ + public com.google.recaptchaenterprise.v1.ExpressKeySettings.Builder + getExpressSettingsBuilder() { + return getExpressSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Settings for keys that can be used by reCAPTCHA Express.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ExpressKeySettingsOrBuilder + getExpressSettingsOrBuilder() { + if ((platformSettingsCase_ == 11) && (expressSettingsBuilder_ != null)) { + return expressSettingsBuilder_.getMessageOrBuilder(); + } else { + if (platformSettingsCase_ == 11) { + return (com.google.recaptchaenterprise.v1.ExpressKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1.ExpressKeySettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Settings for keys that can be used by reCAPTCHA Express.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.ExpressKeySettings, + com.google.recaptchaenterprise.v1.ExpressKeySettings.Builder, + com.google.recaptchaenterprise.v1.ExpressKeySettingsOrBuilder> + getExpressSettingsFieldBuilder() { + if (expressSettingsBuilder_ == null) { + if (!(platformSettingsCase_ == 11)) { + platformSettings_ = + com.google.recaptchaenterprise.v1.ExpressKeySettings.getDefaultInstance(); + } + expressSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.ExpressKeySettings, + com.google.recaptchaenterprise.v1.ExpressKeySettings.Builder, + com.google.recaptchaenterprise.v1.ExpressKeySettingsOrBuilder>( + (com.google.recaptchaenterprise.v1.ExpressKeySettings) platformSettings_, + getParentForChildren(), + isClean()); + platformSettings_ = null; + } + platformSettingsCase_ = 11; + onChanged(); + return expressSettingsBuilder_; + } + private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { @@ -2190,7 +2492,7 @@ private com.google.protobuf.MapField interna if (!labels_.isMutable()) { labels_ = labels_.copy(); } - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); return labels_; } @@ -2203,7 +2505,7 @@ public int getLabelsCount() { * *
      * Optional. See [Creating and managing labels]
-     * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+     * (https://cloud.google.com/recaptcha/docs/labels).
      * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2226,7 +2528,7 @@ public java.util.Map getLabels() { * *
      * Optional. See [Creating and managing labels]
-     * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+     * (https://cloud.google.com/recaptcha/docs/labels).
      * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2240,7 +2542,7 @@ public java.util.Map getLabelsMap() { * *
      * Optional. See [Creating and managing labels]
-     * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+     * (https://cloud.google.com/recaptcha/docs/labels).
      * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2261,7 +2563,7 @@ public java.util.Map getLabelsMap() { * *
      * Optional. See [Creating and managing labels]
-     * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+     * (https://cloud.google.com/recaptcha/docs/labels).
      * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2279,7 +2581,7 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public Builder clearLabels() { - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); internalGetMutableLabels().getMutableMap().clear(); return this; } @@ -2288,7 +2590,7 @@ public Builder clearLabels() { * *
      * Optional. See [Creating and managing labels]
-     * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+     * (https://cloud.google.com/recaptcha/docs/labels).
      * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2303,7 +2605,7 @@ public Builder removeLabels(java.lang.String key) { /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableLabels() { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; return internalGetMutableLabels().getMutableMap(); } /** @@ -2311,7 +2613,7 @@ public java.util.Map getMutableLabels() { * *
      * Optional. See [Creating and managing labels]
-     * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+     * (https://cloud.google.com/recaptcha/docs/labels).
      * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2324,7 +2626,7 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { throw new NullPointerException("map value"); } internalGetMutableLabels().getMutableMap().put(key, value); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; return this; } /** @@ -2332,14 +2634,14 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * *
      * Optional. See [Creating and managing labels]
-     * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+     * (https://cloud.google.com/recaptcha/docs/labels).
      * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; return this; } @@ -2363,7 +2665,7 @@ public Builder putAllLabels(java.util.Map va * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return ((bitField0_ & 0x00000040) != 0); + return ((bitField0_ & 0x00000080) != 0); } /** * @@ -2407,7 +2709,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { } else { createTimeBuilder_.setMessage(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2428,7 +2730,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal } else { createTimeBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2445,7 +2747,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) + if (((bitField0_ & 0x00000080) != 0) && createTime_ != null && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getCreateTimeBuilder().mergeFrom(value); @@ -2456,7 +2758,7 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { createTimeBuilder_.mergeFrom(value); } if (createTime_ != null) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); } return this; @@ -2473,7 +2775,7 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * */ public Builder clearCreateTime() { - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000080); createTime_ = null; if (createTimeBuilder_ != null) { createTimeBuilder_.dispose(); @@ -2494,7 +2796,7 @@ public Builder clearCreateTime() { * */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return getCreateTimeFieldBuilder().getBuilder(); } @@ -2566,7 +2868,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * @return Whether the testingOptions field is set. */ public boolean hasTestingOptions() { - return ((bitField0_ & 0x00000080) != 0); + return ((bitField0_ & 0x00000100) != 0); } /** * @@ -2610,7 +2912,7 @@ public Builder setTestingOptions(com.google.recaptchaenterprise.v1.TestingOption } else { testingOptionsBuilder_.setMessage(value); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2632,7 +2934,7 @@ public Builder setTestingOptions( } else { testingOptionsBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2649,7 +2951,7 @@ public Builder setTestingOptions( */ public Builder mergeTestingOptions(com.google.recaptchaenterprise.v1.TestingOptions value) { if (testingOptionsBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0) + if (((bitField0_ & 0x00000100) != 0) && testingOptions_ != null && testingOptions_ != com.google.recaptchaenterprise.v1.TestingOptions.getDefaultInstance()) { @@ -2661,7 +2963,7 @@ public Builder mergeTestingOptions(com.google.recaptchaenterprise.v1.TestingOpti testingOptionsBuilder_.mergeFrom(value); } if (testingOptions_ != null) { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); } return this; @@ -2678,7 +2980,7 @@ public Builder mergeTestingOptions(com.google.recaptchaenterprise.v1.TestingOpti * */ public Builder clearTestingOptions() { - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); testingOptions_ = null; if (testingOptionsBuilder_ != null) { testingOptionsBuilder_.dispose(); @@ -2699,7 +3001,7 @@ public Builder clearTestingOptions() { * */ public com.google.recaptchaenterprise.v1.TestingOptions.Builder getTestingOptionsBuilder() { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return getTestingOptionsFieldBuilder().getBuilder(); } @@ -2771,7 +3073,7 @@ public com.google.recaptchaenterprise.v1.TestingOptionsOrBuilder getTestingOptio * @return Whether the wafSettings field is set. */ public boolean hasWafSettings() { - return ((bitField0_ & 0x00000100) != 0); + return ((bitField0_ & 0x00000200) != 0); } /** * @@ -2815,7 +3117,7 @@ public Builder setWafSettings(com.google.recaptchaenterprise.v1.WafSettings valu } else { wafSettingsBuilder_.setMessage(value); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -2837,7 +3139,7 @@ public Builder setWafSettings( } else { wafSettingsBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -2854,7 +3156,7 @@ public Builder setWafSettings( */ public Builder mergeWafSettings(com.google.recaptchaenterprise.v1.WafSettings value) { if (wafSettingsBuilder_ == null) { - if (((bitField0_ & 0x00000100) != 0) + if (((bitField0_ & 0x00000200) != 0) && wafSettings_ != null && wafSettings_ != com.google.recaptchaenterprise.v1.WafSettings.getDefaultInstance()) { getWafSettingsBuilder().mergeFrom(value); @@ -2865,7 +3167,7 @@ public Builder mergeWafSettings(com.google.recaptchaenterprise.v1.WafSettings va wafSettingsBuilder_.mergeFrom(value); } if (wafSettings_ != null) { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); } return this; @@ -2882,7 +3184,7 @@ public Builder mergeWafSettings(com.google.recaptchaenterprise.v1.WafSettings va * */ public Builder clearWafSettings() { - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000200); wafSettings_ = null; if (wafSettingsBuilder_ != null) { wafSettingsBuilder_.dispose(); @@ -2903,7 +3205,7 @@ public Builder clearWafSettings() { * */ public com.google.recaptchaenterprise.v1.WafSettings.Builder getWafSettingsBuilder() { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return getWafSettingsFieldBuilder().getBuilder(); } diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/KeyOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/KeyOrBuilder.java index f75e12b936b3..bea840d8f375 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/KeyOrBuilder.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/KeyOrBuilder.java @@ -181,12 +181,47 @@ public interface KeyOrBuilder */ com.google.recaptchaenterprise.v1.IOSKeySettingsOrBuilder getIosSettingsOrBuilder(); + /** + * + * + *
+   * Settings for keys that can be used by reCAPTCHA Express.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + * + * @return Whether the expressSettings field is set. + */ + boolean hasExpressSettings(); + /** + * + * + *
+   * Settings for keys that can be used by reCAPTCHA Express.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + * + * @return The expressSettings. + */ + com.google.recaptchaenterprise.v1.ExpressKeySettings getExpressSettings(); + /** + * + * + *
+   * Settings for keys that can be used by reCAPTCHA Express.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11; + */ + com.google.recaptchaenterprise.v1.ExpressKeySettingsOrBuilder getExpressSettingsOrBuilder(); + /** * * *
    * Optional. See [Creating and managing labels]
-   * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+   * (https://cloud.google.com/recaptcha/docs/labels).
    * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -197,7 +232,7 @@ public interface KeyOrBuilder * *
    * Optional. See [Creating and managing labels]
-   * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+   * (https://cloud.google.com/recaptcha/docs/labels).
    * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -211,7 +246,7 @@ public interface KeyOrBuilder * *
    * Optional. See [Creating and managing labels]
-   * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+   * (https://cloud.google.com/recaptcha/docs/labels).
    * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -222,7 +257,7 @@ public interface KeyOrBuilder * *
    * Optional. See [Creating and managing labels]
-   * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+   * (https://cloud.google.com/recaptcha/docs/labels).
    * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -237,7 +272,7 @@ java.lang.String getLabelsOrDefault( * *
    * Optional. See [Creating and managing labels]
-   * (https://cloud.google.com/recaptcha-enterprise/docs/labels).
+   * (https://cloud.google.com/recaptcha/docs/labels).
    * 
* * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequest.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequest.java index fdb868acd5aa..df015d2d3a31 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequest.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequest.java @@ -129,11 +129,11 @@ public com.google.protobuf.ByteString getNameBytes() { * Optional. If true, skips the billing check. * A reCAPTCHA Enterprise key or migrated key behaves differently than a * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid * any disruption of your usage, we check that a billing account is present. * If your usage of reCAPTCHA is under the free quota, you can safely skip the * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha-enterprise/docs/billing-information. + * https://cloud.google.com/recaptcha/docs/billing-information. * * * bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -638,11 +638,11 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * Optional. If true, skips the billing check. * A reCAPTCHA Enterprise key or migrated key behaves differently than a * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid * any disruption of your usage, we check that a billing account is present. * If your usage of reCAPTCHA is under the free quota, you can safely skip the * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha-enterprise/docs/billing-information. + * https://cloud.google.com/recaptcha/docs/billing-information. * * * bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -660,11 +660,11 @@ public boolean getSkipBillingCheck() { * Optional. If true, skips the billing check. * A reCAPTCHA Enterprise key or migrated key behaves differently than a * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid * any disruption of your usage, we check that a billing account is present. * If your usage of reCAPTCHA is under the free quota, you can safely skip the * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha-enterprise/docs/billing-information. + * https://cloud.google.com/recaptcha/docs/billing-information. * * * bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -686,11 +686,11 @@ public Builder setSkipBillingCheck(boolean value) { * Optional. If true, skips the billing check. * A reCAPTCHA Enterprise key or migrated key behaves differently than a * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid * any disruption of your usage, we check that a billing account is present. * If your usage of reCAPTCHA is under the free quota, you can safely skip the * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha-enterprise/docs/billing-information. + * https://cloud.google.com/recaptcha/docs/billing-information. * * * bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequestOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequestOrBuilder.java index 4be8e2abf3e2..23d54d7c2bd1 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequestOrBuilder.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequestOrBuilder.java @@ -62,11 +62,11 @@ public interface MigrateKeyRequestOrBuilder * Optional. If true, skips the billing check. * A reCAPTCHA Enterprise key or migrated key behaves differently than a * reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - * https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid + * https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid * any disruption of your usage, we check that a billing account is present. * If your usage of reCAPTCHA is under the free quota, you can safely skip the * billing check and proceed with the migration. See - * https://cloud.google.com/recaptcha-enterprise/docs/billing-information. + * https://cloud.google.com/recaptcha/docs/billing-information. * * * bool skip_billing_check = 2 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseProto.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseProto.java index e47ed62c151a..761ca754299d 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseProto.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseProto.java @@ -240,6 +240,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_recaptchaenterprise_v1_IOSKeySettings_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_recaptchaenterprise_v1_IOSKeySettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_recaptchaenterprise_v1_AppleDeveloperId_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -324,6 +328,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_recaptchaenterprise_v1_SearchRelatedAccountGroupMembershipsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_recaptchaenterprise_v1_SearchRelatedAccountGroupMembershipsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_recaptchaenterprise_v1_RelatedAccountGroupMembership_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -336,6 +348,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_recaptchaenterprise_v1_WafSettings_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_recaptchaenterprise_v1_WafSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -632,261 +648,279 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + ".com/Metrics\022%projects/{project}/keys/{k" + "ey}/metrics*\007metrics2\007metrics\"<\n\037Retriev" + "eLegacySecretKeyResponse\022\031\n\021legacy_secre" - + "t_key\030\001 \001(\t\"\336\005\n\003Key\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\031" + + "t_key\030\001 \001(\t\"\263\006\n\003Key\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\031" + "\n\014display_name\030\002 \001(\tB\003\340A\002\022K\n\014web_setting" + "s\030\003 \001(\01323.google.cloud.recaptchaenterpri" + "se.v1.WebKeySettingsH\000\022S\n\020android_settin" + "gs\030\004 \001(\01327.google.cloud.recaptchaenterpr" + "ise.v1.AndroidKeySettingsH\000\022K\n\014ios_setti" + "ngs\030\005 \001(\01323.google.cloud.recaptchaenterp" - + "rise.v1.IOSKeySettingsH\000\022I\n\006labels\030\006 \003(\013" - + "24.google.cloud.recaptchaenterprise.v1.K" - + "ey.LabelsEntryB\003\340A\001\0224\n\013create_time\030\007 \001(\013" - + "2\032.google.protobuf.TimestampB\003\340A\003\022Q\n\017tes" - + "ting_options\030\t \001(\01323.google.cloud.recapt" - + "chaenterprise.v1.TestingOptionsB\003\340A\001\022K\n\014" - + "waf_settings\030\n \001(\01320.google.cloud.recapt" - + "chaenterprise.v1.WafSettingsB\003\340A\001\032-\n\013Lab" - + "elsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" - + ":U\352AR\n&recaptchaenterprise.googleapis.co" - + "m/Key\022\035projects/{project}/keys/{key}*\004ke" - + "ys2\003keyB\023\n\021platform_settings\"\362\001\n\016Testing" - + "Options\022\032\n\rtesting_score\030\001 \001(\002B\003\340A\001\022d\n\021t" - + "esting_challenge\030\002 \001(\0162D.google.cloud.re" - + "captchaenterprise.v1.TestingOptions.Test" - + "ingChallengeB\003\340A\001\"^\n\020TestingChallenge\022!\n" - + "\035TESTING_CHALLENGE_UNSPECIFIED\020\000\022\r\n\tNOCA" - + "PTCHA\020\001\022\030\n\024UNSOLVABLE_CHALLENGE\020\002\"\244\004\n\016We" - + "bKeySettings\022\036\n\021allow_all_domains\030\003 \001(\010B" - + "\003\340A\001\022\034\n\017allowed_domains\030\001 \003(\tB\003\340A\001\022\036\n\021al" - + "low_amp_traffic\030\002 \001(\010B\003\340A\001\022b\n\020integratio" - + "n_type\030\004 \001(\0162C.google.cloud.recaptchaent" - + "erprise.v1.WebKeySettings.IntegrationTyp" - + "eB\003\340A\002\022{\n\035challenge_security_preference\030" - + "\005 \001(\0162O.google.cloud.recaptchaenterprise" - + ".v1.WebKeySettings.ChallengeSecurityPref" - + "erenceB\003\340A\001\"[\n\017IntegrationType\022 \n\034INTEGR" - + "ATION_TYPE_UNSPECIFIED\020\000\022\t\n\005SCORE\020\001\022\014\n\010C" - + "HECKBOX\020\002\022\r\n\tINVISIBLE\020\003\"v\n\033ChallengeSec" - + "urityPreference\022-\n)CHALLENGE_SECURITY_PR" - + "EFERENCE_UNSPECIFIED\020\000\022\r\n\tUSABILITY\020\001\022\013\n" - + "\007BALANCE\020\002\022\014\n\010SECURITY\020\003\"\226\001\n\022AndroidKeyS" - + "ettings\022$\n\027allow_all_package_names\030\002 \001(\010" - + "B\003\340A\001\022\"\n\025allowed_package_names\030\001 \003(\tB\003\340A" - + "\001\0226\n)support_non_google_app_store_distri" - + "bution\030\003 \001(\010B\003\340A\001\"\254\001\n\016IOSKeySettings\022!\n\024" - + "allow_all_bundle_ids\030\002 \001(\010B\003\340A\001\022\037\n\022allow" - + "ed_bundle_ids\030\001 \003(\tB\003\340A\001\022V\n\022apple_develo" - + "per_id\030\003 \001(\01325.google.cloud.recaptchaent" - + "erprise.v1.AppleDeveloperIdB\003\340A\001\"Z\n\020Appl" - + "eDeveloperId\022\033\n\013private_key\030\001 \001(\tB\006\340A\002\340A" - + "\004\022\023\n\006key_id\030\002 \001(\tB\003\340A\002\022\024\n\007team_id\030\003 \001(\tB" - + "\003\340A\002\"\251\001\n\021ScoreDistribution\022_\n\rscore_buck" - + "ets\030\001 \003(\0132H.google.cloud.recaptchaenterp" - + "rise.v1.ScoreDistribution.ScoreBucketsEn" - + "try\0323\n\021ScoreBucketsEntry\022\013\n\003key\030\001 \001(\005\022\r\n" - + "\005value\030\002 \001(\003:\0028\001\"\253\002\n\014ScoreMetrics\022O\n\017ove" - + "rall_metrics\030\001 \001(\01326.google.cloud.recapt" - + "chaenterprise.v1.ScoreDistribution\022\\\n\016ac" - + "tion_metrics\030\002 \003(\0132D.google.cloud.recapt" - + "chaenterprise.v1.ScoreMetrics.ActionMetr" - + "icsEntry\032l\n\022ActionMetricsEntry\022\013\n\003key\030\001 " - + "\001(\t\022E\n\005value\030\002 \001(\01326.google.cloud.recapt" - + "chaenterprise.v1.ScoreDistribution:\0028\001\"o" - + "\n\020ChallengeMetrics\022\026\n\016pageload_count\030\001 \001" - + "(\003\022\027\n\017nocaptcha_count\030\002 \001(\003\022\024\n\014failed_co" - + "unt\030\003 \001(\003\022\024\n\014passed_count\030\004 \001(\003\"\225\001\n\030Fire" - + "wallPolicyAssessment\022&\n\005error\030\005 \001(\0132\022.go" - + "ogle.rpc.StatusB\003\340A\003\022Q\n\017firewall_policy\030" - + "\010 \001(\01323.google.cloud.recaptchaenterprise" - + ".v1.FirewallPolicyB\003\340A\003\"\202\006\n\016FirewallActi" - + "on\022P\n\005allow\030\001 \001(\0132?.google.cloud.recaptc" - + "haenterprise.v1.FirewallAction.AllowActi" - + "onH\000\022P\n\005block\030\002 \001(\0132?.google.cloud.recap" - + "tchaenterprise.v1.FirewallAction.BlockAc" - + "tionH\000\022t\n\030include_recaptcha_script\030\006 \001(\013" - + "2P.google.cloud.recaptchaenterprise.v1.F" - + "irewallAction.IncludeRecaptchaScriptActi" - + "onH\000\022V\n\010redirect\030\005 \001(\0132B.google.cloud.re" - + "captchaenterprise.v1.FirewallAction.Redi" - + "rectActionH\000\022Z\n\nsubstitute\030\003 \001(\0132D.googl" - + "e.cloud.recaptchaenterprise.v1.FirewallA" - + "ction.SubstituteActionH\000\022Y\n\nset_header\030\004" - + " \001(\0132C.google.cloud.recaptchaenterprise." - + "v1.FirewallAction.SetHeaderActionH\000\032\r\n\013A" - + "llowAction\032\r\n\013BlockAction\032\036\n\034IncludeReca" - + "ptchaScriptAction\032\020\n\016RedirectAction\032%\n\020S" - + "ubstituteAction\022\021\n\004path\030\001 \001(\tB\003\340A\001\0327\n\017Se" - + "tHeaderAction\022\020\n\003key\030\001 \001(\tB\003\340A\001\022\022\n\005value" - + "\030\002 \001(\tB\003\340A\001B\027\n\025firewall_action_oneof\"\305\002\n" - + "\016FirewallPolicy\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\030\n\013de" - + "scription\030\002 \001(\tB\003\340A\001\022\021\n\004path\030\004 \001(\tB\003\340A\001\022" - + "\026\n\tcondition\030\005 \001(\tB\003\340A\001\022I\n\007actions\030\006 \003(\013" - + "23.google.cloud.recaptchaenterprise.v1.F" - + "irewallActionB\003\340A\001:\217\001\352A\213\001\n1recaptchaente" - + "rprise.googleapis.com/FirewallPolicy\0224pr" - + "ojects/{project}/firewallpolicies/{firew" - + "allpolicy}*\020firewallPolicies2\016firewallPo" - + "licy\"\266\001\n)ListRelatedAccountGroupMembersh" - + "ipsRequest\022X\n\006parent\030\001 \001(\tBH\340A\002\372AB\022@reca" - + "ptchaenterprise.googleapis.com/RelatedAc" - + "countGroupMembership\022\026\n\tpage_size\030\002 \001(\005B" - + "\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\"\264\001\n*ListRe" - + "latedAccountGroupMembershipsResponse\022m\n!" - + "related_account_group_memberships\030\001 \003(\0132" - + "B.google.cloud.recaptchaenterprise.v1.Re" - + "latedAccountGroupMembership\022\027\n\017next_page" - + "_token\030\002 \001(\t\"\242\001\n\037ListRelatedAccountGroup" - + "sRequest\022N\n\006parent\030\001 \001(\tB>\340A\002\372A8\0226recapt" - + "chaenterprise.googleapis.com/RelatedAcco" - + "untGroup\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage" - + "_token\030\003 \001(\tB\003\340A\001\"\225\001\n ListRelatedAccount" - + "GroupsResponse\022X\n\026related_account_groups" - + "\030\001 \003(\01328.google.cloud.recaptchaenterpris" - + "e.v1.RelatedAccountGroup\022\027\n\017next_page_to" - + "ken\030\002 \001(\t\"\337\001\n+SearchRelatedAccountGroupM", - "embershipsRequest\022D\n\007project\030\001 \001(\tB3\340A\002\372" - + "A-\n+cloudresourcemanager.googleapis.com/" - + "Project\022\027\n\naccount_id\030\005 \001(\tB\003\340A\001\022 \n\021hash" - + "ed_account_id\030\002 \001(\014B\005\030\001\340A\001\022\026\n\tpage_size\030" - + "\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\"\266\001\n," - + "SearchRelatedAccountGroupMembershipsResp" - + "onse\022m\n!related_account_group_membership" - + "s\030\001 \003(\0132B.google.cloud.recaptchaenterpri" - + "se.v1.RelatedAccountGroupMembership\022\027\n\017n" - + "ext_page_token\030\002 \001(\t\"\310\002\n\035RelatedAccountG" - + "roupMembership\022\024\n\004name\030\001 \001(\tB\006\340A\010\340A\002\022\022\n\n" - + "account_id\030\004 \001(\t\022\035\n\021hashed_account_id\030\002 " - + "\001(\014B\002\030\001:\335\001\352A\331\001\n@recaptchaenterprise.goog" - + "leapis.com/RelatedAccountGroupMembership" - + "\022Vprojects/{project}/relatedaccountgroup" - + "s/{relatedaccountgroup}/memberships/{mem" - + "bership}*\036relatedAccountGroupMemberships" - + "2\035relatedAccountGroupMembership\"\324\001\n\023Rela" - + "tedAccountGroup\022\024\n\004name\030\001 \001(\tB\006\340A\010\340A\002:\246\001" - + "\352A\242\001\n6recaptchaenterprise.googleapis.com" - + "/RelatedAccountGroup\022=projects/{project}" - + "/relatedaccountgroups/{relatedaccountgro" - + "up}*\024relatedAccountGroups2\023relatedAccoun" - + "tGroup\"\373\002\n\013WafSettings\022U\n\013waf_service\030\001 " - + "\001(\0162;.google.cloud.recaptchaenterprise.v" - + "1.WafSettings.WafServiceB\003\340A\002\022U\n\013waf_fea" - + "ture\030\002 \001(\0162;.google.cloud.recaptchaenter" - + "prise.v1.WafSettings.WafFeatureB\003\340A\002\"o\n\n" - + "WafFeature\022\033\n\027WAF_FEATURE_UNSPECIFIED\020\000\022" - + "\022\n\016CHALLENGE_PAGE\020\001\022\021\n\rSESSION_TOKEN\020\002\022\020" - + "\n\014ACTION_TOKEN\020\003\022\013\n\007EXPRESS\020\005\"M\n\nWafServ" - + "ice\022\033\n\027WAF_SERVICE_UNSPECIFIED\020\000\022\006\n\002CA\020\001" - + "\022\n\n\006FASTLY\020\003\022\016\n\nCLOUDFLARE\020\0042\331\037\n\032Recaptc" - + "haEnterpriseService\022\316\001\n\020CreateAssessment" - + "\022<.google.cloud.recaptchaenterprise.v1.C" - + "reateAssessmentRequest\032/.google.cloud.re" - + "captchaenterprise.v1.Assessment\"K\332A\021pare" - + "nt,assessment\202\323\344\223\0021\"#/v1/{parent=project" - + "s/*}/assessments:\nassessment\022\340\001\n\022Annotat" - + "eAssessment\022>.google.cloud.recaptchaente" - + "rprise.v1.AnnotateAssessmentRequest\032?.go" - + "ogle.cloud.recaptchaenterprise.v1.Annota" - + "teAssessmentResponse\"I\332A\017name,annotation" - + "\202\323\344\223\0021\",/v1/{name=projects/*/assessments" - + "/*}:annotate:\001*\022\244\001\n\tCreateKey\0225.google.c" - + "loud.recaptchaenterprise.v1.CreateKeyReq" - + "uest\032(.google.cloud.recaptchaenterprise." - + "v1.Key\"6\332A\nparent,key\202\323\344\223\002#\"\034/v1/{parent" - + "=projects/*}/keys:\003key\022\246\001\n\010ListKeys\0224.go" - + "ogle.cloud.recaptchaenterprise.v1.ListKe" - + "ysRequest\0325.google.cloud.recaptchaenterp" - + "rise.v1.ListKeysResponse\"-\332A\006parent\202\323\344\223\002" - + "\036\022\034/v1/{parent=projects/*}/keys\022\347\001\n\027Retr" - + "ieveLegacySecretKey\022C.google.cloud.recap" - + "tchaenterprise.v1.RetrieveLegacySecretKe" - + "yRequest\032D.google.cloud.recaptchaenterpr" - + "ise.v1.RetrieveLegacySecretKeyResponse\"A" - + "\332A\003key\202\323\344\223\0025\0223/v1/{key=projects/*/keys/*" - + "}:retrieveLegacySecretKey\022\223\001\n\006GetKey\0222.g" - + "oogle.cloud.recaptchaenterprise.v1.GetKe" - + "yRequest\032(.google.cloud.recaptchaenterpr" - + "ise.v1.Key\"+\332A\004name\202\323\344\223\002\036\022\034/v1/{name=pro" - + "jects/*/keys/*}\022\255\001\n\tUpdateKey\0225.google.c" - + "loud.recaptchaenterprise.v1.UpdateKeyReq" - + "uest\032(.google.cloud.recaptchaenterprise." - + "v1.Key\"?\332A\017key,update_mask\202\323\344\223\002\'2 /v1/{k" - + "ey.name=projects/*/keys/*}:\003key\022\207\001\n\tDele" - + "teKey\0225.google.cloud.recaptchaenterprise" - + ".v1.DeleteKeyRequest\032\026.google.protobuf.E" - + "mpty\"+\332A\004name\202\323\344\223\002\036*\034/v1/{name=projects/" - + "*/keys/*}\022\237\001\n\nMigrateKey\0226.google.cloud." - + "recaptchaenterprise.v1.MigrateKeyRequest" - + "\032(.google.cloud.recaptchaenterprise.v1.K" - + "ey\"/\202\323\344\223\002)\"$/v1/{name=projects/*/keys/*}" - + ":migrate:\001*\022\247\001\n\nGetMetrics\0226.google.clou" - + "d.recaptchaenterprise.v1.GetMetricsReque" - + "st\032,.google.cloud.recaptchaenterprise.v1" - + ".Metrics\"3\332A\004name\202\323\344\223\002&\022$/v1/{name=proje" - + "cts/*/keys/*/metrics}\022\351\001\n\024CreateFirewall" - + "Policy\022@.google.cloud.recaptchaenterpris" - + "e.v1.CreateFirewallPolicyRequest\0323.googl" + + "rise.v1.IOSKeySettingsH\000\022S\n\020express_sett" + + "ings\030\013 \001(\01327.google.cloud.recaptchaenter" + + "prise.v1.ExpressKeySettingsH\000\022I\n\006labels\030" + + "\006 \003(\01324.google.cloud.recaptchaenterprise" + + ".v1.Key.LabelsEntryB\003\340A\001\0224\n\013create_time\030" + + "\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022Q" + + "\n\017testing_options\030\t \001(\01323.google.cloud.r" + + "ecaptchaenterprise.v1.TestingOptionsB\003\340A" + + "\001\022K\n\014waf_settings\030\n \001(\01320.google.cloud.r" + + "ecaptchaenterprise.v1.WafSettingsB\003\340A\001\032-" + + "\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(" + + "\t:\0028\001:U\352AR\n&recaptchaenterprise.googleap" + + "is.com/Key\022\035projects/{project}/keys/{key" + + "}*\004keys2\003keyB\023\n\021platform_settings\"\362\001\n\016Te" + + "stingOptions\022\032\n\rtesting_score\030\001 \001(\002B\003\340A\001" + + "\022d\n\021testing_challenge\030\002 \001(\0162D.google.clo" + + "ud.recaptchaenterprise.v1.TestingOptions" + + ".TestingChallengeB\003\340A\001\"^\n\020TestingChallen" + + "ge\022!\n\035TESTING_CHALLENGE_UNSPECIFIED\020\000\022\r\n" + + "\tNOCAPTCHA\020\001\022\030\n\024UNSOLVABLE_CHALLENGE\020\002\"\244" + + "\004\n\016WebKeySettings\022\036\n\021allow_all_domains\030\003" + + " \001(\010B\003\340A\001\022\034\n\017allowed_domains\030\001 \003(\tB\003\340A\001\022" + + "\036\n\021allow_amp_traffic\030\002 \001(\010B\003\340A\001\022b\n\020integ" + + "ration_type\030\004 \001(\0162C.google.cloud.recaptc" + + "haenterprise.v1.WebKeySettings.Integrati" + + "onTypeB\003\340A\002\022{\n\035challenge_security_prefer" + + "ence\030\005 \001(\0162O.google.cloud.recaptchaenter" + + "prise.v1.WebKeySettings.ChallengeSecurit" + + "yPreferenceB\003\340A\001\"[\n\017IntegrationType\022 \n\034I" + + "NTEGRATION_TYPE_UNSPECIFIED\020\000\022\t\n\005SCORE\020\001" + + "\022\014\n\010CHECKBOX\020\002\022\r\n\tINVISIBLE\020\003\"v\n\033Challen" + + "geSecurityPreference\022-\n)CHALLENGE_SECURI" + + "TY_PREFERENCE_UNSPECIFIED\020\000\022\r\n\tUSABILITY" + + "\020\001\022\013\n\007BALANCE\020\002\022\014\n\010SECURITY\020\003\"\226\001\n\022Androi" + + "dKeySettings\022$\n\027allow_all_package_names\030" + + "\002 \001(\010B\003\340A\001\022\"\n\025allowed_package_names\030\001 \003(" + + "\tB\003\340A\001\0226\n)support_non_google_app_store_d" + + "istribution\030\003 \001(\010B\003\340A\001\"\254\001\n\016IOSKeySetting" + + "s\022!\n\024allow_all_bundle_ids\030\002 \001(\010B\003\340A\001\022\037\n\022" + + "allowed_bundle_ids\030\001 \003(\tB\003\340A\001\022V\n\022apple_d" + + "eveloper_id\030\003 \001(\01325.google.cloud.recaptc" + + "haenterprise.v1.AppleDeveloperIdB\003\340A\001\"\024\n" + + "\022ExpressKeySettings\"Z\n\020AppleDeveloperId\022" + + "\033\n\013private_key\030\001 \001(\tB\006\340A\002\340A\004\022\023\n\006key_id\030\002" + + " \001(\tB\003\340A\002\022\024\n\007team_id\030\003 \001(\tB\003\340A\002\"\251\001\n\021Scor" + + "eDistribution\022_\n\rscore_buckets\030\001 \003(\0132H.g" + + "oogle.cloud.recaptchaenterprise.v1.Score" + + "Distribution.ScoreBucketsEntry\0323\n\021ScoreB" + + "ucketsEntry\022\013\n\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\003:" + + "\0028\001\"\253\002\n\014ScoreMetrics\022O\n\017overall_metrics\030" + + "\001 \001(\01326.google.cloud.recaptchaenterprise" + + ".v1.ScoreDistribution\022\\\n\016action_metrics\030" + + "\002 \003(\0132D.google.cloud.recaptchaenterprise" + + ".v1.ScoreMetrics.ActionMetricsEntry\032l\n\022A" + + "ctionMetricsEntry\022\013\n\003key\030\001 \001(\t\022E\n\005value\030" + + "\002 \001(\01326.google.cloud.recaptchaenterprise" + + ".v1.ScoreDistribution:\0028\001\"o\n\020ChallengeMe" + + "trics\022\026\n\016pageload_count\030\001 \001(\003\022\027\n\017nocaptc" + + "ha_count\030\002 \001(\003\022\024\n\014failed_count\030\003 \001(\003\022\024\n\014" + + "passed_count\030\004 \001(\003\"\225\001\n\030FirewallPolicyAss" + + "essment\022&\n\005error\030\005 \001(\0132\022.google.rpc.Stat" + + "usB\003\340A\003\022Q\n\017firewall_policy\030\010 \001(\01323.googl" + "e.cloud.recaptchaenterprise.v1.FirewallP" - + "olicy\"Z\332A\026parent,firewall_policy\202\323\344\223\002;\"(" - + "/v1/{parent=projects/*}/firewallpolicies" - + ":\017firewall_policy\022\326\001\n\024ListFirewallPolici" - + "es\022@.google.cloud.recaptchaenterprise.v1" - + ".ListFirewallPoliciesRequest\032A.google.cl" - + "oud.recaptchaenterprise.v1.ListFirewallP" - + "oliciesResponse\"9\332A\006parent\202\323\344\223\002*\022(/v1/{p" - + "arent=projects/*}/firewallpolicies\022\300\001\n\021G" - + "etFirewallPolicy\022=.google.cloud.recaptch" - + "aenterprise.v1.GetFirewallPolicyRequest\032" - + "3.google.cloud.recaptchaenterprise.v1.Fi" - + "rewallPolicy\"7\332A\004name\202\323\344\223\002*\022(/v1/{name=p" - + "rojects/*/firewallpolicies/*}\022\376\001\n\024Update" - + "FirewallPolicy\022@.google.cloud.recaptchae" - + "nterprise.v1.UpdateFirewallPolicyRequest" - + "\0323.google.cloud.recaptchaenterprise.v1.F" - + "irewallPolicy\"o\332A\033firewall_policy,update" - + "_mask\202\323\344\223\002K28/v1/{firewall_policy.name=p" - + "rojects/*/firewallpolicies/*}:\017firewall_" - + "policy\022\251\001\n\024DeleteFirewallPolicy\022@.google" - + ".cloud.recaptchaenterprise.v1.DeleteFire" - + "wallPolicyRequest\032\026.google.protobuf.Empt" - + "y\"7\332A\004name\202\323\344\223\002**(/v1/{name=projects/*/f" - + "irewallpolicies/*}\022\360\001\n\027ReorderFirewallPo" - + "licies\022C.google.cloud.recaptchaenterpris" - + "e.v1.ReorderFirewallPoliciesRequest\032D.go" - + "ogle.cloud.recaptchaenterprise.v1.Reorde" - + "rFirewallPoliciesResponse\"J\332A\014parent,nam" - + "es\202\323\344\223\0025\"0/v1/{parent=projects/*}/firewa" - + "llpolicies:reorder:\001*\022\346\001\n\030ListRelatedAcc" - + "ountGroups\022D.google.cloud.recaptchaenter" - + "prise.v1.ListRelatedAccountGroupsRequest" - + "\032E.google.cloud.recaptchaenterprise.v1.L" - + "istRelatedAccountGroupsResponse\"=\332A\006pare" - + "nt\202\323\344\223\002.\022,/v1/{parent=projects/*}/relate" - + "daccountgroups\022\222\002\n\"ListRelatedAccountGro" - + "upMemberships\022N.google.cloud.recaptchaen" - + "terprise.v1.ListRelatedAccountGroupMembe" - + "rshipsRequest\032O.google.cloud.recaptchaen" - + "terprise.v1.ListRelatedAccountGroupMembe" - + "rshipsResponse\"K\332A\006parent\202\323\344\223\002<\022:/v1/{pa" - + "rent=projects/*/relatedaccountgroups/*}/" - + "memberships\022\262\002\n$SearchRelatedAccountGrou" - + "pMemberships\022P.google.cloud.recaptchaent" - + "erprise.v1.SearchRelatedAccountGroupMemb" - + "ershipsRequest\032Q.google.cloud.recaptchae" - + "nterprise.v1.SearchRelatedAccountGroupMe" - + "mbershipsResponse\"e\332A\031project,hashed_acc" - + "ount_id\202\323\344\223\002C\">/v1/{project=projects/*}/" - + "relatedaccountgroupmemberships:search:\001*" - + "\032V\312A\"recaptchaenterprise.googleapis.com\322" - + "A.https://www.googleapis.com/auth/cloud-" - + "platformB\231\002\n!com.google.recaptchaenterpr" - + "ise.v1B\030RecaptchaEnterpriseProtoP\001Z\\clou" - + "d.google.com/go/recaptchaenterprise/v2/a" - + "piv1/recaptchaenterprisepb;recaptchaente" - + "rprisepb\242\002\004GCRE\252\002#Google.Cloud.Recaptcha" - + "Enterprise.V1\312\002#Google\\Cloud\\RecaptchaEn" - + "terprise\\V1\352\002&Google::Cloud::RecaptchaEn" - + "terprise::V1b\006proto3" + + "olicyB\003\340A\003\"\202\006\n\016FirewallAction\022P\n\005allow\030\001" + + " \001(\0132?.google.cloud.recaptchaenterprise." + + "v1.FirewallAction.AllowActionH\000\022P\n\005block" + + "\030\002 \001(\0132?.google.cloud.recaptchaenterpris" + + "e.v1.FirewallAction.BlockActionH\000\022t\n\030inc" + + "lude_recaptcha_script\030\006 \001(\0132P.google.clo" + + "ud.recaptchaenterprise.v1.FirewallAction" + + ".IncludeRecaptchaScriptActionH\000\022V\n\010redir" + + "ect\030\005 \001(\0132B.google.cloud.recaptchaenterp" + + "rise.v1.FirewallAction.RedirectActionH\000\022" + + "Z\n\nsubstitute\030\003 \001(\0132D.google.cloud.recap" + + "tchaenterprise.v1.FirewallAction.Substit" + + "uteActionH\000\022Y\n\nset_header\030\004 \001(\0132C.google" + + ".cloud.recaptchaenterprise.v1.FirewallAc" + + "tion.SetHeaderActionH\000\032\r\n\013AllowAction\032\r\n" + + "\013BlockAction\032\036\n\034IncludeRecaptchaScriptAc" + + "tion\032\020\n\016RedirectAction\032%\n\020SubstituteActi" + + "on\022\021\n\004path\030\001 \001(\tB\003\340A\001\0327\n\017SetHeaderAction" + + "\022\020\n\003key\030\001 \001(\tB\003\340A\001\022\022\n\005value\030\002 \001(\tB\003\340A\001B\027" + + "\n\025firewall_action_oneof\"\305\002\n\016FirewallPoli" + + "cy\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\030\n\013description\030\002 \001" + + "(\tB\003\340A\001\022\021\n\004path\030\004 \001(\tB\003\340A\001\022\026\n\tcondition\030" + + "\005 \001(\tB\003\340A\001\022I\n\007actions\030\006 \003(\01323.google.clo" + + "ud.recaptchaenterprise.v1.FirewallAction" + + "B\003\340A\001:\217\001\352A\213\001\n1recaptchaenterprise.google" + + "apis.com/FirewallPolicy\0224projects/{proje" + + "ct}/firewallpolicies/{firewallpolicy}*\020f" + + "irewallPolicies2\016firewallPolicy\"\266\001\n)List" + + "RelatedAccountGroupMembershipsRequest\022X\n" + + "\006parent\030\001 \001(\tBH\340A\002\372AB\022@recaptchaenterpri" + + "se.googleapis.com/RelatedAccountGroupMem" + + "bership\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_" + + "token\030\003 \001(\tB\003\340A\001\"\264\001\n*ListRelatedAccountG" + + "roupMembershipsResponse\022m\n!related_accou" + + "nt_group_memberships\030\001 \003(\0132B.google.clou" + + "d.recaptchaenterprise.v1.RelatedAccountG" + + "roupMembership\022\027\n\017next_page_token\030\002 \001(\t\"" + + "\242\001\n\037ListRelatedAccountGroupsRequest\022N\n\006p" + + "arent\030\001 \001(\tB>\340A\002\372A8\0226recaptchaenterprise" + + ".googleapis.com/RelatedAccountGroup\022\026\n\tp" + + "age_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB" + + "\003\340A\001\"\225\001\n ListRelatedAccountGroupsRespons" + + "e\022X\n\026related_account_groups\030\001 \003(\01328.goog", + "le.cloud.recaptchaenterprise.v1.RelatedA" + + "ccountGroup\022\027\n\017next_page_token\030\002 \001(\t\"\337\001\n" + + "+SearchRelatedAccountGroupMembershipsReq" + + "uest\022D\n\007project\030\001 \001(\tB3\340A\002\372A-\n+cloudreso" + + "urcemanager.googleapis.com/Project\022\027\n\nac" + + "count_id\030\005 \001(\tB\003\340A\001\022 \n\021hashed_account_id" + + "\030\002 \001(\014B\005\030\001\340A\001\022\026\n\tpage_size\030\003 \001(\005B\003\340A\001\022\027\n" + + "\npage_token\030\004 \001(\tB\003\340A\001\"\266\001\n,SearchRelated" + + "AccountGroupMembershipsResponse\022m\n!relat" + + "ed_account_group_memberships\030\001 \003(\0132B.goo" + + "gle.cloud.recaptchaenterprise.v1.Related" + + "AccountGroupMembership\022\027\n\017next_page_toke" + + "n\030\002 \001(\t\"\250\001\n\024AddIpOverrideRequest\022<\n\004name" + + "\030\001 \001(\tB.\340A\002\372A(\n&recaptchaenterprise.goog" + + "leapis.com/Key\022R\n\020ip_override_data\030\002 \001(\013" + + "23.google.cloud.recaptchaenterprise.v1.I" + + "pOverrideDataB\003\340A\002\"\027\n\025AddIpOverrideRespo" + + "nse\"\310\002\n\035RelatedAccountGroupMembership\022\024\n" + + "\004name\030\001 \001(\tB\006\340A\010\340A\002\022\022\n\naccount_id\030\004 \001(\t\022" + + "\035\n\021hashed_account_id\030\002 \001(\014B\002\030\001:\335\001\352A\331\001\n@r" + + "ecaptchaenterprise.googleapis.com/Relate" + + "dAccountGroupMembership\022Vprojects/{proje" + + "ct}/relatedaccountgroups/{relatedaccount" + + "group}/memberships/{membership}*\036related" + + "AccountGroupMemberships2\035relatedAccountG" + + "roupMembership\"\324\001\n\023RelatedAccountGroup\022\024" + + "\n\004name\030\001 \001(\tB\006\340A\010\340A\002:\246\001\352A\242\001\n6recaptchaen" + + "terprise.googleapis.com/RelatedAccountGr" + + "oup\022=projects/{project}/relatedaccountgr" + + "oups/{relatedaccountgroup}*\024relatedAccou" + + "ntGroups2\023relatedAccountGroup\"\373\002\n\013WafSet" + + "tings\022U\n\013waf_service\030\001 \001(\0162;.google.clou" + + "d.recaptchaenterprise.v1.WafSettings.Waf" + + "ServiceB\003\340A\002\022U\n\013waf_feature\030\002 \001(\0162;.goog" + + "le.cloud.recaptchaenterprise.v1.WafSetti" + + "ngs.WafFeatureB\003\340A\002\"o\n\nWafFeature\022\033\n\027WAF" + + "_FEATURE_UNSPECIFIED\020\000\022\022\n\016CHALLENGE_PAGE" + + "\020\001\022\021\n\rSESSION_TOKEN\020\002\022\020\n\014ACTION_TOKEN\020\003\022" + + "\013\n\007EXPRESS\020\005\"M\n\nWafService\022\033\n\027WAF_SERVIC" + + "E_UNSPECIFIED\020\000\022\006\n\002CA\020\001\022\n\n\006FASTLY\020\003\022\016\n\nC" + + "LOUDFLARE\020\004\"\301\001\n\016IpOverrideData\022\027\n\002ip\030\001 \001" + + "(\tB\013\340A\002\342\214\317\327\010\002\010\004\022\\\n\roverride_type\030\003 \001(\0162@" + + ".google.cloud.recaptchaenterprise.v1.IpO" + + "verrideData.OverrideTypeB\003\340A\002\"8\n\014Overrid" + + "eType\022\035\n\031OVERRIDE_TYPE_UNSPECIFIED\020\000\022\t\n\005" + + "ALLOW\020\0012\261!\n\032RecaptchaEnterpriseService\022\316" + + "\001\n\020CreateAssessment\022<.google.cloud.recap" + + "tchaenterprise.v1.CreateAssessmentReques" + + "t\032/.google.cloud.recaptchaenterprise.v1." + + "Assessment\"K\332A\021parent,assessment\202\323\344\223\0021\"#" + + "/v1/{parent=projects/*}/assessments:\nass" + + "essment\022\340\001\n\022AnnotateAssessment\022>.google." + + "cloud.recaptchaenterprise.v1.AnnotateAss" + + "essmentRequest\032?.google.cloud.recaptchae" + + "nterprise.v1.AnnotateAssessmentResponse\"" + + "I\332A\017name,annotation\202\323\344\223\0021\",/v1/{name=pro" + + "jects/*/assessments/*}:annotate:\001*\022\244\001\n\tC" + + "reateKey\0225.google.cloud.recaptchaenterpr" + + "ise.v1.CreateKeyRequest\032(.google.cloud.r" + + "ecaptchaenterprise.v1.Key\"6\332A\nparent,key" + + "\202\323\344\223\002#\"\034/v1/{parent=projects/*}/keys:\003ke" + + "y\022\246\001\n\010ListKeys\0224.google.cloud.recaptchae" + + "nterprise.v1.ListKeysRequest\0325.google.cl" + + "oud.recaptchaenterprise.v1.ListKeysRespo" + + "nse\"-\332A\006parent\202\323\344\223\002\036\022\034/v1/{parent=projec" + + "ts/*}/keys\022\347\001\n\027RetrieveLegacySecretKey\022C" + + ".google.cloud.recaptchaenterprise.v1.Ret" + + "rieveLegacySecretKeyRequest\032D.google.clo" + + "ud.recaptchaenterprise.v1.RetrieveLegacy" + + "SecretKeyResponse\"A\332A\003key\202\323\344\223\0025\0223/v1/{ke" + + "y=projects/*/keys/*}:retrieveLegacySecre" + + "tKey\022\223\001\n\006GetKey\0222.google.cloud.recaptcha" + + "enterprise.v1.GetKeyRequest\032(.google.clo" + + "ud.recaptchaenterprise.v1.Key\"+\332A\004name\202\323" + + "\344\223\002\036\022\034/v1/{name=projects/*/keys/*}\022\255\001\n\tU" + + "pdateKey\0225.google.cloud.recaptchaenterpr" + + "ise.v1.UpdateKeyRequest\032(.google.cloud.r" + + "ecaptchaenterprise.v1.Key\"?\332A\017key,update" + + "_mask\202\323\344\223\002\'2 /v1/{key.name=projects/*/ke" + + "ys/*}:\003key\022\207\001\n\tDeleteKey\0225.google.cloud." + + "recaptchaenterprise.v1.DeleteKeyRequest\032" + + "\026.google.protobuf.Empty\"+\332A\004name\202\323\344\223\002\036*\034" + + "/v1/{name=projects/*/keys/*}\022\237\001\n\nMigrate" + + "Key\0226.google.cloud.recaptchaenterprise.v" + + "1.MigrateKeyRequest\032(.google.cloud.recap" + + "tchaenterprise.v1.Key\"/\202\323\344\223\002)\"$/v1/{name" + + "=projects/*/keys/*}:migrate:\001*\022\325\001\n\rAddIp" + + "Override\0229.google.cloud.recaptchaenterpr" + + "ise.v1.AddIpOverrideRequest\032:.google.clo" + + "ud.recaptchaenterprise.v1.AddIpOverrideR" + + "esponse\"M\332A\025name,ip_override_data\202\323\344\223\002/\"" + + "*/v1/{name=projects/*/keys/*}:addIpOverr" + + "ide:\001*\022\247\001\n\nGetMetrics\0226.google.cloud.rec" + + "aptchaenterprise.v1.GetMetricsRequest\032,." + + "google.cloud.recaptchaenterprise.v1.Metr" + + "ics\"3\332A\004name\202\323\344\223\002&\022$/v1/{name=projects/*" + + "/keys/*/metrics}\022\351\001\n\024CreateFirewallPolic" + + "y\022@.google.cloud.recaptchaenterprise.v1." + + "CreateFirewallPolicyRequest\0323.google.clo" + + "ud.recaptchaenterprise.v1.FirewallPolicy" + + "\"Z\332A\026parent,firewall_policy\202\323\344\223\002;\"(/v1/{" + + "parent=projects/*}/firewallpolicies:\017fir" + + "ewall_policy\022\326\001\n\024ListFirewallPolicies\022@." + + "google.cloud.recaptchaenterprise.v1.List" + + "FirewallPoliciesRequest\032A.google.cloud.r" + + "ecaptchaenterprise.v1.ListFirewallPolici" + + "esResponse\"9\332A\006parent\202\323\344\223\002*\022(/v1/{parent" + + "=projects/*}/firewallpolicies\022\300\001\n\021GetFir" + + "ewallPolicy\022=.google.cloud.recaptchaente" + + "rprise.v1.GetFirewallPolicyRequest\0323.goo" + + "gle.cloud.recaptchaenterprise.v1.Firewal" + + "lPolicy\"7\332A\004name\202\323\344\223\002*\022(/v1/{name=projec" + + "ts/*/firewallpolicies/*}\022\376\001\n\024UpdateFirew" + + "allPolicy\022@.google.cloud.recaptchaenterp" + + "rise.v1.UpdateFirewallPolicyRequest\0323.go" + + "ogle.cloud.recaptchaenterprise.v1.Firewa" + + "llPolicy\"o\332A\033firewall_policy,update_mask" + + "\202\323\344\223\002K28/v1/{firewall_policy.name=projec" + + "ts/*/firewallpolicies/*}:\017firewall_polic" + + "y\022\251\001\n\024DeleteFirewallPolicy\022@.google.clou" + + "d.recaptchaenterprise.v1.DeleteFirewallP" + + "olicyRequest\032\026.google.protobuf.Empty\"7\332A" + + "\004name\202\323\344\223\002**(/v1/{name=projects/*/firewa" + + "llpolicies/*}\022\360\001\n\027ReorderFirewallPolicie" + + "s\022C.google.cloud.recaptchaenterprise.v1." + + "ReorderFirewallPoliciesRequest\032D.google." + + "cloud.recaptchaenterprise.v1.ReorderFire" + + "wallPoliciesResponse\"J\332A\014parent,names\202\323\344" + + "\223\0025\"0/v1/{parent=projects/*}/firewallpol" + + "icies:reorder:\001*\022\346\001\n\030ListRelatedAccountG" + + "roups\022D.google.cloud.recaptchaenterprise" + + ".v1.ListRelatedAccountGroupsRequest\032E.go" + + "ogle.cloud.recaptchaenterprise.v1.ListRe" + + "latedAccountGroupsResponse\"=\332A\006parent\202\323\344" + + "\223\002.\022,/v1/{parent=projects/*}/relatedacco" + + "untgroups\022\222\002\n\"ListRelatedAccountGroupMem" + + "berships\022N.google.cloud.recaptchaenterpr" + + "ise.v1.ListRelatedAccountGroupMembership" + + "sRequest\032O.google.cloud.recaptchaenterpr" + + "ise.v1.ListRelatedAccountGroupMembership" + + "sResponse\"K\332A\006parent\202\323\344\223\002<\022:/v1/{parent=" + + "projects/*/relatedaccountgroups/*}/membe" + + "rships\022\262\002\n$SearchRelatedAccountGroupMemb" + + "erships\022P.google.cloud.recaptchaenterpri" + + "se.v1.SearchRelatedAccountGroupMembershi" + + "psRequest\032Q.google.cloud.recaptchaenterp" + + "rise.v1.SearchRelatedAccountGroupMembers" + + "hipsResponse\"e\332A\031project,hashed_account_" + + "id\202\323\344\223\002C\">/v1/{project=projects/*}/relat" + + "edaccountgroupmemberships:search:\001*\032V\312A\"" + + "recaptchaenterprise.googleapis.com\322A.htt" + + "ps://www.googleapis.com/auth/cloud-platf" + + "ormB\231\002\n!com.google.recaptchaenterprise.v" + + "1B\030RecaptchaEnterpriseProtoP\001Z\\cloud.goo" + + "gle.com/go/recaptchaenterprise/v2/apiv1/" + + "recaptchaenterprisepb;recaptchaenterpris" + + "epb\242\002\004GCRE\252\002#Google.Cloud.RecaptchaEnter" + + "prise.V1\312\002#Google\\Cloud\\RecaptchaEnterpr" + + "ise\\V1\352\002&Google::Cloud::RecaptchaEnterpr" + + "ise::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -1351,6 +1385,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "WebSettings", "AndroidSettings", "IosSettings", + "ExpressSettings", "Labels", "CreateTime", "TestingOptions", @@ -1401,8 +1436,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "AllowAllBundleIds", "AllowedBundleIds", "AppleDeveloperId", }); - internal_static_google_cloud_recaptchaenterprise_v1_AppleDeveloperId_descriptor = + internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_descriptor = getDescriptor().getMessageTypes().get(43); + internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_ExpressKeySettings_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_recaptchaenterprise_v1_AppleDeveloperId_descriptor = + getDescriptor().getMessageTypes().get(44); internal_static_google_cloud_recaptchaenterprise_v1_AppleDeveloperId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_AppleDeveloperId_descriptor, @@ -1410,7 +1451,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PrivateKey", "KeyId", "TeamId", }); internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_descriptor = - getDescriptor().getMessageTypes().get(44); + getDescriptor().getMessageTypes().get(45); internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_descriptor, @@ -1428,7 +1469,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_descriptor = - getDescriptor().getMessageTypes().get(45); + getDescriptor().getMessageTypes().get(46); internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_descriptor, @@ -1446,7 +1487,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_descriptor = - getDescriptor().getMessageTypes().get(46); + getDescriptor().getMessageTypes().get(47); internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_descriptor, @@ -1454,7 +1495,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PageloadCount", "NocaptchaCount", "FailedCount", "PassedCount", }); internal_static_google_cloud_recaptchaenterprise_v1_FirewallPolicyAssessment_descriptor = - getDescriptor().getMessageTypes().get(47); + getDescriptor().getMessageTypes().get(48); internal_static_google_cloud_recaptchaenterprise_v1_FirewallPolicyAssessment_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_FirewallPolicyAssessment_descriptor, @@ -1462,7 +1503,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Error", "FirewallPolicy", }); internal_static_google_cloud_recaptchaenterprise_v1_FirewallAction_descriptor = - getDescriptor().getMessageTypes().get(48); + getDescriptor().getMessageTypes().get(49); internal_static_google_cloud_recaptchaenterprise_v1_FirewallAction_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_FirewallAction_descriptor, @@ -1528,7 +1569,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_recaptchaenterprise_v1_FirewallPolicy_descriptor = - getDescriptor().getMessageTypes().get(49); + getDescriptor().getMessageTypes().get(50); internal_static_google_cloud_recaptchaenterprise_v1_FirewallPolicy_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_FirewallPolicy_descriptor, @@ -1536,7 +1577,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "Description", "Path", "Condition", "Actions", }); internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupMembershipsRequest_descriptor = - getDescriptor().getMessageTypes().get(50); + getDescriptor().getMessageTypes().get(51); internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupMembershipsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupMembershipsRequest_descriptor, @@ -1544,7 +1585,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", }); internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupMembershipsResponse_descriptor = - getDescriptor().getMessageTypes().get(51); + getDescriptor().getMessageTypes().get(52); internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupMembershipsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupMembershipsResponse_descriptor, @@ -1552,7 +1593,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "RelatedAccountGroupMemberships", "NextPageToken", }); internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupsRequest_descriptor = - getDescriptor().getMessageTypes().get(52); + getDescriptor().getMessageTypes().get(53); internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupsRequest_descriptor, @@ -1560,7 +1601,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", }); internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupsResponse_descriptor = - getDescriptor().getMessageTypes().get(53); + getDescriptor().getMessageTypes().get(54); internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_ListRelatedAccountGroupsResponse_descriptor, @@ -1568,7 +1609,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "RelatedAccountGroups", "NextPageToken", }); internal_static_google_cloud_recaptchaenterprise_v1_SearchRelatedAccountGroupMembershipsRequest_descriptor = - getDescriptor().getMessageTypes().get(54); + getDescriptor().getMessageTypes().get(55); internal_static_google_cloud_recaptchaenterprise_v1_SearchRelatedAccountGroupMembershipsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_SearchRelatedAccountGroupMembershipsRequest_descriptor, @@ -1576,15 +1617,29 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Project", "AccountId", "HashedAccountId", "PageSize", "PageToken", }); internal_static_google_cloud_recaptchaenterprise_v1_SearchRelatedAccountGroupMembershipsResponse_descriptor = - getDescriptor().getMessageTypes().get(55); + getDescriptor().getMessageTypes().get(56); internal_static_google_cloud_recaptchaenterprise_v1_SearchRelatedAccountGroupMembershipsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_SearchRelatedAccountGroupMembershipsResponse_descriptor, new java.lang.String[] { "RelatedAccountGroupMemberships", "NextPageToken", }); + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_descriptor = + getDescriptor().getMessageTypes().get(57); + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideRequest_descriptor, + new java.lang.String[] { + "Name", "IpOverrideData", + }); + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_descriptor = + getDescriptor().getMessageTypes().get(58); + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_AddIpOverrideResponse_descriptor, + new java.lang.String[] {}); internal_static_google_cloud_recaptchaenterprise_v1_RelatedAccountGroupMembership_descriptor = - getDescriptor().getMessageTypes().get(56); + getDescriptor().getMessageTypes().get(59); internal_static_google_cloud_recaptchaenterprise_v1_RelatedAccountGroupMembership_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_RelatedAccountGroupMembership_descriptor, @@ -1592,7 +1647,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "AccountId", "HashedAccountId", }); internal_static_google_cloud_recaptchaenterprise_v1_RelatedAccountGroup_descriptor = - getDescriptor().getMessageTypes().get(57); + getDescriptor().getMessageTypes().get(60); internal_static_google_cloud_recaptchaenterprise_v1_RelatedAccountGroup_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_RelatedAccountGroup_descriptor, @@ -1600,13 +1655,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_recaptchaenterprise_v1_WafSettings_descriptor = - getDescriptor().getMessageTypes().get(58); + getDescriptor().getMessageTypes().get(61); internal_static_google_cloud_recaptchaenterprise_v1_WafSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_WafSettings_descriptor, new java.lang.String[] { "WafService", "WafFeature", }); + internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_descriptor = + getDescriptor().getMessageTypes().get(62); + internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_IpOverrideData_descriptor, + new java.lang.String[] { + "Ip", "OverrideType", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RelatedAccountGroupMembership.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RelatedAccountGroupMembership.java index 3da10d6f8238..da6d0f15aaa5 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RelatedAccountGroupMembership.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RelatedAccountGroupMembership.java @@ -192,7 +192,7 @@ public com.google.protobuf.ByteString getAccountIdBytes() { * bytes hashed_account_id = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.hashed_account_id - * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1946 + * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1981 * @return The hashedAccountId. */ @java.lang.Override @@ -846,7 +846,7 @@ public Builder setAccountIdBytes(com.google.protobuf.ByteString value) { * * @deprecated * google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.hashed_account_id is - * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1946 + * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1981 * @return The hashedAccountId. */ @java.lang.Override @@ -868,7 +868,7 @@ public com.google.protobuf.ByteString getHashedAccountId() { * * @deprecated * google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.hashed_account_id is - * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1946 + * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1981 * @param value The hashedAccountId to set. * @return This builder for chaining. */ @@ -896,7 +896,7 @@ public Builder setHashedAccountId(com.google.protobuf.ByteString value) { * * @deprecated * google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.hashed_account_id is - * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1946 + * deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1981 * @return This builder for chaining. */ @java.lang.Deprecated diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RelatedAccountGroupMembershipOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RelatedAccountGroupMembershipOrBuilder.java index d38d6faf261a..ed4d4535c873 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RelatedAccountGroupMembershipOrBuilder.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RelatedAccountGroupMembershipOrBuilder.java @@ -97,7 +97,7 @@ public interface RelatedAccountGroupMembershipOrBuilder * bytes hashed_account_id = 2 [deprecated = true]; * * @deprecated google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.hashed_account_id - * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1946 + * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1981 * @return The hashedAccountId. */ @java.lang.Deprecated diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/SearchRelatedAccountGroupMembershipsRequest.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/SearchRelatedAccountGroupMembershipsRequest.java index 43f58f01030a..160efe4c98f7 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/SearchRelatedAccountGroupMembershipsRequest.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/SearchRelatedAccountGroupMembershipsRequest.java @@ -204,7 +204,7 @@ public com.google.protobuf.ByteString getAccountIdBytes() { * * @deprecated * google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest.hashed_account_id - * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1893 + * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1910 * @return The hashedAccountId. */ @java.lang.Override @@ -1016,7 +1016,7 @@ public Builder setAccountIdBytes(com.google.protobuf.ByteString value) { * * @deprecated * google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest.hashed_account_id - * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1893 + * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1910 * @return The hashedAccountId. */ @java.lang.Override @@ -1041,7 +1041,7 @@ public com.google.protobuf.ByteString getHashedAccountId() { * * @deprecated * google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest.hashed_account_id - * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1893 + * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1910 * @param value The hashedAccountId to set. * @return This builder for chaining. */ @@ -1072,7 +1072,7 @@ public Builder setHashedAccountId(com.google.protobuf.ByteString value) { * * @deprecated * google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest.hashed_account_id - * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1893 + * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1910 * @return This builder for chaining. */ @java.lang.Deprecated diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/SearchRelatedAccountGroupMembershipsRequestOrBuilder.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/SearchRelatedAccountGroupMembershipsRequestOrBuilder.java index c9860b08c893..1dd96dd54acf 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/SearchRelatedAccountGroupMembershipsRequestOrBuilder.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/SearchRelatedAccountGroupMembershipsRequestOrBuilder.java @@ -104,7 +104,7 @@ public interface SearchRelatedAccountGroupMembershipsRequestOrBuilder * * @deprecated * google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest.hashed_account_id - * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1893 + * is deprecated. See google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto;l=1910 * @return The hashedAccountId. */ @java.lang.Deprecated diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WafSettings.java b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WafSettings.java index ece90368e5ae..0e9bb46c27b9 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WafSettings.java +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WafSettings.java @@ -70,7 +70,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Supported WAF features. For more information, see
-   * https://cloud.google.com/recaptcha-enterprise/docs/usecase#comparison_of_features.
+   * https://cloud.google.com/recaptcha/docs/usecase#comparison_of_features.
    * 
* * Protobuf enum {@code google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature} diff --git a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/proto/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/proto/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index be727b9e9441..11320f5311cf 100644 --- a/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/proto/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1/src/main/proto/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -127,6 +127,18 @@ service RecaptchaEnterpriseService { }; } + // Adds an IP override to a key. The following restrictions hold: + // * The maximum number of IP overrides per key is 100. + // * For any conflict (such as IP already exists or IP part of an existing + // IP range), an error will be returned. + rpc AddIpOverride(AddIpOverrideRequest) returns (AddIpOverrideResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/keys/*}:addIpOverride" + body: "*" + }; + option (google.api.method_signature) = "name,ip_override_data"; + } + // Get some aggregated metrics for a Key. This data can be used to build // dashboards. rpc GetMetrics(GetMetricsRequest) returns (Metrics) { @@ -708,8 +720,7 @@ message Event { [deprecated = true, (google.api.field_behavior) = OPTIONAL]; // Optional. Flag for a reCAPTCHA express request for an assessment without a - // token. If enabled, `site_key` must reference a SCORE key with WAF feature - // set to EXPRESS. + // token. If enabled, `site_key` must reference an Express site key. bool express = 14 [(google.api.field_behavior) = OPTIONAL]; // Optional. The URI resource the user requested that triggered an assessment. @@ -1388,11 +1399,11 @@ message MigrateKeyRequest { // Optional. If true, skips the billing check. // A reCAPTCHA Enterprise key or migrated key behaves differently than a // reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - // https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid + // https://cloud.google.com/recaptcha/quotas#quota_limit). To avoid // any disruption of your usage, we check that a billing account is present. // If your usage of reCAPTCHA is under the free quota, you can safely skip the // billing check and proceed with the migration. See - // https://cloud.google.com/recaptcha-enterprise/docs/billing-information. + // https://cloud.google.com/recaptcha/docs/billing-information. bool skip_billing_check = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -1475,10 +1486,13 @@ message Key { // Settings for keys that can be used by iOS apps. IOSKeySettings ios_settings = 5; + + // Settings for keys that can be used by reCAPTCHA Express. + ExpressKeySettings express_settings = 11; } // Optional. See [Creating and managing labels] - // (https://cloud.google.com/recaptcha-enterprise/docs/labels). + // (https://cloud.google.com/recaptcha/docs/labels). map labels = 6 [(google.api.field_behavior) = OPTIONAL]; // Output only. The timestamp corresponding to the creation of this key. @@ -1618,6 +1632,9 @@ message IOSKeySettings { [(google.api.field_behavior) = OPTIONAL]; } +// Settings specific to keys that can be used for reCAPTCHA Express. +message ExpressKeySettings {} + // Contains fields that are required to perform Apple-specific integrity checks. message AppleDeveloperId { // Required. Input only. A private key (downloaded as a text file with a .p8 @@ -1919,6 +1936,24 @@ message SearchRelatedAccountGroupMembershipsResponse { string next_page_token = 2; } +// The AddIpOverride request message. +message AddIpOverrideRequest { + // Required. The name of the key to which the IP override is added, in the + // format `projects/{project}/keys/{key}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; + + // Required. IP override added to the key. + IpOverrideData ip_override_data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for AddIpOverride. +message AddIpOverrideResponse {} + // A membership in a group of related accounts. message RelatedAccountGroupMembership { option (google.api.resource) = { @@ -1969,7 +2004,7 @@ message RelatedAccountGroup { // Firewall). message WafSettings { // Supported WAF features. For more information, see - // https://cloud.google.com/recaptcha-enterprise/docs/usecase#comparison_of_features. + // https://cloud.google.com/recaptcha/docs/usecase#comparison_of_features. enum WafFeature { // Undefined feature. WAF_FEATURE_UNSPECIFIED = 0; @@ -2010,3 +2045,31 @@ message WafSettings { // Required. The WAF feature for which this key is enabled. WafFeature waf_feature = 2 [(google.api.field_behavior) = REQUIRED]; } + +// Information about the IP or IP range override. +message IpOverrideData { + // Enum that represents the type of IP override. + enum OverrideType { + // Default override type that indicates this enum hasn't been specified. + OVERRIDE_TYPE_UNSPECIFIED = 0; + + // Allowlist the IP address; i.e. give a `risk_analysis.score` of 0.9 for + // all valid assessments. + ALLOW = 1; + } + + // Required. The IP address to override (can be IPv4, IPv6 or CIDR). + // The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. + // The IP override must be a public IP address. + // Example of IPv4: 168.192.5.6 + // Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B + // Example of IPv4 with CIDR: 168.192.5.0/24 + // Example of IPv6 with CIDR: 2001:0DB8:1234::/48 + string ip = 1 [ + (google.api.field_info).format = IPV4_OR_IPV6, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Describes the type of IP override. + OverrideType override_type = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/AsyncAddIpOverride.java b/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/AsyncAddIpOverride.java new file mode 100644 index 000000000000..6e79caf74e89 --- /dev/null +++ b/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/AsyncAddIpOverride.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.recaptchaenterprise.v1.samples; + +// [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient; +import com.google.recaptchaenterprise.v1.AddIpOverrideRequest; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; +import com.google.recaptchaenterprise.v1.IpOverrideData; +import com.google.recaptchaenterprise.v1.KeyName; + +public class AsyncAddIpOverride { + + public static void main(String[] args) throws Exception { + asyncAddIpOverride(); + } + + public static void asyncAddIpOverride() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = + RecaptchaEnterpriseServiceClient.create()) { + AddIpOverrideRequest request = + AddIpOverrideRequest.newBuilder() + .setName(KeyName.of("[PROJECT]", "[KEY]").toString()) + .setIpOverrideData(IpOverrideData.newBuilder().build()) + .build(); + ApiFuture future = + recaptchaEnterpriseServiceClient.addIpOverrideCallable().futureCall(request); + // Do something. + AddIpOverrideResponse response = future.get(); + } + } +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_async] diff --git a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/deleteresource/AsyncDeleteResource.java b/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverride.java similarity index 50% rename from java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/deleteresource/AsyncDeleteResource.java rename to java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverride.java index 52a3453cf6b1..a4aa0ed1f921 100644 --- a/java-gke-connect-gateway/samples/snippets/generated/com/google/cloud/gkeconnect/gateway/v1beta1/gatewayservice/deleteresource/AsyncDeleteResource.java +++ b/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverride.java @@ -14,40 +14,36 @@ * limitations under the License. */ -package com.google.cloud.gkeconnect.gateway.v1beta1.samples; +package com.google.cloud.recaptchaenterprise.v1.samples; -// [START connectgateway_v1beta1_generated_GatewayService_DeleteResource_async] -import com.google.api.HttpBody; -import com.google.api.core.ApiFuture; -import com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import java.util.ArrayList; +// [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync] +import com.google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient; +import com.google.recaptchaenterprise.v1.AddIpOverrideRequest; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; +import com.google.recaptchaenterprise.v1.IpOverrideData; +import com.google.recaptchaenterprise.v1.KeyName; -public class AsyncDeleteResource { +public class SyncAddIpOverride { public static void main(String[] args) throws Exception { - asyncDeleteResource(); + syncAddIpOverride(); } - public static void asyncDeleteResource() throws Exception { + public static void syncAddIpOverride() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) { - HttpBody request = - HttpBody.newBuilder() - .setContentType("contentType-389131437") - .setData(ByteString.EMPTY) - .addAllExtensions(new ArrayList()) + try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = + RecaptchaEnterpriseServiceClient.create()) { + AddIpOverrideRequest request = + AddIpOverrideRequest.newBuilder() + .setName(KeyName.of("[PROJECT]", "[KEY]").toString()) + .setIpOverrideData(IpOverrideData.newBuilder().build()) .build(); - ApiFuture future = - gatewayServiceClient.deleteResourceCallable().futureCall(request); - // Do something. - HttpBody response = future.get(); + AddIpOverrideResponse response = recaptchaEnterpriseServiceClient.addIpOverride(request); } } } -// [END connectgateway_v1beta1_generated_GatewayService_DeleteResource_async] +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync] diff --git a/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverrideKeynameIpoverridedata.java b/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverrideKeynameIpoverridedata.java new file mode 100644 index 000000000000..b7728b90e9f2 --- /dev/null +++ b/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverrideKeynameIpoverridedata.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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.recaptchaenterprise.v1.samples; + +// [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_KeynameIpoverridedata_sync] +import com.google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; +import com.google.recaptchaenterprise.v1.IpOverrideData; +import com.google.recaptchaenterprise.v1.KeyName; + +public class SyncAddIpOverrideKeynameIpoverridedata { + + public static void main(String[] args) throws Exception { + syncAddIpOverrideKeynameIpoverridedata(); + } + + public static void syncAddIpOverrideKeynameIpoverridedata() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = + RecaptchaEnterpriseServiceClient.create()) { + KeyName name = KeyName.of("[PROJECT]", "[KEY]"); + IpOverrideData ipOverrideData = IpOverrideData.newBuilder().build(); + AddIpOverrideResponse response = + recaptchaEnterpriseServiceClient.addIpOverride(name, ipOverrideData); + } + } +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_KeynameIpoverridedata_sync] diff --git a/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverrideStringIpoverridedata.java b/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverrideStringIpoverridedata.java new file mode 100644 index 000000000000..cb7a9f8d3b05 --- /dev/null +++ b/java-recaptchaenterprise/samples/snippets/generated/com/google/cloud/recaptchaenterprise/v1/recaptchaenterpriseservice/addipoverride/SyncAddIpOverrideStringIpoverridedata.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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.recaptchaenterprise.v1.samples; + +// [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_StringIpoverridedata_sync] +import com.google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient; +import com.google.recaptchaenterprise.v1.AddIpOverrideResponse; +import com.google.recaptchaenterprise.v1.IpOverrideData; +import com.google.recaptchaenterprise.v1.KeyName; + +public class SyncAddIpOverrideStringIpoverridedata { + + public static void main(String[] args) throws Exception { + syncAddIpOverrideStringIpoverridedata(); + } + + public static void syncAddIpOverrideStringIpoverridedata() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = + RecaptchaEnterpriseServiceClient.create()) { + String name = KeyName.of("[PROJECT]", "[KEY]").toString(); + IpOverrideData ipOverrideData = IpOverrideData.newBuilder().build(); + AddIpOverrideResponse response = + recaptchaEnterpriseServiceClient.addIpOverride(name, ipOverrideData); + } + } +} +// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_StringIpoverridedata_sync] diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Certification.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Certification.java index edc8a8943762..a317ac995ce2 100644 --- a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Certification.java +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Certification.java @@ -23,7 +23,8 @@ * * *
- * The certification for the product.
+ * The certification for the product. Use the this attribute to describe
+ * certifications, such as energy efficiency ratings, associated with a product.
  * 
* * Protobuf type {@code google.shopping.css.v1.Certification} @@ -73,7 +74,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Name of the certification.
+   * The name of the certification. At this time, the most common value is
+   * "EPREL", which represents energy efficiency certifications in the EU
+   * European Registry for Energy Labeling (EPREL) database.
    * 
* * string name = 1; @@ -96,7 +99,9 @@ public java.lang.String getName() { * * *
-   * Name of the certification.
+   * The name of the certification. At this time, the most common value is
+   * "EPREL", which represents energy efficiency certifications in the EU
+   * European Registry for Energy Labeling (EPREL) database.
    * 
* * string name = 1; @@ -124,7 +129,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Name of the certification body.
+   * The authority or certification body responsible for issuing the
+   * certification. At this time, the most common value is "EC" or
+   * “European_Commission” for energy labels in the EU.
    * 
* * string authority = 2; @@ -147,7 +154,9 @@ public java.lang.String getAuthority() { * * *
-   * Name of the certification body.
+   * The authority or certification body responsible for issuing the
+   * certification. At this time, the most common value is "EC" or
+   * “European_Commission” for energy labels in the EU.
    * 
* * string authority = 2; @@ -175,7 +184,9 @@ public com.google.protobuf.ByteString getAuthorityBytes() { * * *
-   * A unique code to identify the certification.
+   * The code of the certification. For example, for the EPREL certificate with
+   * the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456
+   * the code is 123456. The code is required for European Energy Labels.
    * 
* * string code = 3; @@ -198,7 +209,9 @@ public java.lang.String getCode() { * * *
-   * A unique code to identify the certification.
+   * The code of the certification. For example, for the EPREL certificate with
+   * the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456
+   * the code is 123456. The code is required for European Energy Labels.
    * 
* * string code = 3; @@ -398,7 +411,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The certification for the product.
+   * The certification for the product. Use the this attribute to describe
+   * certifications, such as energy efficiency ratings, associated with a product.
    * 
* * Protobuf type {@code google.shopping.css.v1.Certification} @@ -611,7 +625,9 @@ public Builder mergeFrom( * * *
-     * Name of the certification.
+     * The name of the certification. At this time, the most common value is
+     * "EPREL", which represents energy efficiency certifications in the EU
+     * European Registry for Energy Labeling (EPREL) database.
      * 
* * string name = 1; @@ -633,7 +649,9 @@ public java.lang.String getName() { * * *
-     * Name of the certification.
+     * The name of the certification. At this time, the most common value is
+     * "EPREL", which represents energy efficiency certifications in the EU
+     * European Registry for Energy Labeling (EPREL) database.
      * 
* * string name = 1; @@ -655,7 +673,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Name of the certification.
+     * The name of the certification. At this time, the most common value is
+     * "EPREL", which represents energy efficiency certifications in the EU
+     * European Registry for Energy Labeling (EPREL) database.
      * 
* * string name = 1; @@ -676,7 +696,9 @@ public Builder setName(java.lang.String value) { * * *
-     * Name of the certification.
+     * The name of the certification. At this time, the most common value is
+     * "EPREL", which represents energy efficiency certifications in the EU
+     * European Registry for Energy Labeling (EPREL) database.
      * 
* * string name = 1; @@ -693,7 +715,9 @@ public Builder clearName() { * * *
-     * Name of the certification.
+     * The name of the certification. At this time, the most common value is
+     * "EPREL", which represents energy efficiency certifications in the EU
+     * European Registry for Energy Labeling (EPREL) database.
      * 
* * string name = 1; @@ -717,7 +741,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Name of the certification body.
+     * The authority or certification body responsible for issuing the
+     * certification. At this time, the most common value is "EC" or
+     * “European_Commission” for energy labels in the EU.
      * 
* * string authority = 2; @@ -739,7 +765,9 @@ public java.lang.String getAuthority() { * * *
-     * Name of the certification body.
+     * The authority or certification body responsible for issuing the
+     * certification. At this time, the most common value is "EC" or
+     * “European_Commission” for energy labels in the EU.
      * 
* * string authority = 2; @@ -761,7 +789,9 @@ public com.google.protobuf.ByteString getAuthorityBytes() { * * *
-     * Name of the certification body.
+     * The authority or certification body responsible for issuing the
+     * certification. At this time, the most common value is "EC" or
+     * “European_Commission” for energy labels in the EU.
      * 
* * string authority = 2; @@ -782,7 +812,9 @@ public Builder setAuthority(java.lang.String value) { * * *
-     * Name of the certification body.
+     * The authority or certification body responsible for issuing the
+     * certification. At this time, the most common value is "EC" or
+     * “European_Commission” for energy labels in the EU.
      * 
* * string authority = 2; @@ -799,7 +831,9 @@ public Builder clearAuthority() { * * *
-     * Name of the certification body.
+     * The authority or certification body responsible for issuing the
+     * certification. At this time, the most common value is "EC" or
+     * “European_Commission” for energy labels in the EU.
      * 
* * string authority = 2; @@ -823,7 +857,9 @@ public Builder setAuthorityBytes(com.google.protobuf.ByteString value) { * * *
-     * A unique code to identify the certification.
+     * The code of the certification. For example, for the EPREL certificate with
+     * the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456
+     * the code is 123456. The code is required for European Energy Labels.
      * 
* * string code = 3; @@ -845,7 +881,9 @@ public java.lang.String getCode() { * * *
-     * A unique code to identify the certification.
+     * The code of the certification. For example, for the EPREL certificate with
+     * the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456
+     * the code is 123456. The code is required for European Energy Labels.
      * 
* * string code = 3; @@ -867,7 +905,9 @@ public com.google.protobuf.ByteString getCodeBytes() { * * *
-     * A unique code to identify the certification.
+     * The code of the certification. For example, for the EPREL certificate with
+     * the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456
+     * the code is 123456. The code is required for European Energy Labels.
      * 
* * string code = 3; @@ -888,7 +928,9 @@ public Builder setCode(java.lang.String value) { * * *
-     * A unique code to identify the certification.
+     * The code of the certification. For example, for the EPREL certificate with
+     * the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456
+     * the code is 123456. The code is required for European Energy Labels.
      * 
* * string code = 3; @@ -905,7 +947,9 @@ public Builder clearCode() { * * *
-     * A unique code to identify the certification.
+     * The code of the certification. For example, for the EPREL certificate with
+     * the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456
+     * the code is 123456. The code is required for European Energy Labels.
      * 
* * string code = 3; diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CertificationOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CertificationOrBuilder.java index 57644452e94a..34c2d15cbfe2 100644 --- a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CertificationOrBuilder.java +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CertificationOrBuilder.java @@ -28,7 +28,9 @@ public interface CertificationOrBuilder * * *
-   * Name of the certification.
+   * The name of the certification. At this time, the most common value is
+   * "EPREL", which represents energy efficiency certifications in the EU
+   * European Registry for Energy Labeling (EPREL) database.
    * 
* * string name = 1; @@ -40,7 +42,9 @@ public interface CertificationOrBuilder * * *
-   * Name of the certification.
+   * The name of the certification. At this time, the most common value is
+   * "EPREL", which represents energy efficiency certifications in the EU
+   * European Registry for Energy Labeling (EPREL) database.
    * 
* * string name = 1; @@ -53,7 +57,9 @@ public interface CertificationOrBuilder * * *
-   * Name of the certification body.
+   * The authority or certification body responsible for issuing the
+   * certification. At this time, the most common value is "EC" or
+   * “European_Commission” for energy labels in the EU.
    * 
* * string authority = 2; @@ -65,7 +71,9 @@ public interface CertificationOrBuilder * * *
-   * Name of the certification body.
+   * The authority or certification body responsible for issuing the
+   * certification. At this time, the most common value is "EC" or
+   * “European_Commission” for energy labels in the EU.
    * 
* * string authority = 2; @@ -78,7 +86,9 @@ public interface CertificationOrBuilder * * *
-   * A unique code to identify the certification.
+   * The code of the certification. For example, for the EPREL certificate with
+   * the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456
+   * the code is 123456. The code is required for European Energy Labels.
    * 
* * string code = 3; @@ -90,7 +100,9 @@ public interface CertificationOrBuilder * * *
-   * A unique code to identify the certification.
+   * The code of the certification. For example, for the EPREL certificate with
+   * the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456
+   * the code is 123456. The code is required for European Energy Labels.
    * 
* * string code = 3; diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_common.proto b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_common.proto index 574ba45191ab..efe9a13ba2f4 100644 --- a/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_common.proto +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_common.proto @@ -207,15 +207,22 @@ message Attributes { optional string custom_label_4 = 50; } -// The certification for the product. +// The certification for the product. Use the this attribute to describe +// certifications, such as energy efficiency ratings, associated with a product. message Certification { - // Name of the certification. + // The name of the certification. At this time, the most common value is + // "EPREL", which represents energy efficiency certifications in the EU + // European Registry for Energy Labeling (EPREL) database. string name = 1; - // Name of the certification body. + // The authority or certification body responsible for issuing the + // certification. At this time, the most common value is "EC" or + // “European_Commission” for energy labels in the EU. string authority = 2; - // A unique code to identify the certification. + // The code of the certification. For example, for the EPREL certificate with + // the link https://eprel.ec.europa.eu/screen/product/dishwashers2019/123456 + // the code is 123456. The code is required for European Energy Labels. string code = 3; }