3737import com .google .recaptchaenterprise .v1 .CreateKeyRequest ;
3838import com .google .recaptchaenterprise .v1 .DeleteKeyRequest ;
3939import com .google .recaptchaenterprise .v1 .GetKeyRequest ;
40+ import com .google .recaptchaenterprise .v1 .GetMetricsRequest ;
4041import com .google .recaptchaenterprise .v1 .Key ;
4142import com .google .recaptchaenterprise .v1 .ListKeysRequest ;
4243import com .google .recaptchaenterprise .v1 .ListKeysResponse ;
44+ import com .google .recaptchaenterprise .v1 .Metrics ;
45+ import com .google .recaptchaenterprise .v1 .MetricsName ;
46+ import com .google .recaptchaenterprise .v1 .MigrateKeyRequest ;
4347import com .google .recaptchaenterprise .v1 .ProjectName ;
4448import com .google .recaptchaenterprise .v1 .UpdateKeyRequest ;
4549import java .io .IOException ;
@@ -275,7 +279,7 @@ public final UnaryCallable<CreateAssessmentRequest, Assessment> createAssessment
275279 // AUTO-GENERATED DOCUMENTATION AND METHOD.
276280 /**
277281 * Annotates a previously created Assessment to provide additional information on whether the
278- * event turned out to be authentic or fradulent .
282+ * event turned out to be authentic or fraudulent .
279283 *
280284 * <p>Sample code:
281285 *
@@ -292,7 +296,9 @@ public final UnaryCallable<CreateAssessmentRequest, Assessment> createAssessment
292296 *
293297 * @param name Required. The resource name of the Assessment, in the format
294298 * "projects/{project}/assessments/{assessment}".
295- * @param annotation Required. The annotation that will be assigned to the Event.
299+ * @param annotation Optional. The annotation that will be assigned to the Event. This field can
300+ * be left empty to provide reasons that apply to an event without concluding whether the
301+ * event is legitimate or fraudulent.
296302 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
297303 */
298304 public final AnnotateAssessmentResponse annotateAssessment (
@@ -308,7 +314,7 @@ public final AnnotateAssessmentResponse annotateAssessment(
308314 // AUTO-GENERATED DOCUMENTATION AND METHOD.
309315 /**
310316 * Annotates a previously created Assessment to provide additional information on whether the
311- * event turned out to be authentic or fradulent .
317+ * event turned out to be authentic or fraudulent .
312318 *
313319 * <p>Sample code:
314320 *
@@ -325,7 +331,9 @@ public final AnnotateAssessmentResponse annotateAssessment(
325331 *
326332 * @param name Required. The resource name of the Assessment, in the format
327333 * "projects/{project}/assessments/{assessment}".
328- * @param annotation Required. The annotation that will be assigned to the Event.
334+ * @param annotation Optional. The annotation that will be assigned to the Event. This field can
335+ * be left empty to provide reasons that apply to an event without concluding whether the
336+ * event is legitimate or fraudulent.
329337 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
330338 */
331339 public final AnnotateAssessmentResponse annotateAssessment (
@@ -338,7 +346,7 @@ public final AnnotateAssessmentResponse annotateAssessment(
338346 // AUTO-GENERATED DOCUMENTATION AND METHOD.
339347 /**
340348 * Annotates a previously created Assessment to provide additional information on whether the
341- * event turned out to be authentic or fradulent .
349+ * event turned out to be authentic or fraudulent .
342350 *
343351 * <p>Sample code:
344352 *
@@ -348,6 +356,7 @@ public final AnnotateAssessmentResponse annotateAssessment(
348356 * AnnotateAssessmentRequest request =
349357 * AnnotateAssessmentRequest.newBuilder()
350358 * .setName(AssessmentName.of("[PROJECT]", "[ASSESSMENT]").toString())
359+ * .addAllReasons(new ArrayList<AnnotateAssessmentRequest.Reason>())
351360 * .build();
352361 * AnnotateAssessmentResponse response =
353362 * recaptchaEnterpriseServiceClient.annotateAssessment(request);
@@ -364,7 +373,7 @@ public final AnnotateAssessmentResponse annotateAssessment(AnnotateAssessmentReq
364373 // AUTO-GENERATED DOCUMENTATION AND METHOD.
365374 /**
366375 * Annotates a previously created Assessment to provide additional information on whether the
367- * event turned out to be authentic or fradulent .
376+ * event turned out to be authentic or fraudulent .
368377 *
369378 * <p>Sample code:
370379 *
@@ -374,6 +383,7 @@ public final AnnotateAssessmentResponse annotateAssessment(AnnotateAssessmentReq
374383 * AnnotateAssessmentRequest request =
375384 * AnnotateAssessmentRequest.newBuilder()
376385 * .setName(AssessmentName.of("[PROJECT]", "[ASSESSMENT]").toString())
386+ * .addAllReasons(new ArrayList<AnnotateAssessmentRequest.Reason>())
377387 * .build();
378388 * ApiFuture<AnnotateAssessmentResponse> future =
379389 * recaptchaEnterpriseServiceClient.annotateAssessmentCallable().futureCall(request);
@@ -669,6 +679,155 @@ public final UnaryCallable<DeleteKeyRequest, Empty> deleteKeyCallable() {
669679 return stub .deleteKeyCallable ();
670680 }
671681
682+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
683+ /**
684+ * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can
685+ * be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must
686+ * be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must
687+ * have the reCAPTCHA Enterprise Admin IAM role in the destination project.
688+ *
689+ * <p>Sample code:
690+ *
691+ * <pre>{@code
692+ * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
693+ * RecaptchaEnterpriseServiceClient.create()) {
694+ * MigrateKeyRequest request =
695+ * MigrateKeyRequest.newBuilder()
696+ * .setName(KeyName.of("[PROJECT]", "[KEY]").toString())
697+ * .build();
698+ * Key response = recaptchaEnterpriseServiceClient.migrateKey(request);
699+ * }
700+ * }</pre>
701+ *
702+ * @param request The request object containing all of the parameters for the API call.
703+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
704+ */
705+ public final Key migrateKey (MigrateKeyRequest request ) {
706+ return migrateKeyCallable ().call (request );
707+ }
708+
709+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
710+ /**
711+ * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can
712+ * be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must
713+ * be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must
714+ * have the reCAPTCHA Enterprise Admin IAM role in the destination project.
715+ *
716+ * <p>Sample code:
717+ *
718+ * <pre>{@code
719+ * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
720+ * RecaptchaEnterpriseServiceClient.create()) {
721+ * MigrateKeyRequest request =
722+ * MigrateKeyRequest.newBuilder()
723+ * .setName(KeyName.of("[PROJECT]", "[KEY]").toString())
724+ * .build();
725+ * ApiFuture<Key> future =
726+ * recaptchaEnterpriseServiceClient.migrateKeyCallable().futureCall(request);
727+ * // Do something.
728+ * Key response = future.get();
729+ * }
730+ * }</pre>
731+ */
732+ public final UnaryCallable <MigrateKeyRequest , Key > migrateKeyCallable () {
733+ return stub .migrateKeyCallable ();
734+ }
735+
736+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
737+ /**
738+ * Get some aggregated metrics for a Key. This data can be used to build dashboards.
739+ *
740+ * <p>Sample code:
741+ *
742+ * <pre>{@code
743+ * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
744+ * RecaptchaEnterpriseServiceClient.create()) {
745+ * MetricsName name = MetricsName.of("[PROJECT]", "[KEY]");
746+ * Metrics response = recaptchaEnterpriseServiceClient.getMetrics(name);
747+ * }
748+ * }</pre>
749+ *
750+ * @param name Required. The name of the requested metrics, in the format
751+ * "projects/{project}/keys/{key}/metrics".
752+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
753+ */
754+ public final Metrics getMetrics (MetricsName name ) {
755+ GetMetricsRequest request =
756+ GetMetricsRequest .newBuilder ().setName (name == null ? null : name .toString ()).build ();
757+ return getMetrics (request );
758+ }
759+
760+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
761+ /**
762+ * Get some aggregated metrics for a Key. This data can be used to build dashboards.
763+ *
764+ * <p>Sample code:
765+ *
766+ * <pre>{@code
767+ * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
768+ * RecaptchaEnterpriseServiceClient.create()) {
769+ * String name = MetricsName.of("[PROJECT]", "[KEY]").toString();
770+ * Metrics response = recaptchaEnterpriseServiceClient.getMetrics(name);
771+ * }
772+ * }</pre>
773+ *
774+ * @param name Required. The name of the requested metrics, in the format
775+ * "projects/{project}/keys/{key}/metrics".
776+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
777+ */
778+ public final Metrics getMetrics (String name ) {
779+ GetMetricsRequest request = GetMetricsRequest .newBuilder ().setName (name ).build ();
780+ return getMetrics (request );
781+ }
782+
783+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
784+ /**
785+ * Get some aggregated metrics for a Key. This data can be used to build dashboards.
786+ *
787+ * <p>Sample code:
788+ *
789+ * <pre>{@code
790+ * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
791+ * RecaptchaEnterpriseServiceClient.create()) {
792+ * GetMetricsRequest request =
793+ * GetMetricsRequest.newBuilder()
794+ * .setName(MetricsName.of("[PROJECT]", "[KEY]").toString())
795+ * .build();
796+ * Metrics response = recaptchaEnterpriseServiceClient.getMetrics(request);
797+ * }
798+ * }</pre>
799+ *
800+ * @param request The request object containing all of the parameters for the API call.
801+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
802+ */
803+ public final Metrics getMetrics (GetMetricsRequest request ) {
804+ return getMetricsCallable ().call (request );
805+ }
806+
807+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
808+ /**
809+ * Get some aggregated metrics for a Key. This data can be used to build dashboards.
810+ *
811+ * <p>Sample code:
812+ *
813+ * <pre>{@code
814+ * try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
815+ * RecaptchaEnterpriseServiceClient.create()) {
816+ * GetMetricsRequest request =
817+ * GetMetricsRequest.newBuilder()
818+ * .setName(MetricsName.of("[PROJECT]", "[KEY]").toString())
819+ * .build();
820+ * ApiFuture<Metrics> future =
821+ * recaptchaEnterpriseServiceClient.getMetricsCallable().futureCall(request);
822+ * // Do something.
823+ * Metrics response = future.get();
824+ * }
825+ * }</pre>
826+ */
827+ public final UnaryCallable <GetMetricsRequest , Metrics > getMetricsCallable () {
828+ return stub .getMetricsCallable ();
829+ }
830+
672831 @ Override
673832 public final void close () {
674833 stub .close ();
0 commit comments