@@ -39,7 +39,7 @@ def make_copy(self):
39
39
.with_need_rpc_auth (self .need_rpc_auth )
40
40
)
41
41
42
- def with_compression (self , compression ):
42
+ def with_compression (self , compression ) -> "BaseRequestSettings" :
43
43
"""
44
44
Enables compression for the specific RPC
45
45
:param compression: An RPCCompression enum value.
@@ -48,11 +48,11 @@ def with_compression(self, compression):
48
48
self .compression = compression
49
49
return self
50
50
51
- def with_need_rpc_auth (self , need_rpc_auth ):
51
+ def with_need_rpc_auth (self , need_rpc_auth ) -> "BaseRequestSettings" :
52
52
self .need_rpc_auth = need_rpc_auth
53
53
return self
54
54
55
- def with_header (self , key , value ):
55
+ def with_header (self , key , value ) -> "BaseRequestSettings" :
56
56
"""
57
57
Adds a key-value pair to the request headers.
58
58
:param key: A string with a header key.
@@ -62,7 +62,7 @@ def with_header(self, key, value):
62
62
self .headers .append ((key , value ))
63
63
return self
64
64
65
- def with_trace_id (self , trace_id ):
65
+ def with_trace_id (self , trace_id ) -> "BaseRequestSettings" :
66
66
"""
67
67
Includes trace id for RPC headers
68
68
:param trace_id: A trace id string
@@ -71,7 +71,7 @@ def with_trace_id(self, trace_id):
71
71
self .trace_id = trace_id
72
72
return self
73
73
74
- def with_request_type (self , request_type ):
74
+ def with_request_type (self , request_type ) -> "BaseRequestSettings" :
75
75
"""
76
76
Includes request type for RPC headers
77
77
:param request_type: A request type string
@@ -80,7 +80,7 @@ def with_request_type(self, request_type):
80
80
self .request_type = request_type
81
81
return self
82
82
83
- def with_operation_timeout (self , timeout ):
83
+ def with_operation_timeout (self , timeout ) -> "BaseRequestSettings" :
84
84
"""
85
85
Indicates that client is no longer interested in the result of operation after the specified duration
86
86
starting from the time operation arrives at the server.
@@ -89,25 +89,25 @@ def with_operation_timeout(self, timeout):
89
89
Timeout of operation does not tell anything about its result, it might be completed successfully
90
90
or cancelled on server.
91
91
:param timeout:
92
- :return:
92
+ :return: The self instance
93
93
"""
94
94
self .operation_timeout = timeout
95
95
return self
96
96
97
- def with_cancel_after (self , timeout ):
97
+ def with_cancel_after (self , timeout ) -> "BaseRequestSettings" :
98
98
"""
99
99
Server will try to cancel the operation after the specified duration starting from the time
100
100
the operation arrives at server.
101
101
In case of successful cancellation operation will receive CANCELLED status code, which will be
102
102
sent back to client if it was waiting for the operation result.
103
103
In case when cancellation isn't possible, no action will be performed.
104
104
:param timeout:
105
- :return:
105
+ :return: The self instance
106
106
"""
107
107
self .cancel_after = timeout
108
108
return self
109
109
110
- def with_timeout (self , timeout ):
110
+ def with_timeout (self , timeout ) -> "BaseRequestSettings" :
111
111
"""
112
112
Client-side timeout to complete request.
113
113
Since YDB doesn't support request cancellation at this moment, this feature should be
0 commit comments