17
17
import dataclasses
18
18
import json # type: ignore
19
19
import re
20
- from typing import Callable , Dict , List , Optional , Sequence , Tuple , Union
20
+ from typing import Any , Callable , Dict , List , Optional , Sequence , Tuple , Union
21
21
import warnings
22
22
23
23
from google .api_core import (
@@ -470,7 +470,7 @@ def pre_get_location(
470
470
self ,
471
471
request : locations_pb2 .GetLocationRequest ,
472
472
metadata : Sequence [Tuple [str , str ]],
473
- ) -> locations_pb2 .Location :
473
+ ) -> Tuple [ locations_pb2 .GetLocationRequest , Sequence [ Tuple [ str , str ]]] :
474
474
"""Pre-rpc interceptor for get_location
475
475
476
476
Override in a subclass to manipulate the request or metadata
@@ -479,7 +479,7 @@ def pre_get_location(
479
479
return request , metadata
480
480
481
481
def post_get_location (
482
- self , response : locations_pb2 .GetLocationRequest
482
+ self , response : locations_pb2 .Location
483
483
) -> locations_pb2 .Location :
484
484
"""Post-rpc interceptor for get_location
485
485
@@ -493,7 +493,7 @@ def pre_list_locations(
493
493
self ,
494
494
request : locations_pb2 .ListLocationsRequest ,
495
495
metadata : Sequence [Tuple [str , str ]],
496
- ) -> locations_pb2 .ListLocationsResponse :
496
+ ) -> Tuple [ locations_pb2 .ListLocationsRequest , Sequence [ Tuple [ str , str ]]] :
497
497
"""Pre-rpc interceptor for list_locations
498
498
499
499
Override in a subclass to manipulate the request or metadata
@@ -502,7 +502,7 @@ def pre_list_locations(
502
502
return request , metadata
503
503
504
504
def post_list_locations (
505
- self , response : locations_pb2 .ListLocationsRequest
505
+ self , response : locations_pb2 .ListLocationsResponse
506
506
) -> locations_pb2 .ListLocationsResponse :
507
507
"""Post-rpc interceptor for list_locations
508
508
@@ -516,17 +516,15 @@ def pre_cancel_operation(
516
516
self ,
517
517
request : operations_pb2 .CancelOperationRequest ,
518
518
metadata : Sequence [Tuple [str , str ]],
519
- ) -> None :
519
+ ) -> Tuple [ operations_pb2 . CancelOperationRequest , Sequence [ Tuple [ str , str ]]] :
520
520
"""Pre-rpc interceptor for cancel_operation
521
521
522
522
Override in a subclass to manipulate the request or metadata
523
523
before they are sent to the Tpu server.
524
524
"""
525
525
return request , metadata
526
526
527
- def post_cancel_operation (
528
- self , response : operations_pb2 .CancelOperationRequest
529
- ) -> None :
527
+ def post_cancel_operation (self , response : None ) -> None :
530
528
"""Post-rpc interceptor for cancel_operation
531
529
532
530
Override in a subclass to manipulate the response
@@ -539,17 +537,15 @@ def pre_delete_operation(
539
537
self ,
540
538
request : operations_pb2 .DeleteOperationRequest ,
541
539
metadata : Sequence [Tuple [str , str ]],
542
- ) -> None :
540
+ ) -> Tuple [ operations_pb2 . DeleteOperationRequest , Sequence [ Tuple [ str , str ]]] :
543
541
"""Pre-rpc interceptor for delete_operation
544
542
545
543
Override in a subclass to manipulate the request or metadata
546
544
before they are sent to the Tpu server.
547
545
"""
548
546
return request , metadata
549
547
550
- def post_delete_operation (
551
- self , response : operations_pb2 .DeleteOperationRequest
552
- ) -> None :
548
+ def post_delete_operation (self , response : None ) -> None :
553
549
"""Post-rpc interceptor for delete_operation
554
550
555
551
Override in a subclass to manipulate the response
@@ -562,7 +558,7 @@ def pre_get_operation(
562
558
self ,
563
559
request : operations_pb2 .GetOperationRequest ,
564
560
metadata : Sequence [Tuple [str , str ]],
565
- ) -> operations_pb2 .Operation :
561
+ ) -> Tuple [ operations_pb2 .GetOperationRequest , Sequence [ Tuple [ str , str ]]] :
566
562
"""Pre-rpc interceptor for get_operation
567
563
568
564
Override in a subclass to manipulate the request or metadata
@@ -571,7 +567,7 @@ def pre_get_operation(
571
567
return request , metadata
572
568
573
569
def post_get_operation (
574
- self , response : operations_pb2 .GetOperationRequest
570
+ self , response : operations_pb2 .Operation
575
571
) -> operations_pb2 .Operation :
576
572
"""Post-rpc interceptor for get_operation
577
573
@@ -585,7 +581,7 @@ def pre_list_operations(
585
581
self ,
586
582
request : operations_pb2 .ListOperationsRequest ,
587
583
metadata : Sequence [Tuple [str , str ]],
588
- ) -> operations_pb2 .ListOperationsResponse :
584
+ ) -> Tuple [ operations_pb2 .ListOperationsRequest , Sequence [ Tuple [ str , str ]]] :
589
585
"""Pre-rpc interceptor for list_operations
590
586
591
587
Override in a subclass to manipulate the request or metadata
@@ -594,7 +590,7 @@ def pre_list_operations(
594
590
return request , metadata
595
591
596
592
def post_list_operations (
597
- self , response : operations_pb2 .ListOperationsRequest
593
+ self , response : operations_pb2 .ListOperationsResponse
598
594
) -> operations_pb2 .ListOperationsResponse :
599
595
"""Post-rpc interceptor for list_operations
600
596
@@ -759,7 +755,7 @@ class _CreateNode(TpuRestStub):
759
755
def __hash__ (self ):
760
756
return hash ("CreateNode" )
761
757
762
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
758
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
763
759
764
760
@classmethod
765
761
def _get_unset_required_fields (cls , message_dict ):
@@ -857,7 +853,7 @@ class _DeleteNode(TpuRestStub):
857
853
def __hash__ (self ):
858
854
return hash ("DeleteNode" )
859
855
860
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
856
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
861
857
862
858
@classmethod
863
859
def _get_unset_required_fields (cls , message_dict ):
@@ -946,7 +942,7 @@ class _GenerateServiceIdentity(TpuRestStub):
946
942
def __hash__ (self ):
947
943
return hash ("GenerateServiceIdentity" )
948
944
949
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
945
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
950
946
951
947
@classmethod
952
948
def _get_unset_required_fields (cls , message_dict ):
@@ -1047,7 +1043,7 @@ class _GetAcceleratorType(TpuRestStub):
1047
1043
def __hash__ (self ):
1048
1044
return hash ("GetAcceleratorType" )
1049
1045
1050
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
1046
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
1051
1047
1052
1048
@classmethod
1053
1049
def _get_unset_required_fields (cls , message_dict ):
@@ -1139,7 +1135,7 @@ class _GetGuestAttributes(TpuRestStub):
1139
1135
def __hash__ (self ):
1140
1136
return hash ("GetGuestAttributes" )
1141
1137
1142
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
1138
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
1143
1139
1144
1140
@classmethod
1145
1141
def _get_unset_required_fields (cls , message_dict ):
@@ -1240,7 +1236,7 @@ class _GetNode(TpuRestStub):
1240
1236
def __hash__ (self ):
1241
1237
return hash ("GetNode" )
1242
1238
1243
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
1239
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
1244
1240
1245
1241
@classmethod
1246
1242
def _get_unset_required_fields (cls , message_dict ):
@@ -1326,7 +1322,7 @@ class _GetRuntimeVersion(TpuRestStub):
1326
1322
def __hash__ (self ):
1327
1323
return hash ("GetRuntimeVersion" )
1328
1324
1329
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
1325
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
1330
1326
1331
1327
@classmethod
1332
1328
def _get_unset_required_fields (cls , message_dict ):
@@ -1418,7 +1414,7 @@ class _ListAcceleratorTypes(TpuRestStub):
1418
1414
def __hash__ (self ):
1419
1415
return hash ("ListAcceleratorTypes" )
1420
1416
1421
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
1417
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
1422
1418
1423
1419
@classmethod
1424
1420
def _get_unset_required_fields (cls , message_dict ):
@@ -1510,7 +1506,7 @@ class _ListNodes(TpuRestStub):
1510
1506
def __hash__ (self ):
1511
1507
return hash ("ListNodes" )
1512
1508
1513
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
1509
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
1514
1510
1515
1511
@classmethod
1516
1512
def _get_unset_required_fields (cls , message_dict ):
@@ -1600,7 +1596,7 @@ class _ListRuntimeVersions(TpuRestStub):
1600
1596
def __hash__ (self ):
1601
1597
return hash ("ListRuntimeVersions" )
1602
1598
1603
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
1599
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
1604
1600
1605
1601
@classmethod
1606
1602
def _get_unset_required_fields (cls , message_dict ):
@@ -1692,7 +1688,7 @@ class _StartNode(TpuRestStub):
1692
1688
def __hash__ (self ):
1693
1689
return hash ("StartNode" )
1694
1690
1695
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
1691
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
1696
1692
1697
1693
@classmethod
1698
1694
def _get_unset_required_fields (cls , message_dict ):
@@ -1790,7 +1786,7 @@ class _StopNode(TpuRestStub):
1790
1786
def __hash__ (self ):
1791
1787
return hash ("StopNode" )
1792
1788
1793
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {}
1789
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
1794
1790
1795
1791
@classmethod
1796
1792
def _get_unset_required_fields (cls , message_dict ):
@@ -1888,7 +1884,7 @@ class _UpdateNode(TpuRestStub):
1888
1884
def __hash__ (self ):
1889
1885
return hash ("UpdateNode" )
1890
1886
1891
- __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , str ] = {
1887
+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {
1892
1888
"updateMask" : {},
1893
1889
}
1894
1890
0 commit comments