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

Commit 54613d7

Browse files
docs: Add documentation for enums (#334)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 75624b6 commit 54613d7

File tree

3 files changed

+256
-8
lines changed

3 files changed

+256
-8
lines changed

google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ def sample_search_related_account_group_memberships():
18431843
# Done; return the response.
18441844
return response
18451845

1846-
def __enter__(self):
1846+
def __enter__(self) -> "RecaptchaEnterpriseServiceClient":
18471847
return self
18481848

18491849
def __exit__(self, type, value, traceback):

google/cloud/recaptchaenterprise_v1/types/recaptchaenterprise.py

Lines changed: 254 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,28 @@ class AnnotateAssessmentRequest(proto.Message):
115115
"""
116116

117117
class Annotation(proto.Enum):
118-
r"""Enum that represents the types of annotations."""
118+
r"""Enum that represents the types of annotations.
119+
120+
Values:
121+
ANNOTATION_UNSPECIFIED (0):
122+
Default unspecified type.
123+
LEGITIMATE (1):
124+
Provides information that the event turned
125+
out to be legitimate.
126+
FRAUDULENT (2):
127+
Provides information that the event turned
128+
out to be fraudulent.
129+
PASSWORD_CORRECT (3):
130+
Provides information that the event was related to a login
131+
event in which the user typed the correct password.
132+
Deprecated, prefer indicating CORRECT_PASSWORD through the
133+
reasons field instead.
134+
PASSWORD_INCORRECT (4):
135+
Provides information that the event was related to a login
136+
event in which the user typed the incorrect password.
137+
Deprecated, prefer indicating INCORRECT_PASSWORD through the
138+
reasons field instead.
139+
"""
119140
ANNOTATION_UNSPECIFIED = 0
120141
LEGITIMATE = 1
121142
FRAUDULENT = 2
@@ -125,6 +146,71 @@ class Annotation(proto.Enum):
125146
class Reason(proto.Enum):
126147
r"""Enum that represents potential reasons for annotating an
127148
assessment.
149+
150+
Values:
151+
REASON_UNSPECIFIED (0):
152+
Default unspecified reason.
153+
CHARGEBACK (1):
154+
Indicates that the transaction had a chargeback issued with
155+
no other details. When possible, specify the type by using
156+
CHARGEBACK_FRAUD or CHARGEBACK_DISPUTE instead.
157+
CHARGEBACK_FRAUD (8):
158+
Indicates that the transaction had a
159+
chargeback issued related to an alleged
160+
unauthorized transaction from the cardholder's
161+
perspective (for example, the card number was
162+
stolen).
163+
CHARGEBACK_DISPUTE (9):
164+
Indicates that the transaction had a
165+
chargeback issued related to the cardholder
166+
having provided their card details but allegedly
167+
not being satisfied with the purchase (for
168+
example, misrepresentation, attempted
169+
cancellation).
170+
REFUND (10):
171+
Indicates that the completed payment
172+
transaction was refunded by the seller.
173+
REFUND_FRAUD (11):
174+
Indicates that the completed payment
175+
transaction was determined to be fraudulent by
176+
the seller, and was cancelled and refunded as a
177+
result.
178+
TRANSACTION_ACCEPTED (12):
179+
Indicates that the payment transaction was
180+
accepted, and the user was charged.
181+
TRANSACTION_DECLINED (13):
182+
Indicates that the payment transaction was
183+
declined, for example due to invalid card
184+
details.
185+
PAYMENT_HEURISTICS (2):
186+
Indicates the transaction associated with the
187+
assessment is suspected of being fraudulent
188+
based on the payment method, billing details,
189+
shipping address or other transaction
190+
information.
191+
INITIATED_TWO_FACTOR (7):
192+
Indicates that the user was served a 2FA challenge. An old
193+
assessment with ``ENUM_VALUES.INITIATED_TWO_FACTOR`` reason
194+
that has not been overwritten with ``PASSED_TWO_FACTOR`` is
195+
treated as an abandoned 2FA flow. This is equivalent to
196+
``FAILED_TWO_FACTOR``.
197+
PASSED_TWO_FACTOR (3):
198+
Indicates that the user passed a 2FA
199+
challenge.
200+
FAILED_TWO_FACTOR (4):
201+
Indicates that the user failed a 2FA
202+
challenge.
203+
CORRECT_PASSWORD (5):
204+
Indicates the user provided the correct
205+
password.
206+
INCORRECT_PASSWORD (6):
207+
Indicates the user provided an incorrect
208+
password.
209+
SOCIAL_SPAM (14):
210+
Indicates that the user sent unwanted and
211+
abusive messages to other users of the platform,
212+
such as spam, scams, phishing, or social
213+
engineering.
128214
"""
129215
REASON_UNSPECIFIED = 0
130216
CHARGEBACK = 1
@@ -242,6 +328,42 @@ class AccountVerificationInfo(proto.Message):
242328
class Result(proto.Enum):
243329
r"""Result of the account verification as contained in the
244330
verdict token issued at the end of the verification flow.
331+
332+
Values:
333+
RESULT_UNSPECIFIED (0):
334+
No information about the latest account
335+
verification.
336+
SUCCESS_USER_VERIFIED (1):
337+
The user was successfully verified. This
338+
means the account verification challenge was
339+
successfully completed.
340+
ERROR_USER_NOT_VERIFIED (2):
341+
The user failed the verification challenge.
342+
ERROR_SITE_ONBOARDING_INCOMPLETE (3):
343+
The site is not properly onboarded to use the
344+
account verification feature.
345+
ERROR_RECIPIENT_NOT_ALLOWED (4):
346+
The recipient is not allowed for account
347+
verification. This can occur during integration
348+
but should not occur in production.
349+
ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED (5):
350+
The recipient has already been sent too many
351+
verification codes in a short amount of time.
352+
ERROR_CRITICAL_INTERNAL (6):
353+
The verification flow could not be completed
354+
due to a critical internal error.
355+
ERROR_CUSTOMER_QUOTA_EXHAUSTED (7):
356+
The client has exceeded their two factor
357+
request quota for this period of time.
358+
ERROR_VERIFICATION_BYPASSED (8):
359+
The request cannot be processed at the time
360+
because of an incident. This bypass can be
361+
restricted to a problematic destination email
362+
domain, a customer, or could affect the entire
363+
service.
364+
ERROR_VERDICT_MISMATCH (9):
365+
The request parameters do not match with the
366+
token provided and cannot be processed.
245367
"""
246368
RESULT_UNSPECIFIED = 0
247369
SUCCESS_USER_VERIFIED = 1
@@ -454,7 +576,28 @@ class RiskAnalysis(proto.Message):
454576
"""
455577

456578
class ClassificationReason(proto.Enum):
457-
r"""Reasons contributing to the risk analysis verdict."""
579+
r"""Reasons contributing to the risk analysis verdict.
580+
581+
Values:
582+
CLASSIFICATION_REASON_UNSPECIFIED (0):
583+
Default unspecified type.
584+
AUTOMATION (1):
585+
Interactions matched the behavior of an
586+
automated agent.
587+
UNEXPECTED_ENVIRONMENT (2):
588+
The event originated from an illegitimate
589+
environment.
590+
TOO_MUCH_TRAFFIC (3):
591+
Traffic volume from the event source is
592+
higher than normal.
593+
UNEXPECTED_USAGE_PATTERNS (4):
594+
Interactions with the site were significantly
595+
different than expected patterns.
596+
LOW_CONFIDENCE_SCORE (5):
597+
Too little traffic has been received from
598+
this site thus far to generate quality risk
599+
analysis.
600+
"""
458601
CLASSIFICATION_REASON_UNSPECIFIED = 0
459602
AUTOMATION = 1
460603
UNEXPECTED_ENVIRONMENT = 2
@@ -504,7 +647,27 @@ class TokenProperties(proto.Message):
504647
"""
505648

506649
class InvalidReason(proto.Enum):
507-
r"""Enum that represents the types of invalid token reasons."""
650+
r"""Enum that represents the types of invalid token reasons.
651+
652+
Values:
653+
INVALID_REASON_UNSPECIFIED (0):
654+
Default unspecified type.
655+
UNKNOWN_INVALID_REASON (1):
656+
If the failure reason was not accounted for.
657+
MALFORMED (2):
658+
The provided user verification token was
659+
malformed.
660+
EXPIRED (3):
661+
The user verification token had expired.
662+
DUPE (4):
663+
The user verification had already been seen.
664+
MISSING (5):
665+
The user verification token was not present.
666+
BROWSER_ERROR (6):
667+
A retriable error (such as network failure)
668+
occurred on the browser. Could easily be
669+
simulated by an attacker.
670+
"""
508671
INVALID_REASON_UNSPECIFIED = 0
509672
UNKNOWN_INVALID_REASON = 1
510673
MALFORMED = 2
@@ -554,7 +717,29 @@ class AccountDefenderAssessment(proto.Message):
554717
"""
555718

556719
class AccountDefenderLabel(proto.Enum):
557-
r"""Labels returned by account defender for this request."""
720+
r"""Labels returned by account defender for this request.
721+
722+
Values:
723+
ACCOUNT_DEFENDER_LABEL_UNSPECIFIED (0):
724+
Default unspecified type.
725+
PROFILE_MATCH (1):
726+
The request matches a known good profile for
727+
the user.
728+
SUSPICIOUS_LOGIN_ACTIVITY (2):
729+
The request is potentially a suspicious login
730+
event and must be further verified either
731+
through multi-factor authentication or another
732+
system.
733+
SUSPICIOUS_ACCOUNT_CREATION (3):
734+
The request matched a profile that previously
735+
had suspicious account creation behavior. This
736+
can mean that this is a fake account.
737+
RELATED_ACCOUNTS_NUMBER_HIGH (4):
738+
The account in the request has a high number
739+
of related accounts. It does not necessarily
740+
imply that the account is bad but can require
741+
further investigation.
742+
"""
558743
ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0
559744
PROFILE_MATCH = 1
560745
SUSPICIOUS_LOGIN_ACTIVITY = 2
@@ -937,6 +1122,18 @@ class TestingOptions(proto.Message):
9371122
class TestingChallenge(proto.Enum):
9381123
r"""Enum that represents the challenge option for challenge-based
9391124
(CHECKBOX, INVISIBLE) testing keys.
1125+
1126+
Values:
1127+
TESTING_CHALLENGE_UNSPECIFIED (0):
1128+
Perform the normal risk analysis and return
1129+
either nocaptcha or a challenge depending on
1130+
risk and trust factors.
1131+
NOCAPTCHA (1):
1132+
Challenge requests for this key always return
1133+
a nocaptcha, which does not require a solution.
1134+
UNSOLVABLE_CHALLENGE (2):
1135+
Challenge requests for this key always return
1136+
an unsolvable challenge.
9401137
"""
9411138
TESTING_CHALLENGE_UNSPECIFIED = 0
9421139
NOCAPTCHA = 1
@@ -982,7 +1179,26 @@ class WebKeySettings(proto.Message):
9821179
"""
9831180

9841181
class IntegrationType(proto.Enum):
985-
r"""Enum that represents the integration types for web keys."""
1182+
r"""Enum that represents the integration types for web keys.
1183+
1184+
Values:
1185+
INTEGRATION_TYPE_UNSPECIFIED (0):
1186+
Default type that indicates this enum hasn't
1187+
been specified. This is not a valid
1188+
IntegrationType, one of the other types must be
1189+
specified instead.
1190+
SCORE (1):
1191+
Only used to produce scores. It doesn't
1192+
display the "I'm not a robot" checkbox and never
1193+
shows captcha challenges.
1194+
CHECKBOX (2):
1195+
Displays the "I'm not a robot" checkbox and
1196+
may show captcha challenges after it is checked.
1197+
INVISIBLE (3):
1198+
Doesn't display the "I'm not a robot"
1199+
checkbox, but may show captcha challenges after
1200+
risk analysis.
1201+
"""
9861202
INTEGRATION_TYPE_UNSPECIFIED = 0
9871203
SCORE = 1
9881204
CHECKBOX = 2
@@ -991,6 +1207,19 @@ class IntegrationType(proto.Enum):
9911207
class ChallengeSecurityPreference(proto.Enum):
9921208
r"""Enum that represents the possible challenge frequency and
9931209
difficulty configurations for a web key.
1210+
1211+
Values:
1212+
CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED (0):
1213+
Default type that indicates this enum hasn't
1214+
been specified.
1215+
USABILITY (1):
1216+
Key tends to show fewer and easier
1217+
challenges.
1218+
BALANCE (2):
1219+
Key tends to show balanced (in amount and
1220+
difficulty) challenges.
1221+
SECURITY (3):
1222+
Key tends to show more and harder challenges.
9941223
"""
9951224
CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0
9961225
USABILITY = 1
@@ -1416,14 +1645,33 @@ class WafSettings(proto.Message):
14161645
class WafFeature(proto.Enum):
14171646
r"""Supported WAF features. For more information, see
14181647
https://cloud.google.com/recaptcha-enterprise/docs/usecase#comparison_of_features.
1648+
1649+
Values:
1650+
WAF_FEATURE_UNSPECIFIED (0):
1651+
Undefined feature.
1652+
CHALLENGE_PAGE (1):
1653+
Redirects suspicious traffic to reCAPTCHA.
1654+
SESSION_TOKEN (2):
1655+
Use reCAPTCHA session-tokens to protect the
1656+
whole user session on the site's domain.
1657+
ACTION_TOKEN (3):
1658+
Use reCAPTCHA action-tokens to protect user
1659+
actions.
14191660
"""
14201661
WAF_FEATURE_UNSPECIFIED = 0
14211662
CHALLENGE_PAGE = 1
14221663
SESSION_TOKEN = 2
14231664
ACTION_TOKEN = 3
14241665

14251666
class WafService(proto.Enum):
1426-
r"""Web Application Firewalls supported by reCAPTCHA Enterprise."""
1667+
r"""Web Application Firewalls supported by reCAPTCHA Enterprise.
1668+
1669+
Values:
1670+
WAF_SERVICE_UNSPECIFIED (0):
1671+
Undefined WAF
1672+
CA (1):
1673+
Cloud Armor
1674+
"""
14271675
WAF_SERVICE_UNSPECIFIED = 0
14281676
CA = 1
14291677

samples/generated_samples/snippet_metadata_google.cloud.recaptchaenterprise.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-recaptcha-enterprise",
11-
"version": "1.11.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)