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

Commit 86096a4

Browse files
fix: rename parent to project in SearchRelatedAccountGroupMembershipsRequest (#227)
- [ ] Regenerate this pull request now. feat: introduced WafSettings PiperOrigin-RevId: 446496512 Source-Link: googleapis/googleapis@63d4fba Source-Link: https://github.com/googleapis/googleapis-gen/commit/f168b29e44d1d09bc407e8ef09587b7c8fcfe622 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2OGIyOWU0NGQxZDA5YmM0MDdlOGVmMDk1ODdiN2M4ZmNmZTYyMiJ9
1 parent 89c3b7c commit 86096a4

11 files changed

+88
-36
lines changed

google/cloud/recaptchaenterprise/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
TestingOptions,
5454
TokenProperties,
5555
UpdateKeyRequest,
56+
WafSettings,
5657
WebKeySettings,
5758
)
5859

@@ -91,5 +92,6 @@
9192
"TestingOptions",
9293
"TokenProperties",
9394
"UpdateKeyRequest",
95+
"WafSettings",
9496
"WebKeySettings",
9597
)

google/cloud/recaptchaenterprise_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
TestingOptions,
5252
TokenProperties,
5353
UpdateKeyRequest,
54+
WafSettings,
5455
WebKeySettings,
5556
)
5657

@@ -89,5 +90,6 @@
8990
"TestingOptions",
9091
"TokenProperties",
9192
"UpdateKeyRequest",
93+
"WafSettings",
9294
"WebKeySettings",
9395
)

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ async def search_related_account_group_memberships(
12201220
recaptchaenterprise.SearchRelatedAccountGroupMembershipsRequest, dict
12211221
] = None,
12221222
*,
1223-
parent: str = None,
1223+
project: str = None,
12241224
hashed_account_id: bytes = None,
12251225
retry: OptionalRetry = gapic_v1.method.DEFAULT,
12261226
timeout: float = None,
@@ -1238,7 +1238,7 @@ async def sample_search_related_account_group_memberships():
12381238
12391239
# Initialize request argument(s)
12401240
request = recaptchaenterprise_v1.SearchRelatedAccountGroupMembershipsRequest(
1241-
parent="parent_value",
1241+
project="project_value",
12421242
)
12431243
12441244
# Make the request
@@ -1252,13 +1252,13 @@ async def sample_search_related_account_group_memberships():
12521252
request (Union[google.cloud.recaptchaenterprise_v1.types.SearchRelatedAccountGroupMembershipsRequest, dict]):
12531253
The request object. The request message to search
12541254
related account group memberships.
1255-
parent (:class:`str`):
1255+
project (:class:`str`):
12561256
Required. The name of the project to
12571257
search related account group memberships
12581258
from, in the format
12591259
"projects/{project}".
12601260
1261-
This corresponds to the ``parent`` field
1261+
This corresponds to the ``project`` field
12621262
on the ``request`` instance; if ``request`` is provided, this
12631263
should not be set.
12641264
hashed_account_id (:class:`bytes`):
@@ -1288,7 +1288,7 @@ async def sample_search_related_account_group_memberships():
12881288
# Create or coerce a protobuf request object.
12891289
# Quick check: If we got a request object, we should *not* have
12901290
# gotten any keyword arguments that map to the request.
1291-
has_flattened_params = any([parent, hashed_account_id])
1291+
has_flattened_params = any([project, hashed_account_id])
12921292
if request is not None and has_flattened_params:
12931293
raise ValueError(
12941294
"If the `request` argument is set, then none of "
@@ -1301,8 +1301,8 @@ async def sample_search_related_account_group_memberships():
13011301

13021302
# If we have keyword arguments corresponding to fields on the
13031303
# request, apply these.
1304-
if parent is not None:
1305-
request.parent = parent
1304+
if project is not None:
1305+
request.project = project
13061306
if hashed_account_id is not None:
13071307
request.hashed_account_id = hashed_account_id
13081308

@@ -1317,7 +1317,7 @@ async def sample_search_related_account_group_memberships():
13171317
# Certain fields should be provided within the metadata header;
13181318
# add these here.
13191319
metadata = tuple(metadata) + (
1320-
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
1320+
gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)),
13211321
)
13221322

13231323
# Send the request.

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ def search_related_account_group_memberships(
15041504
recaptchaenterprise.SearchRelatedAccountGroupMembershipsRequest, dict
15051505
] = None,
15061506
*,
1507-
parent: str = None,
1507+
project: str = None,
15081508
hashed_account_id: bytes = None,
15091509
retry: OptionalRetry = gapic_v1.method.DEFAULT,
15101510
timeout: float = None,
@@ -1522,7 +1522,7 @@ def sample_search_related_account_group_memberships():
15221522
15231523
# Initialize request argument(s)
15241524
request = recaptchaenterprise_v1.SearchRelatedAccountGroupMembershipsRequest(
1525-
parent="parent_value",
1525+
project="project_value",
15261526
)
15271527
15281528
# Make the request
@@ -1536,13 +1536,13 @@ def sample_search_related_account_group_memberships():
15361536
request (Union[google.cloud.recaptchaenterprise_v1.types.SearchRelatedAccountGroupMembershipsRequest, dict]):
15371537
The request object. The request message to search
15381538
related account group memberships.
1539-
parent (str):
1539+
project (str):
15401540
Required. The name of the project to
15411541
search related account group memberships
15421542
from, in the format
15431543
"projects/{project}".
15441544
1545-
This corresponds to the ``parent`` field
1545+
This corresponds to the ``project`` field
15461546
on the ``request`` instance; if ``request`` is provided, this
15471547
should not be set.
15481548
hashed_account_id (bytes):
@@ -1572,7 +1572,7 @@ def sample_search_related_account_group_memberships():
15721572
# Create or coerce a protobuf request object.
15731573
# Quick check: If we got a request object, we should *not* have
15741574
# gotten any keyword arguments that map to the request.
1575-
has_flattened_params = any([parent, hashed_account_id])
1575+
has_flattened_params = any([project, hashed_account_id])
15761576
if request is not None and has_flattened_params:
15771577
raise ValueError(
15781578
"If the `request` argument is set, then none of "
@@ -1591,8 +1591,8 @@ def sample_search_related_account_group_memberships():
15911591
)
15921592
# If we have keyword arguments corresponding to fields on the
15931593
# request, apply these.
1594-
if parent is not None:
1595-
request.parent = parent
1594+
if project is not None:
1595+
request.project = project
15961596
if hashed_account_id is not None:
15971597
request.hashed_account_id = hashed_account_id
15981598

@@ -1605,7 +1605,7 @@ def sample_search_related_account_group_memberships():
16051605
# Certain fields should be provided within the metadata header;
16061606
# add these here.
16071607
metadata = tuple(metadata) + (
1608-
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
1608+
gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)),
16091609
)
16101610

16111611
# Send the request.

google/cloud/recaptchaenterprise_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
TestingOptions,
4747
TokenProperties,
4848
UpdateKeyRequest,
49+
WafSettings,
4950
WebKeySettings,
5051
)
5152

@@ -82,5 +83,6 @@
8283
"TestingOptions",
8384
"TokenProperties",
8485
"UpdateKeyRequest",
86+
"WafSettings",
8587
"WebKeySettings",
8688
)

google/cloud/recaptchaenterprise_v1/types/recaptchaenterprise.py

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"SearchRelatedAccountGroupMembershipsResponse",
5454
"RelatedAccountGroupMembership",
5555
"RelatedAccountGroup",
56+
"WafSettings",
5657
},
5758
)
5859

@@ -620,6 +621,8 @@ class Key(proto.Message):
620621
of this Key.
621622
testing_options (google.cloud.recaptchaenterprise_v1.types.TestingOptions):
622623
Options for user acceptance testing.
624+
waf_settings (google.cloud.recaptchaenterprise_v1.types.WafSettings):
625+
Settings for WAF
623626
"""
624627

625628
name = proto.Field(
@@ -663,6 +666,11 @@ class Key(proto.Message):
663666
number=9,
664667
message="TestingOptions",
665668
)
669+
waf_settings = proto.Field(
670+
proto.MESSAGE,
671+
number=10,
672+
message="WafSettings",
673+
)
666674

667675

668676
class TestingOptions(proto.Message):
@@ -1030,7 +1038,7 @@ class SearchRelatedAccountGroupMembershipsRequest(proto.Message):
10301038
memberships.
10311039
10321040
Attributes:
1033-
parent (str):
1041+
project (str):
10341042
Required. The name of the project to search
10351043
related account group memberships from, in the
10361044
format "projects/{project}".
@@ -1055,7 +1063,7 @@ class SearchRelatedAccountGroupMembershipsRequest(proto.Message):
10551063
that provided the page token.
10561064
"""
10571065

1058-
parent = proto.Field(
1066+
project = proto.Field(
10591067
proto.STRING,
10601068
number=1,
10611069
)
@@ -1140,4 +1148,42 @@ class RelatedAccountGroup(proto.Message):
11401148
)
11411149

11421150

1151+
class WafSettings(proto.Message):
1152+
r"""Settings specific to keys that can be used for WAF (Web
1153+
Application Firewall).
1154+
1155+
Attributes:
1156+
waf_service (google.cloud.recaptchaenterprise_v1.types.WafSettings.WafService):
1157+
Required. The WAF service that uses this key.
1158+
waf_feature (google.cloud.recaptchaenterprise_v1.types.WafSettings.WafFeature):
1159+
Required. The WAF feature for which this key
1160+
is enabled.
1161+
"""
1162+
1163+
class WafFeature(proto.Enum):
1164+
r"""Supported WAF features. For more information, see
1165+
https://cloud.google.com/recaptcha-enterprise/docs/usecase#comparison_of_features.
1166+
"""
1167+
WAF_FEATURE_UNSPECIFIED = 0
1168+
CHALLENGE_PAGE = 1
1169+
SESSION_TOKEN = 2
1170+
ACTION_TOKEN = 3
1171+
1172+
class WafService(proto.Enum):
1173+
r"""Web Application Firewalls supported by reCAPTCHA Enterprise."""
1174+
WAF_SERVICE_UNSPECIFIED = 0
1175+
CA = 1
1176+
1177+
waf_service = proto.Field(
1178+
proto.ENUM,
1179+
number=1,
1180+
enum=WafService,
1181+
)
1182+
waf_feature = proto.Field(
1183+
proto.ENUM,
1184+
number=2,
1185+
enum=WafFeature,
1186+
)
1187+
1188+
11431189
__all__ = tuple(sorted(__protobuf__.manifest))

samples/generated_samples/recaptchaenterprise_v1_generated_recaptcha_enterprise_service_search_related_account_group_memberships_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def sample_search_related_account_group_memberships():
3333

3434
# Initialize request argument(s)
3535
request = recaptchaenterprise_v1.SearchRelatedAccountGroupMembershipsRequest(
36-
parent="parent_value",
36+
project="project_value",
3737
)
3838

3939
# Make the request

samples/generated_samples/recaptchaenterprise_v1_generated_recaptcha_enterprise_service_search_related_account_group_memberships_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def sample_search_related_account_group_memberships():
3333

3434
# Initialize request argument(s)
3535
request = recaptchaenterprise_v1.SearchRelatedAccountGroupMembershipsRequest(
36-
parent="parent_value",
36+
project="project_value",
3737
)
3838

3939
# Make the request

samples/generated_samples/snippet_metadata_recaptchaenterprise_v1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@
16131613
"type": "google.cloud.recaptchaenterprise_v1.types.SearchRelatedAccountGroupMembershipsRequest"
16141614
},
16151615
{
1616-
"name": "parent",
1616+
"name": "project",
16171617
"type": "str"
16181618
},
16191619
{
@@ -1697,7 +1697,7 @@
16971697
"type": "google.cloud.recaptchaenterprise_v1.types.SearchRelatedAccountGroupMembershipsRequest"
16981698
},
16991699
{
1700-
"name": "parent",
1700+
"name": "project",
17011701
"type": "str"
17021702
},
17031703
{

scripts/fixup_recaptchaenterprise_v1_keywords.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class recaptchaenterpriseCallTransformer(cst.CSTTransformer):
4949
'list_related_account_group_memberships': ('parent', 'page_size', 'page_token', ),
5050
'list_related_account_groups': ('parent', 'page_size', 'page_token', ),
5151
'migrate_key': ('name', ),
52-
'search_related_account_group_memberships': ('parent', 'hashed_account_id', 'page_size', 'page_token', ),
52+
'search_related_account_group_memberships': ('project', 'hashed_account_id', 'page_size', 'page_token', ),
5353
'update_key': ('key', 'update_mask', ),
5454
}
5555

0 commit comments

Comments
 (0)