This repository has been archived by the owner on Oct 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shopping_list_pb2_grpc.py
222 lines (194 loc) · 9.64 KB
/
shopping_list_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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import shopping_list_pb2 as shopping__list__pb2
class ShoppingListServiceStub(object):
"""Server interface to manage a shopping list.
Note: Names generally follow this convention:
https://cloud.google.com/apis/design/naming_convention
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.CreateShoppingList = channel.unary_unary(
'/shopping_list.ShoppingListService/CreateShoppingList',
request_serializer=shopping__list__pb2.CreateShoppingListRequest.SerializeToString,
response_deserializer=shopping__list__pb2.ShoppingList.FromString,
)
self.UpdateShoppingList = channel.unary_unary(
'/shopping_list.ShoppingListService/UpdateShoppingList',
request_serializer=shopping__list__pb2.UpdateShoppingListRequest.SerializeToString,
response_deserializer=shopping__list__pb2.ShoppingList.FromString,
)
self.DeleteShoppingList = channel.unary_unary(
'/shopping_list.ShoppingListService/DeleteShoppingList',
request_serializer=shopping__list__pb2.DeleteShoppingListRequest.SerializeToString,
response_deserializer=shopping__list__pb2.DeleteShoppingListResponse.FromString,
)
self.ListShoppingLists = channel.unary_unary(
'/shopping_list.ShoppingListService/ListShoppingLists',
request_serializer=shopping__list__pb2.ListShoppingListsRequest.SerializeToString,
response_deserializer=shopping__list__pb2.ListShoppingListsResponse.FromString,
)
self.ListShoppingListsStream = channel.unary_stream(
'/shopping_list.ShoppingListService/ListShoppingListsStream',
request_serializer=shopping__list__pb2.ListShoppingListsStreamRequest.SerializeToString,
response_deserializer=shopping__list__pb2.ShoppingList.FromString,
)
self.AddItem = channel.unary_unary(
'/shopping_list.ShoppingListService/AddItem',
request_serializer=shopping__list__pb2.AddItemRequest.SerializeToString,
response_deserializer=shopping__list__pb2.AddItemResponse.FromString,
)
self.RemoveItem = channel.unary_unary(
'/shopping_list.ShoppingListService/RemoveItem',
request_serializer=shopping__list__pb2.RemoveItemRequest.SerializeToString,
response_deserializer=shopping__list__pb2.RemoveItemResponse.FromString,
)
self.SetItemChecked = channel.unary_unary(
'/shopping_list.ShoppingListService/SetItemChecked',
request_serializer=shopping__list__pb2.SetItemCheckedRequest.SerializeToString,
response_deserializer=shopping__list__pb2.SetItemCheckedResponse.FromString,
)
self.ListItems = channel.unary_unary(
'/shopping_list.ShoppingListService/ListItems',
request_serializer=shopping__list__pb2.ListItemsRequest.SerializeToString,
response_deserializer=shopping__list__pb2.ListItemsResponse.FromString,
)
self.ListItemsStream = channel.unary_stream(
'/shopping_list.ShoppingListService/ListItemsStream',
request_serializer=shopping__list__pb2.ListItemsStreamRequest.SerializeToString,
response_deserializer=shopping__list__pb2.Item.FromString,
)
class ShoppingListServiceServicer(object):
"""Server interface to manage a shopping list.
Note: Names generally follow this convention:
https://cloud.google.com/apis/design/naming_convention
"""
def CreateShoppingList(self, request, context):
"""Create a new shopping list.
If the shopping list name is empty, returns `INVALID_ARGUMENT`.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UpdateShoppingList(self, request, context):
"""Update properties of a shopping list.
If the shopping list name is empty, returns `INVALID_ARGUMENT`.
If a shopping list with the specified ID doesn't exist, returns `NOT_FOUND`.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def DeleteShoppingList(self, request, context):
"""Delete a shopping list.
If a shopping list with the specified ID doesn't exist, returns `NOT_FOUND`.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListShoppingLists(self, request, context):
"""List shopping lists.
When a value for the `filter` parameter is provided, only shopping lists whose
name includes the filter value are returned.
Note: A robust implementation would handle paging.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListShoppingListsStream(self, request, context):
"""List shopping lists, returning results as a stream.
When a value for the `filter` parameter is provided, only shopping lists
whose name includes the filter value are returned.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def AddItem(self, request, context):
"""Add an item to a shopping list.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def RemoveItem(self, request, context):
"""Remove an item from a shopping list.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetItemChecked(self, request, context):
"""Set whether an item on a shopping list is checked.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListItems(self, request, context):
"""List items on a shopping list.
Note: A robust implementation would handle paging.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListItemsStream(self, request, context):
"""List items on a shopping list, returning results as a stream.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_ShoppingListServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'CreateShoppingList': grpc.unary_unary_rpc_method_handler(
servicer.CreateShoppingList,
request_deserializer=shopping__list__pb2.CreateShoppingListRequest.FromString,
response_serializer=shopping__list__pb2.ShoppingList.SerializeToString,
),
'UpdateShoppingList': grpc.unary_unary_rpc_method_handler(
servicer.UpdateShoppingList,
request_deserializer=shopping__list__pb2.UpdateShoppingListRequest.FromString,
response_serializer=shopping__list__pb2.ShoppingList.SerializeToString,
),
'DeleteShoppingList': grpc.unary_unary_rpc_method_handler(
servicer.DeleteShoppingList,
request_deserializer=shopping__list__pb2.DeleteShoppingListRequest.FromString,
response_serializer=shopping__list__pb2.DeleteShoppingListResponse.SerializeToString,
),
'ListShoppingLists': grpc.unary_unary_rpc_method_handler(
servicer.ListShoppingLists,
request_deserializer=shopping__list__pb2.ListShoppingListsRequest.FromString,
response_serializer=shopping__list__pb2.ListShoppingListsResponse.SerializeToString,
),
'ListShoppingListsStream': grpc.unary_stream_rpc_method_handler(
servicer.ListShoppingListsStream,
request_deserializer=shopping__list__pb2.ListShoppingListsStreamRequest.FromString,
response_serializer=shopping__list__pb2.ShoppingList.SerializeToString,
),
'AddItem': grpc.unary_unary_rpc_method_handler(
servicer.AddItem,
request_deserializer=shopping__list__pb2.AddItemRequest.FromString,
response_serializer=shopping__list__pb2.AddItemResponse.SerializeToString,
),
'RemoveItem': grpc.unary_unary_rpc_method_handler(
servicer.RemoveItem,
request_deserializer=shopping__list__pb2.RemoveItemRequest.FromString,
response_serializer=shopping__list__pb2.RemoveItemResponse.SerializeToString,
),
'SetItemChecked': grpc.unary_unary_rpc_method_handler(
servicer.SetItemChecked,
request_deserializer=shopping__list__pb2.SetItemCheckedRequest.FromString,
response_serializer=shopping__list__pb2.SetItemCheckedResponse.SerializeToString,
),
'ListItems': grpc.unary_unary_rpc_method_handler(
servicer.ListItems,
request_deserializer=shopping__list__pb2.ListItemsRequest.FromString,
response_serializer=shopping__list__pb2.ListItemsResponse.SerializeToString,
),
'ListItemsStream': grpc.unary_stream_rpc_method_handler(
servicer.ListItemsStream,
request_deserializer=shopping__list__pb2.ListItemsStreamRequest.FromString,
response_serializer=shopping__list__pb2.Item.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'shopping_list.ShoppingListService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))