Debian Codegraph @

examples/python/async_streaming/phone_pb2_grpc.py

raw
1 # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2 """Client and server classes corresponding to protobuf-defined services."""
3 import grpc
4
5 import phone_pb2 as phone__pb2
6
7
8 class PhoneStub(object):
9 """Missing associated documentation comment in .proto file."""
10
11 def __init__(self, channel):
12 """Constructor.
13
14 Args:
15 channel: A grpc.Channel.
16 """
17 self.StreamCall = channel.stream_stream(
18 '/grpc.testing.Phone/StreamCall',
19 request_serializer=phone__pb2.StreamCallRequest.SerializeToString,
20 response_deserializer=phone__pb2.StreamCallResponse.FromString,
21 )
22
23
24 class PhoneServicer(object):
25 """Missing associated documentation comment in .proto file."""
26
27 def StreamCall(self, request_iterator, context):
28 """Makes a phone call and communicate states via a stream.
29 """
30 context.set_code(grpc.StatusCode.UNIMPLEMENTED)
31 context.set_details('Method not implemented!')
32 raise NotImplementedError('Method not implemented!')
33
34
35 def add_PhoneServicer_to_server(servicer, server):
36 rpc_method_handlers = {
37 'StreamCall': grpc.stream_stream_rpc_method_handler(
38 servicer.StreamCall,
39 request_deserializer=phone__pb2.StreamCallRequest.FromString,
40 response_serializer=phone__pb2.StreamCallResponse.SerializeToString,
41 ),
42 }
43 generic_handler = grpc.method_handlers_generic_handler(
44 'grpc.testing.Phone', rpc_method_handlers)
45 server.add_generic_rpc_handlers((generic_handler,))
46
47
48 # This class is part of an EXPERIMENTAL API.
49 class Phone(object):
50 """Missing associated documentation comment in .proto file."""
51
52 @staticmethod
53 def StreamCall(request_iterator,
54 target,
55 options=(),
56 channel_credentials=None,
57 call_credentials=None,
58 insecure=False,
59 compression=None,
60 wait_for_ready=None,
61 timeout=None,
62 metadata=None):
63 return grpc.experimental.stream_stream(request_iterator, target, '/grpc.testing.Phone/StreamCall',
64 phone__pb2.StreamCallRequest.SerializeToString,
65 phone__pb2.StreamCallResponse.FromString,
66 options, channel_credentials,
67 insecure, call_credentials, compression, wait_for_ready, timeout, metadata)