From 5cdc65777a454c1e763f5934eb7bc430e7be3342 Mon Sep 17 00:00:00 2001 From: Dan Sanche Date: Wed, 20 Jun 2018 23:40:47 -0700 Subject: [PATCH] regenerated protos --- src/recommendationservice/demo_pb2.py | 150 +++++++----------- src/recommendationservice/demo_pb2_grpc.py | 8 +- .../recommendation_server.py | 5 +- 3 files changed, 61 insertions(+), 102 deletions(-) diff --git a/src/recommendationservice/demo_pb2.py b/src/recommendationservice/demo_pb2.py index f34ef7c..387e61a 100644 --- a/src/recommendationservice/demo_pb2.py +++ b/src/recommendationservice/demo_pb2.py @@ -19,7 +19,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( name='demo.proto', package='hipstershop', syntax='proto3', - serialized_pb=_b('\n\ndemo.proto\x12\x0bhipstershop\"0\n\x08\x43\x61rtItem\x12\x12\n\nproduct_id\x18\x01 \x01(\t\x12\x10\n\x08quantity\x18\x02 \x01(\x05\"F\n\x0e\x41\x64\x64ItemRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12#\n\x04item\x18\x02 \x01(\x0b\x32\x15.hipstershop.CartItem\"#\n\x10\x45mptyCartRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"!\n\x0eGetCartRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"=\n\x04\x43\x61rt\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12$\n\x05items\x18\x02 \x03(\x0b\x32\x15.hipstershop.CartItem\"\x07\n\x05\x45mpty\"B\n\x1aListRecommendationsRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x13\n\x0bproduct_ids\x18\x02 \x03(\t\"2\n\x1bListRecommendationsResponse\x12\x13\n\x0bproduct_ids\x18\x01 \x03(\t\"v\n\x07Product\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0f\n\x07picture\x18\x04 \x01(\t\x12+\n\tprice_usd\x18\x05 \x01(\x0b\x32\x18.hipstershop.MoneyAmount\">\n\x14ListProductsResponse\x12&\n\x08products\x18\x01 \x03(\x0b\x32\x14.hipstershop.Product\"\x1f\n\x11GetProductRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"&\n\x15SearchProductsRequest\x12\r\n\x05query\x18\x01 \x01(\t\"?\n\x16SearchProductsResponse\x12%\n\x07results\x18\x01 \x03(\x0b\x32\x14.hipstershop.Product\"^\n\x0fGetQuoteRequest\x12%\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x14.hipstershop.Address\x12$\n\x05items\x18\x02 \x03(\x0b\x32\x15.hipstershop.CartItem\">\n\x10GetQuoteResponse\x12*\n\x08\x63ost_usd\x18\x01 \x01(\x0b\x32\x18.hipstershop.MoneyAmount\"_\n\x10ShipOrderRequest\x12%\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x14.hipstershop.Address\x12$\n\x05items\x18\x02 \x03(\x0b\x32\x15.hipstershop.CartItem\"(\n\x11ShipOrderResponse\x12\x13\n\x0btracking_id\x18\x01 \x01(\t\"n\n\x07\x41\x64\x64ress\x12\x18\n\x10street_address_1\x18\x01 \x01(\t\x12\x18\n\x10street_address_2\x18\x02 \x01(\t\x12\x0c\n\x04\x63ity\x18\x03 \x01(\t\x12\x0f\n\x07\x63ountry\x18\x04 \x01(\t\x12\x10\n\x08zip_code\x18\x05 \x01(\x05\"2\n\x0bMoneyAmount\x12\x0f\n\x07\x64\x65\x63imal\x18\x01 \x01(\r\x12\x12\n\nfractional\x18\x02 \x01(\r\"H\n\x05Money\x12\x15\n\rcurrency_code\x18\x01 \x01(\t\x12(\n\x06\x61mount\x18\x02 \x01(\x0b\x32\x18.hipstershop.MoneyAmount\"8\n\x1eGetSupportedCurrenciesResponse\x12\x16\n\x0e\x63urrency_codes\x18\x01 \x03(\t\"F\n\x11\x43onversionRequest\x12 \n\x04\x66rom\x18\x01 \x01(\x0b\x32\x12.hipstershop.Money\x12\x0f\n\x07to_code\x18\x02 \x01(\t\"8\n\x12\x43onversionResponse\x12\"\n\x06result\x18\x01 \x01(\x0b\x32\x12.hipstershop.Money\"\x90\x01\n\x0e\x43reditCardInfo\x12\x1a\n\x12\x63redit_card_number\x18\x01 \x01(\t\x12\x17\n\x0f\x63redit_card_cvv\x18\x02 \x01(\x05\x12#\n\x1b\x63redit_card_expiration_year\x18\x03 \x01(\x05\x12$\n\x1c\x63redit_card_expiration_month\x18\x04 \x01(\x05\"e\n\rChargeRequest\x12\"\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x12.hipstershop.Money\x12\x30\n\x0b\x63redit_card\x18\x02 \x01(\x0b\x32\x1b.hipstershop.CreditCardInfo\"(\n\x0e\x43hargeResponse\x12\x16\n\x0etransaction_id\x18\x01 \x01(\t\"R\n\tOrderItem\x12#\n\x04item\x18\x01 \x01(\x0b\x32\x15.hipstershop.CartItem\x12 \n\x04\x63ost\x18\x02 \x01(\x0b\x32\x12.hipstershop.Money\"\xbf\x01\n\x0bOrderResult\x12\x10\n\x08order_id\x18\x01 \x01(\t\x12\x1c\n\x14shipping_tracking_id\x18\x02 \x01(\t\x12)\n\rshipping_cost\x18\x03 \x01(\x0b\x32\x12.hipstershop.Money\x12.\n\x10shipping_address\x18\x04 \x01(\x0b\x32\x14.hipstershop.Address\x12%\n\x05items\x18\x05 \x03(\x0b\x32\x16.hipstershop.OrderItem\"V\n\x1cSendOrderConfirmationRequest\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\'\n\x05order\x18\x02 \x01(\x0b\x32\x18.hipstershop.OrderResult\"c\n\x12\x43reateOrderRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x15\n\ruser_currency\x18\x02 \x01(\t\x12%\n\x07\x61\x64\x64ress\x18\x03 \x01(\x0b\x32\x14.hipstershop.Address\"g\n\x13\x43reateOrderResponse\x12%\n\x05items\x18\x01 \x03(\x0b\x32\x16.hipstershop.OrderItem\x12)\n\rshipping_cost\x18\x02 \x01(\x0b\x32\x12.hipstershop.Money\"\xa3\x01\n\x11PlaceOrderRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x15\n\ruser_currency\x18\x02 \x01(\t\x12%\n\x07\x61\x64\x64ress\x18\x03 \x01(\x0b\x32\x14.hipstershop.Address\x12\r\n\x05\x65mail\x18\x05 \x01(\t\x12\x30\n\x0b\x63redit_card\x18\x06 \x01(\x0b\x32\x1b.hipstershop.CreditCardInfo\"=\n\x12PlaceOrderResponse\x12\'\n\x05order\x18\x01 \x01(\x0b\x32\x18.hipstershop.OrderResult2\xca\x01\n\x0b\x43\x61rtService\x12<\n\x07\x41\x64\x64Item\x12\x1b.hipstershop.AddItemRequest\x1a\x12.hipstershop.Empty\"\x00\x12;\n\x07GetCart\x12\x1b.hipstershop.GetCartRequest\x1a\x11.hipstershop.Cart\"\x00\x12@\n\tEmptyCart\x12\x1d.hipstershop.EmptyCartRequest\x1a\x12.hipstershop.Empty\"\x00\x32\x83\x01\n\x15RecommendationService\x12j\n\x13ListRecommendations\x12\'.hipstershop.ListRecommendationsRequest\x1a(.hipstershop.ListRecommendationsResponse\"\x00\x32\x83\x02\n\x15ProductCatalogService\x12G\n\x0cListProducts\x12\x12.hipstershop.Empty\x1a!.hipstershop.ListProductsResponse\"\x00\x12\x44\n\nGetProduct\x12\x1e.hipstershop.GetProductRequest\x1a\x14.hipstershop.Product\"\x00\x12[\n\x0eSearchProducts\x12\".hipstershop.SearchProductsRequest\x1a#.hipstershop.SearchProductsResponse\"\x00\x32\xaa\x01\n\x0fShippingService\x12I\n\x08GetQuote\x12\x1c.hipstershop.GetQuoteRequest\x1a\x1d.hipstershop.GetQuoteResponse\"\x00\x12L\n\tShipOrder\x12\x1d.hipstershop.ShipOrderRequest\x1a\x1e.hipstershop.ShipOrderResponse\"\x00\x32\xbc\x01\n\x0f\x43urrencyService\x12[\n\x16GetSupportedCurrencies\x12\x12.hipstershop.Empty\x1a+.hipstershop.GetSupportedCurrenciesResponse\"\x00\x12L\n\x07\x43onvert\x12\x1e.hipstershop.ConversionRequest\x1a\x1f.hipstershop.ConversionResponse\"\x00\x32U\n\x0ePaymentService\x12\x43\n\x06\x43harge\x12\x1a.hipstershop.ChargeRequest\x1a\x1b.hipstershop.ChargeResponse\"\x00\x32h\n\x0c\x45mailService\x12X\n\x15SendOrderConfirmation\x12).hipstershop.SendOrderConfirmationRequest\x1a\x12.hipstershop.Empty\"\x00\x32\xb6\x01\n\x0f\x43heckoutService\x12R\n\x0b\x43reateOrder\x12\x1f.hipstershop.CreateOrderRequest\x1a .hipstershop.CreateOrderResponse\"\x00\x12O\n\nPlaceOrder\x12\x1e.hipstershop.PlaceOrderRequest\x1a\x1f.hipstershop.PlaceOrderResponse\"\x00\x62\x06proto3') + serialized_pb=_b('\n\ndemo.proto\x12\x0bhipstershop\"0\n\x08\x43\x61rtItem\x12\x12\n\nproduct_id\x18\x01 \x01(\t\x12\x10\n\x08quantity\x18\x02 \x01(\x05\"F\n\x0e\x41\x64\x64ItemRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12#\n\x04item\x18\x02 \x01(\x0b\x32\x15.hipstershop.CartItem\"#\n\x10\x45mptyCartRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"!\n\x0eGetCartRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"=\n\x04\x43\x61rt\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12$\n\x05items\x18\x02 \x03(\x0b\x32\x15.hipstershop.CartItem\"\x07\n\x05\x45mpty\"B\n\x1aListRecommendationsRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x13\n\x0bproduct_ids\x18\x02 \x03(\t\"2\n\x1bListRecommendationsResponse\x12\x13\n\x0bproduct_ids\x18\x01 \x03(\t\"v\n\x07Product\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0f\n\x07picture\x18\x04 \x01(\t\x12+\n\tprice_usd\x18\x05 \x01(\x0b\x32\x18.hipstershop.MoneyAmount\">\n\x14ListProductsResponse\x12&\n\x08products\x18\x01 \x03(\x0b\x32\x14.hipstershop.Product\"\x1f\n\x11GetProductRequest\x12\n\n\x02id\x18\x01 \x01(\t\"&\n\x15SearchProductsRequest\x12\r\n\x05query\x18\x01 \x01(\t\"?\n\x16SearchProductsResponse\x12%\n\x07results\x18\x01 \x03(\x0b\x32\x14.hipstershop.Product\"^\n\x0fGetQuoteRequest\x12%\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x14.hipstershop.Address\x12$\n\x05items\x18\x02 \x03(\x0b\x32\x15.hipstershop.CartItem\">\n\x10GetQuoteResponse\x12*\n\x08\x63ost_usd\x18\x01 \x01(\x0b\x32\x18.hipstershop.MoneyAmount\"_\n\x10ShipOrderRequest\x12%\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x14.hipstershop.Address\x12$\n\x05items\x18\x02 \x03(\x0b\x32\x15.hipstershop.CartItem\"(\n\x11ShipOrderResponse\x12\x13\n\x0btracking_id\x18\x01 \x01(\t\"n\n\x07\x41\x64\x64ress\x12\x18\n\x10street_address_1\x18\x01 \x01(\t\x12\x18\n\x10street_address_2\x18\x02 \x01(\t\x12\x0c\n\x04\x63ity\x18\x03 \x01(\t\x12\x0f\n\x07\x63ountry\x18\x04 \x01(\t\x12\x10\n\x08zip_code\x18\x05 \x01(\x05\"2\n\x0bMoneyAmount\x12\x0f\n\x07\x64\x65\x63imal\x18\x01 \x01(\r\x12\x12\n\nfractional\x18\x02 \x01(\r\"H\n\x05Money\x12\x15\n\rcurrency_code\x18\x01 \x01(\t\x12(\n\x06\x61mount\x18\x02 \x01(\x0b\x32\x18.hipstershop.MoneyAmount\"8\n\x1eGetSupportedCurrenciesResponse\x12\x16\n\x0e\x63urrency_codes\x18\x01 \x03(\t\"N\n\x19\x43urrencyConversionRequest\x12 \n\x04\x66rom\x18\x01 \x01(\x0b\x32\x12.hipstershop.Money\x12\x0f\n\x07to_code\x18\x02 \x01(\t\"\x90\x01\n\x0e\x43reditCardInfo\x12\x1a\n\x12\x63redit_card_number\x18\x01 \x01(\t\x12\x17\n\x0f\x63redit_card_cvv\x18\x02 \x01(\x05\x12#\n\x1b\x63redit_card_expiration_year\x18\x03 \x01(\x05\x12$\n\x1c\x63redit_card_expiration_month\x18\x04 \x01(\x05\"e\n\rChargeRequest\x12\"\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x12.hipstershop.Money\x12\x30\n\x0b\x63redit_card\x18\x02 \x01(\x0b\x32\x1b.hipstershop.CreditCardInfo\"(\n\x0e\x43hargeResponse\x12\x16\n\x0etransaction_id\x18\x01 \x01(\t\"R\n\tOrderItem\x12#\n\x04item\x18\x01 \x01(\x0b\x32\x15.hipstershop.CartItem\x12 \n\x04\x63ost\x18\x02 \x01(\x0b\x32\x12.hipstershop.Money\"\xbf\x01\n\x0bOrderResult\x12\x10\n\x08order_id\x18\x01 \x01(\t\x12\x1c\n\x14shipping_tracking_id\x18\x02 \x01(\t\x12)\n\rshipping_cost\x18\x03 \x01(\x0b\x32\x12.hipstershop.Money\x12.\n\x10shipping_address\x18\x04 \x01(\x0b\x32\x14.hipstershop.Address\x12%\n\x05items\x18\x05 \x03(\x0b\x32\x16.hipstershop.OrderItem\"V\n\x1cSendOrderConfirmationRequest\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\'\n\x05order\x18\x02 \x01(\x0b\x32\x18.hipstershop.OrderResult\"c\n\x12\x43reateOrderRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x15\n\ruser_currency\x18\x02 \x01(\t\x12%\n\x07\x61\x64\x64ress\x18\x03 \x01(\x0b\x32\x14.hipstershop.Address\"g\n\x13\x43reateOrderResponse\x12%\n\x05items\x18\x01 \x03(\x0b\x32\x16.hipstershop.OrderItem\x12)\n\rshipping_cost\x18\x02 \x01(\x0b\x32\x12.hipstershop.Money\"\xa3\x01\n\x11PlaceOrderRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x15\n\ruser_currency\x18\x02 \x01(\t\x12%\n\x07\x61\x64\x64ress\x18\x03 \x01(\x0b\x32\x14.hipstershop.Address\x12\r\n\x05\x65mail\x18\x05 \x01(\t\x12\x30\n\x0b\x63redit_card\x18\x06 \x01(\x0b\x32\x1b.hipstershop.CreditCardInfo\"=\n\x12PlaceOrderResponse\x12\'\n\x05order\x18\x01 \x01(\x0b\x32\x18.hipstershop.OrderResult2\xca\x01\n\x0b\x43\x61rtService\x12<\n\x07\x41\x64\x64Item\x12\x1b.hipstershop.AddItemRequest\x1a\x12.hipstershop.Empty\"\x00\x12;\n\x07GetCart\x12\x1b.hipstershop.GetCartRequest\x1a\x11.hipstershop.Cart\"\x00\x12@\n\tEmptyCart\x12\x1d.hipstershop.EmptyCartRequest\x1a\x12.hipstershop.Empty\"\x00\x32\x83\x01\n\x15RecommendationService\x12j\n\x13ListRecommendations\x12\'.hipstershop.ListRecommendationsRequest\x1a(.hipstershop.ListRecommendationsResponse\"\x00\x32\x83\x02\n\x15ProductCatalogService\x12G\n\x0cListProducts\x12\x12.hipstershop.Empty\x1a!.hipstershop.ListProductsResponse\"\x00\x12\x44\n\nGetProduct\x12\x1e.hipstershop.GetProductRequest\x1a\x14.hipstershop.Product\"\x00\x12[\n\x0eSearchProducts\x12\".hipstershop.SearchProductsRequest\x1a#.hipstershop.SearchProductsResponse\"\x00\x32\xaa\x01\n\x0fShippingService\x12I\n\x08GetQuote\x12\x1c.hipstershop.GetQuoteRequest\x1a\x1d.hipstershop.GetQuoteResponse\"\x00\x12L\n\tShipOrder\x12\x1d.hipstershop.ShipOrderRequest\x1a\x1e.hipstershop.ShipOrderResponse\"\x00\x32\xb7\x01\n\x0f\x43urrencyService\x12[\n\x16GetSupportedCurrencies\x12\x12.hipstershop.Empty\x1a+.hipstershop.GetSupportedCurrenciesResponse\"\x00\x12G\n\x07\x43onvert\x12&.hipstershop.CurrencyConversionRequest\x1a\x12.hipstershop.Money\"\x00\x32U\n\x0ePaymentService\x12\x43\n\x06\x43harge\x12\x1a.hipstershop.ChargeRequest\x1a\x1b.hipstershop.ChargeResponse\"\x00\x32h\n\x0c\x45mailService\x12X\n\x15SendOrderConfirmation\x12).hipstershop.SendOrderConfirmationRequest\x1a\x12.hipstershop.Empty\"\x00\x32\xb6\x01\n\x0f\x43heckoutService\x12R\n\x0b\x43reateOrder\x12\x1f.hipstershop.CreateOrderRequest\x1a .hipstershop.CreateOrderResponse\"\x00\x12O\n\nPlaceOrder\x12\x1e.hipstershop.PlaceOrderRequest\x1a\x1f.hipstershop.PlaceOrderResponse\"\x00\x62\x06proto3') ) @@ -303,8 +303,8 @@ _PRODUCT = _descriptor.Descriptor( fields=[ _descriptor.FieldDescriptor( name='id', full_name='hipstershop.Product.id', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), @@ -393,8 +393,8 @@ _GETPRODUCTREQUEST = _descriptor.Descriptor( fields=[ _descriptor.FieldDescriptor( name='id', full_name='hipstershop.GetProductRequest.id', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), @@ -781,22 +781,22 @@ _GETSUPPORTEDCURRENCIESRESPONSE = _descriptor.Descriptor( ) -_CONVERSIONREQUEST = _descriptor.Descriptor( - name='ConversionRequest', - full_name='hipstershop.ConversionRequest', +_CURRENCYCONVERSIONREQUEST = _descriptor.Descriptor( + name='CurrencyConversionRequest', + full_name='hipstershop.CurrencyConversionRequest', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='from', full_name='hipstershop.ConversionRequest.from', index=0, + name='from', full_name='hipstershop.CurrencyConversionRequest.from', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( - name='to_code', full_name='hipstershop.ConversionRequest.to_code', index=1, + name='to_code', full_name='hipstershop.CurrencyConversionRequest.to_code', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, @@ -815,38 +815,7 @@ _CONVERSIONREQUEST = _descriptor.Descriptor( oneofs=[ ], serialized_start=1330, - serialized_end=1400, -) - - -_CONVERSIONRESPONSE = _descriptor.Descriptor( - name='ConversionResponse', - full_name='hipstershop.ConversionResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='result', full_name='hipstershop.ConversionResponse.result', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1402, - serialized_end=1458, + serialized_end=1408, ) @@ -897,8 +866,8 @@ _CREDITCARDINFO = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1461, - serialized_end=1605, + serialized_start=1411, + serialized_end=1555, ) @@ -935,8 +904,8 @@ _CHARGEREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1607, - serialized_end=1708, + serialized_start=1557, + serialized_end=1658, ) @@ -966,8 +935,8 @@ _CHARGERESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1710, - serialized_end=1750, + serialized_start=1660, + serialized_end=1700, ) @@ -1004,8 +973,8 @@ _ORDERITEM = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1752, - serialized_end=1834, + serialized_start=1702, + serialized_end=1784, ) @@ -1063,8 +1032,8 @@ _ORDERRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1837, - serialized_end=2028, + serialized_start=1787, + serialized_end=1978, ) @@ -1101,8 +1070,8 @@ _SENDORDERCONFIRMATIONREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2030, - serialized_end=2116, + serialized_start=1980, + serialized_end=2066, ) @@ -1146,8 +1115,8 @@ _CREATEORDERREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2118, - serialized_end=2217, + serialized_start=2068, + serialized_end=2167, ) @@ -1184,8 +1153,8 @@ _CREATEORDERRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2219, - serialized_end=2322, + serialized_start=2169, + serialized_end=2272, ) @@ -1243,8 +1212,8 @@ _PLACEORDERREQUEST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2325, - serialized_end=2488, + serialized_start=2275, + serialized_end=2438, ) @@ -1274,8 +1243,8 @@ _PLACEORDERRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2490, - serialized_end=2551, + serialized_start=2440, + serialized_end=2501, ) _ADDITEMREQUEST.fields_by_name['item'].message_type = _CARTITEM @@ -1289,8 +1258,7 @@ _GETQUOTERESPONSE.fields_by_name['cost_usd'].message_type = _MONEYAMOUNT _SHIPORDERREQUEST.fields_by_name['address'].message_type = _ADDRESS _SHIPORDERREQUEST.fields_by_name['items'].message_type = _CARTITEM _MONEY.fields_by_name['amount'].message_type = _MONEYAMOUNT -_CONVERSIONREQUEST.fields_by_name['from'].message_type = _MONEY -_CONVERSIONRESPONSE.fields_by_name['result'].message_type = _MONEY +_CURRENCYCONVERSIONREQUEST.fields_by_name['from'].message_type = _MONEY _CHARGEREQUEST.fields_by_name['amount'].message_type = _MONEY _CHARGEREQUEST.fields_by_name['credit_card'].message_type = _CREDITCARDINFO _ORDERITEM.fields_by_name['item'].message_type = _CARTITEM @@ -1326,8 +1294,7 @@ DESCRIPTOR.message_types_by_name['Address'] = _ADDRESS DESCRIPTOR.message_types_by_name['MoneyAmount'] = _MONEYAMOUNT DESCRIPTOR.message_types_by_name['Money'] = _MONEY DESCRIPTOR.message_types_by_name['GetSupportedCurrenciesResponse'] = _GETSUPPORTEDCURRENCIESRESPONSE -DESCRIPTOR.message_types_by_name['ConversionRequest'] = _CONVERSIONREQUEST -DESCRIPTOR.message_types_by_name['ConversionResponse'] = _CONVERSIONRESPONSE +DESCRIPTOR.message_types_by_name['CurrencyConversionRequest'] = _CURRENCYCONVERSIONREQUEST DESCRIPTOR.message_types_by_name['CreditCardInfo'] = _CREDITCARDINFO DESCRIPTOR.message_types_by_name['ChargeRequest'] = _CHARGEREQUEST DESCRIPTOR.message_types_by_name['ChargeResponse'] = _CHARGERESPONSE @@ -1487,19 +1454,12 @@ GetSupportedCurrenciesResponse = _reflection.GeneratedProtocolMessageType('GetSu )) _sym_db.RegisterMessage(GetSupportedCurrenciesResponse) -ConversionRequest = _reflection.GeneratedProtocolMessageType('ConversionRequest', (_message.Message,), dict( - DESCRIPTOR = _CONVERSIONREQUEST, +CurrencyConversionRequest = _reflection.GeneratedProtocolMessageType('CurrencyConversionRequest', (_message.Message,), dict( + DESCRIPTOR = _CURRENCYCONVERSIONREQUEST, __module__ = 'demo_pb2' - # @@protoc_insertion_point(class_scope:hipstershop.ConversionRequest) + # @@protoc_insertion_point(class_scope:hipstershop.CurrencyConversionRequest) )) -_sym_db.RegisterMessage(ConversionRequest) - -ConversionResponse = _reflection.GeneratedProtocolMessageType('ConversionResponse', (_message.Message,), dict( - DESCRIPTOR = _CONVERSIONRESPONSE, - __module__ = 'demo_pb2' - # @@protoc_insertion_point(class_scope:hipstershop.ConversionResponse) - )) -_sym_db.RegisterMessage(ConversionResponse) +_sym_db.RegisterMessage(CurrencyConversionRequest) CreditCardInfo = _reflection.GeneratedProtocolMessageType('CreditCardInfo', (_message.Message,), dict( DESCRIPTOR = _CREDITCARDINFO, @@ -1579,8 +1539,8 @@ _CARTSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, options=None, - serialized_start=2554, - serialized_end=2756, + serialized_start=2504, + serialized_end=2706, methods=[ _descriptor.MethodDescriptor( name='AddItem', @@ -1621,8 +1581,8 @@ _RECOMMENDATIONSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=1, options=None, - serialized_start=2759, - serialized_end=2890, + serialized_start=2709, + serialized_end=2840, methods=[ _descriptor.MethodDescriptor( name='ListRecommendations', @@ -1645,8 +1605,8 @@ _PRODUCTCATALOGSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=2, options=None, - serialized_start=2893, - serialized_end=3152, + serialized_start=2843, + serialized_end=3102, methods=[ _descriptor.MethodDescriptor( name='ListProducts', @@ -1687,8 +1647,8 @@ _SHIPPINGSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=3, options=None, - serialized_start=3155, - serialized_end=3325, + serialized_start=3105, + serialized_end=3275, methods=[ _descriptor.MethodDescriptor( name='GetQuote', @@ -1720,8 +1680,8 @@ _CURRENCYSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=4, options=None, - serialized_start=3328, - serialized_end=3516, + serialized_start=3278, + serialized_end=3461, methods=[ _descriptor.MethodDescriptor( name='GetSupportedCurrencies', @@ -1737,8 +1697,8 @@ _CURRENCYSERVICE = _descriptor.ServiceDescriptor( full_name='hipstershop.CurrencyService.Convert', index=1, containing_service=None, - input_type=_CONVERSIONREQUEST, - output_type=_CONVERSIONRESPONSE, + input_type=_CURRENCYCONVERSIONREQUEST, + output_type=_MONEY, options=None, ), ]) @@ -1753,8 +1713,8 @@ _PAYMENTSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=5, options=None, - serialized_start=3518, - serialized_end=3603, + serialized_start=3463, + serialized_end=3548, methods=[ _descriptor.MethodDescriptor( name='Charge', @@ -1777,8 +1737,8 @@ _EMAILSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=6, options=None, - serialized_start=3605, - serialized_end=3709, + serialized_start=3550, + serialized_end=3654, methods=[ _descriptor.MethodDescriptor( name='SendOrderConfirmation', @@ -1801,8 +1761,8 @@ _CHECKOUTSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=7, options=None, - serialized_start=3712, - serialized_end=3894, + serialized_start=3657, + serialized_end=3839, methods=[ _descriptor.MethodDescriptor( name='CreateOrder', diff --git a/src/recommendationservice/demo_pb2_grpc.py b/src/recommendationservice/demo_pb2_grpc.py index 5b529af..86e0815 100644 --- a/src/recommendationservice/demo_pb2_grpc.py +++ b/src/recommendationservice/demo_pb2_grpc.py @@ -283,8 +283,8 @@ class CurrencyServiceStub(object): ) self.Convert = channel.unary_unary( '/hipstershop.CurrencyService/Convert', - request_serializer=demo__pb2.ConversionRequest.SerializeToString, - response_deserializer=demo__pb2.ConversionResponse.FromString, + request_serializer=demo__pb2.CurrencyConversionRequest.SerializeToString, + response_deserializer=demo__pb2.Money.FromString, ) @@ -317,8 +317,8 @@ def add_CurrencyServiceServicer_to_server(servicer, server): ), 'Convert': grpc.unary_unary_rpc_method_handler( servicer.Convert, - request_deserializer=demo__pb2.ConversionRequest.FromString, - response_serializer=demo__pb2.ConversionResponse.SerializeToString, + request_deserializer=demo__pb2.CurrencyConversionRequest.FromString, + response_serializer=demo__pb2.Money.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( diff --git a/src/recommendationservice/recommendation_server.py b/src/recommendationservice/recommendation_server.py index 97246db..fa8bd70 100644 --- a/src/recommendationservice/recommendation_server.py +++ b/src/recommendationservice/recommendation_server.py @@ -9,15 +9,14 @@ import os class RecommendationService(demo_pb2_grpc.RecommendationServiceServicer): def ListRecommendations(self, request, context): max_responses = 5 - print("handling request") # get list of products cat_response = stub.ListProducts(demo_pb2.Empty()) num_prodcuts = len(cat_response.products) indices = random.sample(range(num_prodcuts), min(max_responses, num_prodcuts)) - prod_list = [str(cat_response.products[i].id) for i in indices] - print(indices, prod_list) + prod_list = [cat_response.products[i].id for i in indices] + print("handling request: {}".format(prod_list)) response = demo_pb2.ListRecommendationsResponse() response.product_ids.extend(prod_list)