-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomer_pb2_grpc.py
63 lines (52 loc) · 2.12 KB
/
customer_pb2_grpc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import customer_pb2 as customer__pb2
class CustomerStub(object):
"""The Customer service definition.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetCustomers = channel.unary_stream(
'/customer.Customer/GetCustomers',
request_serializer=customer__pb2.CustomerFilter.SerializeToString,
response_deserializer=customer__pb2.CustomerRequest.FromString,
)
self.CreateCustomer = channel.unary_unary(
'/customer.Customer/CreateCustomer',
request_serializer=customer__pb2.CustomerRequest.SerializeToString,
response_deserializer=customer__pb2.CustomerResponse.FromString,
)
class CustomerServicer(object):
"""The Customer service definition.
"""
def GetCustomers(self, request, context):
"""Get all Customers with filter - A server-to-client streaming RPC.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CreateCustomer(self, request, context):
"""Create a new Customer - A simple RPC
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_CustomerServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetCustomers': grpc.unary_stream_rpc_method_handler(
servicer.GetCustomers,
request_deserializer=customer__pb2.CustomerFilter.FromString,
response_serializer=customer__pb2.CustomerRequest.SerializeToString,
),
'CreateCustomer': grpc.unary_unary_rpc_method_handler(
servicer.CreateCustomer,
request_deserializer=customer__pb2.CustomerRequest.FromString,
response_serializer=customer__pb2.CustomerResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'customer.Customer', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))