grpcio-fips 1.53.2__0-cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. grpc/__init__.py +2174 -0
  2. grpc/_auth.py +68 -0
  3. grpc/_channel.py +1767 -0
  4. grpc/_common.py +177 -0
  5. grpc/_compression.py +63 -0
  6. grpc/_cython/__init__.py +13 -0
  7. grpc/_cython/_credentials/roots.pem +4337 -0
  8. grpc/_cython/_cygrpc/__init__.py +13 -0
  9. grpc/_cython/cygrpc.cp310-win_amd64.pyd +0 -0
  10. grpc/_grpcio_metadata.py +1 -0
  11. grpc/_interceptor.py +638 -0
  12. grpc/_plugin_wrapping.py +121 -0
  13. grpc/_runtime_protos.py +159 -0
  14. grpc/_server.py +1141 -0
  15. grpc/_simple_stubs.py +486 -0
  16. grpc/_typing.py +58 -0
  17. grpc/_utilities.py +180 -0
  18. grpc/aio/__init__.py +95 -0
  19. grpc/aio/_base_call.py +248 -0
  20. grpc/aio/_base_channel.py +348 -0
  21. grpc/aio/_base_server.py +369 -0
  22. grpc/aio/_call.py +649 -0
  23. grpc/aio/_channel.py +492 -0
  24. grpc/aio/_interceptor.py +1003 -0
  25. grpc/aio/_metadata.py +120 -0
  26. grpc/aio/_server.py +209 -0
  27. grpc/aio/_typing.py +35 -0
  28. grpc/aio/_utils.py +22 -0
  29. grpc/beta/__init__.py +13 -0
  30. grpc/beta/_client_adaptations.py +706 -0
  31. grpc/beta/_metadata.py +52 -0
  32. grpc/beta/_server_adaptations.py +385 -0
  33. grpc/beta/implementations.py +311 -0
  34. grpc/beta/interfaces.py +163 -0
  35. grpc/beta/utilities.py +149 -0
  36. grpc/experimental/__init__.py +128 -0
  37. grpc/experimental/aio/__init__.py +16 -0
  38. grpc/experimental/gevent.py +27 -0
  39. grpc/experimental/session_cache.py +45 -0
  40. grpc/framework/__init__.py +13 -0
  41. grpc/framework/common/__init__.py +13 -0
  42. grpc/framework/common/cardinality.py +26 -0
  43. grpc/framework/common/style.py +24 -0
  44. grpc/framework/foundation/__init__.py +13 -0
  45. grpc/framework/foundation/abandonment.py +22 -0
  46. grpc/framework/foundation/callable_util.py +94 -0
  47. grpc/framework/foundation/future.py +219 -0
  48. grpc/framework/foundation/logging_pool.py +71 -0
  49. grpc/framework/foundation/stream.py +43 -0
  50. grpc/framework/foundation/stream_util.py +148 -0
  51. grpc/framework/interfaces/__init__.py +13 -0
  52. grpc/framework/interfaces/base/__init__.py +13 -0
  53. grpc/framework/interfaces/base/base.py +325 -0
  54. grpc/framework/interfaces/base/utilities.py +71 -0
  55. grpc/framework/interfaces/face/__init__.py +13 -0
  56. grpc/framework/interfaces/face/face.py +1049 -0
  57. grpc/framework/interfaces/face/utilities.py +168 -0
  58. grpcio_fips-1.53.2.dist-info/LICENSE +610 -0
  59. grpcio_fips-1.53.2.dist-info/METADATA +137 -0
  60. grpcio_fips-1.53.2.dist-info/RECORD +62 -0
  61. grpcio_fips-1.53.2.dist-info/WHEEL +5 -0
  62. grpcio_fips-1.53.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,348 @@
1
+ # Copyright 2020 The gRPC Authors
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """Abstract base classes for Channel objects and Multicallable objects."""
15
+
16
+ import abc
17
+ from typing import Any, Optional
18
+
19
+ import grpc
20
+
21
+ from . import _base_call
22
+ from ._typing import DeserializingFunction
23
+ from ._typing import MetadataType
24
+ from ._typing import RequestIterableType
25
+ from ._typing import SerializingFunction
26
+
27
+
28
+ class UnaryUnaryMultiCallable(abc.ABC):
29
+ """Enables asynchronous invocation of a unary-call RPC."""
30
+
31
+ @abc.abstractmethod
32
+ def __call__(
33
+ self,
34
+ request: Any,
35
+ *,
36
+ timeout: Optional[float] = None,
37
+ metadata: Optional[MetadataType] = None,
38
+ credentials: Optional[grpc.CallCredentials] = None,
39
+ wait_for_ready: Optional[bool] = None,
40
+ compression: Optional[grpc.Compression] = None
41
+ ) -> _base_call.UnaryUnaryCall:
42
+ """Asynchronously invokes the underlying RPC.
43
+
44
+ Args:
45
+ request: The request value for the RPC.
46
+ timeout: An optional duration of time in seconds to allow
47
+ for the RPC.
48
+ metadata: Optional :term:`metadata` to be transmitted to the
49
+ service-side of the RPC.
50
+ credentials: An optional CallCredentials for the RPC. Only valid for
51
+ secure Channel.
52
+ wait_for_ready: An optional flag to enable :term:`wait_for_ready` mechanism.
53
+ compression: An element of grpc.compression, e.g.
54
+ grpc.compression.Gzip.
55
+
56
+ Returns:
57
+ A UnaryUnaryCall object.
58
+
59
+ Raises:
60
+ RpcError: Indicates that the RPC terminated with non-OK status. The
61
+ raised RpcError will also be a Call for the RPC affording the RPC's
62
+ metadata, status code, and details.
63
+ """
64
+
65
+
66
+ class UnaryStreamMultiCallable(abc.ABC):
67
+ """Enables asynchronous invocation of a server-streaming RPC."""
68
+
69
+ @abc.abstractmethod
70
+ def __call__(
71
+ self,
72
+ request: Any,
73
+ *,
74
+ timeout: Optional[float] = None,
75
+ metadata: Optional[MetadataType] = None,
76
+ credentials: Optional[grpc.CallCredentials] = None,
77
+ wait_for_ready: Optional[bool] = None,
78
+ compression: Optional[grpc.Compression] = None
79
+ ) -> _base_call.UnaryStreamCall:
80
+ """Asynchronously invokes the underlying RPC.
81
+
82
+ Args:
83
+ request: The request value for the RPC.
84
+ timeout: An optional duration of time in seconds to allow
85
+ for the RPC.
86
+ metadata: Optional :term:`metadata` to be transmitted to the
87
+ service-side of the RPC.
88
+ credentials: An optional CallCredentials for the RPC. Only valid for
89
+ secure Channel.
90
+ wait_for_ready: An optional flag to enable :term:`wait_for_ready` mechanism.
91
+ compression: An element of grpc.compression, e.g.
92
+ grpc.compression.Gzip.
93
+
94
+ Returns:
95
+ A UnaryStreamCall object.
96
+
97
+ Raises:
98
+ RpcError: Indicates that the RPC terminated with non-OK status. The
99
+ raised RpcError will also be a Call for the RPC affording the RPC's
100
+ metadata, status code, and details.
101
+ """
102
+
103
+
104
+ class StreamUnaryMultiCallable(abc.ABC):
105
+ """Enables asynchronous invocation of a client-streaming RPC."""
106
+
107
+ @abc.abstractmethod
108
+ def __call__(
109
+ self,
110
+ request_iterator: Optional[RequestIterableType] = None,
111
+ timeout: Optional[float] = None,
112
+ metadata: Optional[MetadataType] = None,
113
+ credentials: Optional[grpc.CallCredentials] = None,
114
+ wait_for_ready: Optional[bool] = None,
115
+ compression: Optional[grpc.Compression] = None
116
+ ) -> _base_call.StreamUnaryCall:
117
+ """Asynchronously invokes the underlying RPC.
118
+
119
+ Args:
120
+ request_iterator: An optional async iterable or iterable of request
121
+ messages for the RPC.
122
+ timeout: An optional duration of time in seconds to allow
123
+ for the RPC.
124
+ metadata: Optional :term:`metadata` to be transmitted to the
125
+ service-side of the RPC.
126
+ credentials: An optional CallCredentials for the RPC. Only valid for
127
+ secure Channel.
128
+ wait_for_ready: An optional flag to enable :term:`wait_for_ready` mechanism.
129
+ compression: An element of grpc.compression, e.g.
130
+ grpc.compression.Gzip.
131
+
132
+ Returns:
133
+ A StreamUnaryCall object.
134
+
135
+ Raises:
136
+ RpcError: Indicates that the RPC terminated with non-OK status. The
137
+ raised RpcError will also be a Call for the RPC affording the RPC's
138
+ metadata, status code, and details.
139
+ """
140
+
141
+
142
+ class StreamStreamMultiCallable(abc.ABC):
143
+ """Enables asynchronous invocation of a bidirectional-streaming RPC."""
144
+
145
+ @abc.abstractmethod
146
+ def __call__(
147
+ self,
148
+ request_iterator: Optional[RequestIterableType] = None,
149
+ timeout: Optional[float] = None,
150
+ metadata: Optional[MetadataType] = None,
151
+ credentials: Optional[grpc.CallCredentials] = None,
152
+ wait_for_ready: Optional[bool] = None,
153
+ compression: Optional[grpc.Compression] = None
154
+ ) -> _base_call.StreamStreamCall:
155
+ """Asynchronously invokes the underlying RPC.
156
+
157
+ Args:
158
+ request_iterator: An optional async iterable or iterable of request
159
+ messages for the RPC.
160
+ timeout: An optional duration of time in seconds to allow
161
+ for the RPC.
162
+ metadata: Optional :term:`metadata` to be transmitted to the
163
+ service-side of the RPC.
164
+ credentials: An optional CallCredentials for the RPC. Only valid for
165
+ secure Channel.
166
+ wait_for_ready: An optional flag to enable :term:`wait_for_ready` mechanism.
167
+ compression: An element of grpc.compression, e.g.
168
+ grpc.compression.Gzip.
169
+
170
+ Returns:
171
+ A StreamStreamCall object.
172
+
173
+ Raises:
174
+ RpcError: Indicates that the RPC terminated with non-OK status. The
175
+ raised RpcError will also be a Call for the RPC affording the RPC's
176
+ metadata, status code, and details.
177
+ """
178
+
179
+
180
+ class Channel(abc.ABC):
181
+ """Enables asynchronous RPC invocation as a client.
182
+
183
+ Channel objects implement the Asynchronous Context Manager (aka. async
184
+ with) type, although they are not supportted to be entered and exited
185
+ multiple times.
186
+ """
187
+
188
+ @abc.abstractmethod
189
+ async def __aenter__(self):
190
+ """Starts an asynchronous context manager.
191
+
192
+ Returns:
193
+ Channel the channel that was instantiated.
194
+ """
195
+
196
+ @abc.abstractmethod
197
+ async def __aexit__(self, exc_type, exc_val, exc_tb):
198
+ """Finishes the asynchronous context manager by closing the channel.
199
+
200
+ Still active RPCs will be cancelled.
201
+ """
202
+
203
+ @abc.abstractmethod
204
+ async def close(self, grace: Optional[float] = None):
205
+ """Closes this Channel and releases all resources held by it.
206
+
207
+ This method immediately stops the channel from executing new RPCs in
208
+ all cases.
209
+
210
+ If a grace period is specified, this method wait until all active
211
+ RPCs are finshed, once the grace period is reached the ones that haven't
212
+ been terminated are cancelled. If a grace period is not specified
213
+ (by passing None for grace), all existing RPCs are cancelled immediately.
214
+
215
+ This method is idempotent.
216
+ """
217
+
218
+ @abc.abstractmethod
219
+ def get_state(self,
220
+ try_to_connect: bool = False) -> grpc.ChannelConnectivity:
221
+ """Checks the connectivity state of a channel.
222
+
223
+ This is an EXPERIMENTAL API.
224
+
225
+ If the channel reaches a stable connectivity state, it is guaranteed
226
+ that the return value of this function will eventually converge to that
227
+ state.
228
+
229
+ Args:
230
+ try_to_connect: a bool indicate whether the Channel should try to
231
+ connect to peer or not.
232
+
233
+ Returns: A ChannelConnectivity object.
234
+ """
235
+
236
+ @abc.abstractmethod
237
+ async def wait_for_state_change(
238
+ self,
239
+ last_observed_state: grpc.ChannelConnectivity,
240
+ ) -> None:
241
+ """Waits for a change in connectivity state.
242
+
243
+ This is an EXPERIMENTAL API.
244
+
245
+ The function blocks until there is a change in the channel connectivity
246
+ state from the "last_observed_state". If the state is already
247
+ different, this function will return immediately.
248
+
249
+ There is an inherent race between the invocation of
250
+ "Channel.wait_for_state_change" and "Channel.get_state". The state can
251
+ change arbitrary many times during the race, so there is no way to
252
+ observe every state transition.
253
+
254
+ If there is a need to put a timeout for this function, please refer to
255
+ "asyncio.wait_for".
256
+
257
+ Args:
258
+ last_observed_state: A grpc.ChannelConnectivity object representing
259
+ the last known state.
260
+ """
261
+
262
+ @abc.abstractmethod
263
+ async def channel_ready(self) -> None:
264
+ """Creates a coroutine that blocks until the Channel is READY."""
265
+
266
+ @abc.abstractmethod
267
+ def unary_unary(
268
+ self,
269
+ method: str,
270
+ request_serializer: Optional[SerializingFunction] = None,
271
+ response_deserializer: Optional[DeserializingFunction] = None
272
+ ) -> UnaryUnaryMultiCallable:
273
+ """Creates a UnaryUnaryMultiCallable for a unary-unary method.
274
+
275
+ Args:
276
+ method: The name of the RPC method.
277
+ request_serializer: Optional :term:`serializer` for serializing the request
278
+ message. Request goes unserialized in case None is passed.
279
+ response_deserializer: Optional :term:`deserializer` for deserializing the
280
+ response message. Response goes undeserialized in case None
281
+ is passed.
282
+
283
+ Returns:
284
+ A UnaryUnaryMultiCallable value for the named unary-unary method.
285
+ """
286
+
287
+ @abc.abstractmethod
288
+ def unary_stream(
289
+ self,
290
+ method: str,
291
+ request_serializer: Optional[SerializingFunction] = None,
292
+ response_deserializer: Optional[DeserializingFunction] = None
293
+ ) -> UnaryStreamMultiCallable:
294
+ """Creates a UnaryStreamMultiCallable for a unary-stream method.
295
+
296
+ Args:
297
+ method: The name of the RPC method.
298
+ request_serializer: Optional :term:`serializer` for serializing the request
299
+ message. Request goes unserialized in case None is passed.
300
+ response_deserializer: Optional :term:`deserializer` for deserializing the
301
+ response message. Response goes undeserialized in case None
302
+ is passed.
303
+
304
+ Returns:
305
+ A UnarySteramMultiCallable value for the named unary-stream method.
306
+ """
307
+
308
+ @abc.abstractmethod
309
+ def stream_unary(
310
+ self,
311
+ method: str,
312
+ request_serializer: Optional[SerializingFunction] = None,
313
+ response_deserializer: Optional[DeserializingFunction] = None
314
+ ) -> StreamUnaryMultiCallable:
315
+ """Creates a StreamUnaryMultiCallable for a stream-unary method.
316
+
317
+ Args:
318
+ method: The name of the RPC method.
319
+ request_serializer: Optional :term:`serializer` for serializing the request
320
+ message. Request goes unserialized in case None is passed.
321
+ response_deserializer: Optional :term:`deserializer` for deserializing the
322
+ response message. Response goes undeserialized in case None
323
+ is passed.
324
+
325
+ Returns:
326
+ A StreamUnaryMultiCallable value for the named stream-unary method.
327
+ """
328
+
329
+ @abc.abstractmethod
330
+ def stream_stream(
331
+ self,
332
+ method: str,
333
+ request_serializer: Optional[SerializingFunction] = None,
334
+ response_deserializer: Optional[DeserializingFunction] = None
335
+ ) -> StreamStreamMultiCallable:
336
+ """Creates a StreamStreamMultiCallable for a stream-stream method.
337
+
338
+ Args:
339
+ method: The name of the RPC method.
340
+ request_serializer: Optional :term:`serializer` for serializing the request
341
+ message. Request goes unserialized in case None is passed.
342
+ response_deserializer: Optional :term:`deserializer` for deserializing the
343
+ response message. Response goes undeserialized in case None
344
+ is passed.
345
+
346
+ Returns:
347
+ A StreamStreamMultiCallable value for the named stream-stream method.
348
+ """