Skip to content
This repository was archived by the owner on Mar 15, 2025. It is now read-only.

Commit c2ea337

Browse files
chore: use gapic-generator-python 0.51.2 (#86)
- [ ] Regenerate this pull request now. fix: add 'dict' annotation type to 'request' Committer: @busunkim96 PiperOrigin-RevId: 398509016 Source-Link: googleapis/googleapis@b224dfa Source-Link: googleapis/googleapis-gen@63a1db7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjNhMWRiN2EzOGQ3NGI5NjM5NTkyZjUyMWVkMWRhYWY3Mjk5YWQ5YSJ9
1 parent 4d54f46 commit c2ea337

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

google/cloud/orgpolicy_v2/services/org_policy/client.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from distutils import util
1818
import os
1919
import re
20-
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
20+
from typing import Dict, Optional, Sequence, Tuple, Type, Union
2121
import pkg_resources
2222

2323
from google.api_core import client_options as client_options_lib # type: ignore
@@ -385,7 +385,7 @@ def __init__(
385385

386386
def list_constraints(
387387
self,
388-
request: orgpolicy.ListConstraintsRequest = None,
388+
request: Union[orgpolicy.ListConstraintsRequest, dict] = None,
389389
*,
390390
parent: str = None,
391391
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -396,7 +396,7 @@ def list_constraints(
396396
resource.
397397
398398
Args:
399-
request (google.cloud.orgpolicy_v2.types.ListConstraintsRequest):
399+
request (Union[google.cloud.orgpolicy_v2.types.ListConstraintsRequest, dict]):
400400
The request object. The request sent to the
401401
[ListConstraints]
402402
[google.cloud.orgpolicy.v2.OrgPolicy.ListConstraints]
@@ -474,7 +474,7 @@ def list_constraints(
474474

475475
def list_policies(
476476
self,
477-
request: orgpolicy.ListPoliciesRequest = None,
477+
request: Union[orgpolicy.ListPoliciesRequest, dict] = None,
478478
*,
479479
parent: str = None,
480480
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -485,7 +485,7 @@ def list_policies(
485485
resource.
486486
487487
Args:
488-
request (google.cloud.orgpolicy_v2.types.ListPoliciesRequest):
488+
request (Union[google.cloud.orgpolicy_v2.types.ListPoliciesRequest, dict]):
489489
The request object. The request sent to the
490490
[ListPolicies]
491491
[google.cloud.orgpolicy.v2.OrgPolicy.ListPolicies]
@@ -565,7 +565,7 @@ def list_policies(
565565

566566
def get_policy(
567567
self,
568-
request: orgpolicy.GetPolicyRequest = None,
568+
request: Union[orgpolicy.GetPolicyRequest, dict] = None,
569569
*,
570570
name: str = None,
571571
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -579,7 +579,7 @@ def get_policy(
579579
a ``Policy`` during read-modify-write.
580580
581581
Args:
582-
request (google.cloud.orgpolicy_v2.types.GetPolicyRequest):
582+
request (Union[google.cloud.orgpolicy_v2.types.GetPolicyRequest, dict]):
583583
The request object. The request sent to the [GetPolicy]
584584
[google.cloud.orgpolicy.v2.OrgPolicy.GetPolicy] method.
585585
name (str):
@@ -640,7 +640,7 @@ def get_policy(
640640

641641
def get_effective_policy(
642642
self,
643-
request: orgpolicy.GetEffectivePolicyRequest = None,
643+
request: Union[orgpolicy.GetEffectivePolicyRequest, dict] = None,
644644
*,
645645
name: str = None,
646646
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -655,7 +655,7 @@ def get_effective_policy(
655655
hierarchy with 'under:' prefix will not be expanded.
656656
657657
Args:
658-
request (google.cloud.orgpolicy_v2.types.GetEffectivePolicyRequest):
658+
request (Union[google.cloud.orgpolicy_v2.types.GetEffectivePolicyRequest, dict]):
659659
The request object. The request sent to the
660660
[GetEffectivePolicy]
661661
[google.cloud.orgpolicy.v2.OrgPolicy.GetEffectivePolicy]
@@ -718,7 +718,7 @@ def get_effective_policy(
718718

719719
def create_policy(
720720
self,
721-
request: orgpolicy.CreatePolicyRequest = None,
721+
request: Union[orgpolicy.CreatePolicyRequest, dict] = None,
722722
*,
723723
parent: str = None,
724724
policy: orgpolicy.Policy = None,
@@ -735,7 +735,7 @@ def create_policy(
735735
on the given Cloud resource.
736736
737737
Args:
738-
request (google.cloud.orgpolicy_v2.types.CreatePolicyRequest):
738+
request (Union[google.cloud.orgpolicy_v2.types.CreatePolicyRequest, dict]):
739739
The request object. The request sent to the
740740
[CreatePolicyRequest]
741741
[google.cloud.orgpolicy.v2.OrgPolicy.CreatePolicy]
@@ -810,7 +810,7 @@ def create_policy(
810810

811811
def update_policy(
812812
self,
813-
request: orgpolicy.UpdatePolicyRequest = None,
813+
request: Union[orgpolicy.UpdatePolicyRequest, dict] = None,
814814
*,
815815
policy: orgpolicy.Policy = None,
816816
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -829,7 +829,7 @@ def update_policy(
829829
fields.
830830
831831
Args:
832-
request (google.cloud.orgpolicy_v2.types.UpdatePolicyRequest):
832+
request (Union[google.cloud.orgpolicy_v2.types.UpdatePolicyRequest, dict]):
833833
The request object. The request sent to the
834834
[UpdatePolicyRequest]
835835
[google.cloud.orgpolicy.v2.OrgPolicy.UpdatePolicy]
@@ -892,7 +892,7 @@ def update_policy(
892892

893893
def delete_policy(
894894
self,
895-
request: orgpolicy.DeletePolicyRequest = None,
895+
request: Union[orgpolicy.DeletePolicyRequest, dict] = None,
896896
*,
897897
name: str = None,
898898
retry: retries.Retry = gapic_v1.method.DEFAULT,
@@ -906,7 +906,7 @@ def delete_policy(
906906
does not exist.
907907
908908
Args:
909-
request (google.cloud.orgpolicy_v2.types.DeletePolicyRequest):
909+
request (Union[google.cloud.orgpolicy_v2.types.DeletePolicyRequest, dict]):
910910
The request object. The request sent to the
911911
[DeletePolicy]
912912
[google.cloud.orgpolicy.v2.OrgPolicy.DeletePolicy]

google/cloud/orgpolicy_v2/services/org_policy/transports/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def __init__(
118118
**scopes_kwargs, quota_project_id=quota_project_id
119119
)
120120

121-
# If the credentials is service account credentials, then always try to use self signed JWT.
121+
# If the credentials are service account credentials, then always try to use self signed JWT.
122122
if (
123123
always_use_jwt_access
124124
and isinstance(credentials, service_account.Credentials)

google/cloud/orgpolicy_v2/services/org_policy/transports/grpc.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,16 @@ def __init__(
102102
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
103103
If provided, it overrides the ``host`` argument and tries to create
104104
a mutual TLS channel with client SSL credentials from
105-
``client_cert_source`` or applicatin default SSL credentials.
105+
``client_cert_source`` or application default SSL credentials.
106106
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
107107
Deprecated. A callback to provide client SSL certificate bytes and
108108
private key bytes, both in PEM format. It is ignored if
109109
``api_mtls_endpoint`` is None.
110110
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
111-
for grpc channel. It is ignored if ``channel`` is provided.
111+
for the grpc channel. It is ignored if ``channel`` is provided.
112112
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
113113
A callback to provide client certificate bytes and private key bytes,
114-
both in PEM format. It is used to configure mutual TLS channel. It is
114+
both in PEM format. It is used to configure a mutual TLS channel. It is
115115
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
116116
quota_project_id (Optional[str]): An optional project to use for billing
117117
and quota.

google/cloud/orgpolicy_v2/services/org_policy/transports/grpc_asyncio.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,16 @@ def __init__(
149149
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
150150
If provided, it overrides the ``host`` argument and tries to create
151151
a mutual TLS channel with client SSL credentials from
152-
``client_cert_source`` or applicatin default SSL credentials.
152+
``client_cert_source`` or application default SSL credentials.
153153
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
154154
Deprecated. A callback to provide client SSL certificate bytes and
155155
private key bytes, both in PEM format. It is ignored if
156156
``api_mtls_endpoint`` is None.
157157
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
158-
for grpc channel. It is ignored if ``channel`` is provided.
158+
for the grpc channel. It is ignored if ``channel`` is provided.
159159
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
160160
A callback to provide client certificate bytes and private key bytes,
161-
both in PEM format. It is used to configure mutual TLS channel. It is
161+
both in PEM format. It is used to configure a mutual TLS channel. It is
162162
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
163163
quota_project_id (Optional[str]): An optional project to use for billing
164164
and quota.

scripts/fixup_orgpolicy_v2_keywords.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ def partition(
3939
class orgpolicyCallTransformer(cst.CSTTransformer):
4040
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
4141
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
42-
'create_policy': ('parent', 'policy', ),
43-
'delete_policy': ('name', ),
44-
'get_effective_policy': ('name', ),
45-
'get_policy': ('name', ),
46-
'list_constraints': ('parent', 'page_size', 'page_token', ),
47-
'list_policies': ('parent', 'page_size', 'page_token', ),
48-
'update_policy': ('policy', ),
42+
'create_policy': ('parent', 'policy', ),
43+
'delete_policy': ('name', ),
44+
'get_effective_policy': ('name', ),
45+
'get_policy': ('name', ),
46+
'list_constraints': ('parent', 'page_size', 'page_token', ),
47+
'list_policies': ('parent', 'page_size', 'page_token', ),
48+
'update_policy': ('policy', ),
4949
}
5050

5151
def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode:
@@ -64,7 +64,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode:
6464
return updated
6565

6666
kwargs, ctrl_kwargs = partition(
67-
lambda a: not a.keyword.value in self.CTRL_PARAMS,
67+
lambda a: a.keyword.value not in self.CTRL_PARAMS,
6868
kwargs
6969
)
7070

0 commit comments

Comments
 (0)