@@ -50,6 +50,10 @@ class RecaptchaEnterpriseServiceAsyncClient:
5050 )
5151 key_path = staticmethod (RecaptchaEnterpriseServiceClient .key_path )
5252 parse_key_path = staticmethod (RecaptchaEnterpriseServiceClient .parse_key_path )
53+ metrics_path = staticmethod (RecaptchaEnterpriseServiceClient .metrics_path )
54+ parse_metrics_path = staticmethod (
55+ RecaptchaEnterpriseServiceClient .parse_metrics_path
56+ )
5357 common_billing_account_path = staticmethod (
5458 RecaptchaEnterpriseServiceClient .common_billing_account_path
5559 )
@@ -266,7 +270,7 @@ async def annotate_assessment(
266270 ) -> recaptchaenterprise .AnnotateAssessmentResponse :
267271 r"""Annotates a previously created Assessment to provide
268272 additional information on whether the event turned out
269- to be authentic or fradulent .
273+ to be authentic or fraudulent .
270274
271275 Args:
272276 request (:class:`google.cloud.recaptchaenterprise_v1.types.AnnotateAssessmentRequest`):
@@ -281,8 +285,11 @@ async def annotate_assessment(
281285 on the ``request`` instance; if ``request`` is provided, this
282286 should not be set.
283287 annotation (:class:`google.cloud.recaptchaenterprise_v1.types.AnnotateAssessmentRequest.Annotation`):
284- Required. The annotation that will be
285- assigned to the Event.
288+ Optional. The annotation that will be
289+ assigned to the Event. This field can be
290+ left empty to provide reasons that apply
291+ to an event without concluding whether
292+ the event is legitimate or fraudulent.
286293
287294 This corresponds to the ``annotation`` field
288295 on the ``request`` instance; if ``request`` is provided, this
@@ -584,6 +591,131 @@ async def delete_key(
584591 request , retry = retry , timeout = timeout , metadata = metadata ,
585592 )
586593
594+ async def migrate_key (
595+ self ,
596+ request : recaptchaenterprise .MigrateKeyRequest = None ,
597+ * ,
598+ retry : retries .Retry = gapic_v1 .method .DEFAULT ,
599+ timeout : float = None ,
600+ metadata : Sequence [Tuple [str , str ]] = (),
601+ ) -> recaptchaenterprise .Key :
602+ r"""Migrates an existing key from reCAPTCHA to reCAPTCHA
603+ Enterprise. Once a key is migrated, it can be used from
604+ either product. SiteVerify requests are billed as
605+ CreateAssessment calls. You must be authenticated as one
606+ of the current owners of the reCAPTCHA Site Key, and
607+ your user must have the reCAPTCHA Enterprise Admin IAM
608+ role in the destination project.
609+
610+ Args:
611+ request (:class:`google.cloud.recaptchaenterprise_v1.types.MigrateKeyRequest`):
612+ The request object. The migrate key request message.
613+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
614+ should be retried.
615+ timeout (float): The timeout for this request.
616+ metadata (Sequence[Tuple[str, str]]): Strings which should be
617+ sent along with the request as metadata.
618+
619+ Returns:
620+ google.cloud.recaptchaenterprise_v1.types.Key:
621+ A key used to identify and configure
622+ applications (web and/or mobile) that
623+ use reCAPTCHA Enterprise.
624+
625+ """
626+ # Create or coerce a protobuf request object.
627+ request = recaptchaenterprise .MigrateKeyRequest (request )
628+
629+ # Wrap the RPC method; this adds retry and timeout information,
630+ # and friendly error handling.
631+ rpc = gapic_v1 .method_async .wrap_method (
632+ self ._client ._transport .migrate_key ,
633+ default_timeout = None ,
634+ client_info = DEFAULT_CLIENT_INFO ,
635+ )
636+
637+ # Certain fields should be provided within the metadata header;
638+ # add these here.
639+ metadata = tuple (metadata ) + (
640+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
641+ )
642+
643+ # Send the request.
644+ response = await rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
645+
646+ # Done; return the response.
647+ return response
648+
649+ async def get_metrics (
650+ self ,
651+ request : recaptchaenterprise .GetMetricsRequest = None ,
652+ * ,
653+ name : str = None ,
654+ retry : retries .Retry = gapic_v1 .method .DEFAULT ,
655+ timeout : float = None ,
656+ metadata : Sequence [Tuple [str , str ]] = (),
657+ ) -> recaptchaenterprise .Metrics :
658+ r"""Get some aggregated metrics for a Key. This data can
659+ be used to build dashboards.
660+
661+ Args:
662+ request (:class:`google.cloud.recaptchaenterprise_v1.types.GetMetricsRequest`):
663+ The request object. The get metrics request message.
664+ name (:class:`str`):
665+ Required. The name of the requested
666+ metrics, in the format
667+ "projects/{project}/keys/{key}/metrics".
668+
669+ This corresponds to the ``name`` field
670+ on the ``request`` instance; if ``request`` is provided, this
671+ should not be set.
672+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
673+ should be retried.
674+ timeout (float): The timeout for this request.
675+ metadata (Sequence[Tuple[str, str]]): Strings which should be
676+ sent along with the request as metadata.
677+
678+ Returns:
679+ google.cloud.recaptchaenterprise_v1.types.Metrics:
680+ Metrics for a single Key.
681+ """
682+ # Create or coerce a protobuf request object.
683+ # Sanity check: If we got a request object, we should *not* have
684+ # gotten any keyword arguments that map to the request.
685+ has_flattened_params = any ([name ])
686+ if request is not None and has_flattened_params :
687+ raise ValueError (
688+ "If the `request` argument is set, then none of "
689+ "the individual field arguments should be set."
690+ )
691+
692+ request = recaptchaenterprise .GetMetricsRequest (request )
693+
694+ # If we have keyword arguments corresponding to fields on the
695+ # request, apply these.
696+ if name is not None :
697+ request .name = name
698+
699+ # Wrap the RPC method; this adds retry and timeout information,
700+ # and friendly error handling.
701+ rpc = gapic_v1 .method_async .wrap_method (
702+ self ._client ._transport .get_metrics ,
703+ default_timeout = None ,
704+ client_info = DEFAULT_CLIENT_INFO ,
705+ )
706+
707+ # Certain fields should be provided within the metadata header;
708+ # add these here.
709+ metadata = tuple (metadata ) + (
710+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
711+ )
712+
713+ # Send the request.
714+ response = await rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
715+
716+ # Done; return the response.
717+ return response
718+
587719
588720try :
589721 DEFAULT_CLIENT_INFO = gapic_v1 .client_info .ClientInfo (
0 commit comments