From aba39fa1937e71113444d2e1bb732f2f8da21ea8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 15:22:59 -0700 Subject: [PATCH] feat: add GetMetrics and MigrateKey methods to reCAPTCHA enterprise API (#574) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add GetMetrics and MigrateKey methods to reCAPTCHA enterprise API PiperOrigin-RevId: 396937887 Source-Link: https://github.com/googleapis/googleapis/commit/020672e489e00ba3eccbb66f9286657cbc8dfb73 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a5847907eb3607837f10f93e95fdfcc0a98e6f21 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTU4NDc5MDdlYjM2MDc4MzdmMTBmOTNlOTVmZGZjYzBhOThlNmYyMSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1/RecaptchaEnterpriseServiceClient.java | 171 +- .../RecaptchaEnterpriseServiceSettings.java | 23 + .../v1/gapic_metadata.json | 6 + .../GrpcRecaptchaEnterpriseServiceStub.java | 59 + .../stub/RecaptchaEnterpriseServiceStub.java | 11 + ...ecaptchaEnterpriseServiceStubSettings.java | 54 +- .../MockRecaptchaEnterpriseServiceImpl.java | 43 + .../RecaptchaEnterpriseServiceClientTest.java | 139 ++ .../v1/RecaptchaEnterpriseServiceGrpc.java | 259 ++- .../v1/AndroidKeySettings.java | 90 + .../v1/AndroidKeySettingsOrBuilder.java | 13 + .../v1/AnnotateAssessmentRequest.java | 788 ++++++- .../AnnotateAssessmentRequestOrBuilder.java | 86 +- .../v1/ChallengeMetrics.java | 832 +++++++ .../v1/ChallengeMetricsOrBuilder.java | 81 + .../v1/GetMetricsRequest.java | 657 ++++++ .../v1/GetMetricsRequestOrBuilder.java | 56 + .../v1/IOSKeySettings.java | 90 + .../v1/IOSKeySettingsOrBuilder.java | 13 + .../google/recaptchaenterprise/v1/Key.java | 322 ++- .../recaptchaenterprise/v1/KeyOrBuilder.java | 55 +- .../recaptchaenterprise/v1/Metrics.java | 2006 +++++++++++++++++ .../recaptchaenterprise/v1/MetricsName.java | 191 ++ .../v1/MetricsOrBuilder.java | 212 ++ .../v1/MigrateKeyRequest.java | 657 ++++++ .../v1/MigrateKeyRequestOrBuilder.java | 56 + .../v1/RecaptchaEnterpriseProto.java | 414 +++- .../recaptchaenterprise/v1/RiskAnalysis.java | 1 - .../v1/ScoreDistribution.java | 789 +++++++ .../v1/ScoreDistributionOrBuilder.java | 89 + .../recaptchaenterprise/v1/ScoreMetrics.java | 1141 ++++++++++ .../v1/ScoreMetricsOrBuilder.java | 137 ++ .../v1/TestingOptions.java | 908 ++++++++ .../v1/TestingOptionsOrBuilder.java | 72 + .../v1/TokenProperties.java | 25 +- .../v1/UpdateKeyRequest.java | 24 +- .../v1/UpdateKeyRequestOrBuilder.java | 6 +- .../v1/WebKeySettings.java | 4 + .../v1/WebKeySettingsOrBuilder.java | 1 + .../v1/recaptchaenterprise.proto | 216 +- 40 files changed, 10569 insertions(+), 228 deletions(-) create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ChallengeMetrics.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ChallengeMetricsOrBuilder.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/GetMetricsRequest.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/GetMetricsRequestOrBuilder.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Metrics.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MetricsName.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MetricsOrBuilder.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequest.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequestOrBuilder.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreDistribution.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreDistributionOrBuilder.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreMetrics.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreMetricsOrBuilder.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TestingOptions.java create mode 100644 proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TestingOptionsOrBuilder.java diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient.java index bd621f26..9b2faca4 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient.java @@ -37,9 +37,13 @@ import com.google.recaptchaenterprise.v1.CreateKeyRequest; import com.google.recaptchaenterprise.v1.DeleteKeyRequest; import com.google.recaptchaenterprise.v1.GetKeyRequest; +import com.google.recaptchaenterprise.v1.GetMetricsRequest; import com.google.recaptchaenterprise.v1.Key; import com.google.recaptchaenterprise.v1.ListKeysRequest; import com.google.recaptchaenterprise.v1.ListKeysResponse; +import com.google.recaptchaenterprise.v1.Metrics; +import com.google.recaptchaenterprise.v1.MetricsName; +import com.google.recaptchaenterprise.v1.MigrateKeyRequest; import com.google.recaptchaenterprise.v1.ProjectName; import com.google.recaptchaenterprise.v1.UpdateKeyRequest; import java.io.IOException; @@ -275,7 +279,7 @@ public final UnaryCallable createAssessment // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Annotates a previously created Assessment to provide additional information on whether the - * event turned out to be authentic or fradulent. + * event turned out to be authentic or fraudulent. * *

Sample code: * @@ -292,7 +296,9 @@ public final UnaryCallable createAssessment * * @param name Required. The resource name of the Assessment, in the format * "projects/{project}/assessments/{assessment}". - * @param annotation Required. The annotation that will be assigned to the Event. + * @param annotation Optional. The annotation that will be assigned to the Event. This field can + * be left empty to provide reasons that apply to an event without concluding whether the + * event is legitimate or fraudulent. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnnotateAssessmentResponse annotateAssessment( @@ -308,7 +314,7 @@ public final AnnotateAssessmentResponse annotateAssessment( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Annotates a previously created Assessment to provide additional information on whether the - * event turned out to be authentic or fradulent. + * event turned out to be authentic or fraudulent. * *

Sample code: * @@ -325,7 +331,9 @@ public final AnnotateAssessmentResponse annotateAssessment( * * @param name Required. The resource name of the Assessment, in the format * "projects/{project}/assessments/{assessment}". - * @param annotation Required. The annotation that will be assigned to the Event. + * @param annotation Optional. The annotation that will be assigned to the Event. This field can + * be left empty to provide reasons that apply to an event without concluding whether the + * event is legitimate or fraudulent. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnnotateAssessmentResponse annotateAssessment( @@ -338,7 +346,7 @@ public final AnnotateAssessmentResponse annotateAssessment( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Annotates a previously created Assessment to provide additional information on whether the - * event turned out to be authentic or fradulent. + * event turned out to be authentic or fraudulent. * *

Sample code: * @@ -348,6 +356,7 @@ public final AnnotateAssessmentResponse annotateAssessment( * AnnotateAssessmentRequest request = * AnnotateAssessmentRequest.newBuilder() * .setName(AssessmentName.of("[PROJECT]", "[ASSESSMENT]").toString()) + * .addAllReasons(new ArrayList()) * .build(); * AnnotateAssessmentResponse response = * recaptchaEnterpriseServiceClient.annotateAssessment(request); @@ -364,7 +373,7 @@ public final AnnotateAssessmentResponse annotateAssessment(AnnotateAssessmentReq // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Annotates a previously created Assessment to provide additional information on whether the - * event turned out to be authentic or fradulent. + * event turned out to be authentic or fraudulent. * *

Sample code: * @@ -374,6 +383,7 @@ public final AnnotateAssessmentResponse annotateAssessment(AnnotateAssessmentReq * AnnotateAssessmentRequest request = * AnnotateAssessmentRequest.newBuilder() * .setName(AssessmentName.of("[PROJECT]", "[ASSESSMENT]").toString()) + * .addAllReasons(new ArrayList()) * .build(); * ApiFuture future = * recaptchaEnterpriseServiceClient.annotateAssessmentCallable().futureCall(request); @@ -669,6 +679,155 @@ public final UnaryCallable deleteKeyCallable() { return stub.deleteKeyCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can + * be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must + * be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must + * have the reCAPTCHA Enterprise Admin IAM role in the destination project. + * + *

Sample code: + * + *

{@code
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   MigrateKeyRequest request =
+   *       MigrateKeyRequest.newBuilder()
+   *           .setName(KeyName.of("[PROJECT]", "[KEY]").toString())
+   *           .build();
+   *   Key response = recaptchaEnterpriseServiceClient.migrateKey(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 Key migrateKey(MigrateKeyRequest request) { + return migrateKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can + * be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must + * be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must + * have the reCAPTCHA Enterprise Admin IAM role in the destination project. + * + *

Sample code: + * + *

{@code
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   MigrateKeyRequest request =
+   *       MigrateKeyRequest.newBuilder()
+   *           .setName(KeyName.of("[PROJECT]", "[KEY]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       recaptchaEnterpriseServiceClient.migrateKeyCallable().futureCall(request);
+   *   // Do something.
+   *   Key response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable migrateKeyCallable() { + return stub.migrateKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get some aggregated metrics for a Key. This data can be used to build dashboards. + * + *

Sample code: + * + *

{@code
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   MetricsName name = MetricsName.of("[PROJECT]", "[KEY]");
+   *   Metrics response = recaptchaEnterpriseServiceClient.getMetrics(name);
+   * }
+   * }
+ * + * @param name Required. The name of the requested metrics, in the format + * "projects/{project}/keys/{key}/metrics". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Metrics getMetrics(MetricsName name) { + GetMetricsRequest request = + GetMetricsRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getMetrics(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get some aggregated metrics for a Key. This data can be used to build dashboards. + * + *

Sample code: + * + *

{@code
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   String name = MetricsName.of("[PROJECT]", "[KEY]").toString();
+   *   Metrics response = recaptchaEnterpriseServiceClient.getMetrics(name);
+   * }
+   * }
+ * + * @param name Required. The name of the requested metrics, in the format + * "projects/{project}/keys/{key}/metrics". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Metrics getMetrics(String name) { + GetMetricsRequest request = GetMetricsRequest.newBuilder().setName(name).build(); + return getMetrics(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get some aggregated metrics for a Key. This data can be used to build dashboards. + * + *

Sample code: + * + *

{@code
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   GetMetricsRequest request =
+   *       GetMetricsRequest.newBuilder()
+   *           .setName(MetricsName.of("[PROJECT]", "[KEY]").toString())
+   *           .build();
+   *   Metrics response = recaptchaEnterpriseServiceClient.getMetrics(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 Metrics getMetrics(GetMetricsRequest request) { + return getMetricsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get some aggregated metrics for a Key. This data can be used to build dashboards. + * + *

Sample code: + * + *

{@code
+   * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
+   *     RecaptchaEnterpriseServiceClient.create()) {
+   *   GetMetricsRequest request =
+   *       GetMetricsRequest.newBuilder()
+   *           .setName(MetricsName.of("[PROJECT]", "[KEY]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       recaptchaEnterpriseServiceClient.getMetricsCallable().futureCall(request);
+   *   // Do something.
+   *   Metrics response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getMetricsCallable() { + return stub.getMetricsCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceSettings.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceSettings.java index a114b824..b75db2f9 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceSettings.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceSettings.java @@ -38,9 +38,12 @@ import com.google.recaptchaenterprise.v1.CreateKeyRequest; import com.google.recaptchaenterprise.v1.DeleteKeyRequest; import com.google.recaptchaenterprise.v1.GetKeyRequest; +import com.google.recaptchaenterprise.v1.GetMetricsRequest; import com.google.recaptchaenterprise.v1.Key; import com.google.recaptchaenterprise.v1.ListKeysRequest; import com.google.recaptchaenterprise.v1.ListKeysResponse; +import com.google.recaptchaenterprise.v1.Metrics; +import com.google.recaptchaenterprise.v1.MigrateKeyRequest; import com.google.recaptchaenterprise.v1.UpdateKeyRequest; import java.io.IOException; import java.util.List; @@ -122,6 +125,16 @@ public UnaryCallSettings deleteKeySettings() { return ((RecaptchaEnterpriseServiceStubSettings) getStubSettings()).deleteKeySettings(); } + /** Returns the object with the settings used for calls to migrateKey. */ + public UnaryCallSettings migrateKeySettings() { + return ((RecaptchaEnterpriseServiceStubSettings) getStubSettings()).migrateKeySettings(); + } + + /** Returns the object with the settings used for calls to getMetrics. */ + public UnaryCallSettings getMetricsSettings() { + return ((RecaptchaEnterpriseServiceStubSettings) getStubSettings()).getMetricsSettings(); + } + public static final RecaptchaEnterpriseServiceSettings create( RecaptchaEnterpriseServiceStubSettings stub) throws IOException { return new RecaptchaEnterpriseServiceSettings.Builder(stub.toBuilder()).build(); @@ -258,6 +271,16 @@ public UnaryCallSettings.Builder deleteKeySettings() { return getStubSettingsBuilder().deleteKeySettings(); } + /** Returns the builder for the settings used for calls to migrateKey. */ + public UnaryCallSettings.Builder migrateKeySettings() { + return getStubSettingsBuilder().migrateKeySettings(); + } + + /** Returns the builder for the settings used for calls to getMetrics. */ + public UnaryCallSettings.Builder getMetricsSettings() { + return getStubSettingsBuilder().getMetricsSettings(); + } + @Override public RecaptchaEnterpriseServiceSettings build() throws IOException { return new RecaptchaEnterpriseServiceSettings(this); diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/gapic_metadata.json b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/gapic_metadata.json index d60797c9..1c34d924 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/gapic_metadata.json +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/gapic_metadata.json @@ -25,9 +25,15 @@ "GetKey": { "methods": ["getKey", "getKeyCallable"] }, + "GetMetrics": { + "methods": ["getMetrics", "getMetrics", "getMetrics", "getMetricsCallable"] + }, "ListKeys": { "methods": ["listKeys", "listKeysPagedCallable", "listKeysCallable"] }, + "MigrateKey": { + "methods": ["migrateKey", "migrateKeyCallable"] + }, "UpdateKey": { "methods": ["updateKey", "updateKeyCallable"] } diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/GrpcRecaptchaEnterpriseServiceStub.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/GrpcRecaptchaEnterpriseServiceStub.java index 3c67410b..aa072423 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/GrpcRecaptchaEnterpriseServiceStub.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/GrpcRecaptchaEnterpriseServiceStub.java @@ -34,9 +34,12 @@ import com.google.recaptchaenterprise.v1.CreateKeyRequest; import com.google.recaptchaenterprise.v1.DeleteKeyRequest; import com.google.recaptchaenterprise.v1.GetKeyRequest; +import com.google.recaptchaenterprise.v1.GetMetricsRequest; import com.google.recaptchaenterprise.v1.Key; import com.google.recaptchaenterprise.v1.ListKeysRequest; import com.google.recaptchaenterprise.v1.ListKeysResponse; +import com.google.recaptchaenterprise.v1.Metrics; +import com.google.recaptchaenterprise.v1.MigrateKeyRequest; import com.google.recaptchaenterprise.v1.UpdateKeyRequest; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -121,6 +124,24 @@ public class GrpcRecaptchaEnterpriseServiceStub extends RecaptchaEnterpriseServi .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor migrateKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/MigrateKey") + .setRequestMarshaller(ProtoUtils.marshaller(MigrateKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Key.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getMetricsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/GetMetrics") + .setRequestMarshaller(ProtoUtils.marshaller(GetMetricsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Metrics.getDefaultInstance())) + .build(); + private final UnaryCallable createAssessmentCallable; private final UnaryCallable annotateAssessmentCallable; @@ -130,6 +151,8 @@ public class GrpcRecaptchaEnterpriseServiceStub extends RecaptchaEnterpriseServi private final UnaryCallable getKeyCallable; private final UnaryCallable updateKeyCallable; private final UnaryCallable deleteKeyCallable; + private final UnaryCallable migrateKeyCallable; + private final UnaryCallable getMetricsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -249,6 +272,26 @@ protected GrpcRecaptchaEnterpriseServiceStub( return params.build(); }) .build(); + GrpcCallSettings migrateKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(migrateKeyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getMetricsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMetricsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); this.createAssessmentCallable = callableFactory.createUnaryCallable( @@ -276,6 +319,12 @@ protected GrpcRecaptchaEnterpriseServiceStub( this.deleteKeyCallable = callableFactory.createUnaryCallable( deleteKeyTransportSettings, settings.deleteKeySettings(), clientContext); + this.migrateKeyCallable = + callableFactory.createUnaryCallable( + migrateKeyTransportSettings, settings.migrateKeySettings(), clientContext); + this.getMetricsCallable = + callableFactory.createUnaryCallable( + getMetricsTransportSettings, settings.getMetricsSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -326,6 +375,16 @@ public UnaryCallable deleteKeyCallable() { return deleteKeyCallable; } + @Override + public UnaryCallable migrateKeyCallable() { + return migrateKeyCallable; + } + + @Override + public UnaryCallable getMetricsCallable() { + return getMetricsCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStub.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStub.java index 79c62e5c..28d0a6f2 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStub.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStub.java @@ -28,9 +28,12 @@ import com.google.recaptchaenterprise.v1.CreateKeyRequest; import com.google.recaptchaenterprise.v1.DeleteKeyRequest; import com.google.recaptchaenterprise.v1.GetKeyRequest; +import com.google.recaptchaenterprise.v1.GetMetricsRequest; import com.google.recaptchaenterprise.v1.Key; import com.google.recaptchaenterprise.v1.ListKeysRequest; import com.google.recaptchaenterprise.v1.ListKeysResponse; +import com.google.recaptchaenterprise.v1.Metrics; +import com.google.recaptchaenterprise.v1.MigrateKeyRequest; import com.google.recaptchaenterprise.v1.UpdateKeyRequest; import javax.annotation.Generated; @@ -76,6 +79,14 @@ public UnaryCallable deleteKeyCallable() { throw new UnsupportedOperationException("Not implemented: deleteKeyCallable()"); } + public UnaryCallable migrateKeyCallable() { + throw new UnsupportedOperationException("Not implemented: migrateKeyCallable()"); + } + + public UnaryCallable getMetricsCallable() { + throw new UnsupportedOperationException("Not implemented: getMetricsCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStubSettings.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStubSettings.java index 80e00af4..977da082 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStubSettings.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1/stub/RecaptchaEnterpriseServiceStubSettings.java @@ -52,9 +52,12 @@ import com.google.recaptchaenterprise.v1.CreateKeyRequest; import com.google.recaptchaenterprise.v1.DeleteKeyRequest; import com.google.recaptchaenterprise.v1.GetKeyRequest; +import com.google.recaptchaenterprise.v1.GetMetricsRequest; import com.google.recaptchaenterprise.v1.Key; import com.google.recaptchaenterprise.v1.ListKeysRequest; import com.google.recaptchaenterprise.v1.ListKeysResponse; +import com.google.recaptchaenterprise.v1.Metrics; +import com.google.recaptchaenterprise.v1.MigrateKeyRequest; import com.google.recaptchaenterprise.v1.UpdateKeyRequest; import java.io.IOException; import java.util.List; @@ -111,6 +114,8 @@ public class RecaptchaEnterpriseServiceStubSettings private final UnaryCallSettings getKeySettings; private final UnaryCallSettings updateKeySettings; private final UnaryCallSettings deleteKeySettings; + private final UnaryCallSettings migrateKeySettings; + private final UnaryCallSettings getMetricsSettings; private static final PagedListDescriptor LIST_KEYS_PAGE_STR_DESC = @@ -201,6 +206,16 @@ public UnaryCallSettings deleteKeySettings() { return deleteKeySettings; } + /** Returns the object with the settings used for calls to migrateKey. */ + public UnaryCallSettings migrateKeySettings() { + return migrateKeySettings; + } + + /** Returns the object with the settings used for calls to getMetrics. */ + public UnaryCallSettings getMetricsSettings() { + return getMetricsSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public RecaptchaEnterpriseServiceStub createStub() throws IOException { if (getTransportChannelProvider() @@ -284,6 +299,8 @@ protected RecaptchaEnterpriseServiceStubSettings(Builder settingsBuilder) throws getKeySettings = settingsBuilder.getKeySettings().build(); updateKeySettings = settingsBuilder.updateKeySettings().build(); deleteKeySettings = settingsBuilder.deleteKeySettings().build(); + migrateKeySettings = settingsBuilder.migrateKeySettings().build(); + getMetricsSettings = settingsBuilder.getMetricsSettings().build(); } /** Builder for RecaptchaEnterpriseServiceStubSettings. */ @@ -301,6 +318,8 @@ public static class Builder private final UnaryCallSettings.Builder getKeySettings; private final UnaryCallSettings.Builder updateKeySettings; private final UnaryCallSettings.Builder deleteKeySettings; + private final UnaryCallSettings.Builder migrateKeySettings; + private final UnaryCallSettings.Builder getMetricsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -309,6 +328,7 @@ public static class Builder ImmutableMap.builder(); definitions.put( "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -325,6 +345,8 @@ public static class Builder .setTotalTimeout(Duration.ofMillis(600000L)) .build(); definitions.put("no_retry_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -342,6 +364,8 @@ protected Builder(ClientContext clientContext) { getKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + migrateKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getMetricsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -351,7 +375,9 @@ protected Builder(ClientContext clientContext) { listKeysSettings, getKeySettings, updateKeySettings, - deleteKeySettings); + deleteKeySettings, + migrateKeySettings, + getMetricsSettings); initDefaults(this); } @@ -365,6 +391,8 @@ protected Builder(RecaptchaEnterpriseServiceStubSettings settings) { getKeySettings = settings.getKeySettings.toBuilder(); updateKeySettings = settings.updateKeySettings.toBuilder(); deleteKeySettings = settings.deleteKeySettings.toBuilder(); + migrateKeySettings = settings.migrateKeySettings.toBuilder(); + getMetricsSettings = settings.getMetricsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -374,7 +402,9 @@ protected Builder(RecaptchaEnterpriseServiceStubSettings settings) { listKeysSettings, getKeySettings, updateKeySettings, - deleteKeySettings); + deleteKeySettings, + migrateKeySettings, + getMetricsSettings); } private static Builder createDefault() { @@ -426,6 +456,16 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .migrateKeySettings() + .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")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + return builder; } @@ -482,6 +522,16 @@ public UnaryCallSettings.Builder deleteKeySettings() { return deleteKeySettings; } + /** Returns the builder for the settings used for calls to migrateKey. */ + public UnaryCallSettings.Builder migrateKeySettings() { + return migrateKeySettings; + } + + /** Returns the builder for the settings used for calls to getMetrics. */ + public UnaryCallSettings.Builder getMetricsSettings() { + return getMetricsSettings; + } + @Override public RecaptchaEnterpriseServiceStubSettings build() throws IOException { return new RecaptchaEnterpriseServiceStubSettings(this); diff --git a/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/MockRecaptchaEnterpriseServiceImpl.java b/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/MockRecaptchaEnterpriseServiceImpl.java index 914386ae..eb9a32ec 100644 --- a/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/MockRecaptchaEnterpriseServiceImpl.java +++ b/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/MockRecaptchaEnterpriseServiceImpl.java @@ -26,9 +26,12 @@ import com.google.recaptchaenterprise.v1.CreateKeyRequest; import com.google.recaptchaenterprise.v1.DeleteKeyRequest; import com.google.recaptchaenterprise.v1.GetKeyRequest; +import com.google.recaptchaenterprise.v1.GetMetricsRequest; import com.google.recaptchaenterprise.v1.Key; import com.google.recaptchaenterprise.v1.ListKeysRequest; import com.google.recaptchaenterprise.v1.ListKeysResponse; +import com.google.recaptchaenterprise.v1.Metrics; +import com.google.recaptchaenterprise.v1.MigrateKeyRequest; import com.google.recaptchaenterprise.v1.RecaptchaEnterpriseServiceGrpc.RecaptchaEnterpriseServiceImplBase; import com.google.recaptchaenterprise.v1.UpdateKeyRequest; import io.grpc.stub.StreamObserver; @@ -212,4 +215,44 @@ public void deleteKey(DeleteKeyRequest request, StreamObserver responseOb Exception.class.getName()))); } } + + @Override + public void migrateKey(MigrateKeyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Key) { + requests.add(request); + responseObserver.onNext(((Key) 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 MigrateKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Key.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getMetrics(GetMetricsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Metrics) { + requests.add(request); + responseObserver.onNext(((Metrics) 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 GetMetrics, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Metrics.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClientTest.java b/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClientTest.java index 820ef352..34df5e37 100644 --- a/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClientTest.java +++ b/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClientTest.java @@ -34,21 +34,29 @@ import com.google.recaptchaenterprise.v1.AnnotateAssessmentResponse; import com.google.recaptchaenterprise.v1.Assessment; import com.google.recaptchaenterprise.v1.AssessmentName; +import com.google.recaptchaenterprise.v1.ChallengeMetrics; import com.google.recaptchaenterprise.v1.CreateAssessmentRequest; import com.google.recaptchaenterprise.v1.CreateKeyRequest; import com.google.recaptchaenterprise.v1.DeleteKeyRequest; import com.google.recaptchaenterprise.v1.Event; import com.google.recaptchaenterprise.v1.GetKeyRequest; +import com.google.recaptchaenterprise.v1.GetMetricsRequest; import com.google.recaptchaenterprise.v1.Key; import com.google.recaptchaenterprise.v1.KeyName; import com.google.recaptchaenterprise.v1.ListKeysRequest; import com.google.recaptchaenterprise.v1.ListKeysResponse; +import com.google.recaptchaenterprise.v1.Metrics; +import com.google.recaptchaenterprise.v1.MetricsName; +import com.google.recaptchaenterprise.v1.MigrateKeyRequest; import com.google.recaptchaenterprise.v1.ProjectName; import com.google.recaptchaenterprise.v1.RiskAnalysis; +import com.google.recaptchaenterprise.v1.ScoreMetrics; +import com.google.recaptchaenterprise.v1.TestingOptions; import com.google.recaptchaenterprise.v1.TokenProperties; import com.google.recaptchaenterprise.v1.UpdateKeyRequest; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -276,6 +284,7 @@ public void createKeyTest() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setTestingOptions(TestingOptions.newBuilder().build()) .build(); mockRecaptchaEnterpriseService.addResponse(expectedResponse); @@ -382,6 +391,7 @@ public void getKeyTest() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setTestingOptions(TestingOptions.newBuilder().build()) .build(); mockRecaptchaEnterpriseService.addResponse(expectedResponse); @@ -425,6 +435,7 @@ public void updateKeyTest() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setTestingOptions(TestingOptions.newBuilder().build()) .build(); mockRecaptchaEnterpriseService.addResponse(expectedResponse); @@ -504,4 +515,132 @@ public void deleteKeyExceptionTest() throws Exception { // Expected exception. } } + + @Test + public void migrateKeyTest() throws Exception { + Key expectedResponse = + Key.newBuilder() + .setName(KeyName.of("[PROJECT]", "[KEY]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setTestingOptions(TestingOptions.newBuilder().build()) + .build(); + mockRecaptchaEnterpriseService.addResponse(expectedResponse); + + MigrateKeyRequest request = + MigrateKeyRequest.newBuilder().setName(KeyName.of("[PROJECT]", "[KEY]").toString()).build(); + + Key actualResponse = client.migrateKey(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRecaptchaEnterpriseService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MigrateKeyRequest actualRequest = ((MigrateKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void migrateKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRecaptchaEnterpriseService.addException(exception); + + try { + MigrateKeyRequest request = + MigrateKeyRequest.newBuilder() + .setName(KeyName.of("[PROJECT]", "[KEY]").toString()) + .build(); + client.migrateKey(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMetricsTest() throws Exception { + Metrics expectedResponse = + Metrics.newBuilder() + .setName(MetricsName.of("[PROJECT]", "[KEY]").toString()) + .setStartTime(Timestamp.newBuilder().build()) + .addAllScoreMetrics(new ArrayList()) + .addAllChallengeMetrics(new ArrayList()) + .build(); + mockRecaptchaEnterpriseService.addResponse(expectedResponse); + + MetricsName name = MetricsName.of("[PROJECT]", "[KEY]"); + + Metrics actualResponse = client.getMetrics(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRecaptchaEnterpriseService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMetricsRequest actualRequest = ((GetMetricsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMetricsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRecaptchaEnterpriseService.addException(exception); + + try { + MetricsName name = MetricsName.of("[PROJECT]", "[KEY]"); + client.getMetrics(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMetricsTest2() throws Exception { + Metrics expectedResponse = + Metrics.newBuilder() + .setName(MetricsName.of("[PROJECT]", "[KEY]").toString()) + .setStartTime(Timestamp.newBuilder().build()) + .addAllScoreMetrics(new ArrayList()) + .addAllChallengeMetrics(new ArrayList()) + .build(); + mockRecaptchaEnterpriseService.addResponse(expectedResponse); + + String name = "name3373707"; + + Metrics actualResponse = client.getMetrics(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRecaptchaEnterpriseService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMetricsRequest actualRequest = ((GetMetricsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMetricsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRecaptchaEnterpriseService.addException(exception); + + try { + String name = "name3373707"; + client.getMetrics(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/grpc-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseServiceGrpc.java b/grpc-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseServiceGrpc.java index 904e0e43..0b014d4a 100644 --- a/grpc-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseServiceGrpc.java +++ b/grpc-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseServiceGrpc.java @@ -355,6 +355,98 @@ private RecaptchaEnterpriseServiceGrpc() {} return getDeleteKeyMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1.MigrateKeyRequest, + com.google.recaptchaenterprise.v1.Key> + getMigrateKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MigrateKey", + requestType = com.google.recaptchaenterprise.v1.MigrateKeyRequest.class, + responseType = com.google.recaptchaenterprise.v1.Key.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1.MigrateKeyRequest, + com.google.recaptchaenterprise.v1.Key> + getMigrateKeyMethod() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1.MigrateKeyRequest, + com.google.recaptchaenterprise.v1.Key> + getMigrateKeyMethod; + if ((getMigrateKeyMethod = RecaptchaEnterpriseServiceGrpc.getMigrateKeyMethod) == null) { + synchronized (RecaptchaEnterpriseServiceGrpc.class) { + if ((getMigrateKeyMethod = RecaptchaEnterpriseServiceGrpc.getMigrateKeyMethod) == null) { + RecaptchaEnterpriseServiceGrpc.getMigrateKeyMethod = + getMigrateKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MigrateKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1.MigrateKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1.Key.getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceMethodDescriptorSupplier("MigrateKey")) + .build(); + } + } + } + return getMigrateKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1.GetMetricsRequest, + com.google.recaptchaenterprise.v1.Metrics> + getGetMetricsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetMetrics", + requestType = com.google.recaptchaenterprise.v1.GetMetricsRequest.class, + responseType = com.google.recaptchaenterprise.v1.Metrics.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1.GetMetricsRequest, + com.google.recaptchaenterprise.v1.Metrics> + getGetMetricsMethod() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1.GetMetricsRequest, + com.google.recaptchaenterprise.v1.Metrics> + getGetMetricsMethod; + if ((getGetMetricsMethod = RecaptchaEnterpriseServiceGrpc.getGetMetricsMethod) == null) { + synchronized (RecaptchaEnterpriseServiceGrpc.class) { + if ((getGetMetricsMethod = RecaptchaEnterpriseServiceGrpc.getGetMetricsMethod) == null) { + RecaptchaEnterpriseServiceGrpc.getGetMetricsMethod = + getGetMetricsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetMetrics")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1.GetMetricsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1.Metrics.getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceMethodDescriptorSupplier("GetMetrics")) + .build(); + } + } + } + return getGetMetricsMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static RecaptchaEnterpriseServiceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -426,7 +518,7 @@ public void createAssessment( * *
      * Annotates a previously created Assessment to provide additional information
-     * on whether the event turned out to be authentic or fradulent.
+     * on whether the event turned out to be authentic or fraudulent.
      * 
*/ public void annotateAssessment( @@ -503,6 +595,38 @@ public void deleteKey( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteKeyMethod(), responseObserver); } + /** + * + * + *
+     * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
+     * Once a key is migrated, it can be used from either product. SiteVerify
+     * requests are billed as CreateAssessment calls. You must be
+     * authenticated as one of the current owners of the reCAPTCHA Site Key, and
+     * your user must have the reCAPTCHA Enterprise Admin IAM role in the
+     * destination project.
+     * 
+ */ + public void migrateKey( + com.google.recaptchaenterprise.v1.MigrateKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMigrateKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * Get some aggregated metrics for a Key. This data can be used to build
+     * dashboards.
+     * 
+ */ + public void getMetrics( + com.google.recaptchaenterprise.v1.GetMetricsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMetricsMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -551,6 +675,18 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.recaptchaenterprise.v1.DeleteKeyRequest, com.google.protobuf.Empty>(this, METHODID_DELETE_KEY))) + .addMethod( + getMigrateKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1.MigrateKeyRequest, + com.google.recaptchaenterprise.v1.Key>(this, METHODID_MIGRATE_KEY))) + .addMethod( + getGetMetricsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1.GetMetricsRequest, + com.google.recaptchaenterprise.v1.Metrics>(this, METHODID_GET_METRICS))) .build(); } } @@ -597,7 +733,7 @@ public void createAssessment( * *
      * Annotates a previously created Assessment to provide additional information
-     * on whether the event turned out to be authentic or fradulent.
+     * on whether the event turned out to be authentic or fraudulent.
      * 
*/ public void annotateAssessment( @@ -680,6 +816,40 @@ public void deleteKey( io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getDeleteKeyMethod(), getCallOptions()), request, responseObserver); } + + /** + * + * + *
+     * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
+     * Once a key is migrated, it can be used from either product. SiteVerify
+     * requests are billed as CreateAssessment calls. You must be
+     * authenticated as one of the current owners of the reCAPTCHA Site Key, and
+     * your user must have the reCAPTCHA Enterprise Admin IAM role in the
+     * destination project.
+     * 
+ */ + public void migrateKey( + com.google.recaptchaenterprise.v1.MigrateKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMigrateKeyMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Get some aggregated metrics for a Key. This data can be used to build
+     * dashboards.
+     * 
+ */ + public void getMetrics( + com.google.recaptchaenterprise.v1.GetMetricsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMetricsMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -720,7 +890,7 @@ public com.google.recaptchaenterprise.v1.Assessment createAssessment( * *
      * Annotates a previously created Assessment to provide additional information
-     * on whether the event turned out to be authentic or fradulent.
+     * on whether the event turned out to be authentic or fraudulent.
      * 
*/ public com.google.recaptchaenterprise.v1.AnnotateAssessmentResponse annotateAssessment( @@ -793,6 +963,38 @@ public com.google.protobuf.Empty deleteKey( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeleteKeyMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
+     * Once a key is migrated, it can be used from either product. SiteVerify
+     * requests are billed as CreateAssessment calls. You must be
+     * authenticated as one of the current owners of the reCAPTCHA Site Key, and
+     * your user must have the reCAPTCHA Enterprise Admin IAM role in the
+     * destination project.
+     * 
+ */ + public com.google.recaptchaenterprise.v1.Key migrateKey( + com.google.recaptchaenterprise.v1.MigrateKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMigrateKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get some aggregated metrics for a Key. This data can be used to build
+     * dashboards.
+     * 
+ */ + public com.google.recaptchaenterprise.v1.Metrics getMetrics( + com.google.recaptchaenterprise.v1.GetMetricsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMetricsMethod(), getCallOptions(), request); + } } /** @@ -834,7 +1036,7 @@ protected RecaptchaEnterpriseServiceFutureStub build( * *
      * Annotates a previously created Assessment to provide additional information
-     * on whether the event turned out to be authentic or fradulent.
+     * on whether the event turned out to be authentic or fraudulent.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< @@ -909,6 +1111,39 @@ public com.google.common.util.concurrent.ListenableFuture + * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. + * Once a key is migrated, it can be used from either product. SiteVerify + * requests are billed as CreateAssessment calls. You must be + * authenticated as one of the current owners of the reCAPTCHA Site Key, and + * your user must have the reCAPTCHA Enterprise Admin IAM role in the + * destination project. + * + */ + public com.google.common.util.concurrent.ListenableFuture + migrateKey(com.google.recaptchaenterprise.v1.MigrateKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMigrateKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get some aggregated metrics for a Key. This data can be used to build
+     * dashboards.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.recaptchaenterprise.v1.Metrics> + getMetrics(com.google.recaptchaenterprise.v1.GetMetricsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMetricsMethod(), getCallOptions()), request); + } } private static final int METHODID_CREATE_ASSESSMENT = 0; @@ -918,6 +1153,8 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -978,6 +1215,18 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.recaptchaenterprise.v1.DeleteKeyRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_MIGRATE_KEY: + serviceImpl.migrateKey( + (com.google.recaptchaenterprise.v1.MigrateKeyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_METRICS: + serviceImpl.getMetrics( + (com.google.recaptchaenterprise.v1.GetMetricsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; default: throw new AssertionError(); } @@ -1049,6 +1298,8 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetKeyMethod()) .addMethod(getUpdateKeyMethod()) .addMethod(getDeleteKeyMethod()) + .addMethod(getMigrateKeyMethod()) + .addMethod(getGetMetricsMethod()) .build(); } } diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AndroidKeySettings.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AndroidKeySettings.java index 4da149c2..1bb22e48 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AndroidKeySettings.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AndroidKeySettings.java @@ -81,6 +81,11 @@ private AndroidKeySettings( allowedPackageNames_.add(s); break; } + case 16: + { + allowAllPackageNames_ = input.readBool(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -118,6 +123,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.recaptchaenterprise.v1.AndroidKeySettings.Builder.class); } + public static final int ALLOW_ALL_PACKAGE_NAMES_FIELD_NUMBER = 2; + private boolean allowAllPackageNames_; + /** + * + * + *
+   * If set to true, it means allowed_package_names will not be enforced.
+   * 
+ * + * bool allow_all_package_names = 2; + * + * @return The allowAllPackageNames. + */ + @java.lang.Override + public boolean getAllowAllPackageNames() { + return allowAllPackageNames_; + } + public static final int ALLOWED_PACKAGE_NAMES_FIELD_NUMBER = 1; private com.google.protobuf.LazyStringList allowedPackageNames_; /** @@ -200,6 +223,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < allowedPackageNames_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedPackageNames_.getRaw(i)); } + if (allowAllPackageNames_ != false) { + output.writeBool(2, allowAllPackageNames_); + } unknownFields.writeTo(output); } @@ -217,6 +243,9 @@ public int getSerializedSize() { size += dataSize; size += 1 * getAllowedPackageNamesList().size(); } + if (allowAllPackageNames_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowAllPackageNames_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -233,6 +262,7 @@ public boolean equals(final java.lang.Object obj) { com.google.recaptchaenterprise.v1.AndroidKeySettings other = (com.google.recaptchaenterprise.v1.AndroidKeySettings) obj; + if (getAllowAllPackageNames() != other.getAllowAllPackageNames()) return false; if (!getAllowedPackageNamesList().equals(other.getAllowedPackageNamesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -245,6 +275,8 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ALLOW_ALL_PACKAGE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowAllPackageNames()); if (getAllowedPackageNamesCount() > 0) { hash = (37 * hash) + ALLOWED_PACKAGE_NAMES_FIELD_NUMBER; hash = (53 * hash) + getAllowedPackageNamesList().hashCode(); @@ -394,6 +426,8 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + allowAllPackageNames_ = false; + allowedPackageNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); return this; @@ -424,6 +458,7 @@ public com.google.recaptchaenterprise.v1.AndroidKeySettings buildPartial() { com.google.recaptchaenterprise.v1.AndroidKeySettings result = new com.google.recaptchaenterprise.v1.AndroidKeySettings(this); int from_bitField0_ = bitField0_; + result.allowAllPackageNames_ = allowAllPackageNames_; if (((bitField0_ & 0x00000001) != 0)) { allowedPackageNames_ = allowedPackageNames_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); @@ -479,6 +514,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.recaptchaenterprise.v1.AndroidKeySettings other) { if (other == com.google.recaptchaenterprise.v1.AndroidKeySettings.getDefaultInstance()) return this; + if (other.getAllowAllPackageNames() != false) { + setAllowAllPackageNames(other.getAllowAllPackageNames()); + } if (!other.allowedPackageNames_.isEmpty()) { if (allowedPackageNames_.isEmpty()) { allowedPackageNames_ = other.allowedPackageNames_; @@ -521,6 +559,58 @@ public Builder mergeFrom( private int bitField0_; + private boolean allowAllPackageNames_; + /** + * + * + *
+     * If set to true, it means allowed_package_names will not be enforced.
+     * 
+ * + * bool allow_all_package_names = 2; + * + * @return The allowAllPackageNames. + */ + @java.lang.Override + public boolean getAllowAllPackageNames() { + return allowAllPackageNames_; + } + /** + * + * + *
+     * If set to true, it means allowed_package_names will not be enforced.
+     * 
+ * + * bool allow_all_package_names = 2; + * + * @param value The allowAllPackageNames to set. + * @return This builder for chaining. + */ + public Builder setAllowAllPackageNames(boolean value) { + + allowAllPackageNames_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, it means allowed_package_names will not be enforced.
+     * 
+ * + * bool allow_all_package_names = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllowAllPackageNames() { + + allowAllPackageNames_ = false; + onChanged(); + return this; + } + private com.google.protobuf.LazyStringList allowedPackageNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AndroidKeySettingsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AndroidKeySettingsOrBuilder.java index 5a87b95e..1e238f61 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AndroidKeySettingsOrBuilder.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AndroidKeySettingsOrBuilder.java @@ -23,6 +23,19 @@ public interface AndroidKeySettingsOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.AndroidKeySettings) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
+   * If set to true, it means allowed_package_names will not be enforced.
+   * 
+ * + * bool allow_all_package_names = 2; + * + * @return The allowAllPackageNames. + */ + boolean getAllowAllPackageNames(); + /** * * diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AnnotateAssessmentRequest.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AnnotateAssessmentRequest.java index 86d11a75..8d20552f 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AnnotateAssessmentRequest.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AnnotateAssessmentRequest.java @@ -40,6 +40,7 @@ private AnnotateAssessmentRequest(com.google.protobuf.GeneratedMessageV3.Builder private AnnotateAssessmentRequest() { name_ = ""; annotation_ = 0; + reasons_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -61,6 +62,7 @@ private AnnotateAssessmentRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -85,6 +87,31 @@ private AnnotateAssessmentRequest( annotation_ = rawValue; break; } + case 24: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + reasons_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + reasons_.add(rawValue); + break; + } + case 26: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + reasons_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + reasons_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -99,6 +126,9 @@ private AnnotateAssessmentRequest( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + reasons_ = java.util.Collections.unmodifiableList(reasons_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -123,7 +153,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Enum that reprensents the types of annotations.
+   * Enum that represents the types of annotations.
    * 
* * Protobuf enum {@code google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} @@ -164,22 +194,26 @@ public enum Annotation implements com.google.protobuf.ProtocolMessageEnum { * *
      * Provides information that the event was related to a login event in which
-     * the user typed the correct password.
+     * the user typed the correct password. Deprecated, prefer indicating
+     * CORRECT_PASSWORD through the reasons field instead.
      * 
* - * PASSWORD_CORRECT = 3; + * PASSWORD_CORRECT = 3 [deprecated = true]; */ + @java.lang.Deprecated PASSWORD_CORRECT(3), /** * * *
      * Provides information that the event was related to a login event in which
-     * the user typed the incorrect password.
+     * the user typed the incorrect password. Deprecated, prefer indicating
+     * INCORRECT_PASSWORD through the reasons field instead.
      * 
* - * PASSWORD_INCORRECT = 4; + * PASSWORD_INCORRECT = 4 [deprecated = true]; */ + @java.lang.Deprecated PASSWORD_INCORRECT(4), UNRECOGNIZED(-1), ; @@ -219,23 +253,25 @@ public enum Annotation implements com.google.protobuf.ProtocolMessageEnum { * *
      * Provides information that the event was related to a login event in which
-     * the user typed the correct password.
+     * the user typed the correct password. Deprecated, prefer indicating
+     * CORRECT_PASSWORD through the reasons field instead.
      * 
* - * PASSWORD_CORRECT = 3; + * PASSWORD_CORRECT = 3 [deprecated = true]; */ - public static final int PASSWORD_CORRECT_VALUE = 3; + @java.lang.Deprecated public static final int PASSWORD_CORRECT_VALUE = 3; /** * * *
      * Provides information that the event was related to a login event in which
-     * the user typed the incorrect password.
+     * the user typed the incorrect password. Deprecated, prefer indicating
+     * INCORRECT_PASSWORD through the reasons field instead.
      * 
* - * PASSWORD_INCORRECT = 4; + * PASSWORD_INCORRECT = 4 [deprecated = true]; */ - public static final int PASSWORD_INCORRECT_VALUE = 4; + @java.lang.Deprecated public static final int PASSWORD_INCORRECT_VALUE = 4; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -326,6 +362,287 @@ private Annotation(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation) } + /** + * + * + *
+   * Enum that represents potential reasons for annotating an assessment.
+   * 
+ * + * Protobuf enum {@code google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason} + */ + public enum Reason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default unspecified reason.
+     * 
+ * + * REASON_UNSPECIFIED = 0; + */ + REASON_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates a chargeback for fraud was issued for the transaction
+     * associated with the assessment.
+     * 
+ * + * CHARGEBACK = 1; + */ + CHARGEBACK(1), + /** + * + * + *
+     * Indicates the transaction associated with the assessment is suspected of
+     * being fraudulent based on the payment method, billing details, shipping
+     * address or other transaction information.
+     * 
+ * + * PAYMENT_HEURISTICS = 2; + */ + PAYMENT_HEURISTICS(2), + /** + * + * + *
+     * Indicates that the user was served a 2FA challenge. An old assessment
+     * with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been
+     * overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow.
+     * This is equivalent to `FAILED_TWO_FACTOR`.
+     * 
+ * + * INITIATED_TWO_FACTOR = 7; + */ + INITIATED_TWO_FACTOR(7), + /** + * + * + *
+     * Indicates that the user passed a 2FA challenge.
+     * 
+ * + * PASSED_TWO_FACTOR = 3; + */ + PASSED_TWO_FACTOR(3), + /** + * + * + *
+     * Indicates that the user failed a 2FA challenge.
+     * 
+ * + * FAILED_TWO_FACTOR = 4; + */ + FAILED_TWO_FACTOR(4), + /** + * + * + *
+     * Indicates the user provided the correct password.
+     * 
+ * + * CORRECT_PASSWORD = 5; + */ + CORRECT_PASSWORD(5), + /** + * + * + *
+     * Indicates the user provided an incorrect password.
+     * 
+ * + * INCORRECT_PASSWORD = 6; + */ + INCORRECT_PASSWORD(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default unspecified reason.
+     * 
+ * + * REASON_UNSPECIFIED = 0; + */ + public static final int REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indicates a chargeback for fraud was issued for the transaction
+     * associated with the assessment.
+     * 
+ * + * CHARGEBACK = 1; + */ + public static final int CHARGEBACK_VALUE = 1; + /** + * + * + *
+     * Indicates the transaction associated with the assessment is suspected of
+     * being fraudulent based on the payment method, billing details, shipping
+     * address or other transaction information.
+     * 
+ * + * PAYMENT_HEURISTICS = 2; + */ + public static final int PAYMENT_HEURISTICS_VALUE = 2; + /** + * + * + *
+     * Indicates that the user was served a 2FA challenge. An old assessment
+     * with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been
+     * overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow.
+     * This is equivalent to `FAILED_TWO_FACTOR`.
+     * 
+ * + * INITIATED_TWO_FACTOR = 7; + */ + public static final int INITIATED_TWO_FACTOR_VALUE = 7; + /** + * + * + *
+     * Indicates that the user passed a 2FA challenge.
+     * 
+ * + * PASSED_TWO_FACTOR = 3; + */ + public static final int PASSED_TWO_FACTOR_VALUE = 3; + /** + * + * + *
+     * Indicates that the user failed a 2FA challenge.
+     * 
+ * + * FAILED_TWO_FACTOR = 4; + */ + public static final int FAILED_TWO_FACTOR_VALUE = 4; + /** + * + * + *
+     * Indicates the user provided the correct password.
+     * 
+ * + * CORRECT_PASSWORD = 5; + */ + public static final int CORRECT_PASSWORD_VALUE = 5; + /** + * + * + *
+     * Indicates the user provided an incorrect password.
+     * 
+ * + * INCORRECT_PASSWORD = 6; + */ + public static final int INCORRECT_PASSWORD_VALUE = 6; + + 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 Reason 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 Reason forNumber(int value) { + switch (value) { + case 0: + return REASON_UNSPECIFIED; + case 1: + return CHARGEBACK; + case 2: + return PAYMENT_HEURISTICS; + case 7: + return INITIATED_TWO_FACTOR; + case 3: + return PASSED_TWO_FACTOR; + case 4: + return FAILED_TWO_FACTOR; + case 5: + return CORRECT_PASSWORD; + case 6: + return INCORRECT_PASSWORD; + 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 Reason findValueByNumber(int number) { + return Reason.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.AnnotateAssessmentRequest.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final Reason[] VALUES = values(); + + public static Reason 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 Reason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason) + } + public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -387,11 +704,13 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Required. The annotation that will be assigned to the Event.
+   * Optional. The annotation that will be assigned to the Event. This field can be left
+   * empty to provide reasons that apply to an event without concluding whether
+   * the event is legitimate or fraudulent.
    * 
* * - * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The enum numeric value on the wire for annotation. @@ -404,11 +723,13 @@ public int getAnnotationValue() { * * *
-   * Required. The annotation that will be assigned to the Event.
+   * Optional. The annotation that will be assigned to the Event. This field can be left
+   * empty to provide reasons that apply to an event without concluding whether
+   * the event is legitimate or fraudulent.
    * 
* * - * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The annotation. @@ -423,6 +744,117 @@ public com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation ge : result; } + public static final int REASONS_FIELD_NUMBER = 3; + private java.util.List reasons_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason> + reasons_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason>() { + public com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason result = + com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason.valueOf(from); + return result == null + ? com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the reasons. + */ + @java.lang.Override + public java.util.List + getReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason>( + reasons_, reasons_converter_); + } + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of reasons. + */ + @java.lang.Override + public int getReasonsCount() { + return reasons_.size(); + } + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The reasons at the given index. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason getReasons(int index) { + return reasons_converter_.convert(reasons_.get(index)); + } + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for reasons. + */ + @java.lang.Override + public java.util.List getReasonsValueList() { + return reasons_; + } + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of reasons at the given index. + */ + @java.lang.Override + public int getReasonsValue(int index) { + return reasons_.get(index); + } + + private int reasonsMemoizedSerializedSize; + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -437,6 +869,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } @@ -446,6 +879,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(2, annotation_); } + if (getReasonsList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(reasonsMemoizedSerializedSize); + } + for (int i = 0; i < reasons_.size(); i++) { + output.writeEnumNoTag(reasons_.get(i)); + } unknownFields.writeTo(output); } @@ -464,6 +904,18 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, annotation_); } + { + int dataSize = 0; + for (int i = 0; i < reasons_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(reasons_.get(i)); + } + size += dataSize; + if (!getReasonsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + reasonsMemoizedSerializedSize = dataSize; + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -482,6 +934,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (annotation_ != other.annotation_) return false; + if (!reasons_.equals(other.reasons_)) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -497,6 +950,10 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + ANNOTATION_FIELD_NUMBER; hash = (53 * hash) + annotation_; + if (getReasonsCount() > 0) { + hash = (37 * hash) + REASONS_FIELD_NUMBER; + hash = (53 * hash) + reasons_.hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -647,6 +1104,8 @@ public Builder clear() { annotation_ = 0; + reasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -674,8 +1133,14 @@ public com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest build() { public com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest buildPartial() { com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest result = new com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest(this); + int from_bitField0_ = bitField0_; result.name_ = name_; result.annotation_ = annotation_; + if (((bitField0_ & 0x00000001) != 0)) { + reasons_ = java.util.Collections.unmodifiableList(reasons_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.reasons_ = reasons_; onBuilt(); return result; } @@ -733,6 +1198,16 @@ public Builder mergeFrom(com.google.recaptchaenterprise.v1.AnnotateAssessmentReq if (other.annotation_ != 0) { setAnnotationValue(other.getAnnotationValue()); } + if (!other.reasons_.isEmpty()) { + if (reasons_.isEmpty()) { + reasons_ = other.reasons_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReasonsIsMutable(); + reasons_.addAll(other.reasons_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -763,6 +1238,8 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; /** * @@ -889,11 +1366,13 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. The annotation that will be assigned to the Event.
+     * Optional. The annotation that will be assigned to the Event. This field can be left
+     * empty to provide reasons that apply to an event without concluding whether
+     * the event is legitimate or fraudulent.
      * 
* * - * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The enum numeric value on the wire for annotation. @@ -906,11 +1385,13 @@ public int getAnnotationValue() { * * *
-     * Required. The annotation that will be assigned to the Event.
+     * Optional. The annotation that will be assigned to the Event. This field can be left
+     * empty to provide reasons that apply to an event without concluding whether
+     * the event is legitimate or fraudulent.
      * 
* * - * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; * * * @param value The enum numeric value on the wire for annotation to set. @@ -926,11 +1407,13 @@ public Builder setAnnotationValue(int value) { * * *
-     * Required. The annotation that will be assigned to the Event.
+     * Optional. The annotation that will be assigned to the Event. This field can be left
+     * empty to provide reasons that apply to an event without concluding whether
+     * the event is legitimate or fraudulent.
      * 
* * - * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The annotation. @@ -949,11 +1432,13 @@ public com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation ge * * *
-     * Required. The annotation that will be assigned to the Event.
+     * Optional. The annotation that will be assigned to the Event. This field can be left
+     * empty to provide reasons that apply to an event without concluding whether
+     * the event is legitimate or fraudulent.
      * 
* * - * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; * * * @param value The annotation to set. @@ -973,11 +1458,13 @@ public Builder setAnnotation( * * *
-     * Required. The annotation that will be assigned to the Event.
+     * Optional. The annotation that will be assigned to the Event. This field can be left
+     * empty to provide reasons that apply to an event without concluding whether
+     * the event is legitimate or fraudulent.
      * 
* * - * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; * * * @return This builder for chaining. @@ -989,6 +1476,257 @@ public Builder clearAnnotation() { return this; } + private java.util.List reasons_ = java.util.Collections.emptyList(); + + private void ensureReasonsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + reasons_ = new java.util.ArrayList(reasons_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the reasons. + */ + public java.util.List + getReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason>( + reasons_, reasons_converter_); + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of reasons. + */ + public int getReasonsCount() { + return reasons_.size(); + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The reasons at the given index. + */ + public com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason getReasons( + int index) { + return reasons_converter_.convert(reasons_.get(index)); + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The reasons to set. + * @return This builder for chaining. + */ + public Builder setReasons( + int index, com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReasonsIsMutable(); + reasons_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The reasons to add. + * @return This builder for chaining. + */ + public Builder addReasons( + com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReasonsIsMutable(); + reasons_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The reasons to add. + * @return This builder for chaining. + */ + public Builder addAllReasons( + java.lang.Iterable< + ? extends com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason> + values) { + ensureReasonsIsMutable(); + for (com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason value : values) { + reasons_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearReasons() { + reasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for reasons. + */ + public java.util.List getReasonsValueList() { + return java.util.Collections.unmodifiableList(reasons_); + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of reasons at the given index. + */ + public int getReasonsValue(int index) { + return reasons_.get(index); + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of reasons at the given index. + * @return This builder for chaining. + */ + public Builder setReasonsValue(int index, int value) { + ensureReasonsIsMutable(); + reasons_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for reasons to add. + * @return This builder for chaining. + */ + public Builder addReasonsValue(int value) { + ensureReasonsIsMutable(); + reasons_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional reasons for the annotation that will be assigned to the Event.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The enum numeric values on the wire for reasons to add. + * @return This builder for chaining. + */ + public Builder addAllReasonsValue(java.lang.Iterable values) { + ensureReasonsIsMutable(); + for (int value : values) { + reasons_.add(value); + } + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AnnotateAssessmentRequestOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AnnotateAssessmentRequestOrBuilder.java index 20fefb88..890d340a 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AnnotateAssessmentRequestOrBuilder.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/AnnotateAssessmentRequestOrBuilder.java @@ -58,11 +58,13 @@ public interface AnnotateAssessmentRequestOrBuilder * * *
-   * Required. The annotation that will be assigned to the Event.
+   * Optional. The annotation that will be assigned to the Event. This field can be left
+   * empty to provide reasons that apply to an event without concluding whether
+   * the event is legitimate or fraudulent.
    * 
* * - * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The enum numeric value on the wire for annotation. @@ -72,14 +74,90 @@ public interface AnnotateAssessmentRequestOrBuilder * * *
-   * Required. The annotation that will be assigned to the Event.
+   * Optional. The annotation that will be assigned to the Event. This field can be left
+   * empty to provide reasons that apply to an event without concluding whether
+   * the event is legitimate or fraudulent.
    * 
* * - * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The annotation. */ com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation getAnnotation(); + + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the reasons. + */ + java.util.List + getReasonsList(); + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of reasons. + */ + int getReasonsCount(); + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The reasons at the given index. + */ + com.google.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason getReasons(int index); + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for reasons. + */ + java.util.List getReasonsValueList(); + /** + * + * + *
+   * Optional. Optional reasons for the annotation that will be assigned to the Event.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason reasons = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of reasons at the given index. + */ + int getReasonsValue(int index); } diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ChallengeMetrics.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ChallengeMetrics.java new file mode 100644 index 00000000..fb96451b --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ChallengeMetrics.java @@ -0,0 +1,832 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * Metrics related to challenges.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.ChallengeMetrics} + */ +public final class ChallengeMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.ChallengeMetrics) + ChallengeMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ChallengeMetrics.newBuilder() to construct. + private ChallengeMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ChallengeMetrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ChallengeMetrics(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ChallengeMetrics( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pageloadCount_ = input.readInt64(); + break; + } + case 16: + { + nocaptchaCount_ = input.readInt64(); + break; + } + case 24: + { + failedCount_ = input.readInt64(); + break; + } + case 32: + { + passedCount_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.ChallengeMetrics.class, + com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder.class); + } + + public static final int PAGELOAD_COUNT_FIELD_NUMBER = 1; + private long pageloadCount_; + /** + * + * + *
+   * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent
+   * to a count of pageloads for pages that include reCAPTCHA.
+   * 
+ * + * int64 pageload_count = 1; + * + * @return The pageloadCount. + */ + @java.lang.Override + public long getPageloadCount() { + return pageloadCount_; + } + + public static final int NOCAPTCHA_COUNT_FIELD_NUMBER = 2; + private long nocaptchaCount_; + /** + * + * + *
+   * Count of nocaptchas (successful verification without a challenge) issued.
+   * 
+ * + * int64 nocaptcha_count = 2; + * + * @return The nocaptchaCount. + */ + @java.lang.Override + public long getNocaptchaCount() { + return nocaptchaCount_; + } + + public static final int FAILED_COUNT_FIELD_NUMBER = 3; + private long failedCount_; + /** + * + * + *
+   * Count of submitted challenge solutions that were incorrect or otherwise
+   * deemed suspicious such that a subsequent challenge was triggered.
+   * 
+ * + * int64 failed_count = 3; + * + * @return The failedCount. + */ + @java.lang.Override + public long getFailedCount() { + return failedCount_; + } + + public static final int PASSED_COUNT_FIELD_NUMBER = 4; + private long passedCount_; + /** + * + * + *
+   * Count of nocaptchas (successful verification without a challenge) plus
+   * submitted challenge solutions that were correct and resulted in
+   * verification.
+   * 
+ * + * int64 passed_count = 4; + * + * @return The passedCount. + */ + @java.lang.Override + public long getPassedCount() { + return passedCount_; + } + + 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 (pageloadCount_ != 0L) { + output.writeInt64(1, pageloadCount_); + } + if (nocaptchaCount_ != 0L) { + output.writeInt64(2, nocaptchaCount_); + } + if (failedCount_ != 0L) { + output.writeInt64(3, failedCount_); + } + if (passedCount_ != 0L) { + output.writeInt64(4, passedCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageloadCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, pageloadCount_); + } + if (nocaptchaCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, nocaptchaCount_); + } + if (failedCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, failedCount_); + } + if (passedCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, passedCount_); + } + size += unknownFields.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.ChallengeMetrics)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.ChallengeMetrics other = + (com.google.recaptchaenterprise.v1.ChallengeMetrics) obj; + + if (getPageloadCount() != other.getPageloadCount()) return false; + if (getNocaptchaCount() != other.getNocaptchaCount()) return false; + if (getFailedCount() != other.getFailedCount()) return false; + if (getPassedCount() != other.getPassedCount()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PAGELOAD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPageloadCount()); + hash = (37 * hash) + NOCAPTCHA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getNocaptchaCount()); + hash = (37 * hash) + FAILED_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailedCount()); + hash = (37 * hash) + PASSED_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPassedCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.ChallengeMetrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ChallengeMetrics 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.ChallengeMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ChallengeMetrics 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.ChallengeMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ChallengeMetrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.ChallengeMetrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ChallengeMetrics 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.ChallengeMetrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ChallengeMetrics 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.ChallengeMetrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ChallengeMetrics 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.ChallengeMetrics 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; + } + /** + * + * + *
+   * Metrics related to challenges.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.ChallengeMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.ChallengeMetrics) + com.google.recaptchaenterprise.v1.ChallengeMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.ChallengeMetrics.class, + com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.ChallengeMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + pageloadCount_ = 0L; + + nocaptchaCount_ = 0L; + + failedCount_ = 0L; + + passedCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ChallengeMetrics getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.ChallengeMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ChallengeMetrics build() { + com.google.recaptchaenterprise.v1.ChallengeMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ChallengeMetrics buildPartial() { + com.google.recaptchaenterprise.v1.ChallengeMetrics result = + new com.google.recaptchaenterprise.v1.ChallengeMetrics(this); + result.pageloadCount_ = pageloadCount_; + result.nocaptchaCount_ = nocaptchaCount_; + result.failedCount_ = failedCount_; + result.passedCount_ = passedCount_; + 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.ChallengeMetrics) { + return mergeFrom((com.google.recaptchaenterprise.v1.ChallengeMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.ChallengeMetrics other) { + if (other == com.google.recaptchaenterprise.v1.ChallengeMetrics.getDefaultInstance()) + return this; + if (other.getPageloadCount() != 0L) { + setPageloadCount(other.getPageloadCount()); + } + if (other.getNocaptchaCount() != 0L) { + setNocaptchaCount(other.getNocaptchaCount()); + } + if (other.getFailedCount() != 0L) { + setFailedCount(other.getFailedCount()); + } + if (other.getPassedCount() != 0L) { + setPassedCount(other.getPassedCount()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.recaptchaenterprise.v1.ChallengeMetrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1.ChallengeMetrics) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long pageloadCount_; + /** + * + * + *
+     * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent
+     * to a count of pageloads for pages that include reCAPTCHA.
+     * 
+ * + * int64 pageload_count = 1; + * + * @return The pageloadCount. + */ + @java.lang.Override + public long getPageloadCount() { + return pageloadCount_; + } + /** + * + * + *
+     * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent
+     * to a count of pageloads for pages that include reCAPTCHA.
+     * 
+ * + * int64 pageload_count = 1; + * + * @param value The pageloadCount to set. + * @return This builder for chaining. + */ + public Builder setPageloadCount(long value) { + + pageloadCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent
+     * to a count of pageloads for pages that include reCAPTCHA.
+     * 
+ * + * int64 pageload_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageloadCount() { + + pageloadCount_ = 0L; + onChanged(); + return this; + } + + private long nocaptchaCount_; + /** + * + * + *
+     * Count of nocaptchas (successful verification without a challenge) issued.
+     * 
+ * + * int64 nocaptcha_count = 2; + * + * @return The nocaptchaCount. + */ + @java.lang.Override + public long getNocaptchaCount() { + return nocaptchaCount_; + } + /** + * + * + *
+     * Count of nocaptchas (successful verification without a challenge) issued.
+     * 
+ * + * int64 nocaptcha_count = 2; + * + * @param value The nocaptchaCount to set. + * @return This builder for chaining. + */ + public Builder setNocaptchaCount(long value) { + + nocaptchaCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of nocaptchas (successful verification without a challenge) issued.
+     * 
+ * + * int64 nocaptcha_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearNocaptchaCount() { + + nocaptchaCount_ = 0L; + onChanged(); + return this; + } + + private long failedCount_; + /** + * + * + *
+     * Count of submitted challenge solutions that were incorrect or otherwise
+     * deemed suspicious such that a subsequent challenge was triggered.
+     * 
+ * + * int64 failed_count = 3; + * + * @return The failedCount. + */ + @java.lang.Override + public long getFailedCount() { + return failedCount_; + } + /** + * + * + *
+     * Count of submitted challenge solutions that were incorrect or otherwise
+     * deemed suspicious such that a subsequent challenge was triggered.
+     * 
+ * + * int64 failed_count = 3; + * + * @param value The failedCount to set. + * @return This builder for chaining. + */ + public Builder setFailedCount(long value) { + + failedCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of submitted challenge solutions that were incorrect or otherwise
+     * deemed suspicious such that a subsequent challenge was triggered.
+     * 
+ * + * int64 failed_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearFailedCount() { + + failedCount_ = 0L; + onChanged(); + return this; + } + + private long passedCount_; + /** + * + * + *
+     * Count of nocaptchas (successful verification without a challenge) plus
+     * submitted challenge solutions that were correct and resulted in
+     * verification.
+     * 
+ * + * int64 passed_count = 4; + * + * @return The passedCount. + */ + @java.lang.Override + public long getPassedCount() { + return passedCount_; + } + /** + * + * + *
+     * Count of nocaptchas (successful verification without a challenge) plus
+     * submitted challenge solutions that were correct and resulted in
+     * verification.
+     * 
+ * + * int64 passed_count = 4; + * + * @param value The passedCount to set. + * @return This builder for chaining. + */ + public Builder setPassedCount(long value) { + + passedCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of nocaptchas (successful verification without a challenge) plus
+     * submitted challenge solutions that were correct and resulted in
+     * verification.
+     * 
+ * + * int64 passed_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearPassedCount() { + + passedCount_ = 0L; + 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.ChallengeMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.ChallengeMetrics) + private static final com.google.recaptchaenterprise.v1.ChallengeMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.ChallengeMetrics(); + } + + public static com.google.recaptchaenterprise.v1.ChallengeMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ChallengeMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ChallengeMetrics(input, extensionRegistry); + } + }; + + 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.ChallengeMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ChallengeMetricsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ChallengeMetricsOrBuilder.java new file mode 100644 index 00000000..53909bd3 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ChallengeMetricsOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +public interface ChallengeMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.ChallengeMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent
+   * to a count of pageloads for pages that include reCAPTCHA.
+   * 
+ * + * int64 pageload_count = 1; + * + * @return The pageloadCount. + */ + long getPageloadCount(); + + /** + * + * + *
+   * Count of nocaptchas (successful verification without a challenge) issued.
+   * 
+ * + * int64 nocaptcha_count = 2; + * + * @return The nocaptchaCount. + */ + long getNocaptchaCount(); + + /** + * + * + *
+   * Count of submitted challenge solutions that were incorrect or otherwise
+   * deemed suspicious such that a subsequent challenge was triggered.
+   * 
+ * + * int64 failed_count = 3; + * + * @return The failedCount. + */ + long getFailedCount(); + + /** + * + * + *
+   * Count of nocaptchas (successful verification without a challenge) plus
+   * submitted challenge solutions that were correct and resulted in
+   * verification.
+   * 
+ * + * int64 passed_count = 4; + * + * @return The passedCount. + */ + long getPassedCount(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/GetMetricsRequest.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/GetMetricsRequest.java new file mode 100644 index 00000000..8ac25874 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/GetMetricsRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * The get metrics request message.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.GetMetricsRequest} + */ +public final class GetMetricsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.GetMetricsRequest) + GetMetricsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetMetricsRequest.newBuilder() to construct. + private GetMetricsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetMetricsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetMetricsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetMetricsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.GetMetricsRequest.class, + com.google.recaptchaenterprise.v1.GetMetricsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the requested metrics, in the format
+   * "projects/{project}/keys/{key}/metrics".
+   * 
+ * + * + * 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 requested metrics, in the format
+   * "projects/{project}/keys/{key}/metrics".
+   * 
+ * + * + * 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; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.GetMetricsRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.GetMetricsRequest other = + (com.google.recaptchaenterprise.v1.GetMetricsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.GetMetricsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.GetMetricsRequest 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.GetMetricsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.GetMetricsRequest 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.GetMetricsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.GetMetricsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.GetMetricsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.GetMetricsRequest 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.GetMetricsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.GetMetricsRequest 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.GetMetricsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.GetMetricsRequest 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.GetMetricsRequest 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 get metrics request message.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.GetMetricsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.GetMetricsRequest) + com.google.recaptchaenterprise.v1.GetMetricsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.GetMetricsRequest.class, + com.google.recaptchaenterprise.v1.GetMetricsRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.GetMetricsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.GetMetricsRequest getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.GetMetricsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.GetMetricsRequest build() { + com.google.recaptchaenterprise.v1.GetMetricsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.GetMetricsRequest buildPartial() { + com.google.recaptchaenterprise.v1.GetMetricsRequest result = + new com.google.recaptchaenterprise.v1.GetMetricsRequest(this); + result.name_ = name_; + 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.GetMetricsRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1.GetMetricsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.GetMetricsRequest other) { + if (other == com.google.recaptchaenterprise.v1.GetMetricsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.recaptchaenterprise.v1.GetMetricsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1.GetMetricsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the requested metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * + * 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 requested metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * + * 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 requested metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the requested metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the requested metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * + * 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; + 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.GetMetricsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.GetMetricsRequest) + private static final com.google.recaptchaenterprise.v1.GetMetricsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.GetMetricsRequest(); + } + + public static com.google.recaptchaenterprise.v1.GetMetricsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetMetricsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetMetricsRequest(input, extensionRegistry); + } + }; + + 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.GetMetricsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/GetMetricsRequestOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/GetMetricsRequestOrBuilder.java new file mode 100644 index 00000000..a6ca6e52 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/GetMetricsRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +public interface GetMetricsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.GetMetricsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the requested metrics, in the format
+   * "projects/{project}/keys/{key}/metrics".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the requested metrics, in the format
+   * "projects/{project}/keys/{key}/metrics".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IOSKeySettings.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IOSKeySettings.java index c97b398b..8027d721 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IOSKeySettings.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IOSKeySettings.java @@ -81,6 +81,11 @@ private IOSKeySettings( allowedBundleIds_.add(s); break; } + case 16: + { + allowAllBundleIds_ = input.readBool(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -118,6 +123,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.recaptchaenterprise.v1.IOSKeySettings.Builder.class); } + public static final int ALLOW_ALL_BUNDLE_IDS_FIELD_NUMBER = 2; + private boolean allowAllBundleIds_; + /** + * + * + *
+   * If set to true, it means allowed_bundle_ids will not be enforced.
+   * 
+ * + * bool allow_all_bundle_ids = 2; + * + * @return The allowAllBundleIds. + */ + @java.lang.Override + public boolean getAllowAllBundleIds() { + return allowAllBundleIds_; + } + public static final int ALLOWED_BUNDLE_IDS_FIELD_NUMBER = 1; private com.google.protobuf.LazyStringList allowedBundleIds_; /** @@ -200,6 +223,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < allowedBundleIds_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedBundleIds_.getRaw(i)); } + if (allowAllBundleIds_ != false) { + output.writeBool(2, allowAllBundleIds_); + } unknownFields.writeTo(output); } @@ -217,6 +243,9 @@ public int getSerializedSize() { size += dataSize; size += 1 * getAllowedBundleIdsList().size(); } + if (allowAllBundleIds_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowAllBundleIds_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -233,6 +262,7 @@ public boolean equals(final java.lang.Object obj) { com.google.recaptchaenterprise.v1.IOSKeySettings other = (com.google.recaptchaenterprise.v1.IOSKeySettings) obj; + if (getAllowAllBundleIds() != other.getAllowAllBundleIds()) return false; if (!getAllowedBundleIdsList().equals(other.getAllowedBundleIdsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -245,6 +275,8 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ALLOW_ALL_BUNDLE_IDS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowAllBundleIds()); if (getAllowedBundleIdsCount() > 0) { hash = (37 * hash) + ALLOWED_BUNDLE_IDS_FIELD_NUMBER; hash = (53 * hash) + getAllowedBundleIdsList().hashCode(); @@ -394,6 +426,8 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + allowAllBundleIds_ = false; + allowedBundleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); return this; @@ -424,6 +458,7 @@ public com.google.recaptchaenterprise.v1.IOSKeySettings buildPartial() { com.google.recaptchaenterprise.v1.IOSKeySettings result = new com.google.recaptchaenterprise.v1.IOSKeySettings(this); int from_bitField0_ = bitField0_; + result.allowAllBundleIds_ = allowAllBundleIds_; if (((bitField0_ & 0x00000001) != 0)) { allowedBundleIds_ = allowedBundleIds_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); @@ -479,6 +514,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.recaptchaenterprise.v1.IOSKeySettings other) { if (other == com.google.recaptchaenterprise.v1.IOSKeySettings.getDefaultInstance()) return this; + if (other.getAllowAllBundleIds() != false) { + setAllowAllBundleIds(other.getAllowAllBundleIds()); + } if (!other.allowedBundleIds_.isEmpty()) { if (allowedBundleIds_.isEmpty()) { allowedBundleIds_ = other.allowedBundleIds_; @@ -520,6 +558,58 @@ public Builder mergeFrom( private int bitField0_; + private boolean allowAllBundleIds_; + /** + * + * + *
+     * If set to true, it means allowed_bundle_ids will not be enforced.
+     * 
+ * + * bool allow_all_bundle_ids = 2; + * + * @return The allowAllBundleIds. + */ + @java.lang.Override + public boolean getAllowAllBundleIds() { + return allowAllBundleIds_; + } + /** + * + * + *
+     * If set to true, it means allowed_bundle_ids will not be enforced.
+     * 
+ * + * bool allow_all_bundle_ids = 2; + * + * @param value The allowAllBundleIds to set. + * @return This builder for chaining. + */ + public Builder setAllowAllBundleIds(boolean value) { + + allowAllBundleIds_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, it means allowed_bundle_ids will not be enforced.
+     * 
+ * + * bool allow_all_bundle_ids = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllowAllBundleIds() { + + allowAllBundleIds_ = false; + onChanged(); + return this; + } + private com.google.protobuf.LazyStringList allowedBundleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IOSKeySettingsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IOSKeySettingsOrBuilder.java index a7170d96..c9364789 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IOSKeySettingsOrBuilder.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/IOSKeySettingsOrBuilder.java @@ -23,6 +23,19 @@ public interface IOSKeySettingsOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.IOSKeySettings) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
+   * If set to true, it means allowed_bundle_ids will not be enforced.
+   * 
+ * + * bool allow_all_bundle_ids = 2; + * + * @return The allowAllBundleIds. + */ + boolean getAllowAllBundleIds(); + /** * * diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Key.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Key.java index c64561b2..a02f119f 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Key.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Key.java @@ -171,6 +171,22 @@ private Key( createTime_ = subBuilder.buildPartial(); } + break; + } + case 74: + { + com.google.recaptchaenterprise.v1.TestingOptions.Builder subBuilder = null; + if (testingOptions_ != null) { + subBuilder = testingOptions_.toBuilder(); + } + testingOptions_ = + input.readMessage( + com.google.recaptchaenterprise.v1.TestingOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(testingOptions_); + testingOptions_ = subBuilder.buildPartial(); + } + break; } default: @@ -551,11 +567,11 @@ public int getLabelsCount() { * * *
-   * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+   * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
    * Creating and managing labels</a>.
    * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ @java.lang.Override public boolean containsLabels(java.lang.String key) { @@ -574,11 +590,11 @@ public java.util.Map getLabels() { * * *
-   * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+   * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
    * Creating and managing labels</a>.
    * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ @java.lang.Override public java.util.Map getLabelsMap() { @@ -588,11 +604,11 @@ public java.util.Map getLabelsMap() { * * *
-   * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+   * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
    * Creating and managing labels</a>.
    * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ @java.lang.Override public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { @@ -606,11 +622,11 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * * *
-   * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+   * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
    * Creating and managing labels</a>.
    * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { @@ -670,6 +686,54 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return getCreateTime(); } + public static final int TESTING_OPTIONS_FIELD_NUMBER = 9; + private com.google.recaptchaenterprise.v1.TestingOptions testingOptions_; + /** + * + * + *
+   * Options for user acceptance testing.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + * + * @return Whether the testingOptions field is set. + */ + @java.lang.Override + public boolean hasTestingOptions() { + return testingOptions_ != null; + } + /** + * + * + *
+   * Options for user acceptance testing.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + * + * @return The testingOptions. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.TestingOptions getTestingOptions() { + return testingOptions_ == null + ? com.google.recaptchaenterprise.v1.TestingOptions.getDefaultInstance() + : testingOptions_; + } + /** + * + * + *
+   * Options for user acceptance testing.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.TestingOptionsOrBuilder getTestingOptionsOrBuilder() { + return getTestingOptions(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -705,6 +769,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (createTime_ != null) { output.writeMessage(7, getCreateTime()); } + if (testingOptions_ != null) { + output.writeMessage(9, getTestingOptions()); + } unknownFields.writeTo(output); } @@ -748,6 +815,9 @@ public int getSerializedSize() { if (createTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); } + if (testingOptions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getTestingOptions()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -770,6 +840,10 @@ public boolean equals(final java.lang.Object obj) { if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; } + if (hasTestingOptions() != other.hasTestingOptions()) return false; + if (hasTestingOptions()) { + if (!getTestingOptions().equals(other.getTestingOptions())) return false; + } if (!getPlatformSettingsCase().equals(other.getPlatformSettingsCase())) return false; switch (platformSettingsCase_) { case 3: @@ -807,6 +881,10 @@ public int hashCode() { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); } + if (hasTestingOptions()) { + hash = (37 * hash) + TESTING_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTestingOptions().hashCode(); + } switch (platformSettingsCase_) { case 3: hash = (37 * hash) + WEB_SETTINGS_FIELD_NUMBER; @@ -999,6 +1077,12 @@ public Builder clear() { createTime_ = null; createTimeBuilder_ = null; } + if (testingOptionsBuilder_ == null) { + testingOptions_ = null; + } else { + testingOptions_ = null; + testingOptionsBuilder_ = null; + } platformSettingsCase_ = 0; platformSettings_ = null; return this; @@ -1059,6 +1143,11 @@ public com.google.recaptchaenterprise.v1.Key buildPartial() { } else { result.createTime_ = createTimeBuilder_.build(); } + if (testingOptionsBuilder_ == null) { + result.testingOptions_ = testingOptions_; + } else { + result.testingOptions_ = testingOptionsBuilder_.build(); + } result.platformSettingsCase_ = platformSettingsCase_; onBuilt(); return result; @@ -1121,6 +1210,9 @@ public Builder mergeFrom(com.google.recaptchaenterprise.v1.Key other) { if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } + if (other.hasTestingOptions()) { + mergeTestingOptions(other.getTestingOptions()); + } switch (other.getPlatformSettingsCase()) { case WEB_SETTINGS: { @@ -2067,11 +2159,11 @@ public int getLabelsCount() { * * *
-     * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+     * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
      * Creating and managing labels</a>.
      * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ @java.lang.Override public boolean containsLabels(java.lang.String key) { @@ -2090,11 +2182,11 @@ public java.util.Map getLabels() { * * *
-     * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+     * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
      * Creating and managing labels</a>.
      * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ @java.lang.Override public java.util.Map getLabelsMap() { @@ -2104,11 +2196,11 @@ public java.util.Map getLabelsMap() { * * *
-     * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+     * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
      * Creating and managing labels</a>.
      * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ @java.lang.Override public java.lang.String getLabelsOrDefault( @@ -2123,11 +2215,11 @@ public java.lang.String getLabelsOrDefault( * * *
-     * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+     * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
      * Creating and managing labels</a>.
      * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { @@ -2149,11 +2241,11 @@ public Builder clearLabels() { * * *
-     * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+     * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
      * Creating and managing labels</a>.
      * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ public Builder removeLabels(java.lang.String key) { if (key == null) { @@ -2171,11 +2263,11 @@ public java.util.Map getMutableLabels() { * * *
-     * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+     * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
      * Creating and managing labels</a>.
      * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ public Builder putLabels(java.lang.String key, java.lang.String value) { if (key == null) { @@ -2191,11 +2283,11 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * * *
-     * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+     * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
      * Creating and managing labels</a>.
      * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); @@ -2385,6 +2477,192 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return createTimeBuilder_; } + private com.google.recaptchaenterprise.v1.TestingOptions testingOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.TestingOptions, + com.google.recaptchaenterprise.v1.TestingOptions.Builder, + com.google.recaptchaenterprise.v1.TestingOptionsOrBuilder> + testingOptionsBuilder_; + /** + * + * + *
+     * Options for user acceptance testing.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + * + * @return Whether the testingOptions field is set. + */ + public boolean hasTestingOptions() { + return testingOptionsBuilder_ != null || testingOptions_ != null; + } + /** + * + * + *
+     * Options for user acceptance testing.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + * + * @return The testingOptions. + */ + public com.google.recaptchaenterprise.v1.TestingOptions getTestingOptions() { + if (testingOptionsBuilder_ == null) { + return testingOptions_ == null + ? com.google.recaptchaenterprise.v1.TestingOptions.getDefaultInstance() + : testingOptions_; + } else { + return testingOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Options for user acceptance testing.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + */ + public Builder setTestingOptions(com.google.recaptchaenterprise.v1.TestingOptions value) { + if (testingOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + testingOptions_ = value; + onChanged(); + } else { + testingOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Options for user acceptance testing.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + */ + public Builder setTestingOptions( + com.google.recaptchaenterprise.v1.TestingOptions.Builder builderForValue) { + if (testingOptionsBuilder_ == null) { + testingOptions_ = builderForValue.build(); + onChanged(); + } else { + testingOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Options for user acceptance testing.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + */ + public Builder mergeTestingOptions(com.google.recaptchaenterprise.v1.TestingOptions value) { + if (testingOptionsBuilder_ == null) { + if (testingOptions_ != null) { + testingOptions_ = + com.google.recaptchaenterprise.v1.TestingOptions.newBuilder(testingOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + testingOptions_ = value; + } + onChanged(); + } else { + testingOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Options for user acceptance testing.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + */ + public Builder clearTestingOptions() { + if (testingOptionsBuilder_ == null) { + testingOptions_ = null; + onChanged(); + } else { + testingOptions_ = null; + testingOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Options for user acceptance testing.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + */ + public com.google.recaptchaenterprise.v1.TestingOptions.Builder getTestingOptionsBuilder() { + + onChanged(); + return getTestingOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Options for user acceptance testing.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + */ + public com.google.recaptchaenterprise.v1.TestingOptionsOrBuilder getTestingOptionsOrBuilder() { + if (testingOptionsBuilder_ != null) { + return testingOptionsBuilder_.getMessageOrBuilder(); + } else { + return testingOptions_ == null + ? com.google.recaptchaenterprise.v1.TestingOptions.getDefaultInstance() + : testingOptions_; + } + } + /** + * + * + *
+     * Options for user acceptance testing.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.TestingOptions, + com.google.recaptchaenterprise.v1.TestingOptions.Builder, + com.google.recaptchaenterprise.v1.TestingOptionsOrBuilder> + getTestingOptionsFieldBuilder() { + if (testingOptionsBuilder_ == null) { + testingOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.TestingOptions, + com.google.recaptchaenterprise.v1.TestingOptions.Builder, + com.google.recaptchaenterprise.v1.TestingOptionsOrBuilder>( + getTestingOptions(), getParentForChildren(), isClean()); + testingOptions_ = null; + } + return testingOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/KeyOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/KeyOrBuilder.java index 9c475e52..4cc29a94 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/KeyOrBuilder.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/KeyOrBuilder.java @@ -184,22 +184,22 @@ public interface KeyOrBuilder * * *
-   * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+   * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
    * Creating and managing labels</a>.
    * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ int getLabelsCount(); /** * * *
-   * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+   * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
    * Creating and managing labels</a>.
    * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ boolean containsLabels(java.lang.String key); /** Use {@link #getLabelsMap()} instead. */ @@ -209,33 +209,33 @@ public interface KeyOrBuilder * * *
-   * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+   * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
    * Creating and managing labels</a>.
    * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ java.util.Map getLabelsMap(); /** * * *
-   * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+   * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
    * Creating and managing labels</a>.
    * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); /** * * *
-   * Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
+   * See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
    * Creating and managing labels</a>.
    * 
* - * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * map<string, string> labels = 6; */ java.lang.String getLabelsOrThrow(java.lang.String key); @@ -274,5 +274,40 @@ public interface KeyOrBuilder */ com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + /** + * + * + *
+   * Options for user acceptance testing.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + * + * @return Whether the testingOptions field is set. + */ + boolean hasTestingOptions(); + /** + * + * + *
+   * Options for user acceptance testing.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + * + * @return The testingOptions. + */ + com.google.recaptchaenterprise.v1.TestingOptions getTestingOptions(); + /** + * + * + *
+   * Options for user acceptance testing.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9; + */ + com.google.recaptchaenterprise.v1.TestingOptionsOrBuilder getTestingOptionsOrBuilder(); + public com.google.recaptchaenterprise.v1.Key.PlatformSettingsCase getPlatformSettingsCase(); } diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Metrics.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Metrics.java new file mode 100644 index 00000000..96997e0a --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/Metrics.java @@ -0,0 +1,2006 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * Metrics for a single Key.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.Metrics} + */ +public final class Metrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.Metrics) + MetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Metrics.newBuilder() to construct. + private Metrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Metrics() { + name_ = ""; + scoreMetrics_ = java.util.Collections.emptyList(); + challengeMetrics_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Metrics(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Metrics( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + scoreMetrics_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + scoreMetrics_.add( + input.readMessage( + com.google.recaptchaenterprise.v1.ScoreMetrics.parser(), extensionRegistry)); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + challengeMetrics_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + challengeMetrics_.add( + input.readMessage( + com.google.recaptchaenterprise.v1.ChallengeMetrics.parser(), + extensionRegistry)); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + scoreMetrics_ = java.util.Collections.unmodifiableList(scoreMetrics_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + challengeMetrics_ = java.util.Collections.unmodifiableList(challengeMetrics_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_Metrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_Metrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.Metrics.class, + com.google.recaptchaenterprise.v1.Metrics.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 4; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The name of the metrics, in the format
+   * "projects/{project}/keys/{key}/metrics".
+   * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the metrics, in the format
+   * "projects/{project}/keys/{key}/metrics".
+   * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Inclusive start time aligned to a day (UTC).
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Inclusive start time aligned to a day (UTC).
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Inclusive start time aligned to a day (UTC).
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int SCORE_METRICS_FIELD_NUMBER = 2; + private java.util.List scoreMetrics_; + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + @java.lang.Override + public java.util.List getScoreMetricsList() { + return scoreMetrics_; + } + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + @java.lang.Override + public java.util.List + getScoreMetricsOrBuilderList() { + return scoreMetrics_; + } + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + @java.lang.Override + public int getScoreMetricsCount() { + return scoreMetrics_.size(); + } + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreMetrics getScoreMetrics(int index) { + return scoreMetrics_.get(index); + } + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreMetricsOrBuilder getScoreMetricsOrBuilder( + int index) { + return scoreMetrics_.get(index); + } + + public static final int CHALLENGE_METRICS_FIELD_NUMBER = 3; + private java.util.List challengeMetrics_; + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + @java.lang.Override + public java.util.List + getChallengeMetricsList() { + return challengeMetrics_; + } + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + @java.lang.Override + public java.util.List + getChallengeMetricsOrBuilderList() { + return challengeMetrics_; + } + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + @java.lang.Override + public int getChallengeMetricsCount() { + return challengeMetrics_.size(); + } + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ChallengeMetrics getChallengeMetrics(int index) { + return challengeMetrics_.get(index); + } + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ChallengeMetricsOrBuilder getChallengeMetricsOrBuilder( + int index) { + return challengeMetrics_.get(index); + } + + 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 (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + for (int i = 0; i < scoreMetrics_.size(); i++) { + output.writeMessage(2, scoreMetrics_.get(i)); + } + for (int i = 0; i < challengeMetrics_.size(); i++) { + output.writeMessage(3, challengeMetrics_.get(i)); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + for (int i = 0; i < scoreMetrics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, scoreMetrics_.get(i)); + } + for (int i = 0; i < challengeMetrics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, challengeMetrics_.get(i)); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, name_); + } + size += unknownFields.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.Metrics)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.Metrics other = + (com.google.recaptchaenterprise.v1.Metrics) obj; + + if (!getName().equals(other.getName())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (!getScoreMetricsList().equals(other.getScoreMetricsList())) return false; + if (!getChallengeMetricsList().equals(other.getChallengeMetricsList())) return false; + if (!unknownFields.equals(other.unknownFields)) 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 (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (getScoreMetricsCount() > 0) { + hash = (37 * hash) + SCORE_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getScoreMetricsList().hashCode(); + } + if (getChallengeMetricsCount() > 0) { + hash = (37 * hash) + CHALLENGE_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getChallengeMetricsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.Metrics parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.Metrics 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.Metrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.Metrics 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.Metrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.Metrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.Metrics parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.Metrics 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.Metrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.Metrics 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.Metrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.Metrics 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.Metrics 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; + } + /** + * + * + *
+   * Metrics for a single Key.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.Metrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.Metrics) + com.google.recaptchaenterprise.v1.MetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_Metrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_Metrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.Metrics.class, + com.google.recaptchaenterprise.v1.Metrics.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.Metrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getScoreMetricsFieldBuilder(); + getChallengeMetricsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (scoreMetricsBuilder_ == null) { + scoreMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + scoreMetricsBuilder_.clear(); + } + if (challengeMetricsBuilder_ == null) { + challengeMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + challengeMetricsBuilder_.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_Metrics_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.Metrics getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.Metrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.Metrics build() { + com.google.recaptchaenterprise.v1.Metrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.Metrics buildPartial() { + com.google.recaptchaenterprise.v1.Metrics result = + new com.google.recaptchaenterprise.v1.Metrics(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (scoreMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + scoreMetrics_ = java.util.Collections.unmodifiableList(scoreMetrics_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.scoreMetrics_ = scoreMetrics_; + } else { + result.scoreMetrics_ = scoreMetricsBuilder_.build(); + } + if (challengeMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + challengeMetrics_ = java.util.Collections.unmodifiableList(challengeMetrics_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.challengeMetrics_ = challengeMetrics_; + } else { + result.challengeMetrics_ = challengeMetricsBuilder_.build(); + } + 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.Metrics) { + return mergeFrom((com.google.recaptchaenterprise.v1.Metrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.Metrics other) { + if (other == com.google.recaptchaenterprise.v1.Metrics.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (scoreMetricsBuilder_ == null) { + if (!other.scoreMetrics_.isEmpty()) { + if (scoreMetrics_.isEmpty()) { + scoreMetrics_ = other.scoreMetrics_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureScoreMetricsIsMutable(); + scoreMetrics_.addAll(other.scoreMetrics_); + } + onChanged(); + } + } else { + if (!other.scoreMetrics_.isEmpty()) { + if (scoreMetricsBuilder_.isEmpty()) { + scoreMetricsBuilder_.dispose(); + scoreMetricsBuilder_ = null; + scoreMetrics_ = other.scoreMetrics_; + bitField0_ = (bitField0_ & ~0x00000001); + scoreMetricsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getScoreMetricsFieldBuilder() + : null; + } else { + scoreMetricsBuilder_.addAllMessages(other.scoreMetrics_); + } + } + } + if (challengeMetricsBuilder_ == null) { + if (!other.challengeMetrics_.isEmpty()) { + if (challengeMetrics_.isEmpty()) { + challengeMetrics_ = other.challengeMetrics_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureChallengeMetricsIsMutable(); + challengeMetrics_.addAll(other.challengeMetrics_); + } + onChanged(); + } + } else { + if (!other.challengeMetrics_.isEmpty()) { + if (challengeMetricsBuilder_.isEmpty()) { + challengeMetricsBuilder_.dispose(); + challengeMetricsBuilder_ = null; + challengeMetrics_ = other.challengeMetrics_; + bitField0_ = (bitField0_ & ~0x00000002); + challengeMetricsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getChallengeMetricsFieldBuilder() + : null; + } else { + challengeMetricsBuilder_.addAllMessages(other.challengeMetrics_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.recaptchaenterprise.v1.Metrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.recaptchaenterprise.v1.Metrics) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The name of the metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the metrics, in the format
+     * "projects/{project}/keys/{key}/metrics".
+     * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Inclusive start time aligned to a day (UTC).
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * Inclusive start time aligned to a day (UTC).
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Inclusive start time aligned to a day (UTC).
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Inclusive start time aligned to a day (UTC).
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Inclusive start time aligned to a day (UTC).
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Inclusive start time aligned to a day (UTC).
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Inclusive start time aligned to a day (UTC).
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Inclusive start time aligned to a day (UTC).
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Inclusive start time aligned to a day (UTC).
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private java.util.List scoreMetrics_ = + java.util.Collections.emptyList(); + + private void ensureScoreMetricsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + scoreMetrics_ = + new java.util.ArrayList(scoreMetrics_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.recaptchaenterprise.v1.ScoreMetrics, + com.google.recaptchaenterprise.v1.ScoreMetrics.Builder, + com.google.recaptchaenterprise.v1.ScoreMetricsOrBuilder> + scoreMetricsBuilder_; + + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public java.util.List getScoreMetricsList() { + if (scoreMetricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(scoreMetrics_); + } else { + return scoreMetricsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public int getScoreMetricsCount() { + if (scoreMetricsBuilder_ == null) { + return scoreMetrics_.size(); + } else { + return scoreMetricsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public com.google.recaptchaenterprise.v1.ScoreMetrics getScoreMetrics(int index) { + if (scoreMetricsBuilder_ == null) { + return scoreMetrics_.get(index); + } else { + return scoreMetricsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public Builder setScoreMetrics( + int index, com.google.recaptchaenterprise.v1.ScoreMetrics value) { + if (scoreMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScoreMetricsIsMutable(); + scoreMetrics_.set(index, value); + onChanged(); + } else { + scoreMetricsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public Builder setScoreMetrics( + int index, com.google.recaptchaenterprise.v1.ScoreMetrics.Builder builderForValue) { + if (scoreMetricsBuilder_ == null) { + ensureScoreMetricsIsMutable(); + scoreMetrics_.set(index, builderForValue.build()); + onChanged(); + } else { + scoreMetricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public Builder addScoreMetrics(com.google.recaptchaenterprise.v1.ScoreMetrics value) { + if (scoreMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScoreMetricsIsMutable(); + scoreMetrics_.add(value); + onChanged(); + } else { + scoreMetricsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public Builder addScoreMetrics( + int index, com.google.recaptchaenterprise.v1.ScoreMetrics value) { + if (scoreMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScoreMetricsIsMutable(); + scoreMetrics_.add(index, value); + onChanged(); + } else { + scoreMetricsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public Builder addScoreMetrics( + com.google.recaptchaenterprise.v1.ScoreMetrics.Builder builderForValue) { + if (scoreMetricsBuilder_ == null) { + ensureScoreMetricsIsMutable(); + scoreMetrics_.add(builderForValue.build()); + onChanged(); + } else { + scoreMetricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public Builder addScoreMetrics( + int index, com.google.recaptchaenterprise.v1.ScoreMetrics.Builder builderForValue) { + if (scoreMetricsBuilder_ == null) { + ensureScoreMetricsIsMutable(); + scoreMetrics_.add(index, builderForValue.build()); + onChanged(); + } else { + scoreMetricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public Builder addAllScoreMetrics( + java.lang.Iterable values) { + if (scoreMetricsBuilder_ == null) { + ensureScoreMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scoreMetrics_); + onChanged(); + } else { + scoreMetricsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public Builder clearScoreMetrics() { + if (scoreMetricsBuilder_ == null) { + scoreMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + scoreMetricsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public Builder removeScoreMetrics(int index) { + if (scoreMetricsBuilder_ == null) { + ensureScoreMetricsIsMutable(); + scoreMetrics_.remove(index); + onChanged(); + } else { + scoreMetricsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public com.google.recaptchaenterprise.v1.ScoreMetrics.Builder getScoreMetricsBuilder( + int index) { + return getScoreMetricsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public com.google.recaptchaenterprise.v1.ScoreMetricsOrBuilder getScoreMetricsOrBuilder( + int index) { + if (scoreMetricsBuilder_ == null) { + return scoreMetrics_.get(index); + } else { + return scoreMetricsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public java.util.List + getScoreMetricsOrBuilderList() { + if (scoreMetricsBuilder_ != null) { + return scoreMetricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(scoreMetrics_); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public com.google.recaptchaenterprise.v1.ScoreMetrics.Builder addScoreMetricsBuilder() { + return getScoreMetricsFieldBuilder() + .addBuilder(com.google.recaptchaenterprise.v1.ScoreMetrics.getDefaultInstance()); + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public com.google.recaptchaenterprise.v1.ScoreMetrics.Builder addScoreMetricsBuilder( + int index) { + return getScoreMetricsFieldBuilder() + .addBuilder(index, com.google.recaptchaenterprise.v1.ScoreMetrics.getDefaultInstance()); + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. All Key types should have score-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + public java.util.List + getScoreMetricsBuilderList() { + return getScoreMetricsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.recaptchaenterprise.v1.ScoreMetrics, + com.google.recaptchaenterprise.v1.ScoreMetrics.Builder, + com.google.recaptchaenterprise.v1.ScoreMetricsOrBuilder> + getScoreMetricsFieldBuilder() { + if (scoreMetricsBuilder_ == null) { + scoreMetricsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.recaptchaenterprise.v1.ScoreMetrics, + com.google.recaptchaenterprise.v1.ScoreMetrics.Builder, + com.google.recaptchaenterprise.v1.ScoreMetricsOrBuilder>( + scoreMetrics_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + scoreMetrics_ = null; + } + return scoreMetricsBuilder_; + } + + private java.util.List challengeMetrics_ = + java.util.Collections.emptyList(); + + private void ensureChallengeMetricsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + challengeMetrics_ = + new java.util.ArrayList( + challengeMetrics_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.recaptchaenterprise.v1.ChallengeMetrics, + com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder, + com.google.recaptchaenterprise.v1.ChallengeMetricsOrBuilder> + challengeMetricsBuilder_; + + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public java.util.List + getChallengeMetricsList() { + if (challengeMetricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(challengeMetrics_); + } else { + return challengeMetricsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public int getChallengeMetricsCount() { + if (challengeMetricsBuilder_ == null) { + return challengeMetrics_.size(); + } else { + return challengeMetricsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public com.google.recaptchaenterprise.v1.ChallengeMetrics getChallengeMetrics(int index) { + if (challengeMetricsBuilder_ == null) { + return challengeMetrics_.get(index); + } else { + return challengeMetricsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public Builder setChallengeMetrics( + int index, com.google.recaptchaenterprise.v1.ChallengeMetrics value) { + if (challengeMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChallengeMetricsIsMutable(); + challengeMetrics_.set(index, value); + onChanged(); + } else { + challengeMetricsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public Builder setChallengeMetrics( + int index, com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder builderForValue) { + if (challengeMetricsBuilder_ == null) { + ensureChallengeMetricsIsMutable(); + challengeMetrics_.set(index, builderForValue.build()); + onChanged(); + } else { + challengeMetricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public Builder addChallengeMetrics(com.google.recaptchaenterprise.v1.ChallengeMetrics value) { + if (challengeMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChallengeMetricsIsMutable(); + challengeMetrics_.add(value); + onChanged(); + } else { + challengeMetricsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public Builder addChallengeMetrics( + int index, com.google.recaptchaenterprise.v1.ChallengeMetrics value) { + if (challengeMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChallengeMetricsIsMutable(); + challengeMetrics_.add(index, value); + onChanged(); + } else { + challengeMetricsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public Builder addChallengeMetrics( + com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder builderForValue) { + if (challengeMetricsBuilder_ == null) { + ensureChallengeMetricsIsMutable(); + challengeMetrics_.add(builderForValue.build()); + onChanged(); + } else { + challengeMetricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public Builder addChallengeMetrics( + int index, com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder builderForValue) { + if (challengeMetricsBuilder_ == null) { + ensureChallengeMetricsIsMutable(); + challengeMetrics_.add(index, builderForValue.build()); + onChanged(); + } else { + challengeMetricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public Builder addAllChallengeMetrics( + java.lang.Iterable values) { + if (challengeMetricsBuilder_ == null) { + ensureChallengeMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, challengeMetrics_); + onChanged(); + } else { + challengeMetricsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public Builder clearChallengeMetrics() { + if (challengeMetricsBuilder_ == null) { + challengeMetrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + challengeMetricsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public Builder removeChallengeMetrics(int index) { + if (challengeMetricsBuilder_ == null) { + ensureChallengeMetricsIsMutable(); + challengeMetrics_.remove(index); + onChanged(); + } else { + challengeMetricsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder getChallengeMetricsBuilder( + int index) { + return getChallengeMetricsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public com.google.recaptchaenterprise.v1.ChallengeMetricsOrBuilder getChallengeMetricsOrBuilder( + int index) { + if (challengeMetricsBuilder_ == null) { + return challengeMetrics_.get(index); + } else { + return challengeMetricsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public java.util.List + getChallengeMetricsOrBuilderList() { + if (challengeMetricsBuilder_ != null) { + return challengeMetricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(challengeMetrics_); + } + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder addChallengeMetricsBuilder() { + return getChallengeMetricsFieldBuilder() + .addBuilder(com.google.recaptchaenterprise.v1.ChallengeMetrics.getDefaultInstance()); + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder addChallengeMetricsBuilder( + int index) { + return getChallengeMetricsFieldBuilder() + .addBuilder( + index, com.google.recaptchaenterprise.v1.ChallengeMetrics.getDefaultInstance()); + } + /** + * + * + *
+     * Metrics will be continuous and in order by dates, and in the granularity
+     * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+     * challenge-based data.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + public java.util.List + getChallengeMetricsBuilderList() { + return getChallengeMetricsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.recaptchaenterprise.v1.ChallengeMetrics, + com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder, + com.google.recaptchaenterprise.v1.ChallengeMetricsOrBuilder> + getChallengeMetricsFieldBuilder() { + if (challengeMetricsBuilder_ == null) { + challengeMetricsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.recaptchaenterprise.v1.ChallengeMetrics, + com.google.recaptchaenterprise.v1.ChallengeMetrics.Builder, + com.google.recaptchaenterprise.v1.ChallengeMetricsOrBuilder>( + challengeMetrics_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + challengeMetrics_ = null; + } + return challengeMetricsBuilder_; + } + + @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.Metrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.Metrics) + private static final com.google.recaptchaenterprise.v1.Metrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.Metrics(); + } + + public static com.google.recaptchaenterprise.v1.Metrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Metrics(input, extensionRegistry); + } + }; + + 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.Metrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MetricsName.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MetricsName.java new file mode 100644 index 00000000..dfe0d846 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MetricsName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2021 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.recaptchaenterprise.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class MetricsName implements ResourceName { + private static final PathTemplate PROJECT_KEY = + PathTemplate.createWithoutUrlEncoding("projects/{project}/keys/{key}/metrics"); + private volatile Map fieldValuesMap; + private final String project; + private final String key; + + @Deprecated + protected MetricsName() { + project = null; + key = null; + } + + private MetricsName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + key = Preconditions.checkNotNull(builder.getKey()); + } + + public String getProject() { + return project; + } + + public String getKey() { + return key; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static MetricsName of(String project, String key) { + return newBuilder().setProject(project).setKey(key).build(); + } + + public static String format(String project, String key) { + return newBuilder().setProject(project).setKey(key).build().toString(); + } + + public static MetricsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_KEY.validatedMatch( + formattedString, "MetricsName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("key")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (MetricsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_KEY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (key != null) { + fieldMapBuilder.put("key", key); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_KEY.instantiate("project", project, "key", key); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + MetricsName that = ((MetricsName) o); + return Objects.equals(this.project, that.project) && Objects.equals(this.key, that.key); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(key); + return h; + } + + /** Builder for projects/{project}/keys/{key}/metrics. */ + public static class Builder { + private String project; + private String key; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getKey() { + return key; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + private Builder(MetricsName metricsName) { + this.project = metricsName.project; + this.key = metricsName.key; + } + + public MetricsName build() { + return new MetricsName(this); + } + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MetricsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MetricsOrBuilder.java new file mode 100644 index 00000000..bb2fe0df --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MetricsOrBuilder.java @@ -0,0 +1,212 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +public interface MetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.Metrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the metrics, in the format
+   * "projects/{project}/keys/{key}/metrics".
+   * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the metrics, in the format
+   * "projects/{project}/keys/{key}/metrics".
+   * 
+ * + * string name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Inclusive start time aligned to a day (UTC).
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Inclusive start time aligned to a day (UTC).
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Inclusive start time aligned to a day (UTC).
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + java.util.List getScoreMetricsList(); + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + com.google.recaptchaenterprise.v1.ScoreMetrics getScoreMetrics(int index); + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + int getScoreMetricsCount(); + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + java.util.List + getScoreMetricsOrBuilderList(); + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. All Key types should have score-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ScoreMetrics score_metrics = 2; + */ + com.google.recaptchaenterprise.v1.ScoreMetricsOrBuilder getScoreMetricsOrBuilder(int index); + + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + java.util.List getChallengeMetricsList(); + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + com.google.recaptchaenterprise.v1.ChallengeMetrics getChallengeMetrics(int index); + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + int getChallengeMetricsCount(); + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + java.util.List + getChallengeMetricsOrBuilderList(); + /** + * + * + *
+   * Metrics will be continuous and in order by dates, and in the granularity
+   * of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
+   * challenge-based data.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1.ChallengeMetrics challenge_metrics = 3; + * + */ + com.google.recaptchaenterprise.v1.ChallengeMetricsOrBuilder getChallengeMetricsOrBuilder( + int index); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequest.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequest.java new file mode 100644 index 00000000..83e03137 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * The migrate key request message.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} + */ +public final class MigrateKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.MigrateKeyRequest) + MigrateKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MigrateKeyRequest.newBuilder() to construct. + private MigrateKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MigrateKeyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MigrateKeyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MigrateKeyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.MigrateKeyRequest.class, + com.google.recaptchaenterprise.v1.MigrateKeyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the key to be migrated, 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 be migrated, 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; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.MigrateKeyRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.MigrateKeyRequest other = + (com.google.recaptchaenterprise.v1.MigrateKeyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.MigrateKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.MigrateKeyRequest 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.MigrateKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.MigrateKeyRequest 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.MigrateKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.MigrateKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.MigrateKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.MigrateKeyRequest 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.MigrateKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.MigrateKeyRequest 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.MigrateKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.MigrateKeyRequest 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.MigrateKeyRequest 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 migrate key request message.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.MigrateKeyRequest) + com.google.recaptchaenterprise.v1.MigrateKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.MigrateKeyRequest.class, + com.google.recaptchaenterprise.v1.MigrateKeyRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.MigrateKeyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.MigrateKeyRequest getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.MigrateKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.MigrateKeyRequest build() { + com.google.recaptchaenterprise.v1.MigrateKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.MigrateKeyRequest buildPartial() { + com.google.recaptchaenterprise.v1.MigrateKeyRequest result = + new com.google.recaptchaenterprise.v1.MigrateKeyRequest(this); + result.name_ = name_; + 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.MigrateKeyRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1.MigrateKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.MigrateKeyRequest other) { + if (other == com.google.recaptchaenterprise.v1.MigrateKeyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.recaptchaenterprise.v1.MigrateKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1.MigrateKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the key to be migrated, 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 be migrated, 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 be migrated, 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the key to be migrated, 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the key to be migrated, 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; + 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.MigrateKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.MigrateKeyRequest) + private static final com.google.recaptchaenterprise.v1.MigrateKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.MigrateKeyRequest(); + } + + public static com.google.recaptchaenterprise.v1.MigrateKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MigrateKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MigrateKeyRequest(input, extensionRegistry); + } + }; + + 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.MigrateKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequestOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequestOrBuilder.java new file mode 100644 index 00000000..7b65fbe7 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/MigrateKeyRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +public interface MigrateKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.MigrateKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the key to be migrated, 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 be migrated, 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(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseProto.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseProto.java index 6239ba74..170de2cd 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseProto.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RecaptchaEnterpriseProto.java @@ -79,6 +79,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_recaptchaenterprise_v1_DeleteKeyRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_recaptchaenterprise_v1_DeleteKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_Metrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_Metrics_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_recaptchaenterprise_v1_Key_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -87,6 +99,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_recaptchaenterprise_v1_Key_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_recaptchaenterprise_v1_Key_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_TestingOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_TestingOptions_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_recaptchaenterprise_v1_WebKeySettings_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -99,6 +115,26 @@ 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_ScoreDistribution_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_ScoreBucketsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_ScoreBucketsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_ActionMetricsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_ActionMetricsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -120,130 +156,183 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\372A-\n+cloudresourcemanager.googleapis.com" + "/Project\022H\n\nassessment\030\002 \001(\0132/.google.cl" + "oud.recaptchaenterprise.v1.AssessmentB\003\340" - + "A\002\"\274\002\n\031AnnotateAssessmentRequest\022C\n\004name" + + "A\002\"\342\004\n\031AnnotateAssessmentRequest\022C\n\004name" + "\030\001 \001(\tB5\340A\002\372A/\n-recaptchaenterprise.goog" + "leapis.com/Assessment\022b\n\nannotation\030\002 \001(" + "\0162I.google.cloud.recaptchaenterprise.v1." + "AnnotateAssessmentRequest.AnnotationB\003\340A" - + "\002\"v\n\nAnnotation\022\032\n\026ANNOTATION_UNSPECIFIE" - + "D\020\000\022\016\n\nLEGITIMATE\020\001\022\016\n\nFRAUDULENT\020\002\022\024\n\020P" - + "ASSWORD_CORRECT\020\003\022\026\n\022PASSWORD_INCORRECT\020" - + "\004\"\034\n\032AnnotateAssessmentResponse\"\337\002\n\nAsse" - + "ssment\022\021\n\004name\030\001 \001(\tB\003\340A\003\0229\n\005event\030\002 \001(\013" - + "2*.google.cloud.recaptchaenterprise.v1.E" - + "vent\022M\n\rrisk_analysis\030\003 \001(\01321.google.clo" - + "ud.recaptchaenterprise.v1.RiskAnalysisB\003" - + "\340A\003\022S\n\020token_properties\030\004 \001(\01324.google.c" - + "loud.recaptchaenterprise.v1.TokenPropert" - + "iesB\003\340A\003:_\352A\\\n-recaptchaenterprise.googl" - + "eapis.com/Assessment\022+projects/{project}" - + "/assessments/{assessment}\"\207\001\n\005Event\022\022\n\005t" - + "oken\030\001 \001(\tB\003\340A\001\022\025\n\010site_key\030\002 \001(\tB\003\340A\001\022\027" - + "\n\nuser_agent\030\003 \001(\tB\003\340A\001\022\034\n\017user_ip_addre" - + "ss\030\004 \001(\tB\003\340A\001\022\034\n\017expected_action\030\005 \001(\tB\003" - + "\340A\001\"\261\002\n\014RiskAnalysis\022\r\n\005score\030\001 \001(\002\022W\n\007r" - + "easons\030\002 \003(\0162F.google.cloud.recaptchaent" - + "erprise.v1.RiskAnalysis.ClassificationRe" - + "ason\"\270\001\n\024ClassificationReason\022%\n!CLASSIF" - + "ICATION_REASON_UNSPECIFIED\020\000\022\016\n\nAUTOMATI" - + "ON\020\001\022\032\n\026UNEXPECTED_ENVIRONMENT\020\002\022\024\n\020TOO_" - + "MUCH_TRAFFIC\020\003\022\035\n\031UNEXPECTED_USAGE_PATTE" - + "RNS\020\004\022\030\n\024LOW_CONFIDENCE_SCORE\020\005\"\317\002\n\017Toke" - + "nProperties\022\r\n\005valid\030\001 \001(\010\022Z\n\016invalid_re" - + "ason\030\002 \001(\0162B.google.cloud.recaptchaenter" - + "prise.v1.TokenProperties.InvalidReason\022/" - + "\n\013create_time\030\003 \001(\0132\032.google.protobuf.Ti" - + "mestamp\022\020\n\010hostname\030\004 \001(\t\022\016\n\006action\030\005 \001(" - + "\t\"~\n\rInvalidReason\022\036\n\032INVALID_REASON_UNS" - + "PECIFIED\020\000\022\032\n\026UNKNOWN_INVALID_REASON\020\001\022\r" - + "\n\tMALFORMED\020\002\022\013\n\007EXPIRED\020\003\022\010\n\004DUPE\020\004\022\013\n\007" - + "MISSING\020\005\"\223\001\n\020CreateKeyRequest\022C\n\006parent" - + "\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.goo" - + "gleapis.com/Project\022:\n\003key\030\002 \001(\0132(.googl" - + "e.cloud.recaptchaenterprise.v1.KeyB\003\340A\002\"" - + "\207\001\n\017ListKeysRequest\022C\n\006parent\030\001 \001(\tB3\340A\002" - + "\372A-\n+cloudresourcemanager.googleapis.com" - + "/Project\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage" - + "_token\030\003 \001(\tB\003\340A\001\"c\n\020ListKeysResponse\0226\n" - + "\004keys\030\001 \003(\0132(.google.cloud.recaptchaente" - + "rprise.v1.Key\022\027\n\017next_page_token\030\002 \001(\t\"M" - + "\n\rGetKeyRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&r" - + "ecaptchaenterprise.googleapis.com/Key\"\204\001" - + "\n\020UpdateKeyRequest\022:\n\003key\030\001 \001(\0132(.google" - + ".cloud.recaptchaenterprise.v1.KeyB\003\340A\002\0224" - + "\n\013update_mask\030\002 \001(\0132\032.google.protobuf.Fi" - + "eldMaskB\003\340A\001\"P\n\020DeleteKeyRequest\022<\n\004name" - + "\030\001 \001(\tB.\340A\002\372A(\n&recaptchaenterprise.goog" - + "leapis.com/Key\"\244\004\n\003Key\022\014\n\004name\030\001 \001(\t\022\024\n\014" - + "display_name\030\002 \001(\t\022K\n\014web_settings\030\003 \001(\013" - + "23.google.cloud.recaptchaenterprise.v1.W" - + "ebKeySettingsH\000\022S\n\020android_settings\030\004 \001(" - + "\01327.google.cloud.recaptchaenterprise.v1." - + "AndroidKeySettingsH\000\022K\n\014ios_settings\030\005 \001" - + "(\01323.google.cloud.recaptchaenterprise.v1" - + ".IOSKeySettingsH\000\022I\n\006labels\030\006 \003(\01324.goog" - + "le.cloud.recaptchaenterprise.v1.Key.Labe" - + "lsEntryB\003\340A\001\022/\n\013create_time\030\007 \001(\0132\032.goog" - + "le.protobuf.Timestamp\032-\n\013LabelsEntry\022\013\n\003" + + "\001\022[\n\007reasons\030\003 \003(\0162E.google.cloud.recapt" + + "chaenterprise.v1.AnnotateAssessmentReque" + + "st.ReasonB\003\340A\001\"~\n\nAnnotation\022\032\n\026ANNOTATI" + + "ON_UNSPECIFIED\020\000\022\016\n\nLEGITIMATE\020\001\022\016\n\nFRAU" + + "DULENT\020\002\022\030\n\020PASSWORD_CORRECT\020\003\032\002\010\001\022\032\n\022PA" + + "SSWORD_INCORRECT\020\004\032\002\010\001\"\276\001\n\006Reason\022\026\n\022REA" + + "SON_UNSPECIFIED\020\000\022\016\n\nCHARGEBACK\020\001\022\026\n\022PAY" + + "MENT_HEURISTICS\020\002\022\030\n\024INITIATED_TWO_FACTO" + + "R\020\007\022\025\n\021PASSED_TWO_FACTOR\020\003\022\025\n\021FAILED_TWO" + + "_FACTOR\020\004\022\024\n\020CORRECT_PASSWORD\020\005\022\026\n\022INCOR" + + "RECT_PASSWORD\020\006\"\034\n\032AnnotateAssessmentRes" + + "ponse\"\337\002\n\nAssessment\022\021\n\004name\030\001 \001(\tB\003\340A\003\022" + + "9\n\005event\030\002 \001(\0132*.google.cloud.recaptchae" + + "nterprise.v1.Event\022M\n\rrisk_analysis\030\003 \001(" + + "\01321.google.cloud.recaptchaenterprise.v1." + + "RiskAnalysisB\003\340A\003\022S\n\020token_properties\030\004 " + + "\001(\01324.google.cloud.recaptchaenterprise.v" + + "1.TokenPropertiesB\003\340A\003:_\352A\\\n-recaptchaen" + + "terprise.googleapis.com/Assessment\022+proj" + + "ects/{project}/assessments/{assessment}\"" + + "\207\001\n\005Event\022\022\n\005token\030\001 \001(\tB\003\340A\001\022\025\n\010site_ke" + + "y\030\002 \001(\tB\003\340A\001\022\027\n\nuser_agent\030\003 \001(\tB\003\340A\001\022\034\n" + + "\017user_ip_address\030\004 \001(\tB\003\340A\001\022\034\n\017expected_" + + "action\030\005 \001(\tB\003\340A\001\"\261\002\n\014RiskAnalysis\022\r\n\005sc" + + "ore\030\001 \001(\002\022W\n\007reasons\030\002 \003(\0162F.google.clou" + + "d.recaptchaenterprise.v1.RiskAnalysis.Cl" + + "assificationReason\"\270\001\n\024ClassificationRea" + + "son\022%\n!CLASSIFICATION_REASON_UNSPECIFIED" + + "\020\000\022\016\n\nAUTOMATION\020\001\022\032\n\026UNEXPECTED_ENVIRON" + + "MENT\020\002\022\024\n\020TOO_MUCH_TRAFFIC\020\003\022\035\n\031UNEXPECT" + + "ED_USAGE_PATTERNS\020\004\022\030\n\024LOW_CONFIDENCE_SC" + + "ORE\020\005\"\343\002\n\017TokenProperties\022\r\n\005valid\030\001 \001(\010" + + "\022Z\n\016invalid_reason\030\002 \001(\0162B.google.cloud." + + "recaptchaenterprise.v1.TokenProperties.I" + + "nvalidReason\022/\n\013create_time\030\003 \001(\0132\032.goog" + + "le.protobuf.Timestamp\022\020\n\010hostname\030\004 \001(\t\022" + + "\016\n\006action\030\005 \001(\t\"\221\001\n\rInvalidReason\022\036\n\032INV" + + "ALID_REASON_UNSPECIFIED\020\000\022\032\n\026UNKNOWN_INV" + + "ALID_REASON\020\001\022\r\n\tMALFORMED\020\002\022\013\n\007EXPIRED\020" + + "\003\022\010\n\004DUPE\020\004\022\013\n\007MISSING\020\005\022\021\n\rBROWSER_ERRO" + + "R\020\006\"\223\001\n\020CreateKeyRequest\022C\n\006parent\030\001 \001(\t" + + "B3\340A\002\372A-\n+cloudresourcemanager.googleapi" + + "s.com/Project\022:\n\003key\030\002 \001(\0132(.google.clou" + + "d.recaptchaenterprise.v1.KeyB\003\340A\002\"\207\001\n\017Li" + + "stKeysRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+c" + + "loudresourcemanager.googleapis.com/Proje" + + "ct\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token" + + "\030\003 \001(\tB\003\340A\001\"c\n\020ListKeysResponse\0226\n\004keys\030" + + "\001 \003(\0132(.google.cloud.recaptchaenterprise" + + ".v1.Key\022\027\n\017next_page_token\030\002 \001(\t\"M\n\rGetK" + + "eyRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&recaptc" + + "haenterprise.googleapis.com/Key\"\204\001\n\020Upda" + + "teKeyRequest\022:\n\003key\030\001 \001(\0132(.google.cloud" + + ".recaptchaenterprise.v1.KeyB\003\340A\002\0224\n\013upda" + + "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas" + + "kB\003\340A\001\"P\n\020DeleteKeyRequest\022<\n\004name\030\001 \001(\t" + + "B.\340A\002\372A(\n&recaptchaenterprise.googleapis" + + ".com/Key\"Q\n\021MigrateKeyRequest\022<\n\004name\030\001 " + + "\001(\tB.\340A\002\372A(\n&recaptchaenterprise.googlea" + + "pis.com/Key\"U\n\021GetMetricsRequest\022@\n\004name" + + "\030\001 \001(\tB2\340A\002\372A,\n*recaptchaenterprise.goog" + + "leapis.com/Metrics\"\300\002\n\007Metrics\022\021\n\004name\030\004" + + " \001(\tB\003\340A\003\022.\n\nstart_time\030\001 \001(\0132\032.google.p" + + "rotobuf.Timestamp\022H\n\rscore_metrics\030\002 \003(\013" + + "21.google.cloud.recaptchaenterprise.v1.S" + + "coreMetrics\022P\n\021challenge_metrics\030\003 \003(\01325" + + ".google.cloud.recaptchaenterprise.v1.Cha" + + "llengeMetrics:V\352AS\n*recaptchaenterprise." + + "googleapis.com/Metrics\022%projects/{projec" + + "t}/keys/{key}/metrics\"\355\004\n\003Key\022\014\n\004name\030\001 " + + "\001(\t\022\024\n\014display_name\030\002 \001(\t\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\022D\n\006labels\030\006 \003(\013" + + "24.google.cloud.recaptchaenterprise.v1.K" + + "ey.LabelsEntry\022/\n\013create_time\030\007 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022L\n\017testing_optio" + + "ns\030\t \001(\01323.google.cloud.recaptchaenterpr" + + "ise.v1.TestingOptions\032-\n\013LabelsEntry\022\013\n\003" + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:J\352AG\n&recap" + "tchaenterprise.googleapis.com/Key\022\035proje" + "cts/{project}/keys/{key}B\023\n\021platform_set" - + "tings\"\225\004\n\016WebKeySettings\022\031\n\021allow_all_do" - + "mains\030\003 \001(\010\022\027\n\017allowed_domains\030\001 \003(\t\022\036\n\021" - + "allow_amp_traffic\030\002 \001(\010B\003\340A\002\022b\n\020integrat" - + "ion_type\030\004 \001(\0162C.google.cloud.recaptchae" - + "nterprise.v1.WebKeySettings.IntegrationT" - + "ypeB\003\340A\002\022v\n\035challenge_security_preferenc" - + "e\030\005 \001(\0162O.google.cloud.recaptchaenterpri" - + "se.v1.WebKeySettings.ChallengeSecurityPr" - + "eference\"[\n\017IntegrationType\022 \n\034INTEGRATI" - + "ON_TYPE_UNSPECIFIED\020\000\022\t\n\005SCORE\020\001\022\014\n\010CHEC" - + "KBOX\020\002\022\r\n\tINVISIBLE\020\003\"v\n\033ChallengeSecuri" - + "tyPreference\022-\n)CHALLENGE_SECURITY_PREFE" - + "RENCE_UNSPECIFIED\020\000\022\r\n\tUSABILITY\020\001\022\013\n\007BA" - + "LANCE\020\002\022\014\n\010SECURITY\020\003\"3\n\022AndroidKeySetti" - + "ngs\022\035\n\025allowed_package_names\030\001 \003(\t\",\n\016IO" - + "SKeySettings\022\032\n\022allowed_bundle_ids\030\001 \003(\t" - + "2\222\n\n\032RecaptchaEnterpriseService\022\316\001\n\020Crea" - + "teAssessment\022<.google.cloud.recaptchaent" - + "erprise.v1.CreateAssessmentRequest\032/.goo" - + "gle.cloud.recaptchaenterprise.v1.Assessm" - + "ent\"K\202\323\344\223\0021\"#/v1/{parent=projects/*}/ass" - + "essments:\nassessment\332A\021parent,assessment" - + "\022\340\001\n\022AnnotateAssessment\022>.google.cloud.r" - + "ecaptchaenterprise.v1.AnnotateAssessment" - + "Request\032?.google.cloud.recaptchaenterpri" - + "se.v1.AnnotateAssessmentResponse\"I\202\323\344\223\0021" - + "\",/v1/{name=projects/*/assessments/*}:an" - + "notate:\001*\332A\017name,annotation\022\227\001\n\tCreateKe" - + "y\0225.google.cloud.recaptchaenterprise.v1." - + "CreateKeyRequest\032(.google.cloud.recaptch" - + "aenterprise.v1.Key\")\202\323\344\223\002#\"\034/v1/{parent=" - + "projects/*}/keys:\003key\022\235\001\n\010ListKeys\0224.goo" - + "gle.cloud.recaptchaenterprise.v1.ListKey" - + "sRequest\0325.google.cloud.recaptchaenterpr" - + "ise.v1.ListKeysResponse\"$\202\323\344\223\002\036\022\034/v1/{pa" - + "rent=projects/*}/keys\022\214\001\n\006GetKey\0222.googl" - + "e.cloud.recaptchaenterprise.v1.GetKeyReq" - + "uest\032(.google.cloud.recaptchaenterprise." - + "v1.Key\"$\202\323\344\223\002\036\022\034/v1/{name=projects/*/key" - + "s/*}\022\233\001\n\tUpdateKey\0225.google.cloud.recapt" - + "chaenterprise.v1.UpdateKeyRequest\032(.goog" - + "le.cloud.recaptchaenterprise.v1.Key\"-\202\323\344" - + "\223\002\'2 /v1/{key.name=projects/*/keys/*}:\003k" - + "ey\022\200\001\n\tDeleteKey\0225.google.cloud.recaptch" - + "aenterprise.v1.DeleteKeyRequest\032\026.google" - + ".protobuf.Empty\"$\202\323\344\223\002\036*\034/v1/{name=proje" - + "cts/*/keys/*}\032V\312A\"recaptchaenterprise.go" - + "ogleapis.com\322A.https://www.googleapis.co" - + "m/auth/cloud-platformB\223\002\n!com.google.rec" - + "aptchaenterprise.v1B\030RecaptchaEnterprise" - + "ProtoP\001ZVgoogle.golang.org/genproto/goog" - + "leapis/cloud/recaptchaenterprise/v1;reca" - + "ptchaenterprise\242\002\004GCRE\252\002#Google.Cloud.Re" - + "captchaEnterprise.V1\312\002#Google\\Cloud\\Reca" - + "ptchaEnterprise\\V1\352\002&Google::Cloud::Reca" - + "ptchaEnterprise::V1b\006proto3" + + "tings\"\350\001\n\016TestingOptions\022\025\n\rtesting_scor" + + "e\030\001 \001(\002\022_\n\021testing_challenge\030\002 \001(\0162D.goo" + + "gle.cloud.recaptchaenterprise.v1.Testing" + + "Options.TestingChallenge\"^\n\020TestingChall" + + "enge\022!\n\035TESTING_CHALLENGE_UNSPECIFIED\020\000\022" + + "\r\n\tNOCAPTCHA\020\001\022\030\n\024UNSOLVABLE_CHALLENGE\020\002" + + "\"\225\004\n\016WebKeySettings\022\031\n\021allow_all_domains" + + "\030\003 \001(\010\022\027\n\017allowed_domains\030\001 \003(\t\022\036\n\021allow" + + "_amp_traffic\030\002 \001(\010B\003\340A\002\022b\n\020integration_t" + + "ype\030\004 \001(\0162C.google.cloud.recaptchaenterp" + + "rise.v1.WebKeySettings.IntegrationTypeB\003" + + "\340A\002\022v\n\035challenge_security_preference\030\005 \001" + + "(\0162O.google.cloud.recaptchaenterprise.v1" + + ".WebKeySettings.ChallengeSecurityPrefere" + + "nce\"[\n\017IntegrationType\022 \n\034INTEGRATION_TY" + + "PE_UNSPECIFIED\020\000\022\t\n\005SCORE\020\001\022\014\n\010CHECKBOX\020" + + "\002\022\r\n\tINVISIBLE\020\003\"v\n\033ChallengeSecurityPre" + + "ference\022-\n)CHALLENGE_SECURITY_PREFERENCE" + + "_UNSPECIFIED\020\000\022\r\n\tUSABILITY\020\001\022\013\n\007BALANCE" + + "\020\002\022\014\n\010SECURITY\020\003\"T\n\022AndroidKeySettings\022\037" + + "\n\027allow_all_package_names\030\002 \001(\010\022\035\n\025allow" + + "ed_package_names\030\001 \003(\t\"J\n\016IOSKeySettings" + + "\022\034\n\024allow_all_bundle_ids\030\002 \001(\010\022\032\n\022allowe" + + "d_bundle_ids\030\001 \003(\t\"\251\001\n\021ScoreDistribution" + + "\022_\n\rscore_buckets\030\001 \003(\0132H.google.cloud.r" + + "ecaptchaenterprise.v1.ScoreDistribution." + + "ScoreBucketsEntry\0323\n\021ScoreBucketsEntry\022\013" + + "\n\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\003:\0028\001\"\253\002\n\014Score" + + "Metrics\022O\n\017overall_metrics\030\001 \001(\01326.googl" + + "e.cloud.recaptchaenterprise.v1.ScoreDist" + + "ribution\022\\\n\016action_metrics\030\002 \003(\0132D.googl" + + "e.cloud.recaptchaenterprise.v1.ScoreMetr" + + "ics.ActionMetricsEntry\032l\n\022ActionMetricsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022E\n\005value\030\002 \001(\01326.googl" + + "e.cloud.recaptchaenterprise.v1.ScoreDist" + + "ribution:\0028\001\"o\n\020ChallengeMetrics\022\026\n\016page" + + "load_count\030\001 \001(\003\022\027\n\017nocaptcha_count\030\002 \001(" + + "\003\022\024\n\014failed_count\030\003 \001(\003\022\024\n\014passed_count\030" + + "\004 \001(\0032\336\014\n\032RecaptchaEnterpriseService\022\316\001\n" + + "\020CreateAssessment\022<.google.cloud.recaptc" + + "haenterprise.v1.CreateAssessmentRequest\032" + + "/.google.cloud.recaptchaenterprise.v1.As" + + "sessment\"K\202\323\344\223\0021\"#/v1/{parent=projects/*" + + "}/assessments:\nassessment\332A\021parent,asses" + + "sment\022\340\001\n\022AnnotateAssessment\022>.google.cl" + + "oud.recaptchaenterprise.v1.AnnotateAsses" + + "smentRequest\032?.google.cloud.recaptchaent" + + "erprise.v1.AnnotateAssessmentResponse\"I\202" + + "\323\344\223\0021\",/v1/{name=projects/*/assessments/" + + "*}:annotate:\001*\332A\017name,annotation\022\227\001\n\tCre" + + "ateKey\0225.google.cloud.recaptchaenterpris" + + "e.v1.CreateKeyRequest\032(.google.cloud.rec" + + "aptchaenterprise.v1.Key\")\202\323\344\223\002#\"\034/v1/{pa" + + "rent=projects/*}/keys:\003key\022\235\001\n\010ListKeys\022" + + "4.google.cloud.recaptchaenterprise.v1.Li" + + "stKeysRequest\0325.google.cloud.recaptchaen" + + "terprise.v1.ListKeysResponse\"$\202\323\344\223\002\036\022\034/v" + + "1/{parent=projects/*}/keys\022\214\001\n\006GetKey\0222." + + "google.cloud.recaptchaenterprise.v1.GetK" + + "eyRequest\032(.google.cloud.recaptchaenterp" + + "rise.v1.Key\"$\202\323\344\223\002\036\022\034/v1/{name=projects/" + + "*/keys/*}\022\233\001\n\tUpdateKey\0225.google.cloud.r" + + "ecaptchaenterprise.v1.UpdateKeyRequest\032(" + + ".google.cloud.recaptchaenterprise.v1.Key" + + "\"-\202\323\344\223\002\'2 /v1/{key.name=projects/*/keys/" + + "*}:\003key\022\200\001\n\tDeleteKey\0225.google.cloud.rec" + + "aptchaenterprise.v1.DeleteKeyRequest\032\026.g" + + "oogle.protobuf.Empty\"$\202\323\344\223\002\036*\034/v1/{name=" + + "projects/*/keys/*}\022\237\001\n\nMigrateKey\0226.goog" + + "le.cloud.recaptchaenterprise.v1.MigrateK" + + "eyRequest\032(.google.cloud.recaptchaenterp" + + "rise.v1.Key\"/\202\323\344\223\002)\"$/v1/{name=projects/" + + "*/keys/*}:migrate:\001*\022\247\001\n\nGetMetrics\0226.go" + + "ogle.cloud.recaptchaenterprise.v1.GetMet" + + "ricsRequest\032,.google.cloud.recaptchaente" + + "rprise.v1.Metrics\"3\202\323\344\223\002&\022$/v1/{name=pro" + + "jects/*/keys/*/metrics}\332A\004name\032V\312A\"recap" + + "tchaenterprise.googleapis.com\322A.https://" + + "www.googleapis.com/auth/cloud-platformB\223" + + "\002\n!com.google.recaptchaenterprise.v1B\030Re" + + "captchaEnterpriseProtoP\001ZVgoogle.golang." + + "org/genproto/googleapis/cloud/recaptchae" + + "nterprise/v1;recaptchaenterprise\242\002\004GCRE\252" + + "\002#Google.Cloud.RecaptchaEnterprise.V1\312\002#" + + "Google\\Cloud\\RecaptchaEnterprise\\V1\352\002&Go" + + "ogle::Cloud::RecaptchaEnterprise::V1b\006pr" + + "oto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -271,7 +360,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_AnnotateAssessmentRequest_descriptor, new java.lang.String[] { - "Name", "Annotation", + "Name", "Annotation", "Reasons", }); internal_static_google_cloud_recaptchaenterprise_v1_AnnotateAssessmentResponse_descriptor = getDescriptor().getMessageTypes().get(2); @@ -359,8 +448,32 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", }); - internal_static_google_cloud_recaptchaenterprise_v1_Key_descriptor = + internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_descriptor = getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_MigrateKeyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_GetMetricsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_recaptchaenterprise_v1_Metrics_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_recaptchaenterprise_v1_Metrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_Metrics_descriptor, + new java.lang.String[] { + "Name", "StartTime", "ScoreMetrics", "ChallengeMetrics", + }); + internal_static_google_cloud_recaptchaenterprise_v1_Key_descriptor = + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_recaptchaenterprise_v1_Key_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_Key_descriptor, @@ -372,6 +485,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "IosSettings", "Labels", "CreateTime", + "TestingOptions", "PlatformSettings", }); internal_static_google_cloud_recaptchaenterprise_v1_Key_LabelsEntry_descriptor = @@ -382,8 +496,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_recaptchaenterprise_v1_TestingOptions_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_recaptchaenterprise_v1_TestingOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_TestingOptions_descriptor, + new java.lang.String[] { + "TestingScore", "TestingChallenge", + }); internal_static_google_cloud_recaptchaenterprise_v1_WebKeySettings_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(18); internal_static_google_cloud_recaptchaenterprise_v1_WebKeySettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_WebKeySettings_descriptor, @@ -395,20 +517,64 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ChallengeSecurityPreference", }); internal_static_google_cloud_recaptchaenterprise_v1_AndroidKeySettings_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_recaptchaenterprise_v1_AndroidKeySettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_AndroidKeySettings_descriptor, new java.lang.String[] { - "AllowedPackageNames", + "AllowAllPackageNames", "AllowedPackageNames", }); internal_static_google_cloud_recaptchaenterprise_v1_IOSKeySettings_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_recaptchaenterprise_v1_IOSKeySettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1_IOSKeySettings_descriptor, new java.lang.String[] { - "AllowedBundleIds", + "AllowAllBundleIds", "AllowedBundleIds", + }); + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_descriptor, + new java.lang.String[] { + "ScoreBuckets", + }); + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_ScoreBucketsEntry_descriptor = + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_ScoreBucketsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_ScoreBucketsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_descriptor, + new java.lang.String[] { + "OverallMetrics", "ActionMetrics", + }); + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_ActionMetricsEntry_descriptor = + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_ActionMetricsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_ActionMetricsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1_ChallengeMetrics_descriptor, + new java.lang.String[] { + "PageloadCount", "NocaptchaCount", "FailedCount", "PassedCount", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RiskAnalysis.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RiskAnalysis.java index 17dca315..a0fde04f 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RiskAnalysis.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/RiskAnalysis.java @@ -142,7 +142,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * LINT.IfChange(classification_reason)
    * Reasons contributing to the risk analysis verdict.
    * 
* diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreDistribution.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreDistribution.java new file mode 100644 index 00000000..fb826b6e --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreDistribution.java @@ -0,0 +1,789 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * Score distribution.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.ScoreDistribution} + */ +public final class ScoreDistribution extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.ScoreDistribution) + ScoreDistributionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ScoreDistribution.newBuilder() to construct. + private ScoreDistribution(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ScoreDistribution() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ScoreDistribution(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ScoreDistribution( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + scoreBuckets_ = + com.google.protobuf.MapField.newMapField( + ScoreBucketsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry scoreBuckets__ = + input.readMessage( + ScoreBucketsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + scoreBuckets_.getMutableMap().put(scoreBuckets__.getKey(), scoreBuckets__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetScoreBuckets(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.ScoreDistribution.class, + com.google.recaptchaenterprise.v1.ScoreDistribution.Builder.class); + } + + public static final int SCORE_BUCKETS_FIELD_NUMBER = 1; + + private static final class ScoreBucketsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_ScoreBucketsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT64, + 0L); + } + + private com.google.protobuf.MapField scoreBuckets_; + + private com.google.protobuf.MapField + internalGetScoreBuckets() { + if (scoreBuckets_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScoreBucketsDefaultEntryHolder.defaultEntry); + } + return scoreBuckets_; + } + + public int getScoreBucketsCount() { + return internalGetScoreBuckets().getMap().size(); + } + /** + * + * + *
+   * Map key is score value multiplied by 100. The scores are discrete values
+   * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+   * but typically much lower (ie. 10).
+   * 
+ * + * map<int32, int64> score_buckets = 1; + */ + @java.lang.Override + public boolean containsScoreBuckets(int key) { + + return internalGetScoreBuckets().getMap().containsKey(key); + } + /** Use {@link #getScoreBucketsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScoreBuckets() { + return getScoreBucketsMap(); + } + /** + * + * + *
+   * Map key is score value multiplied by 100. The scores are discrete values
+   * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+   * but typically much lower (ie. 10).
+   * 
+ * + * map<int32, int64> score_buckets = 1; + */ + @java.lang.Override + public java.util.Map getScoreBucketsMap() { + return internalGetScoreBuckets().getMap(); + } + /** + * + * + *
+   * Map key is score value multiplied by 100. The scores are discrete values
+   * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+   * but typically much lower (ie. 10).
+   * 
+ * + * map<int32, int64> score_buckets = 1; + */ + @java.lang.Override + public long getScoreBucketsOrDefault(int key, long defaultValue) { + + java.util.Map map = internalGetScoreBuckets().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Map key is score value multiplied by 100. The scores are discrete values
+   * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+   * but typically much lower (ie. 10).
+   * 
+ * + * map<int32, int64> score_buckets = 1; + */ + @java.lang.Override + public long getScoreBucketsOrThrow(int key) { + + java.util.Map map = internalGetScoreBuckets().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 { + com.google.protobuf.GeneratedMessageV3.serializeIntegerMapTo( + output, internalGetScoreBuckets(), ScoreBucketsDefaultEntryHolder.defaultEntry, 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetScoreBuckets().getMap().entrySet()) { + com.google.protobuf.MapEntry scoreBuckets__ = + ScoreBucketsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, scoreBuckets__); + } + size += unknownFields.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.ScoreDistribution)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.ScoreDistribution other = + (com.google.recaptchaenterprise.v1.ScoreDistribution) obj; + + if (!internalGetScoreBuckets().equals(other.internalGetScoreBuckets())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetScoreBuckets().getMap().isEmpty()) { + hash = (37 * hash) + SCORE_BUCKETS_FIELD_NUMBER; + hash = (53 * hash) + internalGetScoreBuckets().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.ScoreDistribution parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ScoreDistribution 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.ScoreDistribution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ScoreDistribution 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.ScoreDistribution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ScoreDistribution parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.ScoreDistribution parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ScoreDistribution 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.ScoreDistribution parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ScoreDistribution 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.ScoreDistribution parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ScoreDistribution 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.ScoreDistribution 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; + } + /** + * + * + *
+   * Score distribution.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.ScoreDistribution} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.ScoreDistribution) + com.google.recaptchaenterprise.v1.ScoreDistributionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetScoreBuckets(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableScoreBuckets(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreDistribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.ScoreDistribution.class, + com.google.recaptchaenterprise.v1.ScoreDistribution.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.ScoreDistribution.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableScoreBuckets().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_ScoreDistribution_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreDistribution getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.ScoreDistribution.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreDistribution build() { + com.google.recaptchaenterprise.v1.ScoreDistribution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreDistribution buildPartial() { + com.google.recaptchaenterprise.v1.ScoreDistribution result = + new com.google.recaptchaenterprise.v1.ScoreDistribution(this); + int from_bitField0_ = bitField0_; + result.scoreBuckets_ = internalGetScoreBuckets(); + result.scoreBuckets_.makeImmutable(); + 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.ScoreDistribution) { + return mergeFrom((com.google.recaptchaenterprise.v1.ScoreDistribution) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.ScoreDistribution other) { + if (other == com.google.recaptchaenterprise.v1.ScoreDistribution.getDefaultInstance()) + return this; + internalGetMutableScoreBuckets().mergeFrom(other.internalGetScoreBuckets()); + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.recaptchaenterprise.v1.ScoreDistribution parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1.ScoreDistribution) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField scoreBuckets_; + + private com.google.protobuf.MapField + internalGetScoreBuckets() { + if (scoreBuckets_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScoreBucketsDefaultEntryHolder.defaultEntry); + } + return scoreBuckets_; + } + + private com.google.protobuf.MapField + internalGetMutableScoreBuckets() { + onChanged(); + ; + if (scoreBuckets_ == null) { + scoreBuckets_ = + com.google.protobuf.MapField.newMapField(ScoreBucketsDefaultEntryHolder.defaultEntry); + } + if (!scoreBuckets_.isMutable()) { + scoreBuckets_ = scoreBuckets_.copy(); + } + return scoreBuckets_; + } + + public int getScoreBucketsCount() { + return internalGetScoreBuckets().getMap().size(); + } + /** + * + * + *
+     * Map key is score value multiplied by 100. The scores are discrete values
+     * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+     * but typically much lower (ie. 10).
+     * 
+ * + * map<int32, int64> score_buckets = 1; + */ + @java.lang.Override + public boolean containsScoreBuckets(int key) { + + return internalGetScoreBuckets().getMap().containsKey(key); + } + /** Use {@link #getScoreBucketsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScoreBuckets() { + return getScoreBucketsMap(); + } + /** + * + * + *
+     * Map key is score value multiplied by 100. The scores are discrete values
+     * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+     * but typically much lower (ie. 10).
+     * 
+ * + * map<int32, int64> score_buckets = 1; + */ + @java.lang.Override + public java.util.Map getScoreBucketsMap() { + return internalGetScoreBuckets().getMap(); + } + /** + * + * + *
+     * Map key is score value multiplied by 100. The scores are discrete values
+     * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+     * but typically much lower (ie. 10).
+     * 
+ * + * map<int32, int64> score_buckets = 1; + */ + @java.lang.Override + public long getScoreBucketsOrDefault(int key, long defaultValue) { + + java.util.Map map = internalGetScoreBuckets().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Map key is score value multiplied by 100. The scores are discrete values
+     * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+     * but typically much lower (ie. 10).
+     * 
+ * + * map<int32, int64> score_buckets = 1; + */ + @java.lang.Override + public long getScoreBucketsOrThrow(int key) { + + java.util.Map map = internalGetScoreBuckets().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearScoreBuckets() { + internalGetMutableScoreBuckets().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Map key is score value multiplied by 100. The scores are discrete values
+     * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+     * but typically much lower (ie. 10).
+     * 
+ * + * map<int32, int64> score_buckets = 1; + */ + public Builder removeScoreBuckets(int key) { + + internalGetMutableScoreBuckets().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableScoreBuckets() { + return internalGetMutableScoreBuckets().getMutableMap(); + } + /** + * + * + *
+     * Map key is score value multiplied by 100. The scores are discrete values
+     * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+     * but typically much lower (ie. 10).
+     * 
+ * + * map<int32, int64> score_buckets = 1; + */ + public Builder putScoreBuckets(int key, long value) { + + internalGetMutableScoreBuckets().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Map key is score value multiplied by 100. The scores are discrete values
+     * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+     * but typically much lower (ie. 10).
+     * 
+ * + * map<int32, int64> score_buckets = 1; + */ + public Builder putAllScoreBuckets(java.util.Map values) { + internalGetMutableScoreBuckets().getMutableMap().putAll(values); + 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.ScoreDistribution) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.ScoreDistribution) + private static final com.google.recaptchaenterprise.v1.ScoreDistribution DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.ScoreDistribution(); + } + + public static com.google.recaptchaenterprise.v1.ScoreDistribution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScoreDistribution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScoreDistribution(input, extensionRegistry); + } + }; + + 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.ScoreDistribution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreDistributionOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreDistributionOrBuilder.java new file mode 100644 index 00000000..a8342ccd --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreDistributionOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +public interface ScoreDistributionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.ScoreDistribution) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Map key is score value multiplied by 100. The scores are discrete values
+   * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+   * but typically much lower (ie. 10).
+   * 
+ * + * map<int32, int64> score_buckets = 1; + */ + int getScoreBucketsCount(); + /** + * + * + *
+   * Map key is score value multiplied by 100. The scores are discrete values
+   * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+   * but typically much lower (ie. 10).
+   * 
+ * + * map<int32, int64> score_buckets = 1; + */ + boolean containsScoreBuckets(int key); + /** Use {@link #getScoreBucketsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getScoreBuckets(); + /** + * + * + *
+   * Map key is score value multiplied by 100. The scores are discrete values
+   * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+   * but typically much lower (ie. 10).
+   * 
+ * + * map<int32, int64> score_buckets = 1; + */ + java.util.Map getScoreBucketsMap(); + /** + * + * + *
+   * Map key is score value multiplied by 100. The scores are discrete values
+   * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+   * but typically much lower (ie. 10).
+   * 
+ * + * map<int32, int64> score_buckets = 1; + */ + long getScoreBucketsOrDefault(int key, long defaultValue); + /** + * + * + *
+   * Map key is score value multiplied by 100. The scores are discrete values
+   * between [0, 1]. The maximum number of buckets is on order of a few dozen,
+   * but typically much lower (ie. 10).
+   * 
+ * + * map<int32, int64> score_buckets = 1; + */ + long getScoreBucketsOrThrow(int key); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreMetrics.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreMetrics.java new file mode 100644 index 00000000..7b906459 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreMetrics.java @@ -0,0 +1,1141 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * Metrics related to scoring.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.ScoreMetrics} + */ +public final class ScoreMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.ScoreMetrics) + ScoreMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ScoreMetrics.newBuilder() to construct. + private ScoreMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ScoreMetrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ScoreMetrics(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ScoreMetrics( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.recaptchaenterprise.v1.ScoreDistribution.Builder subBuilder = null; + if (overallMetrics_ != null) { + subBuilder = overallMetrics_.toBuilder(); + } + overallMetrics_ = + input.readMessage( + com.google.recaptchaenterprise.v1.ScoreDistribution.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(overallMetrics_); + overallMetrics_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + actionMetrics_ = + com.google.protobuf.MapField.newMapField( + ActionMetricsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.recaptchaenterprise.v1.ScoreDistribution> + actionMetrics__ = + input.readMessage( + ActionMetricsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + actionMetrics_ + .getMutableMap() + .put(actionMetrics__.getKey(), actionMetrics__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetActionMetrics(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.ScoreMetrics.class, + com.google.recaptchaenterprise.v1.ScoreMetrics.Builder.class); + } + + public static final int OVERALL_METRICS_FIELD_NUMBER = 1; + private com.google.recaptchaenterprise.v1.ScoreDistribution overallMetrics_; + /** + * + * + *
+   * Aggregated score metrics for all traffic.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + * + * @return Whether the overallMetrics field is set. + */ + @java.lang.Override + public boolean hasOverallMetrics() { + return overallMetrics_ != null; + } + /** + * + * + *
+   * Aggregated score metrics for all traffic.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + * + * @return The overallMetrics. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreDistribution getOverallMetrics() { + return overallMetrics_ == null + ? com.google.recaptchaenterprise.v1.ScoreDistribution.getDefaultInstance() + : overallMetrics_; + } + /** + * + * + *
+   * Aggregated score metrics for all traffic.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreDistributionOrBuilder getOverallMetricsOrBuilder() { + return getOverallMetrics(); + } + + public static final int ACTION_METRICS_FIELD_NUMBER = 2; + + private static final class ActionMetricsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.recaptchaenterprise.v1.ScoreDistribution> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_ActionMetricsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.recaptchaenterprise.v1.ScoreDistribution.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.recaptchaenterprise.v1.ScoreDistribution> + actionMetrics_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.recaptchaenterprise.v1.ScoreDistribution> + internalGetActionMetrics() { + if (actionMetrics_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ActionMetricsDefaultEntryHolder.defaultEntry); + } + return actionMetrics_; + } + + public int getActionMetricsCount() { + return internalGetActionMetrics().getMap().size(); + } + /** + * + * + *
+   * Action-based metrics. The map key is the action name which specified by the
+   * site owners at time of the "execute" client-side call.
+   * Populated only for SCORE keys.
+   * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + @java.lang.Override + public boolean containsActionMetrics(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetActionMetrics().getMap().containsKey(key); + } + /** Use {@link #getActionMetricsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getActionMetrics() { + return getActionMetricsMap(); + } + /** + * + * + *
+   * Action-based metrics. The map key is the action name which specified by the
+   * site owners at time of the "execute" client-side call.
+   * Populated only for SCORE keys.
+   * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + @java.lang.Override + public java.util.Map + getActionMetricsMap() { + return internalGetActionMetrics().getMap(); + } + /** + * + * + *
+   * Action-based metrics. The map key is the action name which specified by the
+   * site owners at time of the "execute" client-side call.
+   * Populated only for SCORE keys.
+   * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreDistribution getActionMetricsOrDefault( + java.lang.String key, com.google.recaptchaenterprise.v1.ScoreDistribution defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetActionMetrics().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Action-based metrics. The map key is the action name which specified by the
+   * site owners at time of the "execute" client-side call.
+   * Populated only for SCORE keys.
+   * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreDistribution getActionMetricsOrThrow( + java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetActionMetrics().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (overallMetrics_ != null) { + output.writeMessage(1, getOverallMetrics()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetActionMetrics(), ActionMetricsDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (overallMetrics_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOverallMetrics()); + } + for (java.util.Map.Entry + entry : internalGetActionMetrics().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.recaptchaenterprise.v1.ScoreDistribution> + actionMetrics__ = + ActionMetricsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, actionMetrics__); + } + size += unknownFields.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.ScoreMetrics)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.ScoreMetrics other = + (com.google.recaptchaenterprise.v1.ScoreMetrics) obj; + + if (hasOverallMetrics() != other.hasOverallMetrics()) return false; + if (hasOverallMetrics()) { + if (!getOverallMetrics().equals(other.getOverallMetrics())) return false; + } + if (!internalGetActionMetrics().equals(other.internalGetActionMetrics())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOverallMetrics()) { + hash = (37 * hash) + OVERALL_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getOverallMetrics().hashCode(); + } + if (!internalGetActionMetrics().getMap().isEmpty()) { + hash = (37 * hash) + ACTION_METRICS_FIELD_NUMBER; + hash = (53 * hash) + internalGetActionMetrics().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.ScoreMetrics parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ScoreMetrics 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.ScoreMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ScoreMetrics 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.ScoreMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.ScoreMetrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.ScoreMetrics parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ScoreMetrics 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.ScoreMetrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ScoreMetrics 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.ScoreMetrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.ScoreMetrics 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.ScoreMetrics 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; + } + /** + * + * + *
+   * Metrics related to scoring.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.ScoreMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.ScoreMetrics) + com.google.recaptchaenterprise.v1.ScoreMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetActionMetrics(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableActionMetrics(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_ScoreMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.ScoreMetrics.class, + com.google.recaptchaenterprise.v1.ScoreMetrics.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.ScoreMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (overallMetricsBuilder_ == null) { + overallMetrics_ = null; + } else { + overallMetrics_ = null; + overallMetricsBuilder_ = null; + } + internalGetMutableActionMetrics().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_ScoreMetrics_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreMetrics getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.ScoreMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreMetrics build() { + com.google.recaptchaenterprise.v1.ScoreMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreMetrics buildPartial() { + com.google.recaptchaenterprise.v1.ScoreMetrics result = + new com.google.recaptchaenterprise.v1.ScoreMetrics(this); + int from_bitField0_ = bitField0_; + if (overallMetricsBuilder_ == null) { + result.overallMetrics_ = overallMetrics_; + } else { + result.overallMetrics_ = overallMetricsBuilder_.build(); + } + result.actionMetrics_ = internalGetActionMetrics(); + result.actionMetrics_.makeImmutable(); + 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.ScoreMetrics) { + return mergeFrom((com.google.recaptchaenterprise.v1.ScoreMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.ScoreMetrics other) { + if (other == com.google.recaptchaenterprise.v1.ScoreMetrics.getDefaultInstance()) return this; + if (other.hasOverallMetrics()) { + mergeOverallMetrics(other.getOverallMetrics()); + } + internalGetMutableActionMetrics().mergeFrom(other.internalGetActionMetrics()); + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.recaptchaenterprise.v1.ScoreMetrics parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.recaptchaenterprise.v1.ScoreMetrics) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.recaptchaenterprise.v1.ScoreDistribution overallMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.ScoreDistribution, + com.google.recaptchaenterprise.v1.ScoreDistribution.Builder, + com.google.recaptchaenterprise.v1.ScoreDistributionOrBuilder> + overallMetricsBuilder_; + /** + * + * + *
+     * Aggregated score metrics for all traffic.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + * + * @return Whether the overallMetrics field is set. + */ + public boolean hasOverallMetrics() { + return overallMetricsBuilder_ != null || overallMetrics_ != null; + } + /** + * + * + *
+     * Aggregated score metrics for all traffic.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + * + * @return The overallMetrics. + */ + public com.google.recaptchaenterprise.v1.ScoreDistribution getOverallMetrics() { + if (overallMetricsBuilder_ == null) { + return overallMetrics_ == null + ? com.google.recaptchaenterprise.v1.ScoreDistribution.getDefaultInstance() + : overallMetrics_; + } else { + return overallMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Aggregated score metrics for all traffic.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + public Builder setOverallMetrics(com.google.recaptchaenterprise.v1.ScoreDistribution value) { + if (overallMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + overallMetrics_ = value; + onChanged(); + } else { + overallMetricsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Aggregated score metrics for all traffic.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + public Builder setOverallMetrics( + com.google.recaptchaenterprise.v1.ScoreDistribution.Builder builderForValue) { + if (overallMetricsBuilder_ == null) { + overallMetrics_ = builderForValue.build(); + onChanged(); + } else { + overallMetricsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Aggregated score metrics for all traffic.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + public Builder mergeOverallMetrics(com.google.recaptchaenterprise.v1.ScoreDistribution value) { + if (overallMetricsBuilder_ == null) { + if (overallMetrics_ != null) { + overallMetrics_ = + com.google.recaptchaenterprise.v1.ScoreDistribution.newBuilder(overallMetrics_) + .mergeFrom(value) + .buildPartial(); + } else { + overallMetrics_ = value; + } + onChanged(); + } else { + overallMetricsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Aggregated score metrics for all traffic.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + public Builder clearOverallMetrics() { + if (overallMetricsBuilder_ == null) { + overallMetrics_ = null; + onChanged(); + } else { + overallMetrics_ = null; + overallMetricsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Aggregated score metrics for all traffic.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + public com.google.recaptchaenterprise.v1.ScoreDistribution.Builder getOverallMetricsBuilder() { + + onChanged(); + return getOverallMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Aggregated score metrics for all traffic.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + public com.google.recaptchaenterprise.v1.ScoreDistributionOrBuilder + getOverallMetricsOrBuilder() { + if (overallMetricsBuilder_ != null) { + return overallMetricsBuilder_.getMessageOrBuilder(); + } else { + return overallMetrics_ == null + ? com.google.recaptchaenterprise.v1.ScoreDistribution.getDefaultInstance() + : overallMetrics_; + } + } + /** + * + * + *
+     * Aggregated score metrics for all traffic.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.ScoreDistribution, + com.google.recaptchaenterprise.v1.ScoreDistribution.Builder, + com.google.recaptchaenterprise.v1.ScoreDistributionOrBuilder> + getOverallMetricsFieldBuilder() { + if (overallMetricsBuilder_ == null) { + overallMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1.ScoreDistribution, + com.google.recaptchaenterprise.v1.ScoreDistribution.Builder, + com.google.recaptchaenterprise.v1.ScoreDistributionOrBuilder>( + getOverallMetrics(), getParentForChildren(), isClean()); + overallMetrics_ = null; + } + return overallMetricsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.recaptchaenterprise.v1.ScoreDistribution> + actionMetrics_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.recaptchaenterprise.v1.ScoreDistribution> + internalGetActionMetrics() { + if (actionMetrics_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ActionMetricsDefaultEntryHolder.defaultEntry); + } + return actionMetrics_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.recaptchaenterprise.v1.ScoreDistribution> + internalGetMutableActionMetrics() { + onChanged(); + ; + if (actionMetrics_ == null) { + actionMetrics_ = + com.google.protobuf.MapField.newMapField(ActionMetricsDefaultEntryHolder.defaultEntry); + } + if (!actionMetrics_.isMutable()) { + actionMetrics_ = actionMetrics_.copy(); + } + return actionMetrics_; + } + + public int getActionMetricsCount() { + return internalGetActionMetrics().getMap().size(); + } + /** + * + * + *
+     * Action-based metrics. The map key is the action name which specified by the
+     * site owners at time of the "execute" client-side call.
+     * Populated only for SCORE keys.
+     * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + @java.lang.Override + public boolean containsActionMetrics(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetActionMetrics().getMap().containsKey(key); + } + /** Use {@link #getActionMetricsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getActionMetrics() { + return getActionMetricsMap(); + } + /** + * + * + *
+     * Action-based metrics. The map key is the action name which specified by the
+     * site owners at time of the "execute" client-side call.
+     * Populated only for SCORE keys.
+     * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + @java.lang.Override + public java.util.Map + getActionMetricsMap() { + return internalGetActionMetrics().getMap(); + } + /** + * + * + *
+     * Action-based metrics. The map key is the action name which specified by the
+     * site owners at time of the "execute" client-side call.
+     * Populated only for SCORE keys.
+     * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreDistribution getActionMetricsOrDefault( + java.lang.String key, com.google.recaptchaenterprise.v1.ScoreDistribution defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetActionMetrics().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Action-based metrics. The map key is the action name which specified by the
+     * site owners at time of the "execute" client-side call.
+     * Populated only for SCORE keys.
+     * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.ScoreDistribution getActionMetricsOrThrow( + java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetActionMetrics().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearActionMetrics() { + internalGetMutableActionMetrics().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Action-based metrics. The map key is the action name which specified by the
+     * site owners at time of the "execute" client-side call.
+     * Populated only for SCORE keys.
+     * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + public Builder removeActionMetrics(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableActionMetrics().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableActionMetrics() { + return internalGetMutableActionMetrics().getMutableMap(); + } + /** + * + * + *
+     * Action-based metrics. The map key is the action name which specified by the
+     * site owners at time of the "execute" client-side call.
+     * Populated only for SCORE keys.
+     * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + public Builder putActionMetrics( + java.lang.String key, com.google.recaptchaenterprise.v1.ScoreDistribution value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableActionMetrics().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Action-based metrics. The map key is the action name which specified by the
+     * site owners at time of the "execute" client-side call.
+     * Populated only for SCORE keys.
+     * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + public Builder putAllActionMetrics( + java.util.Map + values) { + internalGetMutableActionMetrics().getMutableMap().putAll(values); + 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.ScoreMetrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.ScoreMetrics) + private static final com.google.recaptchaenterprise.v1.ScoreMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.ScoreMetrics(); + } + + public static com.google.recaptchaenterprise.v1.ScoreMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScoreMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScoreMetrics(input, extensionRegistry); + } + }; + + 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.ScoreMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreMetricsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreMetricsOrBuilder.java new file mode 100644 index 00000000..88875c8f --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/ScoreMetricsOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +public interface ScoreMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.ScoreMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Aggregated score metrics for all traffic.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + * + * @return Whether the overallMetrics field is set. + */ + boolean hasOverallMetrics(); + /** + * + * + *
+   * Aggregated score metrics for all traffic.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + * + * @return The overallMetrics. + */ + com.google.recaptchaenterprise.v1.ScoreDistribution getOverallMetrics(); + /** + * + * + *
+   * Aggregated score metrics for all traffic.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1.ScoreDistribution overall_metrics = 1; + */ + com.google.recaptchaenterprise.v1.ScoreDistributionOrBuilder getOverallMetricsOrBuilder(); + + /** + * + * + *
+   * Action-based metrics. The map key is the action name which specified by the
+   * site owners at time of the "execute" client-side call.
+   * Populated only for SCORE keys.
+   * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + int getActionMetricsCount(); + /** + * + * + *
+   * Action-based metrics. The map key is the action name which specified by the
+   * site owners at time of the "execute" client-side call.
+   * Populated only for SCORE keys.
+   * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + boolean containsActionMetrics(java.lang.String key); + /** Use {@link #getActionMetricsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getActionMetrics(); + /** + * + * + *
+   * Action-based metrics. The map key is the action name which specified by the
+   * site owners at time of the "execute" client-side call.
+   * Populated only for SCORE keys.
+   * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + java.util.Map + getActionMetricsMap(); + /** + * + * + *
+   * Action-based metrics. The map key is the action name which specified by the
+   * site owners at time of the "execute" client-side call.
+   * Populated only for SCORE keys.
+   * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + com.google.recaptchaenterprise.v1.ScoreDistribution getActionMetricsOrDefault( + java.lang.String key, com.google.recaptchaenterprise.v1.ScoreDistribution defaultValue); + /** + * + * + *
+   * Action-based metrics. The map key is the action name which specified by the
+   * site owners at time of the "execute" client-side call.
+   * Populated only for SCORE keys.
+   * 
+ * + * + * map<string, .google.cloud.recaptchaenterprise.v1.ScoreDistribution> action_metrics = 2; + * + */ + com.google.recaptchaenterprise.v1.ScoreDistribution getActionMetricsOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TestingOptions.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TestingOptions.java new file mode 100644 index 00000000..535bdf99 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TestingOptions.java @@ -0,0 +1,908 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +/** + * + * + *
+ * Options for user acceptance testing.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.TestingOptions} + */ +public final class TestingOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1.TestingOptions) + TestingOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TestingOptions.newBuilder() to construct. + private TestingOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TestingOptions() { + testingChallenge_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TestingOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TestingOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + testingScore_ = input.readFloat(); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + testingChallenge_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_TestingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_TestingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.TestingOptions.class, + com.google.recaptchaenterprise.v1.TestingOptions.Builder.class); + } + + /** + * + * + *
+   * Enum that represents the challenge option for challenge-based (CHECKBOX,
+   * INVISIBLE) testing keys.
+   * 
+ * + * Protobuf enum {@code google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge} + */ + public enum TestingChallenge implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Perform the normal risk analysis and return either nocaptcha or a
+     * challenge depending on risk and trust factors.
+     * 
+ * + * TESTING_CHALLENGE_UNSPECIFIED = 0; + */ + TESTING_CHALLENGE_UNSPECIFIED(0), + /** + * + * + *
+     * Challenge requests for this key will always return a nocaptcha, which
+     * does not require a solution.
+     * 
+ * + * NOCAPTCHA = 1; + */ + NOCAPTCHA(1), + /** + * + * + *
+     * Challenge requests for this key will always return an unsolvable
+     * challenge.
+     * 
+ * + * UNSOLVABLE_CHALLENGE = 2; + */ + UNSOLVABLE_CHALLENGE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Perform the normal risk analysis and return either nocaptcha or a
+     * challenge depending on risk and trust factors.
+     * 
+ * + * TESTING_CHALLENGE_UNSPECIFIED = 0; + */ + public static final int TESTING_CHALLENGE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Challenge requests for this key will always return a nocaptcha, which
+     * does not require a solution.
+     * 
+ * + * NOCAPTCHA = 1; + */ + public static final int NOCAPTCHA_VALUE = 1; + /** + * + * + *
+     * Challenge requests for this key will always return an unsolvable
+     * challenge.
+     * 
+ * + * UNSOLVABLE_CHALLENGE = 2; + */ + public static final int UNSOLVABLE_CHALLENGE_VALUE = 2; + + 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 TestingChallenge 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 TestingChallenge forNumber(int value) { + switch (value) { + case 0: + return TESTING_CHALLENGE_UNSPECIFIED; + case 1: + return NOCAPTCHA; + case 2: + return UNSOLVABLE_CHALLENGE; + 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 TestingChallenge findValueByNumber(int number) { + return TestingChallenge.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.TestingOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final TestingChallenge[] VALUES = values(); + + public static TestingChallenge 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 TestingChallenge(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge) + } + + public static final int TESTING_SCORE_FIELD_NUMBER = 1; + private float testingScore_; + /** + * + * + *
+   * All assessments for this Key will return this score. Must be between 0
+   * (likely not legitimate) and 1 (likely legitimate) inclusive.
+   * 
+ * + * float testing_score = 1; + * + * @return The testingScore. + */ + @java.lang.Override + public float getTestingScore() { + return testingScore_; + } + + public static final int TESTING_CHALLENGE_FIELD_NUMBER = 2; + private int testingChallenge_; + /** + * + * + *
+   * For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+   * for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+   * challenge if CHALLENGE.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2; + * + * + * @return The enum numeric value on the wire for testingChallenge. + */ + @java.lang.Override + public int getTestingChallengeValue() { + return testingChallenge_; + } + /** + * + * + *
+   * For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+   * for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+   * challenge if CHALLENGE.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2; + * + * + * @return The testingChallenge. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge getTestingChallenge() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge result = + com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge.valueOf( + testingChallenge_); + return result == null + ? com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge.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 (testingScore_ != 0F) { + output.writeFloat(1, testingScore_); + } + if (testingChallenge_ + != com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge + .TESTING_CHALLENGE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, testingChallenge_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (testingScore_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, testingScore_); + } + if (testingChallenge_ + != com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge + .TESTING_CHALLENGE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, testingChallenge_); + } + size += unknownFields.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.TestingOptions)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1.TestingOptions other = + (com.google.recaptchaenterprise.v1.TestingOptions) obj; + + if (java.lang.Float.floatToIntBits(getTestingScore()) + != java.lang.Float.floatToIntBits(other.getTestingScore())) return false; + if (testingChallenge_ != other.testingChallenge_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + TESTING_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getTestingScore()); + hash = (37 * hash) + TESTING_CHALLENGE_FIELD_NUMBER; + hash = (53 * hash) + testingChallenge_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1.TestingOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.TestingOptions 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.TestingOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.TestingOptions 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.TestingOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1.TestingOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1.TestingOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.TestingOptions 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.TestingOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.TestingOptions 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.TestingOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1.TestingOptions 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.TestingOptions 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; + } + /** + * + * + *
+   * Options for user acceptance testing.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1.TestingOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1.TestingOptions) + com.google.recaptchaenterprise.v1.TestingOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_TestingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1_TestingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1.TestingOptions.class, + com.google.recaptchaenterprise.v1.TestingOptions.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1.TestingOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + testingScore_ = 0F; + + testingChallenge_ = 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_TestingOptions_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.TestingOptions getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1.TestingOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.TestingOptions build() { + com.google.recaptchaenterprise.v1.TestingOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1.TestingOptions buildPartial() { + com.google.recaptchaenterprise.v1.TestingOptions result = + new com.google.recaptchaenterprise.v1.TestingOptions(this); + result.testingScore_ = testingScore_; + result.testingChallenge_ = testingChallenge_; + 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.TestingOptions) { + return mergeFrom((com.google.recaptchaenterprise.v1.TestingOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1.TestingOptions other) { + if (other == com.google.recaptchaenterprise.v1.TestingOptions.getDefaultInstance()) + return this; + if (other.getTestingScore() != 0F) { + setTestingScore(other.getTestingScore()); + } + if (other.testingChallenge_ != 0) { + setTestingChallengeValue(other.getTestingChallengeValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.recaptchaenterprise.v1.TestingOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.recaptchaenterprise.v1.TestingOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float testingScore_; + /** + * + * + *
+     * All assessments for this Key will return this score. Must be between 0
+     * (likely not legitimate) and 1 (likely legitimate) inclusive.
+     * 
+ * + * float testing_score = 1; + * + * @return The testingScore. + */ + @java.lang.Override + public float getTestingScore() { + return testingScore_; + } + /** + * + * + *
+     * All assessments for this Key will return this score. Must be between 0
+     * (likely not legitimate) and 1 (likely legitimate) inclusive.
+     * 
+ * + * float testing_score = 1; + * + * @param value The testingScore to set. + * @return This builder for chaining. + */ + public Builder setTestingScore(float value) { + + testingScore_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * All assessments for this Key will return this score. Must be between 0
+     * (likely not legitimate) and 1 (likely legitimate) inclusive.
+     * 
+ * + * float testing_score = 1; + * + * @return This builder for chaining. + */ + public Builder clearTestingScore() { + + testingScore_ = 0F; + onChanged(); + return this; + } + + private int testingChallenge_ = 0; + /** + * + * + *
+     * For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+     * for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+     * challenge if CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2; + * + * + * @return The enum numeric value on the wire for testingChallenge. + */ + @java.lang.Override + public int getTestingChallengeValue() { + return testingChallenge_; + } + /** + * + * + *
+     * For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+     * for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+     * challenge if CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2; + * + * + * @param value The enum numeric value on the wire for testingChallenge to set. + * @return This builder for chaining. + */ + public Builder setTestingChallengeValue(int value) { + + testingChallenge_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+     * for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+     * challenge if CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2; + * + * + * @return The testingChallenge. + */ + @java.lang.Override + public com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge getTestingChallenge() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge result = + com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge.valueOf( + testingChallenge_); + return result == null + ? com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+     * for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+     * challenge if CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2; + * + * + * @param value The testingChallenge to set. + * @return This builder for chaining. + */ + public Builder setTestingChallenge( + com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge value) { + if (value == null) { + throw new NullPointerException(); + } + + testingChallenge_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+     * for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+     * challenge if CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearTestingChallenge() { + + testingChallenge_ = 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.TestingOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1.TestingOptions) + private static final com.google.recaptchaenterprise.v1.TestingOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1.TestingOptions(); + } + + public static com.google.recaptchaenterprise.v1.TestingOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TestingOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TestingOptions(input, extensionRegistry); + } + }; + + 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.TestingOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TestingOptionsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TestingOptionsOrBuilder.java new file mode 100644 index 00000000..9d164455 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TestingOptionsOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2020 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 + +package com.google.recaptchaenterprise.v1; + +public interface TestingOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1.TestingOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All assessments for this Key will return this score. Must be between 0
+   * (likely not legitimate) and 1 (likely legitimate) inclusive.
+   * 
+ * + * float testing_score = 1; + * + * @return The testingScore. + */ + float getTestingScore(); + + /** + * + * + *
+   * For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+   * for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+   * challenge if CHALLENGE.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2; + * + * + * @return The enum numeric value on the wire for testingChallenge. + */ + int getTestingChallengeValue(); + /** + * + * + *
+   * For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
+   * for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
+   * challenge if CHALLENGE.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge testing_challenge = 2; + * + * + * @return The testingChallenge. + */ + com.google.recaptchaenterprise.v1.TestingOptions.TestingChallenge getTestingChallenge(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TokenProperties.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TokenProperties.java index 5917d364..19ee001e 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TokenProperties.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/TokenProperties.java @@ -143,7 +143,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * LINT.IfChange
    * Enum that represents the types of invalid token reasons.
    * 
* @@ -210,6 +209,17 @@ public enum InvalidReason implements com.google.protobuf.ProtocolMessageEnum { * MISSING = 5; */ MISSING(5), + /** + * + * + *
+     * A retriable error (such as network failure) occurred on the browser.
+     * Could easily be simulated by an attacker.
+     * 
+ * + * BROWSER_ERROR = 6; + */ + BROWSER_ERROR(6), UNRECOGNIZED(-1), ; @@ -273,6 +283,17 @@ public enum InvalidReason implements com.google.protobuf.ProtocolMessageEnum { * MISSING = 5; */ public static final int MISSING_VALUE = 5; + /** + * + * + *
+     * A retriable error (such as network failure) occurred on the browser.
+     * Could easily be simulated by an attacker.
+     * 
+ * + * BROWSER_ERROR = 6; + */ + public static final int BROWSER_ERROR_VALUE = 6; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -310,6 +331,8 @@ public static InvalidReason forNumber(int value) { return DUPE; case 5: return MISSING; + case 6: + return BROWSER_ERROR; default: return null; } diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/UpdateKeyRequest.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/UpdateKeyRequest.java index ec2db47e..ae538e68 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/UpdateKeyRequest.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/UpdateKeyRequest.java @@ -191,7 +191,7 @@ public com.google.recaptchaenterprise.v1.KeyOrBuilder getKeyOrBuilder() { * * *
-   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * Optional. The mask to control which fields of the key get updated. If the mask is not
    * present, all fields will be updated.
    * 
* @@ -208,7 +208,7 @@ public boolean hasUpdateMask() { * * *
-   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * Optional. The mask to control which fields of the key get updated. If the mask is not
    * present, all fields will be updated.
    * 
* @@ -225,7 +225,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
-   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * Optional. The mask to control which fields of the key get updated. If the mask is not
    * present, all fields will be updated.
    * 
* @@ -804,7 +804,7 @@ public com.google.recaptchaenterprise.v1.KeyOrBuilder getKeyOrBuilder() { * * *
-     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * Optional. The mask to control which fields of the key get updated. If the mask is not
      * present, all fields will be updated.
      * 
* @@ -820,7 +820,7 @@ public boolean hasUpdateMask() { * * *
-     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * Optional. The mask to control which fields of the key get updated. If the mask is not
      * present, all fields will be updated.
      * 
* @@ -842,7 +842,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
-     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * Optional. The mask to control which fields of the key get updated. If the mask is not
      * present, all fields will be updated.
      * 
* @@ -866,7 +866,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * * *
-     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * Optional. The mask to control which fields of the key get updated. If the mask is not
      * present, all fields will be updated.
      * 
* @@ -887,7 +887,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * * *
-     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * Optional. The mask to control which fields of the key get updated. If the mask is not
      * present, all fields will be updated.
      * 
* @@ -913,7 +913,7 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * * *
-     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * Optional. The mask to control which fields of the key get updated. If the mask is not
      * present, all fields will be updated.
      * 
* @@ -935,7 +935,7 @@ public Builder clearUpdateMask() { * * *
-     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * Optional. The mask to control which fields of the key get updated. If the mask is not
      * present, all fields will be updated.
      * 
* @@ -951,7 +951,7 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * * *
-     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * Optional. The mask to control which fields of the key get updated. If the mask is not
      * present, all fields will be updated.
      * 
* @@ -971,7 +971,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * * *
-     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * Optional. The mask to control which fields of the key get updated. If the mask is not
      * present, all fields will be updated.
      * 
* diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/UpdateKeyRequestOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/UpdateKeyRequestOrBuilder.java index 8f2df713..0dcf968c 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/UpdateKeyRequestOrBuilder.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/UpdateKeyRequestOrBuilder.java @@ -68,7 +68,7 @@ public interface UpdateKeyRequestOrBuilder * * *
-   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * Optional. The mask to control which fields of the key get updated. If the mask is not
    * present, all fields will be updated.
    * 
* @@ -82,7 +82,7 @@ public interface UpdateKeyRequestOrBuilder * * *
-   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * Optional. The mask to control which fields of the key get updated. If the mask is not
    * present, all fields will be updated.
    * 
* @@ -96,7 +96,7 @@ public interface UpdateKeyRequestOrBuilder * * *
-   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * Optional. The mask to control which fields of the key get updated. If the mask is not
    * present, all fields will be updated.
    * 
* diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WebKeySettings.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WebKeySettings.java index 9919bc58..0f72381b 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WebKeySettings.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WebKeySettings.java @@ -617,6 +617,7 @@ public com.google.protobuf.ByteString getAllowedDomainsBytes(int index) { * *
    * Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+   * This can only be set for the SCORE integration type.
    * 
* * bool allow_amp_traffic = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1381,6 +1382,7 @@ public Builder addAllowedDomainsBytes(com.google.protobuf.ByteString value) { * *
      * Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+     * This can only be set for the SCORE integration type.
      * 
* * bool allow_amp_traffic = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1396,6 +1398,7 @@ public boolean getAllowAmpTraffic() { * *
      * Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+     * This can only be set for the SCORE integration type.
      * 
* * bool allow_amp_traffic = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1414,6 +1417,7 @@ public Builder setAllowAmpTraffic(boolean value) { * *
      * Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+     * This can only be set for the SCORE integration type.
      * 
* * bool allow_amp_traffic = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WebKeySettingsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WebKeySettingsOrBuilder.java index 8e30cb2e..00f928f1 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WebKeySettingsOrBuilder.java +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/java/com/google/recaptchaenterprise/v1/WebKeySettingsOrBuilder.java @@ -104,6 +104,7 @@ public interface WebKeySettingsOrBuilder * *
    * Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+   * This can only be set for the SCORE integration type.
    * 
* * bool allow_amp_traffic = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-recaptchaenterprise-v1/src/main/proto/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/proto-google-cloud-recaptchaenterprise-v1/src/main/proto/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 9b60fcef..c28fbde7 100644 --- a/proto-google-cloud-recaptchaenterprise-v1/src/main/proto/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/proto-google-cloud-recaptchaenterprise-v1/src/main/proto/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ service RecaptchaEnterpriseService { } // Annotates a previously created Assessment to provide additional information - // on whether the event turned out to be authentic or fradulent. + // on whether the event turned out to be authentic or fraudulent. rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/assessments/*}:annotate" @@ -93,6 +93,28 @@ service RecaptchaEnterpriseService { delete: "/v1/{name=projects/*/keys/*}" }; } + + // Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. + // Once a key is migrated, it can be used from either product. SiteVerify + // requests are billed as CreateAssessment calls. You must be + // authenticated as one of the current owners of the reCAPTCHA Site Key, and + // your user must have the reCAPTCHA Enterprise Admin IAM role in the + // destination project. + rpc MigrateKey(MigrateKeyRequest) returns (Key) { + option (google.api.http) = { + post: "/v1/{name=projects/*/keys/*}:migrate" + body: "*" + }; + } + + // Get some aggregated metrics for a Key. This data can be used to build + // dashboards. + rpc GetMetrics(GetMetricsRequest) returns (Metrics) { + option (google.api.http) = { + get: "/v1/{name=projects/*/keys/*/metrics}" + }; + option (google.api.method_signature) = "name"; + } } // The create assessment request message. @@ -112,7 +134,7 @@ message CreateAssessmentRequest { // The request message to annotate an Assessment. message AnnotateAssessmentRequest { - // Enum that reprensents the types of annotations. + // Enum that represents the types of annotations. enum Annotation { // Default unspecified type. ANNOTATION_UNSPECIFIED = 0; @@ -124,12 +146,47 @@ message AnnotateAssessmentRequest { FRAUDULENT = 2; // Provides information that the event was related to a login event in which - // the user typed the correct password. - PASSWORD_CORRECT = 3; + // the user typed the correct password. Deprecated, prefer indicating + // CORRECT_PASSWORD through the reasons field instead. + PASSWORD_CORRECT = 3 [deprecated = true]; // Provides information that the event was related to a login event in which - // the user typed the incorrect password. - PASSWORD_INCORRECT = 4; + // the user typed the incorrect password. Deprecated, prefer indicating + // INCORRECT_PASSWORD through the reasons field instead. + PASSWORD_INCORRECT = 4 [deprecated = true]; + } + + // Enum that represents potential reasons for annotating an assessment. + enum Reason { + // Default unspecified reason. + REASON_UNSPECIFIED = 0; + + // Indicates a chargeback for fraud was issued for the transaction + // associated with the assessment. + CHARGEBACK = 1; + + // Indicates the transaction associated with the assessment is suspected of + // being fraudulent based on the payment method, billing details, shipping + // address or other transaction information. + PAYMENT_HEURISTICS = 2; + + // Indicates that the user was served a 2FA challenge. An old assessment + // with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been + // overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. + // This is equivalent to `FAILED_TWO_FACTOR`. + INITIATED_TWO_FACTOR = 7; + + // Indicates that the user passed a 2FA challenge. + PASSED_TWO_FACTOR = 3; + + // Indicates that the user failed a 2FA challenge. + FAILED_TWO_FACTOR = 4; + + // Indicates the user provided the correct password. + CORRECT_PASSWORD = 5; + + // Indicates the user provided an incorrect password. + INCORRECT_PASSWORD = 6; } // Required. The resource name of the Assessment, in the format @@ -141,8 +198,13 @@ message AnnotateAssessmentRequest { } ]; - // Required. The annotation that will be assigned to the Event. - Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED]; + // Optional. The annotation that will be assigned to the Event. This field can be left + // empty to provide reasons that apply to an event without concluding whether + // the event is legitimate or fraudulent. + Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional reasons for the annotation that will be assigned to the Event. + repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL]; } // Empty response for AnnotateAssessment. @@ -195,7 +257,6 @@ message Event { // Risk analysis result for an event. message RiskAnalysis { - // LINT.IfChange(classification_reason) // Reasons contributing to the risk analysis verdict. enum ClassificationReason { // Default unspecified type. @@ -229,7 +290,6 @@ message RiskAnalysis { } message TokenProperties { - // LINT.IfChange // Enum that represents the types of invalid token reasons. enum InvalidReason { // Default unspecified type. @@ -249,6 +309,10 @@ message TokenProperties { // The user verification token was not present. MISSING = 5; + + // A retriable error (such as network failure) occurred on the browser. + // Could easily be simulated by an attacker. + BROWSER_ERROR = 6; } // Whether the provided user response token is valid. When valid = false, the @@ -333,7 +397,7 @@ message UpdateKeyRequest { // Required. The key to update. Key key = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The mask to control which field of the key get updated. If the mask is not + // Optional. The mask to control which fields of the key get updated. If the mask is not // present, all fields will be updated. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -350,6 +414,54 @@ message DeleteKeyRequest { ]; } +// The migrate key request message. +message MigrateKeyRequest { + // Required. The name of the key to be migrated, in the format + // "projects/{project}/keys/{key}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; +} + +// The get metrics request message. +message GetMetricsRequest { + // Required. The name of the requested metrics, in the format + // "projects/{project}/keys/{key}/metrics". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Metrics" + } + ]; +} + +// Metrics for a single Key. +message Metrics { + option (google.api.resource) = { + type: "recaptchaenterprise.googleapis.com/Metrics" + pattern: "projects/{project}/keys/{key}/metrics" + }; + + // Output only. The name of the metrics, in the format + // "projects/{project}/keys/{key}/metrics". + string name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Inclusive start time aligned to a day (UTC). + google.protobuf.Timestamp start_time = 1; + + // Metrics will be continuous and in order by dates, and in the granularity + // of day. All Key types should have score-based data. + repeated ScoreMetrics score_metrics = 2; + + // Metrics will be continuous and in order by dates, and in the granularity + // of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have + // challenge-based data. + repeated ChallengeMetrics challenge_metrics = 3; +} + // A key used to identify and configure applications (web and/or mobile) that // use reCAPTCHA Enterprise. message Key { @@ -378,12 +490,43 @@ message Key { IOSKeySettings ios_settings = 5; } - // Optional. See + // See // Creating and managing labels. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + map labels = 6; // The timestamp corresponding to the creation of this Key. google.protobuf.Timestamp create_time = 7; + + // Options for user acceptance testing. + TestingOptions testing_options = 9; +} + +// Options for user acceptance testing. +message TestingOptions { + // Enum that represents the challenge option for challenge-based (CHECKBOX, + // INVISIBLE) testing keys. + enum TestingChallenge { + // Perform the normal risk analysis and return either nocaptcha or a + // challenge depending on risk and trust factors. + TESTING_CHALLENGE_UNSPECIFIED = 0; + + // Challenge requests for this key will always return a nocaptcha, which + // does not require a solution. + NOCAPTCHA = 1; + + // Challenge requests for this key will always return an unsolvable + // challenge. + UNSOLVABLE_CHALLENGE = 2; + } + + // All assessments for this Key will return this score. Must be between 0 + // (likely not legitimate) and 1 (likely legitimate) inclusive. + float testing_score = 1; + + // For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests + // for this site will return nocaptcha if NOCAPTCHA, or an unsolvable + // challenge if CHALLENGE. + TestingChallenge testing_challenge = 2; } // Settings specific to keys that can be used by websites. @@ -434,6 +577,7 @@ message WebKeySettings { repeated string allowed_domains = 1; // Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites. + // This can only be set for the SCORE integration type. bool allow_amp_traffic = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Describes how this key is integrated with the website. @@ -447,6 +591,9 @@ message WebKeySettings { // Settings specific to keys that can be used by Android apps. message AndroidKeySettings { + // If set to true, it means allowed_package_names will not be enforced. + bool allow_all_package_names = 2; + // Android package names of apps allowed to use the key. // Example: 'com.companyname.appname' repeated string allowed_package_names = 1; @@ -454,7 +601,48 @@ message AndroidKeySettings { // Settings specific to keys that can be used by iOS apps. message IOSKeySettings { + // If set to true, it means allowed_bundle_ids will not be enforced. + bool allow_all_bundle_ids = 2; + // iOS bundle ids of apps allowed to use the key. // Example: 'com.companyname.productname.appname' repeated string allowed_bundle_ids = 1; } + +// Score distribution. +message ScoreDistribution { + // Map key is score value multiplied by 100. The scores are discrete values + // between [0, 1]. The maximum number of buckets is on order of a few dozen, + // but typically much lower (ie. 10). + map score_buckets = 1; +} + +// Metrics related to scoring. +message ScoreMetrics { + // Aggregated score metrics for all traffic. + ScoreDistribution overall_metrics = 1; + + // Action-based metrics. The map key is the action name which specified by the + // site owners at time of the "execute" client-side call. + // Populated only for SCORE keys. + map action_metrics = 2; +} + +// Metrics related to challenges. +message ChallengeMetrics { + // Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent + // to a count of pageloads for pages that include reCAPTCHA. + int64 pageload_count = 1; + + // Count of nocaptchas (successful verification without a challenge) issued. + int64 nocaptcha_count = 2; + + // Count of submitted challenge solutions that were incorrect or otherwise + // deemed suspicious such that a subsequent challenge was triggered. + int64 failed_count = 3; + + // Count of nocaptchas (successful verification without a challenge) plus + // submitted challenge solutions that were correct and resulted in + // verification. + int64 passed_count = 4; +}