From 2e8b6f2ee3cf082f89c5f05f5945f262871f8e48 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 8 Dec 2022 12:01:12 -0500 Subject: [PATCH] feat: add account_verification field to Assessment for MFA (#325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: https://github.com/googleapis/googleapis/commit/fea43879f83a8d0dacc9353b3f75f8f46d37162f Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py * add gapic_version.py * feat: add account_verification field to Assessment for MFA PiperOrigin-RevId: 493691493 Source-Link: https://github.com/googleapis/googleapis/commit/c9560d8f8f535936baff1fcda1f12806e38f67b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ec825c8ef9987b67d43dfffab50914e032275d63 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWM4MjVjOGVmOTk4N2I2N2Q0M2RmZmZhYjUwOTE0ZTAzMjI3NWQ2MyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .coveragerc | 5 - google/cloud/recaptchaenterprise/__init__.py | 4 + .../cloud/recaptchaenterprise_v1/__init__.py | 4 + .../recaptchaenterprise_v1/gapic_version.py | 16 ++ .../async_client.py | 40 +++-- .../recaptcha_enterprise_service/client.py | 40 +++-- .../transports/base.py | 13 +- .../recaptchaenterprise_v1/types/__init__.py | 4 + .../types/recaptchaenterprise.py | 149 +++++++++++++++++- release-please-config.json | 1 + .../fixup_recaptchaenterprise_v1_keywords.py | 2 +- setup.py | 2 +- testing/constraints-3.7.txt | 2 +- 13 files changed, 220 insertions(+), 62 deletions(-) create mode 100644 google/cloud/recaptchaenterprise_v1/gapic_version.py diff --git a/.coveragerc b/.coveragerc index f984736..ff080e5 100644 --- a/.coveragerc +++ b/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/google/cloud/recaptchaenterprise/__init__.py b/google/cloud/recaptchaenterprise/__init__.py index 5c67990..662e224 100644 --- a/google/cloud/recaptchaenterprise/__init__.py +++ b/google/cloud/recaptchaenterprise/__init__.py @@ -26,6 +26,7 @@ ) from google.cloud.recaptchaenterprise_v1.types.recaptchaenterprise import ( AccountDefenderAssessment, + AccountVerificationInfo, AndroidKeySettings, AnnotateAssessmentRequest, AnnotateAssessmentResponse, @@ -34,6 +35,7 @@ CreateAssessmentRequest, CreateKeyRequest, DeleteKeyRequest, + EndpointVerificationInfo, Event, GetKeyRequest, GetMetricsRequest, @@ -68,6 +70,7 @@ "RecaptchaEnterpriseServiceClient", "RecaptchaEnterpriseServiceAsyncClient", "AccountDefenderAssessment", + "AccountVerificationInfo", "AndroidKeySettings", "AnnotateAssessmentRequest", "AnnotateAssessmentResponse", @@ -76,6 +79,7 @@ "CreateAssessmentRequest", "CreateKeyRequest", "DeleteKeyRequest", + "EndpointVerificationInfo", "Event", "GetKeyRequest", "GetMetricsRequest", diff --git a/google/cloud/recaptchaenterprise_v1/__init__.py b/google/cloud/recaptchaenterprise_v1/__init__.py index 9dee73f..bbbf409 100644 --- a/google/cloud/recaptchaenterprise_v1/__init__.py +++ b/google/cloud/recaptchaenterprise_v1/__init__.py @@ -24,6 +24,7 @@ ) from .types.recaptchaenterprise import ( AccountDefenderAssessment, + AccountVerificationInfo, AndroidKeySettings, AnnotateAssessmentRequest, AnnotateAssessmentResponse, @@ -32,6 +33,7 @@ CreateAssessmentRequest, CreateKeyRequest, DeleteKeyRequest, + EndpointVerificationInfo, Event, GetKeyRequest, GetMetricsRequest, @@ -65,6 +67,7 @@ __all__ = ( "RecaptchaEnterpriseServiceAsyncClient", "AccountDefenderAssessment", + "AccountVerificationInfo", "AndroidKeySettings", "AnnotateAssessmentRequest", "AnnotateAssessmentResponse", @@ -73,6 +76,7 @@ "CreateAssessmentRequest", "CreateKeyRequest", "DeleteKeyRequest", + "EndpointVerificationInfo", "Event", "GetKeyRequest", "GetMetricsRequest", diff --git a/google/cloud/recaptchaenterprise_v1/gapic_version.py b/google/cloud/recaptchaenterprise_v1/gapic_version.py new file mode 100644 index 0000000..163d151 --- /dev/null +++ b/google/cloud/recaptchaenterprise_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.9.0" # {x-release-please-version} diff --git a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/async_client.py b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/async_client.py index 39533f8..df988c4 100644 --- a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/async_client.py +++ b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.recaptchaenterprise_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -253,7 +254,7 @@ async def create_assessment( parent: Optional[str] = None, assessment: Optional[recaptchaenterprise.Assessment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Assessment: r"""Creates an Assessment of the likelihood an event is @@ -367,7 +368,7 @@ async def annotate_assessment( recaptchaenterprise.AnnotateAssessmentRequest.Annotation ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.AnnotateAssessmentResponse: r"""Annotates a previously created Assessment to provide @@ -483,7 +484,7 @@ async def create_key( request: Optional[Union[recaptchaenterprise.CreateKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Key: r"""Creates a new reCAPTCHA Enterprise key. @@ -567,7 +568,7 @@ async def list_keys( request: Optional[Union[recaptchaenterprise.ListKeysRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListKeysAsyncPager: r"""Returns the list of all keys that belong to a @@ -663,7 +664,7 @@ async def retrieve_legacy_secret_key( *, key: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.RetrieveLegacySecretKeyResponse: r"""Returns the secret key related to the specified @@ -768,7 +769,7 @@ async def get_key( request: Optional[Union[recaptchaenterprise.GetKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Key: r"""Returns the specified key. @@ -848,7 +849,7 @@ async def update_key( request: Optional[Union[recaptchaenterprise.UpdateKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Key: r"""Updates the specified key. @@ -931,7 +932,7 @@ async def delete_key( request: Optional[Union[recaptchaenterprise.DeleteKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified key. @@ -998,7 +999,7 @@ async def migrate_key( request: Optional[Union[recaptchaenterprise.MigrateKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Key: r"""Migrates an existing key from reCAPTCHA to reCAPTCHA @@ -1085,7 +1086,7 @@ async def get_metrics( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Metrics: r"""Get some aggregated metrics for a Key. This data can @@ -1188,7 +1189,7 @@ async def list_related_account_groups( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListRelatedAccountGroupsAsyncPager: r"""List groups of related accounts. @@ -1305,7 +1306,7 @@ async def list_related_account_group_memberships( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListRelatedAccountGroupMembershipsAsyncPager: r"""Get memberships in a group of related accounts. @@ -1424,7 +1425,7 @@ async def search_related_account_group_memberships( project: Optional[str] = None, hashed_account_id: Optional[bytes] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchRelatedAccountGroupMembershipsAsyncPager: r"""Search group memberships related to a given account. @@ -1556,14 +1557,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-recaptcha-enterprise", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("RecaptchaEnterpriseServiceAsyncClient",) diff --git a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/client.py b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/client.py index 150715e..d1d289f 100644 --- a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/client.py +++ b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.recaptchaenterprise_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -526,7 +527,7 @@ def create_assessment( parent: Optional[str] = None, assessment: Optional[recaptchaenterprise.Assessment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Assessment: r"""Creates an Assessment of the likelihood an event is @@ -640,7 +641,7 @@ def annotate_assessment( recaptchaenterprise.AnnotateAssessmentRequest.Annotation ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.AnnotateAssessmentResponse: r"""Annotates a previously created Assessment to provide @@ -756,7 +757,7 @@ def create_key( request: Optional[Union[recaptchaenterprise.CreateKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Key: r"""Creates a new reCAPTCHA Enterprise key. @@ -841,7 +842,7 @@ def list_keys( request: Optional[Union[recaptchaenterprise.ListKeysRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListKeysPager: r"""Returns the list of all keys that belong to a @@ -938,7 +939,7 @@ def retrieve_legacy_secret_key( *, key: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.RetrieveLegacySecretKeyResponse: r"""Returns the secret key related to the specified @@ -1045,7 +1046,7 @@ def get_key( request: Optional[Union[recaptchaenterprise.GetKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Key: r"""Returns the specified key. @@ -1126,7 +1127,7 @@ def update_key( request: Optional[Union[recaptchaenterprise.UpdateKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Key: r"""Updates the specified key. @@ -1210,7 +1211,7 @@ def delete_key( request: Optional[Union[recaptchaenterprise.DeleteKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified key. @@ -1278,7 +1279,7 @@ def migrate_key( request: Optional[Union[recaptchaenterprise.MigrateKeyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Key: r"""Migrates an existing key from reCAPTCHA to reCAPTCHA @@ -1366,7 +1367,7 @@ def get_metrics( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> recaptchaenterprise.Metrics: r"""Get some aggregated metrics for a Key. This data can @@ -1469,7 +1470,7 @@ def list_related_account_groups( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListRelatedAccountGroupsPager: r"""List groups of related accounts. @@ -1588,7 +1589,7 @@ def list_related_account_group_memberships( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListRelatedAccountGroupMembershipsPager: r"""Get memberships in a group of related accounts. @@ -1713,7 +1714,7 @@ def search_related_account_group_memberships( project: Optional[str] = None, hashed_account_id: Optional[bytes] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.SearchRelatedAccountGroupMembershipsPager: r"""Search group memberships related to a given account. @@ -1856,14 +1857,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-recaptcha-enterprise", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("RecaptchaEnterpriseServiceClient",) diff --git a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/base.py b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/base.py index a8e86a6..cc07653 100644 --- a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/base.py +++ b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.recaptchaenterprise_v1 import gapic_version as package_version from google.cloud.recaptchaenterprise_v1.types import recaptchaenterprise -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-recaptcha-enterprise", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class RecaptchaEnterpriseServiceTransport(abc.ABC): diff --git a/google/cloud/recaptchaenterprise_v1/types/__init__.py b/google/cloud/recaptchaenterprise_v1/types/__init__.py index 8ace7cf..8e2e277 100644 --- a/google/cloud/recaptchaenterprise_v1/types/__init__.py +++ b/google/cloud/recaptchaenterprise_v1/types/__init__.py @@ -15,6 +15,7 @@ # from .recaptchaenterprise import ( AccountDefenderAssessment, + AccountVerificationInfo, AndroidKeySettings, AnnotateAssessmentRequest, AnnotateAssessmentResponse, @@ -23,6 +24,7 @@ CreateAssessmentRequest, CreateKeyRequest, DeleteKeyRequest, + EndpointVerificationInfo, Event, GetKeyRequest, GetMetricsRequest, @@ -55,6 +57,7 @@ __all__ = ( "AccountDefenderAssessment", + "AccountVerificationInfo", "AndroidKeySettings", "AnnotateAssessmentRequest", "AnnotateAssessmentResponse", @@ -63,6 +66,7 @@ "CreateAssessmentRequest", "CreateKeyRequest", "DeleteKeyRequest", + "EndpointVerificationInfo", "Event", "GetKeyRequest", "GetMetricsRequest", diff --git a/google/cloud/recaptchaenterprise_v1/types/recaptchaenterprise.py b/google/cloud/recaptchaenterprise_v1/types/recaptchaenterprise.py index 7249bec..7c79865 100644 --- a/google/cloud/recaptchaenterprise_v1/types/recaptchaenterprise.py +++ b/google/cloud/recaptchaenterprise_v1/types/recaptchaenterprise.py @@ -25,6 +25,8 @@ "CreateAssessmentRequest", "AnnotateAssessmentRequest", "AnnotateAssessmentResponse", + "EndpointVerificationInfo", + "AccountVerificationInfo", "PrivatePasswordLeakVerification", "Assessment", "Event", @@ -164,6 +166,114 @@ class AnnotateAssessmentResponse(proto.Message): r"""Empty response for AnnotateAssessment.""" +class EndpointVerificationInfo(proto.Message): + r"""Information about a verification endpoint that can be used + for 2FA. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + email_address (str): + Email address for which to trigger a + verification request. + + This field is a member of `oneof`_ ``endpoint``. + phone_number (str): + Phone number for which to trigger a + verification request. Should be given in E.164 + format. + + This field is a member of `oneof`_ ``endpoint``. + request_token (str): + Output only. Token to provide to the client + to trigger endpoint verification. It must be + used within 15 minutes. + last_verification_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Timestamp of the last successful + verification for the endpoint, if any. + """ + + email_address: str = proto.Field( + proto.STRING, + number=1, + oneof="endpoint", + ) + phone_number: str = proto.Field( + proto.STRING, + number=2, + oneof="endpoint", + ) + request_token: str = proto.Field( + proto.STRING, + number=3, + ) + last_verification_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + + +class AccountVerificationInfo(proto.Message): + r"""Information about account verification, used for identity + verification. + + Attributes: + endpoints (MutableSequence[google.cloud.recaptchaenterprise_v1.types.EndpointVerificationInfo]): + Endpoints that can be used for identity + verification. + language_code (str): + Language code preference for the verification + message, set as a IETF BCP 47 language code. + latest_verification_result (google.cloud.recaptchaenterprise_v1.types.AccountVerificationInfo.Result): + Output only. Result of the latest account + verification challenge. + username (str): + Username of the account that is being + verified. Deprecated. Customers should now + provide the hashed account ID field in Event. + """ + + class Result(proto.Enum): + r"""Result of the account verification as contained in the + verdict token issued at the end of the verification flow. + """ + RESULT_UNSPECIFIED = 0 + SUCCESS_USER_VERIFIED = 1 + ERROR_USER_NOT_VERIFIED = 2 + ERROR_SITE_ONBOARDING_INCOMPLETE = 3 + ERROR_RECIPIENT_NOT_ALLOWED = 4 + ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5 + ERROR_CRITICAL_INTERNAL = 6 + ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7 + ERROR_VERIFICATION_BYPASSED = 8 + ERROR_VERDICT_MISMATCH = 9 + + endpoints: MutableSequence["EndpointVerificationInfo"] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="EndpointVerificationInfo", + ) + language_code: str = proto.Field( + proto.STRING, + number=3, + ) + latest_verification_result: Result = proto.Field( + proto.ENUM, + number=7, + enum=Result, + ) + username: str = proto.Field( + proto.STRING, + number=2, + ) + + class PrivatePasswordLeakVerification(proto.Message): r"""Private password leak verification info. @@ -223,6 +333,10 @@ class Assessment(proto.Message): token_properties (google.cloud.recaptchaenterprise_v1.types.TokenProperties): Output only. Properties of the provided event token. + account_verification (google.cloud.recaptchaenterprise_v1.types.AccountVerificationInfo): + Account verification information for identity + verification. The assessment event must include + a token and site key to use this feature. account_defender_assessment (google.cloud.recaptchaenterprise_v1.types.AccountDefenderAssessment): Assessment returned by account defender when a hashed_account_id is provided. @@ -252,6 +366,11 @@ class Assessment(proto.Message): number=4, message="TokenProperties", ) + account_verification: "AccountVerificationInfo" = proto.Field( + proto.MESSAGE, + number=5, + message="AccountVerificationInfo", + ) account_defender_assessment: "AccountDefenderAssessment" = proto.Field( proto.MESSAGE, number=6, @@ -374,6 +493,12 @@ class TokenProperties(proto.Message): hostname (str): The hostname of the page on which the token was generated (Web keys only). + android_package_name (str): + The name of the Android package with which + the token was generated (Android keys only). + ios_bundle_id (str): + The ID of the iOS bundle with which the token + was generated (iOS keys only). action (str): Action name provided at token generation. """ @@ -406,6 +531,14 @@ class InvalidReason(proto.Enum): proto.STRING, number=4, ) + android_package_name: str = proto.Field( + proto.STRING, + number=8, + ) + ios_bundle_id: str = proto.Field( + proto.STRING, + number=9, + ) action: str = proto.Field( proto.STRING, number=5, @@ -592,12 +725,27 @@ class MigrateKeyRequest(proto.Message): name (str): Required. The name of the key to be migrated, in the format "projects/{project}/keys/{key}". + skip_billing_check (bool): + Optional. If true, skips the billing check. A reCAPTCHA + Enterprise key or migrated key behaves differently than a + reCAPTCHA (non-Enterprise version) key when you reach a + quota limit (see + https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). + To avoid any disruption of your usage, we check that a + billing account is present. If your usage of reCAPTCHA is + under the free quota, you can safely skip the billing check + and proceed with the migration. See + https://cloud.google.com/recaptcha-enterprise/docs/billing-information. """ name: str = proto.Field( proto.STRING, number=1, ) + skip_billing_check: bool = proto.Field( + proto.BOOL, + number=2, + ) class GetMetricsRequest(proto.Message): @@ -944,7 +1092,6 @@ class ScoreMetrics(proto.Message): 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. """ overall_metrics: "ScoreDistribution" = proto.Field( diff --git a/release-please-config.json b/release-please-config.json index 89a4e73..09b73ca 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -4,6 +4,7 @@ ".": { "release-type": "python", "extra-files": [ + "google/cloud/recaptchaenterprise_v1/gapic_version.py", "google/cloud/recaptchaenterprise/gapic_version.py", { "type": "json", diff --git a/scripts/fixup_recaptchaenterprise_v1_keywords.py b/scripts/fixup_recaptchaenterprise_v1_keywords.py index a13de26..6fa5ab1 100644 --- a/scripts/fixup_recaptchaenterprise_v1_keywords.py +++ b/scripts/fixup_recaptchaenterprise_v1_keywords.py @@ -48,7 +48,7 @@ class recaptchaenterpriseCallTransformer(cst.CSTTransformer): 'list_keys': ('parent', 'page_size', 'page_token', ), 'list_related_account_group_memberships': ('parent', 'page_size', 'page_token', ), 'list_related_account_groups': ('parent', 'page_size', 'page_token', ), - 'migrate_key': ('name', ), + 'migrate_key': ('name', 'skip_billing_check', ), 'retrieve_legacy_secret_key': ('key', ), 'search_related_account_group_memberships': ('project', 'hashed_account_id', 'page_size', 'page_token', ), 'update_key': ('key', 'update_mask', ), diff --git a/setup.py b/setup.py index 05b5ce7..f887cbb 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", ] diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index 6f3158c..6c44adf 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -4,6 +4,6 @@ # Pin the version to the lower bound. # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.33.2 +google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5