1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515#
16+ import inspect
1617import warnings
1718from typing import Awaitable , Callable , Dict , Optional , Sequence , Tuple , Union
1819
@@ -237,6 +238,9 @@ def __init__(
237238 )
238239
239240 # Wrap messages. This must be done after self._grpc_channel exists
241+ self ._wrap_with_kind = (
242+ "kind" in inspect .signature (gapic_v1 .method_async .wrap_method ).parameters
243+ )
240244 self ._prep_wrapped_messages (client_info )
241245
242246 @property
@@ -898,12 +902,12 @@ def list_hot_tablets(
898902 def _prep_wrapped_messages (self , client_info ):
899903 """Precompute the wrapped methods, overriding the base class method to use async wrappers."""
900904 self ._wrapped_methods = {
901- self .create_instance : gapic_v1 . method_async . wrap_method (
905+ self .create_instance : self . _wrap_method (
902906 self .create_instance ,
903907 default_timeout = 300.0 ,
904908 client_info = client_info ,
905909 ),
906- self .get_instance : gapic_v1 . method_async . wrap_method (
910+ self .get_instance : self . _wrap_method (
907911 self .get_instance ,
908912 default_retry = retries .AsyncRetry (
909913 initial = 1.0 ,
@@ -918,7 +922,7 @@ def _prep_wrapped_messages(self, client_info):
918922 default_timeout = 60.0 ,
919923 client_info = client_info ,
920924 ),
921- self .list_instances : gapic_v1 . method_async . wrap_method (
925+ self .list_instances : self . _wrap_method (
922926 self .list_instances ,
923927 default_retry = retries .AsyncRetry (
924928 initial = 1.0 ,
@@ -933,7 +937,7 @@ def _prep_wrapped_messages(self, client_info):
933937 default_timeout = 60.0 ,
934938 client_info = client_info ,
935939 ),
936- self .update_instance : gapic_v1 . method_async . wrap_method (
940+ self .update_instance : self . _wrap_method (
937941 self .update_instance ,
938942 default_retry = retries .AsyncRetry (
939943 initial = 1.0 ,
@@ -948,7 +952,7 @@ def _prep_wrapped_messages(self, client_info):
948952 default_timeout = 60.0 ,
949953 client_info = client_info ,
950954 ),
951- self .partial_update_instance : gapic_v1 . method_async . wrap_method (
955+ self .partial_update_instance : self . _wrap_method (
952956 self .partial_update_instance ,
953957 default_retry = retries .AsyncRetry (
954958 initial = 1.0 ,
@@ -963,17 +967,17 @@ def _prep_wrapped_messages(self, client_info):
963967 default_timeout = 60.0 ,
964968 client_info = client_info ,
965969 ),
966- self .delete_instance : gapic_v1 . method_async . wrap_method (
970+ self .delete_instance : self . _wrap_method (
967971 self .delete_instance ,
968972 default_timeout = 60.0 ,
969973 client_info = client_info ,
970974 ),
971- self .create_cluster : gapic_v1 . method_async . wrap_method (
975+ self .create_cluster : self . _wrap_method (
972976 self .create_cluster ,
973977 default_timeout = 60.0 ,
974978 client_info = client_info ,
975979 ),
976- self .get_cluster : gapic_v1 . method_async . wrap_method (
980+ self .get_cluster : self . _wrap_method (
977981 self .get_cluster ,
978982 default_retry = retries .AsyncRetry (
979983 initial = 1.0 ,
@@ -988,7 +992,7 @@ def _prep_wrapped_messages(self, client_info):
988992 default_timeout = 60.0 ,
989993 client_info = client_info ,
990994 ),
991- self .list_clusters : gapic_v1 . method_async . wrap_method (
995+ self .list_clusters : self . _wrap_method (
992996 self .list_clusters ,
993997 default_retry = retries .AsyncRetry (
994998 initial = 1.0 ,
@@ -1003,7 +1007,7 @@ def _prep_wrapped_messages(self, client_info):
10031007 default_timeout = 60.0 ,
10041008 client_info = client_info ,
10051009 ),
1006- self .update_cluster : gapic_v1 . method_async . wrap_method (
1010+ self .update_cluster : self . _wrap_method (
10071011 self .update_cluster ,
10081012 default_retry = retries .AsyncRetry (
10091013 initial = 1.0 ,
@@ -1018,22 +1022,22 @@ def _prep_wrapped_messages(self, client_info):
10181022 default_timeout = 60.0 ,
10191023 client_info = client_info ,
10201024 ),
1021- self .partial_update_cluster : gapic_v1 . method_async . wrap_method (
1025+ self .partial_update_cluster : self . _wrap_method (
10221026 self .partial_update_cluster ,
10231027 default_timeout = None ,
10241028 client_info = client_info ,
10251029 ),
1026- self .delete_cluster : gapic_v1 . method_async . wrap_method (
1030+ self .delete_cluster : self . _wrap_method (
10271031 self .delete_cluster ,
10281032 default_timeout = 60.0 ,
10291033 client_info = client_info ,
10301034 ),
1031- self .create_app_profile : gapic_v1 . method_async . wrap_method (
1035+ self .create_app_profile : self . _wrap_method (
10321036 self .create_app_profile ,
10331037 default_timeout = 60.0 ,
10341038 client_info = client_info ,
10351039 ),
1036- self .get_app_profile : gapic_v1 . method_async . wrap_method (
1040+ self .get_app_profile : self . _wrap_method (
10371041 self .get_app_profile ,
10381042 default_retry = retries .AsyncRetry (
10391043 initial = 1.0 ,
@@ -1048,7 +1052,7 @@ def _prep_wrapped_messages(self, client_info):
10481052 default_timeout = 60.0 ,
10491053 client_info = client_info ,
10501054 ),
1051- self .list_app_profiles : gapic_v1 . method_async . wrap_method (
1055+ self .list_app_profiles : self . _wrap_method (
10521056 self .list_app_profiles ,
10531057 default_retry = retries .AsyncRetry (
10541058 initial = 1.0 ,
@@ -1063,7 +1067,7 @@ def _prep_wrapped_messages(self, client_info):
10631067 default_timeout = 60.0 ,
10641068 client_info = client_info ,
10651069 ),
1066- self .update_app_profile : gapic_v1 . method_async . wrap_method (
1070+ self .update_app_profile : self . _wrap_method (
10671071 self .update_app_profile ,
10681072 default_retry = retries .AsyncRetry (
10691073 initial = 1.0 ,
@@ -1078,12 +1082,12 @@ def _prep_wrapped_messages(self, client_info):
10781082 default_timeout = 60.0 ,
10791083 client_info = client_info ,
10801084 ),
1081- self .delete_app_profile : gapic_v1 . method_async . wrap_method (
1085+ self .delete_app_profile : self . _wrap_method (
10821086 self .delete_app_profile ,
10831087 default_timeout = 60.0 ,
10841088 client_info = client_info ,
10851089 ),
1086- self .get_iam_policy : gapic_v1 . method_async . wrap_method (
1090+ self .get_iam_policy : self . _wrap_method (
10871091 self .get_iam_policy ,
10881092 default_retry = retries .AsyncRetry (
10891093 initial = 1.0 ,
@@ -1098,12 +1102,12 @@ def _prep_wrapped_messages(self, client_info):
10981102 default_timeout = 60.0 ,
10991103 client_info = client_info ,
11001104 ),
1101- self .set_iam_policy : gapic_v1 . method_async . wrap_method (
1105+ self .set_iam_policy : self . _wrap_method (
11021106 self .set_iam_policy ,
11031107 default_timeout = 60.0 ,
11041108 client_info = client_info ,
11051109 ),
1106- self .test_iam_permissions : gapic_v1 . method_async . wrap_method (
1110+ self .test_iam_permissions : self . _wrap_method (
11071111 self .test_iam_permissions ,
11081112 default_retry = retries .AsyncRetry (
11091113 initial = 1.0 ,
@@ -1118,7 +1122,7 @@ def _prep_wrapped_messages(self, client_info):
11181122 default_timeout = 60.0 ,
11191123 client_info = client_info ,
11201124 ),
1121- self .list_hot_tablets : gapic_v1 . method_async . wrap_method (
1125+ self .list_hot_tablets : self . _wrap_method (
11221126 self .list_hot_tablets ,
11231127 default_retry = retries .AsyncRetry (
11241128 initial = 1.0 ,
@@ -1135,8 +1139,17 @@ def _prep_wrapped_messages(self, client_info):
11351139 ),
11361140 }
11371141
1142+ def _wrap_method (self , func , * args , ** kwargs ):
1143+ if self ._wrap_with_kind : # pragma: NO COVER
1144+ kwargs ["kind" ] = self .kind
1145+ return gapic_v1 .method_async .wrap_method (func , * args , ** kwargs )
1146+
11381147 def close (self ):
11391148 return self .grpc_channel .close ()
11401149
1150+ @property
1151+ def kind (self ) -> str :
1152+ return "grpc_asyncio"
1153+
11411154
11421155__all__ = ("BigtableInstanceAdminGrpcAsyncIOTransport" ,)
0 commit comments