Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

feat: add account_verification field to Assessment for MFA #325

Merged
merged 6 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions google/cloud/recaptchaenterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
)
from google.cloud.recaptchaenterprise_v1.types.recaptchaenterprise import (
AccountDefenderAssessment,
AccountVerificationInfo,
AndroidKeySettings,
AnnotateAssessmentRequest,
AnnotateAssessmentResponse,
Expand All @@ -34,6 +35,7 @@
CreateAssessmentRequest,
CreateKeyRequest,
DeleteKeyRequest,
EndpointVerificationInfo,
Event,
GetKeyRequest,
GetMetricsRequest,
Expand Down Expand Up @@ -68,6 +70,7 @@
"RecaptchaEnterpriseServiceClient",
"RecaptchaEnterpriseServiceAsyncClient",
"AccountDefenderAssessment",
"AccountVerificationInfo",
"AndroidKeySettings",
"AnnotateAssessmentRequest",
"AnnotateAssessmentResponse",
Expand All @@ -76,6 +79,7 @@
"CreateAssessmentRequest",
"CreateKeyRequest",
"DeleteKeyRequest",
"EndpointVerificationInfo",
"Event",
"GetKeyRequest",
"GetMetricsRequest",
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/recaptchaenterprise_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
)
from .types.recaptchaenterprise import (
AccountDefenderAssessment,
AccountVerificationInfo,
AndroidKeySettings,
AnnotateAssessmentRequest,
AnnotateAssessmentResponse,
Expand All @@ -32,6 +33,7 @@
CreateAssessmentRequest,
CreateKeyRequest,
DeleteKeyRequest,
EndpointVerificationInfo,
Event,
GetKeyRequest,
GetMetricsRequest,
Expand Down Expand Up @@ -65,6 +67,7 @@
__all__ = (
"RecaptchaEnterpriseServiceAsyncClient",
"AccountDefenderAssessment",
"AccountVerificationInfo",
"AndroidKeySettings",
"AnnotateAssessmentRequest",
"AnnotateAssessmentResponse",
Expand All @@ -73,6 +76,7 @@
"CreateAssessmentRequest",
"CreateKeyRequest",
"DeleteKeyRequest",
"EndpointVerificationInfo",
"Event",
"GetKeyRequest",
"GetMetricsRequest",
Expand Down
16 changes: 16 additions & 0 deletions google/cloud/recaptchaenterprise_v1/gapic_version.py
Original file line number Diff line number Diff line change
@@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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",)
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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",)
Loading