forked from GoogleCloudPlatform/microservices-demo
-
Notifications
You must be signed in to change notification settings - Fork 30
/
demo_pb2_grpc.py
502 lines (396 loc) · 16.2 KB
/
demo_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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import demo_pb2 as demo__pb2
class CartServiceStub(object):
"""-----------------Cart service-----------------
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.AddItem = channel.unary_unary(
'/hipstershop.CartService/AddItem',
request_serializer=demo__pb2.AddItemRequest.SerializeToString,
response_deserializer=demo__pb2.Empty.FromString,
)
self.GetCart = channel.unary_unary(
'/hipstershop.CartService/GetCart',
request_serializer=demo__pb2.GetCartRequest.SerializeToString,
response_deserializer=demo__pb2.Cart.FromString,
)
self.EmptyCart = channel.unary_unary(
'/hipstershop.CartService/EmptyCart',
request_serializer=demo__pb2.EmptyCartRequest.SerializeToString,
response_deserializer=demo__pb2.Empty.FromString,
)
class CartServiceServicer(object):
"""-----------------Cart service-----------------
"""
def AddItem(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCart(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def EmptyCart(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_CartServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'AddItem': grpc.unary_unary_rpc_method_handler(
servicer.AddItem,
request_deserializer=demo__pb2.AddItemRequest.FromString,
response_serializer=demo__pb2.Empty.SerializeToString,
),
'GetCart': grpc.unary_unary_rpc_method_handler(
servicer.GetCart,
request_deserializer=demo__pb2.GetCartRequest.FromString,
response_serializer=demo__pb2.Cart.SerializeToString,
),
'EmptyCart': grpc.unary_unary_rpc_method_handler(
servicer.EmptyCart,
request_deserializer=demo__pb2.EmptyCartRequest.FromString,
response_serializer=demo__pb2.Empty.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'hipstershop.CartService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class RecommendationServiceStub(object):
"""---------------Recommendation service----------
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.ListRecommendations = channel.unary_unary(
'/hipstershop.RecommendationService/ListRecommendations',
request_serializer=demo__pb2.ListRecommendationsRequest.SerializeToString,
response_deserializer=demo__pb2.ListRecommendationsResponse.FromString,
)
class RecommendationServiceServicer(object):
"""---------------Recommendation service----------
"""
def ListRecommendations(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_RecommendationServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'ListRecommendations': grpc.unary_unary_rpc_method_handler(
servicer.ListRecommendations,
request_deserializer=demo__pb2.ListRecommendationsRequest.FromString,
response_serializer=demo__pb2.ListRecommendationsResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'hipstershop.RecommendationService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class ProductCatalogServiceStub(object):
"""---------------Product Catalog----------------
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.ListProducts = channel.unary_unary(
'/hipstershop.ProductCatalogService/ListProducts',
request_serializer=demo__pb2.Empty.SerializeToString,
response_deserializer=demo__pb2.ListProductsResponse.FromString,
)
self.GetProduct = channel.unary_unary(
'/hipstershop.ProductCatalogService/GetProduct',
request_serializer=demo__pb2.GetProductRequest.SerializeToString,
response_deserializer=demo__pb2.Product.FromString,
)
self.SearchProducts = channel.unary_unary(
'/hipstershop.ProductCatalogService/SearchProducts',
request_serializer=demo__pb2.SearchProductsRequest.SerializeToString,
response_deserializer=demo__pb2.SearchProductsResponse.FromString,
)
class ProductCatalogServiceServicer(object):
"""---------------Product Catalog----------------
"""
def ListProducts(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetProduct(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SearchProducts(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_ProductCatalogServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'ListProducts': grpc.unary_unary_rpc_method_handler(
servicer.ListProducts,
request_deserializer=demo__pb2.Empty.FromString,
response_serializer=demo__pb2.ListProductsResponse.SerializeToString,
),
'GetProduct': grpc.unary_unary_rpc_method_handler(
servicer.GetProduct,
request_deserializer=demo__pb2.GetProductRequest.FromString,
response_serializer=demo__pb2.Product.SerializeToString,
),
'SearchProducts': grpc.unary_unary_rpc_method_handler(
servicer.SearchProducts,
request_deserializer=demo__pb2.SearchProductsRequest.FromString,
response_serializer=demo__pb2.SearchProductsResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'hipstershop.ProductCatalogService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class ShippingServiceStub(object):
"""---------------Shipping Service----------
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetQuote = channel.unary_unary(
'/hipstershop.ShippingService/GetQuote',
request_serializer=demo__pb2.GetQuoteRequest.SerializeToString,
response_deserializer=demo__pb2.GetQuoteResponse.FromString,
)
self.ShipOrder = channel.unary_unary(
'/hipstershop.ShippingService/ShipOrder',
request_serializer=demo__pb2.ShipOrderRequest.SerializeToString,
response_deserializer=demo__pb2.ShipOrderResponse.FromString,
)
class ShippingServiceServicer(object):
"""---------------Shipping Service----------
"""
def GetQuote(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ShipOrder(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_ShippingServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetQuote': grpc.unary_unary_rpc_method_handler(
servicer.GetQuote,
request_deserializer=demo__pb2.GetQuoteRequest.FromString,
response_serializer=demo__pb2.GetQuoteResponse.SerializeToString,
),
'ShipOrder': grpc.unary_unary_rpc_method_handler(
servicer.ShipOrder,
request_deserializer=demo__pb2.ShipOrderRequest.FromString,
response_serializer=demo__pb2.ShipOrderResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'hipstershop.ShippingService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class CurrencyServiceStub(object):
"""-----------------Currency service-----------------
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetSupportedCurrencies = channel.unary_unary(
'/hipstershop.CurrencyService/GetSupportedCurrencies',
request_serializer=demo__pb2.Empty.SerializeToString,
response_deserializer=demo__pb2.GetSupportedCurrenciesResponse.FromString,
)
self.Convert = channel.unary_unary(
'/hipstershop.CurrencyService/Convert',
request_serializer=demo__pb2.CurrencyConversionRequest.SerializeToString,
response_deserializer=demo__pb2.Money.FromString,
)
class CurrencyServiceServicer(object):
"""-----------------Currency service-----------------
"""
def GetSupportedCurrencies(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Convert(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_CurrencyServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetSupportedCurrencies': grpc.unary_unary_rpc_method_handler(
servicer.GetSupportedCurrencies,
request_deserializer=demo__pb2.Empty.FromString,
response_serializer=demo__pb2.GetSupportedCurrenciesResponse.SerializeToString,
),
'Convert': grpc.unary_unary_rpc_method_handler(
servicer.Convert,
request_deserializer=demo__pb2.CurrencyConversionRequest.FromString,
response_serializer=demo__pb2.Money.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'hipstershop.CurrencyService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class PaymentServiceStub(object):
"""-------------Payment service-----------------
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Charge = channel.unary_unary(
'/hipstershop.PaymentService/Charge',
request_serializer=demo__pb2.ChargeRequest.SerializeToString,
response_deserializer=demo__pb2.ChargeResponse.FromString,
)
class PaymentServiceServicer(object):
"""-------------Payment service-----------------
"""
def Charge(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_PaymentServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'Charge': grpc.unary_unary_rpc_method_handler(
servicer.Charge,
request_deserializer=demo__pb2.ChargeRequest.FromString,
response_serializer=demo__pb2.ChargeResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'hipstershop.PaymentService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class EmailServiceStub(object):
"""-------------Email service-----------------
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.SendOrderConfirmation = channel.unary_unary(
'/hipstershop.EmailService/SendOrderConfirmation',
request_serializer=demo__pb2.SendOrderConfirmationRequest.SerializeToString,
response_deserializer=demo__pb2.Empty.FromString,
)
class EmailServiceServicer(object):
"""-------------Email service-----------------
"""
def SendOrderConfirmation(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_EmailServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'SendOrderConfirmation': grpc.unary_unary_rpc_method_handler(
servicer.SendOrderConfirmation,
request_deserializer=demo__pb2.SendOrderConfirmationRequest.FromString,
response_serializer=demo__pb2.Empty.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'hipstershop.EmailService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class CheckoutServiceStub(object):
"""-------------Checkout service-----------------
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.PlaceOrder = channel.unary_unary(
'/hipstershop.CheckoutService/PlaceOrder',
request_serializer=demo__pb2.PlaceOrderRequest.SerializeToString,
response_deserializer=demo__pb2.PlaceOrderResponse.FromString,
)
class CheckoutServiceServicer(object):
"""-------------Checkout service-----------------
"""
def PlaceOrder(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_CheckoutServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'PlaceOrder': grpc.unary_unary_rpc_method_handler(
servicer.PlaceOrder,
request_deserializer=demo__pb2.PlaceOrderRequest.FromString,
response_serializer=demo__pb2.PlaceOrderResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'hipstershop.CheckoutService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class AdsServiceStub(object):
"""------------Ads service------------------
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetAds = channel.unary_unary(
'/hipstershop.AdsService/GetAds',
request_serializer=demo__pb2.AdsRequest.SerializeToString,
response_deserializer=demo__pb2.AdsResponse.FromString,
)
class AdsServiceServicer(object):
"""------------Ads service------------------
"""
def GetAds(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_AdsServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetAds': grpc.unary_unary_rpc_method_handler(
servicer.GetAds,
request_deserializer=demo__pb2.AdsRequest.FromString,
response_serializer=demo__pb2.AdsResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'hipstershop.AdsService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))