From 75907bb8385358b5a6795956150ad782f9bd4b1b 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:10:21 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.51.2 (#27) - [ ] 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 --- .../client.py | 22 ++++++------ .../transports/base.py | 2 +- .../transports/grpc.py | 6 ++-- .../transports/grpc_asyncio.py | 6 ++-- .../client.py | 34 +++++++++---------- .../transports/base.py | 2 +- .../transports/grpc.py | 6 ++-- .../transports/grpc_asyncio.py | 6 ++-- .../scripts/fixup_iap_v1_keywords.py | 28 +++++++-------- 9 files changed, 56 insertions(+), 56 deletions(-) diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py index 3fd8fc620bb8..84c21810d041 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/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 @@ -346,7 +346,7 @@ def __init__( def set_iam_policy( self, - request: iam_policy_pb2.SetIamPolicyRequest = None, + request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -358,7 +358,7 @@ def set_iam_policy( https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api Args: - request (google.iam.v1.iam_policy_pb2.SetIamPolicyRequest): + request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for `SetIamPolicy` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -453,7 +453,7 @@ def set_iam_policy( def get_iam_policy( self, - request: iam_policy_pb2.GetIamPolicyRequest = None, + request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -465,7 +465,7 @@ def get_iam_policy( https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api Args: - request (google.iam.v1.iam_policy_pb2.GetIamPolicyRequest): + request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for `GetIamPolicy` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -560,7 +560,7 @@ def get_iam_policy( def test_iam_permissions( self, - request: iam_policy_pb2.TestIamPermissionsRequest = None, + request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -572,7 +572,7 @@ def test_iam_permissions( https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api Args: - request (google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest): + request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for `TestIamPermissions` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -612,7 +612,7 @@ def test_iam_permissions( def get_iap_settings( self, - request: service.GetIapSettingsRequest = None, + request: Union[service.GetIapSettingsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -622,7 +622,7 @@ def get_iap_settings( resource. Args: - request (google.cloud.iap_v1.types.GetIapSettingsRequest): + request (Union[google.cloud.iap_v1.types.GetIapSettingsRequest, dict]): The request object. The request sent to GetIapSettings. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -660,7 +660,7 @@ def get_iap_settings( def update_iap_settings( self, - request: service.UpdateIapSettingsRequest = None, + request: Union[service.UpdateIapSettingsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -670,7 +670,7 @@ def update_iap_settings( It replaces all fields unless the ``update_mask`` is set. Args: - request (google.cloud.iap_v1.types.UpdateIapSettingsRequest): + request (Union[google.cloud.iap_v1.types.UpdateIapSettingsRequest, dict]): The request object. The request sent to UpdateIapSettings. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/base.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/base.py index f317347fd8ed..b5ef86365fbc 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/base.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/base.py @@ -117,7 +117,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-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc.py index 4931a93e2554..d18eab47ff1c 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc.py @@ -84,16 +84,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-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py index 07033fb4f6d2..47166e5762cf 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py @@ -131,16 +131,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-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py index 2e31a8ae4b85..22774408df7d 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/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 @@ -348,7 +348,7 @@ def __init__( def list_brands( self, - request: service.ListBrandsRequest = None, + request: Union[service.ListBrandsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -357,7 +357,7 @@ def list_brands( r"""Lists the existing brands for the project. Args: - request (google.cloud.iap_v1.types.ListBrandsRequest): + request (Union[google.cloud.iap_v1.types.ListBrandsRequest, dict]): The request object. The request sent to ListBrands. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -395,7 +395,7 @@ def list_brands( def create_brand( self, - request: service.CreateBrandRequest = None, + request: Union[service.CreateBrandRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -413,7 +413,7 @@ def create_brand( by the caller. Args: - request (google.cloud.iap_v1.types.CreateBrandRequest): + request (Union[google.cloud.iap_v1.types.CreateBrandRequest, dict]): The request object. The request sent to CreateBrand. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -454,7 +454,7 @@ def create_brand( def get_brand( self, - request: service.GetBrandRequest = None, + request: Union[service.GetBrandRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -463,7 +463,7 @@ def get_brand( r"""Retrieves the OAuth brand of the project. Args: - request (google.cloud.iap_v1.types.GetBrandRequest): + request (Union[google.cloud.iap_v1.types.GetBrandRequest, dict]): The request object. The request sent to GetBrand. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -504,7 +504,7 @@ def get_brand( def create_identity_aware_proxy_client( self, - request: service.CreateIdentityAwareProxyClientRequest = None, + request: Union[service.CreateIdentityAwareProxyClientRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -516,7 +516,7 @@ def create_identity_aware_proxy_client( use. Args: - request (google.cloud.iap_v1.types.CreateIdentityAwareProxyClientRequest): + request (Union[google.cloud.iap_v1.types.CreateIdentityAwareProxyClientRequest, dict]): The request object. The request sent to CreateIdentityAwareProxyClient. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -559,7 +559,7 @@ def create_identity_aware_proxy_client( def list_identity_aware_proxy_clients( self, - request: service.ListIdentityAwareProxyClientsRequest = None, + request: Union[service.ListIdentityAwareProxyClientsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -568,7 +568,7 @@ def list_identity_aware_proxy_clients( r"""Lists the existing clients for the brand. Args: - request (google.cloud.iap_v1.types.ListIdentityAwareProxyClientsRequest): + request (Union[google.cloud.iap_v1.types.ListIdentityAwareProxyClientsRequest, dict]): The request object. The request sent to ListIdentityAwareProxyClients. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -620,7 +620,7 @@ def list_identity_aware_proxy_clients( def get_identity_aware_proxy_client( self, - request: service.GetIdentityAwareProxyClientRequest = None, + request: Union[service.GetIdentityAwareProxyClientRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -630,7 +630,7 @@ def get_identity_aware_proxy_client( Requires that the client is owned by IAP. Args: - request (google.cloud.iap_v1.types.GetIdentityAwareProxyClientRequest): + request (Union[google.cloud.iap_v1.types.GetIdentityAwareProxyClientRequest, dict]): The request object. The request sent to GetIdentityAwareProxyClient. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -673,7 +673,7 @@ def get_identity_aware_proxy_client( def reset_identity_aware_proxy_client_secret( self, - request: service.ResetIdentityAwareProxyClientSecretRequest = None, + request: Union[service.ResetIdentityAwareProxyClientSecretRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -684,7 +684,7 @@ def reset_identity_aware_proxy_client_secret( that the client is owned by IAP. Args: - request (google.cloud.iap_v1.types.ResetIdentityAwareProxyClientSecretRequest): + request (Union[google.cloud.iap_v1.types.ResetIdentityAwareProxyClientSecretRequest, dict]): The request object. The request sent to ResetIdentityAwareProxyClientSecret. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -727,7 +727,7 @@ def reset_identity_aware_proxy_client_secret( def delete_identity_aware_proxy_client( self, - request: service.DeleteIdentityAwareProxyClientRequest = None, + request: Union[service.DeleteIdentityAwareProxyClientRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -739,7 +739,7 @@ def delete_identity_aware_proxy_client( after tests. Requires that the client is owned by IAP. Args: - request (google.cloud.iap_v1.types.DeleteIdentityAwareProxyClientRequest): + request (Union[google.cloud.iap_v1.types.DeleteIdentityAwareProxyClientRequest, dict]): The request object. The request sent to DeleteIdentityAwareProxyClient. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/base.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/base.py index 7a88d7defd02..bd365968d579 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/base.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/base.py @@ -116,7 +116,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-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc.py index 92d25a935739..19c7516c0931 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc.py @@ -85,16 +85,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-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc_asyncio.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc_asyncio.py index 15a52934cfb9..08034390f741 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc_asyncio.py @@ -132,16 +132,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-iap/scripts/fixup_iap_v1_keywords.py b/packages/google-cloud-iap/scripts/fixup_iap_v1_keywords.py index 5e449f87480f..b3b463625b2e 100644 --- a/packages/google-cloud-iap/scripts/fixup_iap_v1_keywords.py +++ b/packages/google-cloud-iap/scripts/fixup_iap_v1_keywords.py @@ -39,19 +39,19 @@ def partition( class iapCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'create_brand': ('parent', 'brand', ), - 'create_identity_aware_proxy_client': ('parent', 'identity_aware_proxy_client', ), - 'delete_identity_aware_proxy_client': ('name', ), - 'get_brand': ('name', ), - 'get_iam_policy': ('resource', 'options', ), - 'get_iap_settings': ('name', ), - 'get_identity_aware_proxy_client': ('name', ), - 'list_brands': ('parent', ), - 'list_identity_aware_proxy_clients': ('parent', 'page_size', 'page_token', ), - 'reset_identity_aware_proxy_client_secret': ('name', ), - 'set_iam_policy': ('resource', 'policy', ), - 'test_iam_permissions': ('resource', 'permissions', ), - 'update_iap_settings': ('iap_settings', 'update_mask', ), + 'create_brand': ('parent', 'brand', ), + 'create_identity_aware_proxy_client': ('parent', 'identity_aware_proxy_client', ), + 'delete_identity_aware_proxy_client': ('name', ), + 'get_brand': ('name', ), + 'get_iam_policy': ('resource', 'options', ), + 'get_iap_settings': ('name', ), + 'get_identity_aware_proxy_client': ('name', ), + 'list_brands': ('parent', ), + 'list_identity_aware_proxy_clients': ('parent', 'page_size', 'page_token', ), + 'reset_identity_aware_proxy_client_secret': ('name', ), + 'set_iam_policy': ('resource', 'policy', ), + 'test_iam_permissions': ('resource', 'permissions', ), + 'update_iap_settings': ('iap_settings', 'update_mask', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -70,7 +70,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 )