From 2bf845bbf352a61a9d3033c1aa785fe056c06e08 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 24 Sep 2021 15:12:19 +0000 Subject: [PATCH] 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: https://github.com/googleapis/googleapis/commit/b224dfa52642a733ea64849d4e06d15c274bc08f Source-Link: https://github.com/googleapis/googleapis-gen/commit/63a1db7a38d74b9639592f521ed1daaf7299ad9a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjNhMWRiN2EzOGQ3NGI5NjM5NTkyZjUyMWVkMWRhYWY3Mjk5YWQ5YSJ9 --- .../services/org_policy/client.py | 30 +++++++++---------- .../services/org_policy/transports/base.py | 2 +- .../services/org_policy/transports/grpc.py | 6 ++-- .../org_policy/transports/grpc_asyncio.py | 6 ++-- .../scripts/fixup_orgpolicy_v2_keywords.py | 16 +++++----- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/client.py b/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/client.py index bb0327b58a22..da80f60c6f40 100644 --- a/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/client.py +++ b/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -385,7 +385,7 @@ def __init__( def list_constraints( self, - request: orgpolicy.ListConstraintsRequest = None, + request: Union[orgpolicy.ListConstraintsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -396,7 +396,7 @@ def list_constraints( resource. Args: - request (google.cloud.orgpolicy_v2.types.ListConstraintsRequest): + request (Union[google.cloud.orgpolicy_v2.types.ListConstraintsRequest, dict]): The request object. The request sent to the [ListConstraints] [google.cloud.orgpolicy.v2.OrgPolicy.ListConstraints] @@ -474,7 +474,7 @@ def list_constraints( def list_policies( self, - request: orgpolicy.ListPoliciesRequest = None, + request: Union[orgpolicy.ListPoliciesRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -485,7 +485,7 @@ def list_policies( resource. Args: - request (google.cloud.orgpolicy_v2.types.ListPoliciesRequest): + request (Union[google.cloud.orgpolicy_v2.types.ListPoliciesRequest, dict]): The request object. The request sent to the [ListPolicies] [google.cloud.orgpolicy.v2.OrgPolicy.ListPolicies] @@ -565,7 +565,7 @@ def list_policies( def get_policy( self, - request: orgpolicy.GetPolicyRequest = None, + request: Union[orgpolicy.GetPolicyRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -579,7 +579,7 @@ def get_policy( a ``Policy`` during read-modify-write. Args: - request (google.cloud.orgpolicy_v2.types.GetPolicyRequest): + request (Union[google.cloud.orgpolicy_v2.types.GetPolicyRequest, dict]): The request object. The request sent to the [GetPolicy] [google.cloud.orgpolicy.v2.OrgPolicy.GetPolicy] method. name (str): @@ -640,7 +640,7 @@ def get_policy( def get_effective_policy( self, - request: orgpolicy.GetEffectivePolicyRequest = None, + request: Union[orgpolicy.GetEffectivePolicyRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -655,7 +655,7 @@ def get_effective_policy( hierarchy with 'under:' prefix will not be expanded. Args: - request (google.cloud.orgpolicy_v2.types.GetEffectivePolicyRequest): + request (Union[google.cloud.orgpolicy_v2.types.GetEffectivePolicyRequest, dict]): The request object. The request sent to the [GetEffectivePolicy] [google.cloud.orgpolicy.v2.OrgPolicy.GetEffectivePolicy] @@ -718,7 +718,7 @@ def get_effective_policy( def create_policy( self, - request: orgpolicy.CreatePolicyRequest = None, + request: Union[orgpolicy.CreatePolicyRequest, dict] = None, *, parent: str = None, policy: orgpolicy.Policy = None, @@ -735,7 +735,7 @@ def create_policy( on the given Cloud resource. Args: - request (google.cloud.orgpolicy_v2.types.CreatePolicyRequest): + request (Union[google.cloud.orgpolicy_v2.types.CreatePolicyRequest, dict]): The request object. The request sent to the [CreatePolicyRequest] [google.cloud.orgpolicy.v2.OrgPolicy.CreatePolicy] @@ -810,7 +810,7 @@ def create_policy( def update_policy( self, - request: orgpolicy.UpdatePolicyRequest = None, + request: Union[orgpolicy.UpdatePolicyRequest, dict] = None, *, policy: orgpolicy.Policy = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -829,7 +829,7 @@ def update_policy( fields. Args: - request (google.cloud.orgpolicy_v2.types.UpdatePolicyRequest): + request (Union[google.cloud.orgpolicy_v2.types.UpdatePolicyRequest, dict]): The request object. The request sent to the [UpdatePolicyRequest] [google.cloud.orgpolicy.v2.OrgPolicy.UpdatePolicy] @@ -892,7 +892,7 @@ def update_policy( def delete_policy( self, - request: orgpolicy.DeletePolicyRequest = None, + request: Union[orgpolicy.DeletePolicyRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -906,7 +906,7 @@ def delete_policy( does not exist. Args: - request (google.cloud.orgpolicy_v2.types.DeletePolicyRequest): + request (Union[google.cloud.orgpolicy_v2.types.DeletePolicyRequest, dict]): The request object. The request sent to the [DeletePolicy] [google.cloud.orgpolicy.v2.OrgPolicy.DeletePolicy] diff --git a/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/base.py b/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/base.py index e3dc84076c27..9b77084763ee 100644 --- a/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/base.py +++ b/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/base.py @@ -118,7 +118,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/grpc.py b/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/grpc.py index aff7f3cc8517..297d8fe36230 100644 --- a/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/grpc.py +++ b/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/grpc.py @@ -102,16 +102,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/grpc_asyncio.py b/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/grpc_asyncio.py index 4aa679e070a5..8c1dbdb6f771 100644 --- a/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/grpc_asyncio.py +++ b/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/transports/grpc_asyncio.py @@ -149,16 +149,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/packages/google-cloud-org-policy/scripts/fixup_orgpolicy_v2_keywords.py b/packages/google-cloud-org-policy/scripts/fixup_orgpolicy_v2_keywords.py index d8d5fa65ca87..e2f6932e0a99 100644 --- a/packages/google-cloud-org-policy/scripts/fixup_orgpolicy_v2_keywords.py +++ b/packages/google-cloud-org-policy/scripts/fixup_orgpolicy_v2_keywords.py @@ -39,13 +39,13 @@ def partition( class orgpolicyCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'create_policy': ('parent', 'policy', ), - 'delete_policy': ('name', ), - 'get_effective_policy': ('name', ), - 'get_policy': ('name', ), - 'list_constraints': ('parent', 'page_size', 'page_token', ), - 'list_policies': ('parent', 'page_size', 'page_token', ), - 'update_policy': ('policy', ), + 'create_policy': ('parent', 'policy', ), + 'delete_policy': ('name', ), + 'get_effective_policy': ('name', ), + 'get_policy': ('name', ), + 'list_constraints': ('parent', 'page_size', 'page_token', ), + 'list_policies': ('parent', 'page_size', 'page_token', ), + 'update_policy': ('policy', ), } 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: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs )