diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 index 689d3e0620..c5abf93ed6 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 @@ -98,7 +98,8 @@ class {{ service.async_client_name }}: Returns: {{ service.async_client_name }}: The constructed client. """ - return {{ service.client_name }}.from_service_account_info.__func__({{ service.async_client_name }}, info, *args, **kwargs) # type: ignore + sa_info_func = {{ service.client_name }}.from_service_account_info.__func__ # type: ignore + return sa_info_func({{ service.async_client_name }}, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -114,7 +115,8 @@ class {{ service.async_client_name }}: Returns: {{ service.async_client_name }}: The constructed client. """ - return {{ service.client_name }}.from_service_account_file.__func__({{ service.async_client_name }}, filename, *args, **kwargs) # type: ignore + sa_file_func = {{ service.client_name }}.from_service_account_file.__func__ # type: ignore + return sa_file_func({{ service.async_client_name }}, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py index 6ae7827124..6671f3a75f 100755 --- a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py +++ b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py @@ -106,7 +106,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: AssetServiceAsyncClient: The constructed client. """ - return AssetServiceClient.from_service_account_info.__func__(AssetServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = AssetServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(AssetServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -122,7 +123,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: AssetServiceAsyncClient: The constructed client. """ - return AssetServiceClient.from_service_account_file.__func__(AssetServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = AssetServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(AssetServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py index c06d819c47..47e6150e3f 100755 --- a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py +++ b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py @@ -97,7 +97,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: IAMCredentialsAsyncClient: The constructed client. """ - return IAMCredentialsClient.from_service_account_info.__func__(IAMCredentialsAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = IAMCredentialsClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(IAMCredentialsAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -113,7 +114,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: IAMCredentialsAsyncClient: The constructed client. """ - return IAMCredentialsClient.from_service_account_file.__func__(IAMCredentialsAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = IAMCredentialsClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(IAMCredentialsAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py index 15dacf36ca..dbb6896c41 100755 --- a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py +++ b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py @@ -124,7 +124,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: EventarcAsyncClient: The constructed client. """ - return EventarcClient.from_service_account_info.__func__(EventarcAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = EventarcClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(EventarcAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -140,7 +141,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: EventarcAsyncClient: The constructed client. """ - return EventarcClient.from_service_account_file.__func__(EventarcAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = EventarcClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(EventarcAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py index 5946de63c3..0a88964f2a 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py @@ -104,7 +104,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: ConfigServiceV2AsyncClient: The constructed client. """ - return ConfigServiceV2Client.from_service_account_info.__func__(ConfigServiceV2AsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = ConfigServiceV2Client.from_service_account_info.__func__ # type: ignore + return sa_info_func(ConfigServiceV2AsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -120,7 +121,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: ConfigServiceV2AsyncClient: The constructed client. """ - return ConfigServiceV2Client.from_service_account_file.__func__(ConfigServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = ConfigServiceV2Client.from_service_account_file.__func__ # type: ignore + return sa_file_func(ConfigServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py index 545946ee11..b2f472a6d0 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py @@ -89,7 +89,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: LoggingServiceV2AsyncClient: The constructed client. """ - return LoggingServiceV2Client.from_service_account_info.__func__(LoggingServiceV2AsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = LoggingServiceV2Client.from_service_account_info.__func__ # type: ignore + return sa_info_func(LoggingServiceV2AsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -105,7 +106,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: LoggingServiceV2AsyncClient: The constructed client. """ - return LoggingServiceV2Client.from_service_account_file.__func__(LoggingServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = LoggingServiceV2Client.from_service_account_file.__func__ # type: ignore + return sa_file_func(LoggingServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py index e3fdd29780..6932957dc9 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py @@ -90,7 +90,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: MetricsServiceV2AsyncClient: The constructed client. """ - return MetricsServiceV2Client.from_service_account_info.__func__(MetricsServiceV2AsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = MetricsServiceV2Client.from_service_account_info.__func__ # type: ignore + return sa_info_func(MetricsServiceV2AsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -106,7 +107,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: MetricsServiceV2AsyncClient: The constructed client. """ - return MetricsServiceV2Client.from_service_account_file.__func__(MetricsServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = MetricsServiceV2Client.from_service_account_file.__func__ # type: ignore + return sa_file_func(MetricsServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py index dbd972107b..82ba68904f 100755 --- a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py +++ b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py @@ -104,7 +104,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: BaseConfigServiceV2AsyncClient: The constructed client. """ - return BaseConfigServiceV2Client.from_service_account_info.__func__(BaseConfigServiceV2AsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = BaseConfigServiceV2Client.from_service_account_info.__func__ # type: ignore + return sa_info_func(BaseConfigServiceV2AsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -120,7 +121,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: BaseConfigServiceV2AsyncClient: The constructed client. """ - return BaseConfigServiceV2Client.from_service_account_file.__func__(BaseConfigServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = BaseConfigServiceV2Client.from_service_account_file.__func__ # type: ignore + return sa_file_func(BaseConfigServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py index 545946ee11..b2f472a6d0 100755 --- a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py +++ b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py @@ -89,7 +89,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: LoggingServiceV2AsyncClient: The constructed client. """ - return LoggingServiceV2Client.from_service_account_info.__func__(LoggingServiceV2AsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = LoggingServiceV2Client.from_service_account_info.__func__ # type: ignore + return sa_info_func(LoggingServiceV2AsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -105,7 +106,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: LoggingServiceV2AsyncClient: The constructed client. """ - return LoggingServiceV2Client.from_service_account_file.__func__(LoggingServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = LoggingServiceV2Client.from_service_account_file.__func__ # type: ignore + return sa_file_func(LoggingServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py index 4fcff827d2..69751fc378 100755 --- a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +++ b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py @@ -90,7 +90,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: BaseMetricsServiceV2AsyncClient: The constructed client. """ - return BaseMetricsServiceV2Client.from_service_account_info.__func__(BaseMetricsServiceV2AsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = BaseMetricsServiceV2Client.from_service_account_info.__func__ # type: ignore + return sa_info_func(BaseMetricsServiceV2AsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -106,7 +107,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: BaseMetricsServiceV2AsyncClient: The constructed client. """ - return BaseMetricsServiceV2Client.from_service_account_file.__func__(BaseMetricsServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = BaseMetricsServiceV2Client.from_service_account_file.__func__ # type: ignore + return sa_file_func(BaseMetricsServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py index 3a958b16e5..78f428b8ec 100755 --- a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py +++ b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py @@ -114,7 +114,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: CloudRedisAsyncClient: The constructed client. """ - return CloudRedisClient.from_service_account_info.__func__(CloudRedisAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = CloudRedisClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(CloudRedisAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -130,7 +131,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: CloudRedisAsyncClient: The constructed client. """ - return CloudRedisClient.from_service_account_file.__func__(CloudRedisAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = CloudRedisClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(CloudRedisAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py b/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py index cc36acd1f3..5dc91b1bd8 100755 --- a/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py +++ b/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py @@ -114,7 +114,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: CloudRedisAsyncClient: The constructed client. """ - return CloudRedisClient.from_service_account_info.__func__(CloudRedisAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = CloudRedisClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(CloudRedisAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -130,7 +131,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: CloudRedisAsyncClient: The constructed client. """ - return CloudRedisClient.from_service_account_file.__func__(CloudRedisAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = CloudRedisClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(CloudRedisAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file