diff --git a/src/cartservice/CartServiceImpl.cs b/src/cartservice/CartServiceImpl.cs new file mode 100644 index 0000000..e1cbb49 --- /dev/null +++ b/src/cartservice/CartServiceImpl.cs @@ -0,0 +1,120 @@ +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Grpc.Core; +using Hipstershop; +using static Hipstershop.CartService; + +namespace cartservice +{ + // Cart wrapper to deal with grpc communication + internal class CartServiceImpl : CartServiceBase + { + private CartStore cartStore; + + public CartServiceImpl(CartStore cartStore) + { + this.cartStore = cartStore; + } + + public override Task AddItem(AddItemRequest request, Grpc.Core.ServerCallContext context) + { + cartStore.AddItem(request.UserId, request.Item.ProductId, request.Item.Quantity); + return Task.FromResult(new Empty()); + } + + public override Task EmptyCart(EmptyCartRequest request, ServerCallContext context) + { + cartStore.EmptyCart(request.UserId); + return Task.FromResult(new Empty()); + } + + public override Task GetCart(GetCartRequest request, ServerCallContext context) + { + var cart = cartStore.GetCart(request.UserId); + return Task.FromResult(cart.ToHipsterCart()); + } + } + + internal class CartStore + { + // Maps between user and their cart + private ConcurrentDictionary userCartItems = new ConcurrentDictionary(); + + public void AddItem(string userId, string productId, int quantity) + { + Cart cart; + if (!userCartItems.TryGetValue(userId, out cart)) + { + cart = new Cart(userId); + } + else + { + cart = userCartItems[userId]; + } + cart.AddItem(productId, quantity); + } + + public void EmptyCart(string userId) + { + Cart cart; + if (userCartItems.TryGetValue(userId, out cart)) + { + cart.EmptyCart(); + } + } + + public Cart GetCart(string userId) + { + Cart cart = null; + userCartItems.TryGetValue(userId, out cart); + return cart; + } + } + + internal static class CartUtils + { + public static Hipstershop.Cart ToHipsterCart(this Cart cart) + { + var hipsterCart = new Hipstershop.Cart + { + UserId = cart.UserId, + Items = { cart.Items.Select(i => new CartItem { ProductId = i.Key, Quantity = i.Value }) } + }; + return hipsterCart; + } + } + + // Actual implementation of the cart + internal class Cart + { + // Maps between productId and its quantity + private Dictionary cart = new Dictionary(); + + public Cart(string userId) + { + UserId = userId; + } + + public string UserId { get; set; } + + public void AddItem(string productId, int quantity) + { + cart.Add(productId, quantity); + } + + public void EmptyCart() + { + cart.Clear(); + } + + public IReadOnlyDictionary Items + { + get + { + return cart; + } + } + } +} \ No newline at end of file diff --git a/src/cartservice/Demo.cs b/src/cartservice/Demo.cs new file mode 100644 index 0000000..f53469d --- /dev/null +++ b/src/cartservice/Demo.cs @@ -0,0 +1,5394 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: demo.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Hipstershop { + + /// Holder for reflection information generated from demo.proto + public static partial class DemoReflection { + + #region Descriptor + /// File descriptor for demo.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DemoReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgpkZW1vLnByb3RvEgtoaXBzdGVyc2hvcCIwCghDYXJ0SXRlbRISCgpwcm9k", + "dWN0X2lkGAEgASgJEhAKCHF1YW50aXR5GAIgASgFIkYKDkFkZEl0ZW1SZXF1", + "ZXN0Eg8KB3VzZXJfaWQYASABKAkSIwoEaXRlbRgCIAEoCzIVLmhpcHN0ZXJz", + "aG9wLkNhcnRJdGVtIiMKEEVtcHR5Q2FydFJlcXVlc3QSDwoHdXNlcl9pZBgB", + "IAEoCSIhCg5HZXRDYXJ0UmVxdWVzdBIPCgd1c2VyX2lkGAEgASgJIj0KBENh", + "cnQSDwoHdXNlcl9pZBgBIAEoCRIkCgVpdGVtcxgCIAMoCzIVLmhpcHN0ZXJz", + "aG9wLkNhcnRJdGVtIgcKBUVtcHR5IkIKGkxpc3RSZWNvbW1lbmRhdGlvbnNS", + "ZXF1ZXN0Eg8KB3VzZXJfaWQYASABKAkSEwoLcHJvZHVjdF9pZHMYAiADKAki", + "MgobTGlzdFJlY29tbWVuZGF0aW9uc1Jlc3BvbnNlEhMKC3Byb2R1Y3RfaWRz", + "GAEgAygJInYKB1Byb2R1Y3QSCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRIT", + "CgtkZXNjcmlwdGlvbhgDIAEoCRIPCgdwaWN0dXJlGAQgASgJEisKCXByaWNl", + "X3VzZBgFIAEoCzIYLmhpcHN0ZXJzaG9wLk1vbmV5QW1vdW50Ij4KFExpc3RQ", + "cm9kdWN0c1Jlc3BvbnNlEiYKCHByb2R1Y3RzGAEgAygLMhQuaGlwc3RlcnNo", + "b3AuUHJvZHVjdCIfChFHZXRQcm9kdWN0UmVxdWVzdBIKCgJpZBgBIAEoCSIm", + "ChVTZWFyY2hQcm9kdWN0c1JlcXVlc3QSDQoFcXVlcnkYASABKAkiPwoWU2Vh", + "cmNoUHJvZHVjdHNSZXNwb25zZRIlCgdyZXN1bHRzGAEgAygLMhQuaGlwc3Rl", + "cnNob3AuUHJvZHVjdCJeCg9HZXRRdW90ZVJlcXVlc3QSJQoHYWRkcmVzcxgB", + "IAEoCzIULmhpcHN0ZXJzaG9wLkFkZHJlc3MSJAoFaXRlbXMYAiADKAsyFS5o", + "aXBzdGVyc2hvcC5DYXJ0SXRlbSI+ChBHZXRRdW90ZVJlc3BvbnNlEioKCGNv", + "c3RfdXNkGAEgASgLMhguaGlwc3RlcnNob3AuTW9uZXlBbW91bnQiXwoQU2hp", + "cE9yZGVyUmVxdWVzdBIlCgdhZGRyZXNzGAEgASgLMhQuaGlwc3RlcnNob3Au", + "QWRkcmVzcxIkCgVpdGVtcxgCIAMoCzIVLmhpcHN0ZXJzaG9wLkNhcnRJdGVt", + "IigKEVNoaXBPcmRlclJlc3BvbnNlEhMKC3RyYWNraW5nX2lkGAEgASgJIm4K", + "B0FkZHJlc3MSGAoQc3RyZWV0X2FkZHJlc3NfMRgBIAEoCRIYChBzdHJlZXRf", + "YWRkcmVzc18yGAIgASgJEgwKBGNpdHkYAyABKAkSDwoHY291bnRyeRgEIAEo", + "CRIQCgh6aXBfY29kZRgFIAEoBSIyCgtNb25leUFtb3VudBIPCgdkZWNpbWFs", + "GAEgASgNEhIKCmZyYWN0aW9uYWwYAiABKA0iSAoFTW9uZXkSFQoNY3VycmVu", + "Y3lfY29kZRgBIAEoCRIoCgZhbW91bnQYAiABKAsyGC5oaXBzdGVyc2hvcC5N", + "b25leUFtb3VudCI4Ch5HZXRTdXBwb3J0ZWRDdXJyZW5jaWVzUmVzcG9uc2US", + "FgoOY3VycmVuY3lfY29kZXMYASADKAkiRgoRQ29udmVyc2lvblJlcXVlc3QS", + "IAoEZnJvbRgBIAEoCzISLmhpcHN0ZXJzaG9wLk1vbmV5Eg8KB3RvX2NvZGUY", + "AiABKAkiOAoSQ29udmVyc2lvblJlc3BvbnNlEiIKBnJlc3VsdBgBIAEoCzIS", + "LmhpcHN0ZXJzaG9wLk1vbmV5IpABCg5DcmVkaXRDYXJkSW5mbxIaChJjcmVk", + "aXRfY2FyZF9udW1iZXIYASABKAkSFwoPY3JlZGl0X2NhcmRfY3Z2GAIgASgF", + "EiMKG2NyZWRpdF9jYXJkX2V4cGlyYXRpb25feWVhchgDIAEoBRIkChxjcmVk", + "aXRfY2FyZF9leHBpcmF0aW9uX21vbnRoGAQgASgFImUKDUNoYXJnZVJlcXVl", + "c3QSIgoGYW1vdW50GAEgASgLMhIuaGlwc3RlcnNob3AuTW9uZXkSMAoLY3Jl", + "ZGl0X2NhcmQYAiABKAsyGy5oaXBzdGVyc2hvcC5DcmVkaXRDYXJkSW5mbyIo", + "Cg5DaGFyZ2VSZXNwb25zZRIWCg50cmFuc2FjdGlvbl9pZBgBIAEoCSJSCglP", + "cmRlckl0ZW0SIwoEaXRlbRgBIAEoCzIVLmhpcHN0ZXJzaG9wLkNhcnRJdGVt", + "EiAKBGNvc3QYAiABKAsyEi5oaXBzdGVyc2hvcC5Nb25leSK/AQoLT3JkZXJS", + "ZXN1bHQSEAoIb3JkZXJfaWQYASABKAkSHAoUc2hpcHBpbmdfdHJhY2tpbmdf", + "aWQYAiABKAkSKQoNc2hpcHBpbmdfY29zdBgDIAEoCzISLmhpcHN0ZXJzaG9w", + "Lk1vbmV5Ei4KEHNoaXBwaW5nX2FkZHJlc3MYBCABKAsyFC5oaXBzdGVyc2hv", + "cC5BZGRyZXNzEiUKBWl0ZW1zGAUgAygLMhYuaGlwc3RlcnNob3AuT3JkZXJJ", + "dGVtIlYKHFNlbmRPcmRlckNvbmZpcm1hdGlvblJlcXVlc3QSDQoFZW1haWwY", + "ASABKAkSJwoFb3JkZXIYAiABKAsyGC5oaXBzdGVyc2hvcC5PcmRlclJlc3Vs", + "dCJjChJDcmVhdGVPcmRlclJlcXVlc3QSDwoHdXNlcl9pZBgBIAEoCRIVCg11", + "c2VyX2N1cnJlbmN5GAIgASgJEiUKB2FkZHJlc3MYAyABKAsyFC5oaXBzdGVy", + "c2hvcC5BZGRyZXNzImcKE0NyZWF0ZU9yZGVyUmVzcG9uc2USJQoFaXRlbXMY", + "ASADKAsyFi5oaXBzdGVyc2hvcC5PcmRlckl0ZW0SKQoNc2hpcHBpbmdfY29z", + "dBgCIAEoCzISLmhpcHN0ZXJzaG9wLk1vbmV5IqMBChFQbGFjZU9yZGVyUmVx", + "dWVzdBIPCgd1c2VyX2lkGAEgASgJEhUKDXVzZXJfY3VycmVuY3kYAiABKAkS", + "JQoHYWRkcmVzcxgDIAEoCzIULmhpcHN0ZXJzaG9wLkFkZHJlc3MSDQoFZW1h", + "aWwYBSABKAkSMAoLY3JlZGl0X2NhcmQYBiABKAsyGy5oaXBzdGVyc2hvcC5D", + "cmVkaXRDYXJkSW5mbyI9ChJQbGFjZU9yZGVyUmVzcG9uc2USJwoFb3JkZXIY", + "ASABKAsyGC5oaXBzdGVyc2hvcC5PcmRlclJlc3VsdDLKAQoLQ2FydFNlcnZp", + "Y2USPAoHQWRkSXRlbRIbLmhpcHN0ZXJzaG9wLkFkZEl0ZW1SZXF1ZXN0GhIu", + "aGlwc3RlcnNob3AuRW1wdHkiABI7CgdHZXRDYXJ0EhsuaGlwc3RlcnNob3Au", + "R2V0Q2FydFJlcXVlc3QaES5oaXBzdGVyc2hvcC5DYXJ0IgASQAoJRW1wdHlD", + "YXJ0Eh0uaGlwc3RlcnNob3AuRW1wdHlDYXJ0UmVxdWVzdBoSLmhpcHN0ZXJz", + "aG9wLkVtcHR5IgAygwEKFVJlY29tbWVuZGF0aW9uU2VydmljZRJqChNMaXN0", + "UmVjb21tZW5kYXRpb25zEicuaGlwc3RlcnNob3AuTGlzdFJlY29tbWVuZGF0", + "aW9uc1JlcXVlc3QaKC5oaXBzdGVyc2hvcC5MaXN0UmVjb21tZW5kYXRpb25z", + "UmVzcG9uc2UiADKDAgoVUHJvZHVjdENhdGFsb2dTZXJ2aWNlEkcKDExpc3RQ", + "cm9kdWN0cxISLmhpcHN0ZXJzaG9wLkVtcHR5GiEuaGlwc3RlcnNob3AuTGlz", + "dFByb2R1Y3RzUmVzcG9uc2UiABJECgpHZXRQcm9kdWN0Eh4uaGlwc3RlcnNo", + "b3AuR2V0UHJvZHVjdFJlcXVlc3QaFC5oaXBzdGVyc2hvcC5Qcm9kdWN0IgAS", + "WwoOU2VhcmNoUHJvZHVjdHMSIi5oaXBzdGVyc2hvcC5TZWFyY2hQcm9kdWN0", + "c1JlcXVlc3QaIy5oaXBzdGVyc2hvcC5TZWFyY2hQcm9kdWN0c1Jlc3BvbnNl", + "IgAyqgEKD1NoaXBwaW5nU2VydmljZRJJCghHZXRRdW90ZRIcLmhpcHN0ZXJz", + "aG9wLkdldFF1b3RlUmVxdWVzdBodLmhpcHN0ZXJzaG9wLkdldFF1b3RlUmVz", + "cG9uc2UiABJMCglTaGlwT3JkZXISHS5oaXBzdGVyc2hvcC5TaGlwT3JkZXJS", + "ZXF1ZXN0Gh4uaGlwc3RlcnNob3AuU2hpcE9yZGVyUmVzcG9uc2UiADK8AQoP", + "Q3VycmVuY3lTZXJ2aWNlElsKFkdldFN1cHBvcnRlZEN1cnJlbmNpZXMSEi5o", + "aXBzdGVyc2hvcC5FbXB0eRorLmhpcHN0ZXJzaG9wLkdldFN1cHBvcnRlZEN1", + "cnJlbmNpZXNSZXNwb25zZSIAEkwKB0NvbnZlcnQSHi5oaXBzdGVyc2hvcC5D", + "b252ZXJzaW9uUmVxdWVzdBofLmhpcHN0ZXJzaG9wLkNvbnZlcnNpb25SZXNw", + "b25zZSIAMlUKDlBheW1lbnRTZXJ2aWNlEkMKBkNoYXJnZRIaLmhpcHN0ZXJz", + "aG9wLkNoYXJnZVJlcXVlc3QaGy5oaXBzdGVyc2hvcC5DaGFyZ2VSZXNwb25z", + "ZSIAMmgKDEVtYWlsU2VydmljZRJYChVTZW5kT3JkZXJDb25maXJtYXRpb24S", + "KS5oaXBzdGVyc2hvcC5TZW5kT3JkZXJDb25maXJtYXRpb25SZXF1ZXN0GhIu", + "aGlwc3RlcnNob3AuRW1wdHkiADK2AQoPQ2hlY2tvdXRTZXJ2aWNlElIKC0Ny", + "ZWF0ZU9yZGVyEh8uaGlwc3RlcnNob3AuQ3JlYXRlT3JkZXJSZXF1ZXN0GiAu", + "aGlwc3RlcnNob3AuQ3JlYXRlT3JkZXJSZXNwb25zZSIAEk8KClBsYWNlT3Jk", + "ZXISHi5oaXBzdGVyc2hvcC5QbGFjZU9yZGVyUmVxdWVzdBofLmhpcHN0ZXJz", + "aG9wLlBsYWNlT3JkZXJSZXNwb25zZSIAYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.CartItem), global::Hipstershop.CartItem.Parser, new[]{ "ProductId", "Quantity" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.AddItemRequest), global::Hipstershop.AddItemRequest.Parser, new[]{ "UserId", "Item" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.EmptyCartRequest), global::Hipstershop.EmptyCartRequest.Parser, new[]{ "UserId" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.GetCartRequest), global::Hipstershop.GetCartRequest.Parser, new[]{ "UserId" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.Cart), global::Hipstershop.Cart.Parser, new[]{ "UserId", "Items" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.Empty), global::Hipstershop.Empty.Parser, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.ListRecommendationsRequest), global::Hipstershop.ListRecommendationsRequest.Parser, new[]{ "UserId", "ProductIds" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.ListRecommendationsResponse), global::Hipstershop.ListRecommendationsResponse.Parser, new[]{ "ProductIds" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.Product), global::Hipstershop.Product.Parser, new[]{ "Id", "Name", "Description", "Picture", "PriceUsd" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.ListProductsResponse), global::Hipstershop.ListProductsResponse.Parser, new[]{ "Products" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.GetProductRequest), global::Hipstershop.GetProductRequest.Parser, new[]{ "Id" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.SearchProductsRequest), global::Hipstershop.SearchProductsRequest.Parser, new[]{ "Query" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.SearchProductsResponse), global::Hipstershop.SearchProductsResponse.Parser, new[]{ "Results" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.GetQuoteRequest), global::Hipstershop.GetQuoteRequest.Parser, new[]{ "Address", "Items" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.GetQuoteResponse), global::Hipstershop.GetQuoteResponse.Parser, new[]{ "CostUsd" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.ShipOrderRequest), global::Hipstershop.ShipOrderRequest.Parser, new[]{ "Address", "Items" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.ShipOrderResponse), global::Hipstershop.ShipOrderResponse.Parser, new[]{ "TrackingId" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.Address), global::Hipstershop.Address.Parser, new[]{ "StreetAddress1", "StreetAddress2", "City", "Country", "ZipCode" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.MoneyAmount), global::Hipstershop.MoneyAmount.Parser, new[]{ "Decimal", "Fractional" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.Money), global::Hipstershop.Money.Parser, new[]{ "CurrencyCode", "Amount" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.GetSupportedCurrenciesResponse), global::Hipstershop.GetSupportedCurrenciesResponse.Parser, new[]{ "CurrencyCodes" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.ConversionRequest), global::Hipstershop.ConversionRequest.Parser, new[]{ "From", "ToCode" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.ConversionResponse), global::Hipstershop.ConversionResponse.Parser, new[]{ "Result" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.CreditCardInfo), global::Hipstershop.CreditCardInfo.Parser, new[]{ "CreditCardNumber", "CreditCardCvv", "CreditCardExpirationYear", "CreditCardExpirationMonth" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.ChargeRequest), global::Hipstershop.ChargeRequest.Parser, new[]{ "Amount", "CreditCard" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.ChargeResponse), global::Hipstershop.ChargeResponse.Parser, new[]{ "TransactionId" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.OrderItem), global::Hipstershop.OrderItem.Parser, new[]{ "Item", "Cost" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.OrderResult), global::Hipstershop.OrderResult.Parser, new[]{ "OrderId", "ShippingTrackingId", "ShippingCost", "ShippingAddress", "Items" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.SendOrderConfirmationRequest), global::Hipstershop.SendOrderConfirmationRequest.Parser, new[]{ "Email", "Order" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.CreateOrderRequest), global::Hipstershop.CreateOrderRequest.Parser, new[]{ "UserId", "UserCurrency", "Address" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.CreateOrderResponse), global::Hipstershop.CreateOrderResponse.Parser, new[]{ "Items", "ShippingCost" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.PlaceOrderRequest), global::Hipstershop.PlaceOrderRequest.Parser, new[]{ "UserId", "UserCurrency", "Address", "Email", "CreditCard" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.PlaceOrderResponse), global::Hipstershop.PlaceOrderResponse.Parser, new[]{ "Order" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class CartItem : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CartItem()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CartItem() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CartItem(CartItem other) : this() { + productId_ = other.productId_; + quantity_ = other.quantity_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CartItem Clone() { + return new CartItem(this); + } + + /// Field number for the "product_id" field. + public const int ProductIdFieldNumber = 1; + private string productId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ProductId { + get { return productId_; } + set { + productId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "quantity" field. + public const int QuantityFieldNumber = 2; + private int quantity_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Quantity { + get { return quantity_; } + set { + quantity_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CartItem); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CartItem other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ProductId != other.ProductId) return false; + if (Quantity != other.Quantity) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (ProductId.Length != 0) hash ^= ProductId.GetHashCode(); + if (Quantity != 0) hash ^= Quantity.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (ProductId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(ProductId); + } + if (Quantity != 0) { + output.WriteRawTag(16); + output.WriteInt32(Quantity); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (ProductId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ProductId); + } + if (Quantity != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Quantity); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CartItem other) { + if (other == null) { + return; + } + if (other.ProductId.Length != 0) { + ProductId = other.ProductId; + } + if (other.Quantity != 0) { + Quantity = other.Quantity; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ProductId = input.ReadString(); + break; + } + case 16: { + Quantity = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class AddItemRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddItemRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AddItemRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AddItemRequest(AddItemRequest other) : this() { + userId_ = other.userId_; + Item = other.item_ != null ? other.Item.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AddItemRequest Clone() { + return new AddItemRequest(this); + } + + /// Field number for the "user_id" field. + public const int UserIdFieldNumber = 1; + private string userId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UserId { + get { return userId_; } + set { + userId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "item" field. + public const int ItemFieldNumber = 2; + private global::Hipstershop.CartItem item_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.CartItem Item { + get { return item_; } + set { + item_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AddItemRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AddItemRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UserId != other.UserId) return false; + if (!object.Equals(Item, other.Item)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (UserId.Length != 0) hash ^= UserId.GetHashCode(); + if (item_ != null) hash ^= Item.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (UserId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(UserId); + } + if (item_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Item); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (UserId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UserId); + } + if (item_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Item); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AddItemRequest other) { + if (other == null) { + return; + } + if (other.UserId.Length != 0) { + UserId = other.UserId; + } + if (other.item_ != null) { + if (item_ == null) { + item_ = new global::Hipstershop.CartItem(); + } + Item.MergeFrom(other.Item); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + UserId = input.ReadString(); + break; + } + case 18: { + if (item_ == null) { + item_ = new global::Hipstershop.CartItem(); + } + input.ReadMessage(item_); + break; + } + } + } + } + + } + + public sealed partial class EmptyCartRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EmptyCartRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public EmptyCartRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public EmptyCartRequest(EmptyCartRequest other) : this() { + userId_ = other.userId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public EmptyCartRequest Clone() { + return new EmptyCartRequest(this); + } + + /// Field number for the "user_id" field. + public const int UserIdFieldNumber = 1; + private string userId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UserId { + get { return userId_; } + set { + userId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as EmptyCartRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(EmptyCartRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UserId != other.UserId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (UserId.Length != 0) hash ^= UserId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (UserId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(UserId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (UserId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UserId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(EmptyCartRequest other) { + if (other == null) { + return; + } + if (other.UserId.Length != 0) { + UserId = other.UserId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + UserId = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class GetCartRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetCartRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetCartRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetCartRequest(GetCartRequest other) : this() { + userId_ = other.userId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetCartRequest Clone() { + return new GetCartRequest(this); + } + + /// Field number for the "user_id" field. + public const int UserIdFieldNumber = 1; + private string userId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UserId { + get { return userId_; } + set { + userId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetCartRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetCartRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UserId != other.UserId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (UserId.Length != 0) hash ^= UserId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (UserId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(UserId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (UserId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UserId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetCartRequest other) { + if (other == null) { + return; + } + if (other.UserId.Length != 0) { + UserId = other.UserId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + UserId = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class Cart : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Cart()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Cart() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Cart(Cart other) : this() { + userId_ = other.userId_; + items_ = other.items_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Cart Clone() { + return new Cart(this); + } + + /// Field number for the "user_id" field. + public const int UserIdFieldNumber = 1; + private string userId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UserId { + get { return userId_; } + set { + userId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "items" field. + public const int ItemsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_items_codec + = pb::FieldCodec.ForMessage(18, global::Hipstershop.CartItem.Parser); + private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Items { + get { return items_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Cart); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Cart other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UserId != other.UserId) return false; + if(!items_.Equals(other.items_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (UserId.Length != 0) hash ^= UserId.GetHashCode(); + hash ^= items_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (UserId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(UserId); + } + items_.WriteTo(output, _repeated_items_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (UserId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UserId); + } + size += items_.CalculateSize(_repeated_items_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Cart other) { + if (other == null) { + return; + } + if (other.UserId.Length != 0) { + UserId = other.UserId; + } + items_.Add(other.items_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + UserId = input.ReadString(); + break; + } + case 18: { + items_.AddEntriesFrom(input, _repeated_items_codec); + break; + } + } + } + } + + } + + public sealed partial class Empty : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Empty() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Empty(Empty other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Empty Clone() { + return new Empty(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Empty); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Empty other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Empty other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + } + + } + + public sealed partial class ListRecommendationsRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListRecommendationsRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ListRecommendationsRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ListRecommendationsRequest(ListRecommendationsRequest other) : this() { + userId_ = other.userId_; + productIds_ = other.productIds_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ListRecommendationsRequest Clone() { + return new ListRecommendationsRequest(this); + } + + /// Field number for the "user_id" field. + public const int UserIdFieldNumber = 1; + private string userId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UserId { + get { return userId_; } + set { + userId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "product_ids" field. + public const int ProductIdsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_productIds_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField productIds_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ProductIds { + get { return productIds_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ListRecommendationsRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ListRecommendationsRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UserId != other.UserId) return false; + if(!productIds_.Equals(other.productIds_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (UserId.Length != 0) hash ^= UserId.GetHashCode(); + hash ^= productIds_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (UserId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(UserId); + } + productIds_.WriteTo(output, _repeated_productIds_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (UserId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UserId); + } + size += productIds_.CalculateSize(_repeated_productIds_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ListRecommendationsRequest other) { + if (other == null) { + return; + } + if (other.UserId.Length != 0) { + UserId = other.UserId; + } + productIds_.Add(other.productIds_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + UserId = input.ReadString(); + break; + } + case 18: { + productIds_.AddEntriesFrom(input, _repeated_productIds_codec); + break; + } + } + } + } + + } + + public sealed partial class ListRecommendationsResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListRecommendationsResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ListRecommendationsResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ListRecommendationsResponse(ListRecommendationsResponse other) : this() { + productIds_ = other.productIds_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ListRecommendationsResponse Clone() { + return new ListRecommendationsResponse(this); + } + + /// Field number for the "product_ids" field. + public const int ProductIdsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_productIds_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField productIds_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ProductIds { + get { return productIds_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ListRecommendationsResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ListRecommendationsResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!productIds_.Equals(other.productIds_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= productIds_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + productIds_.WriteTo(output, _repeated_productIds_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += productIds_.CalculateSize(_repeated_productIds_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ListRecommendationsResponse other) { + if (other == null) { + return; + } + productIds_.Add(other.productIds_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + productIds_.AddEntriesFrom(input, _repeated_productIds_codec); + break; + } + } + } + } + + } + + public sealed partial class Product : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Product()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Product() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Product(Product other) : this() { + id_ = other.id_; + name_ = other.name_; + description_ = other.description_; + picture_ = other.picture_; + PriceUsd = other.priceUsd_ != null ? other.PriceUsd.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Product Clone() { + return new Product(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 2; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "description" field. + public const int DescriptionFieldNumber = 3; + private string description_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Description { + get { return description_; } + set { + description_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "picture" field. + public const int PictureFieldNumber = 4; + private string picture_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Picture { + get { return picture_; } + set { + picture_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "price_usd" field. + public const int PriceUsdFieldNumber = 5; + private global::Hipstershop.MoneyAmount priceUsd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.MoneyAmount PriceUsd { + get { return priceUsd_; } + set { + priceUsd_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Product); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Product other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + if (Name != other.Name) return false; + if (Description != other.Description) return false; + if (Picture != other.Picture) return false; + if (!object.Equals(PriceUsd, other.PriceUsd)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (Description.Length != 0) hash ^= Description.GetHashCode(); + if (Picture.Length != 0) hash ^= Picture.GetHashCode(); + if (priceUsd_ != null) hash ^= PriceUsd.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (Name.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Name); + } + if (Description.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Description); + } + if (Picture.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Picture); + } + if (priceUsd_ != null) { + output.WriteRawTag(42); + output.WriteMessage(PriceUsd); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (Description.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Description); + } + if (Picture.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Picture); + } + if (priceUsd_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(PriceUsd); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Product other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.Description.Length != 0) { + Description = other.Description; + } + if (other.Picture.Length != 0) { + Picture = other.Picture; + } + if (other.priceUsd_ != null) { + if (priceUsd_ == null) { + priceUsd_ = new global::Hipstershop.MoneyAmount(); + } + PriceUsd.MergeFrom(other.PriceUsd); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + Name = input.ReadString(); + break; + } + case 26: { + Description = input.ReadString(); + break; + } + case 34: { + Picture = input.ReadString(); + break; + } + case 42: { + if (priceUsd_ == null) { + priceUsd_ = new global::Hipstershop.MoneyAmount(); + } + input.ReadMessage(priceUsd_); + break; + } + } + } + } + + } + + public sealed partial class ListProductsResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListProductsResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ListProductsResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ListProductsResponse(ListProductsResponse other) : this() { + products_ = other.products_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ListProductsResponse Clone() { + return new ListProductsResponse(this); + } + + /// Field number for the "products" field. + public const int ProductsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_products_codec + = pb::FieldCodec.ForMessage(10, global::Hipstershop.Product.Parser); + private readonly pbc::RepeatedField products_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Products { + get { return products_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ListProductsResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ListProductsResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!products_.Equals(other.products_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= products_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + products_.WriteTo(output, _repeated_products_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += products_.CalculateSize(_repeated_products_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ListProductsResponse other) { + if (other == null) { + return; + } + products_.Add(other.products_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + products_.AddEntriesFrom(input, _repeated_products_codec); + break; + } + } + } + } + + } + + public sealed partial class GetProductRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetProductRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetProductRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetProductRequest(GetProductRequest other) : this() { + id_ = other.id_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetProductRequest Clone() { + return new GetProductRequest(this); + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 1; + private string id_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Id { + get { return id_; } + set { + id_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetProductRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetProductRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Id != other.Id) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Id.Length != 0) hash ^= Id.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetProductRequest other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class SearchProductsRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SearchProductsRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SearchProductsRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SearchProductsRequest(SearchProductsRequest other) : this() { + query_ = other.query_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SearchProductsRequest Clone() { + return new SearchProductsRequest(this); + } + + /// Field number for the "query" field. + public const int QueryFieldNumber = 1; + private string query_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Query { + get { return query_; } + set { + query_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SearchProductsRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SearchProductsRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Query != other.Query) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Query.Length != 0) hash ^= Query.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Query.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Query); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Query.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Query); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SearchProductsRequest other) { + if (other == null) { + return; + } + if (other.Query.Length != 0) { + Query = other.Query; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Query = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class SearchProductsResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SearchProductsResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SearchProductsResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SearchProductsResponse(SearchProductsResponse other) : this() { + results_ = other.results_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SearchProductsResponse Clone() { + return new SearchProductsResponse(this); + } + + /// Field number for the "results" field. + public const int ResultsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_results_codec + = pb::FieldCodec.ForMessage(10, global::Hipstershop.Product.Parser); + private readonly pbc::RepeatedField results_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Results { + get { return results_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SearchProductsResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SearchProductsResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!results_.Equals(other.results_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= results_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + results_.WriteTo(output, _repeated_results_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += results_.CalculateSize(_repeated_results_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SearchProductsResponse other) { + if (other == null) { + return; + } + results_.Add(other.results_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + results_.AddEntriesFrom(input, _repeated_results_codec); + break; + } + } + } + } + + } + + public sealed partial class GetQuoteRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetQuoteRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[13]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetQuoteRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetQuoteRequest(GetQuoteRequest other) : this() { + Address = other.address_ != null ? other.Address.Clone() : null; + items_ = other.items_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetQuoteRequest Clone() { + return new GetQuoteRequest(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::Hipstershop.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "items" field. + public const int ItemsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_items_codec + = pb::FieldCodec.ForMessage(18, global::Hipstershop.CartItem.Parser); + private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Items { + get { return items_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetQuoteRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetQuoteRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if(!items_.Equals(other.items_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + hash ^= items_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + items_.WriteTo(output, _repeated_items_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + size += items_.CalculateSize(_repeated_items_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetQuoteRequest other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + address_ = new global::Hipstershop.Address(); + } + Address.MergeFrom(other.Address); + } + items_.Add(other.items_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + address_ = new global::Hipstershop.Address(); + } + input.ReadMessage(address_); + break; + } + case 18: { + items_.AddEntriesFrom(input, _repeated_items_codec); + break; + } + } + } + } + + } + + public sealed partial class GetQuoteResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetQuoteResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[14]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetQuoteResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetQuoteResponse(GetQuoteResponse other) : this() { + CostUsd = other.costUsd_ != null ? other.CostUsd.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetQuoteResponse Clone() { + return new GetQuoteResponse(this); + } + + /// Field number for the "cost_usd" field. + public const int CostUsdFieldNumber = 1; + private global::Hipstershop.MoneyAmount costUsd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.MoneyAmount CostUsd { + get { return costUsd_; } + set { + costUsd_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetQuoteResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetQuoteResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(CostUsd, other.CostUsd)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (costUsd_ != null) hash ^= CostUsd.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (costUsd_ != null) { + output.WriteRawTag(10); + output.WriteMessage(CostUsd); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (costUsd_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CostUsd); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetQuoteResponse other) { + if (other == null) { + return; + } + if (other.costUsd_ != null) { + if (costUsd_ == null) { + costUsd_ = new global::Hipstershop.MoneyAmount(); + } + CostUsd.MergeFrom(other.CostUsd); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (costUsd_ == null) { + costUsd_ = new global::Hipstershop.MoneyAmount(); + } + input.ReadMessage(costUsd_); + break; + } + } + } + } + + } + + public sealed partial class ShipOrderRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ShipOrderRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[15]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ShipOrderRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ShipOrderRequest(ShipOrderRequest other) : this() { + Address = other.address_ != null ? other.Address.Clone() : null; + items_ = other.items_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ShipOrderRequest Clone() { + return new ShipOrderRequest(this); + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 1; + private global::Hipstershop.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "items" field. + public const int ItemsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_items_codec + = pb::FieldCodec.ForMessage(18, global::Hipstershop.CartItem.Parser); + private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Items { + get { return items_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ShipOrderRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ShipOrderRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Address, other.Address)) return false; + if(!items_.Equals(other.items_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (address_ != null) hash ^= Address.GetHashCode(); + hash ^= items_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (address_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Address); + } + items_.WriteTo(output, _repeated_items_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + size += items_.CalculateSize(_repeated_items_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ShipOrderRequest other) { + if (other == null) { + return; + } + if (other.address_ != null) { + if (address_ == null) { + address_ = new global::Hipstershop.Address(); + } + Address.MergeFrom(other.Address); + } + items_.Add(other.items_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (address_ == null) { + address_ = new global::Hipstershop.Address(); + } + input.ReadMessage(address_); + break; + } + case 18: { + items_.AddEntriesFrom(input, _repeated_items_codec); + break; + } + } + } + } + + } + + public sealed partial class ShipOrderResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ShipOrderResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[16]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ShipOrderResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ShipOrderResponse(ShipOrderResponse other) : this() { + trackingId_ = other.trackingId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ShipOrderResponse Clone() { + return new ShipOrderResponse(this); + } + + /// Field number for the "tracking_id" field. + public const int TrackingIdFieldNumber = 1; + private string trackingId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TrackingId { + get { return trackingId_; } + set { + trackingId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ShipOrderResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ShipOrderResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TrackingId != other.TrackingId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TrackingId.Length != 0) hash ^= TrackingId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (TrackingId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TrackingId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TrackingId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TrackingId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ShipOrderResponse other) { + if (other == null) { + return; + } + if (other.TrackingId.Length != 0) { + TrackingId = other.TrackingId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TrackingId = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class Address : pb::IMessage
{ + private static readonly pb::MessageParser
_parser = new pb::MessageParser
(() => new Address()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser
Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[17]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Address() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Address(Address other) : this() { + streetAddress1_ = other.streetAddress1_; + streetAddress2_ = other.streetAddress2_; + city_ = other.city_; + country_ = other.country_; + zipCode_ = other.zipCode_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Address Clone() { + return new Address(this); + } + + /// Field number for the "street_address_1" field. + public const int StreetAddress1FieldNumber = 1; + private string streetAddress1_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string StreetAddress1 { + get { return streetAddress1_; } + set { + streetAddress1_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "street_address_2" field. + public const int StreetAddress2FieldNumber = 2; + private string streetAddress2_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string StreetAddress2 { + get { return streetAddress2_; } + set { + streetAddress2_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "city" field. + public const int CityFieldNumber = 3; + private string city_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string City { + get { return city_; } + set { + city_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "country" field. + public const int CountryFieldNumber = 4; + private string country_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Country { + get { return country_; } + set { + country_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "zip_code" field. + public const int ZipCodeFieldNumber = 5; + private int zipCode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ZipCode { + get { return zipCode_; } + set { + zipCode_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Address); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Address other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StreetAddress1 != other.StreetAddress1) return false; + if (StreetAddress2 != other.StreetAddress2) return false; + if (City != other.City) return false; + if (Country != other.Country) return false; + if (ZipCode != other.ZipCode) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (StreetAddress1.Length != 0) hash ^= StreetAddress1.GetHashCode(); + if (StreetAddress2.Length != 0) hash ^= StreetAddress2.GetHashCode(); + if (City.Length != 0) hash ^= City.GetHashCode(); + if (Country.Length != 0) hash ^= Country.GetHashCode(); + if (ZipCode != 0) hash ^= ZipCode.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (StreetAddress1.Length != 0) { + output.WriteRawTag(10); + output.WriteString(StreetAddress1); + } + if (StreetAddress2.Length != 0) { + output.WriteRawTag(18); + output.WriteString(StreetAddress2); + } + if (City.Length != 0) { + output.WriteRawTag(26); + output.WriteString(City); + } + if (Country.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Country); + } + if (ZipCode != 0) { + output.WriteRawTag(40); + output.WriteInt32(ZipCode); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (StreetAddress1.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(StreetAddress1); + } + if (StreetAddress2.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(StreetAddress2); + } + if (City.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(City); + } + if (Country.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Country); + } + if (ZipCode != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ZipCode); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Address other) { + if (other == null) { + return; + } + if (other.StreetAddress1.Length != 0) { + StreetAddress1 = other.StreetAddress1; + } + if (other.StreetAddress2.Length != 0) { + StreetAddress2 = other.StreetAddress2; + } + if (other.City.Length != 0) { + City = other.City; + } + if (other.Country.Length != 0) { + Country = other.Country; + } + if (other.ZipCode != 0) { + ZipCode = other.ZipCode; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + StreetAddress1 = input.ReadString(); + break; + } + case 18: { + StreetAddress2 = input.ReadString(); + break; + } + case 26: { + City = input.ReadString(); + break; + } + case 34: { + Country = input.ReadString(); + break; + } + case 40: { + ZipCode = input.ReadInt32(); + break; + } + } + } + } + + } + + /// + /// Describes a money amount without currency. For example, decimal=2 and + /// fractional=500 (or fractional=5) makes up 2.5 units. + /// + public sealed partial class MoneyAmount : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoneyAmount()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[18]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MoneyAmount() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MoneyAmount(MoneyAmount other) : this() { + decimal_ = other.decimal_; + fractional_ = other.fractional_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MoneyAmount Clone() { + return new MoneyAmount(this); + } + + /// Field number for the "decimal" field. + public const int DecimalFieldNumber = 1; + private uint decimal_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint Decimal { + get { return decimal_; } + set { + decimal_ = value; + } + } + + /// Field number for the "fractional" field. + public const int FractionalFieldNumber = 2; + private uint fractional_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint Fractional { + get { return fractional_; } + set { + fractional_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MoneyAmount); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MoneyAmount other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Decimal != other.Decimal) return false; + if (Fractional != other.Fractional) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Decimal != 0) hash ^= Decimal.GetHashCode(); + if (Fractional != 0) hash ^= Fractional.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Decimal != 0) { + output.WriteRawTag(8); + output.WriteUInt32(Decimal); + } + if (Fractional != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Fractional); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Decimal != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Decimal); + } + if (Fractional != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Fractional); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MoneyAmount other) { + if (other == null) { + return; + } + if (other.Decimal != 0) { + Decimal = other.Decimal; + } + if (other.Fractional != 0) { + Fractional = other.Fractional; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Decimal = input.ReadUInt32(); + break; + } + case 16: { + Fractional = input.ReadUInt32(); + break; + } + } + } + } + + } + + public sealed partial class Money : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Money()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[19]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Money() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Money(Money other) : this() { + currencyCode_ = other.currencyCode_; + Amount = other.amount_ != null ? other.Amount.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Money Clone() { + return new Money(this); + } + + /// Field number for the "currency_code" field. + public const int CurrencyCodeFieldNumber = 1; + private string currencyCode_ = ""; + /// + /// The 3-letter currency code defined in ISO 4217. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string CurrencyCode { + get { return currencyCode_; } + set { + currencyCode_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private global::Hipstershop.MoneyAmount amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.MoneyAmount Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Money); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Money other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CurrencyCode != other.CurrencyCode) return false; + if (!object.Equals(Amount, other.Amount)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (CurrencyCode.Length != 0) hash ^= CurrencyCode.GetHashCode(); + if (amount_ != null) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (CurrencyCode.Length != 0) { + output.WriteRawTag(10); + output.WriteString(CurrencyCode); + } + if (amount_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (CurrencyCode.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CurrencyCode); + } + if (amount_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Money other) { + if (other == null) { + return; + } + if (other.CurrencyCode.Length != 0) { + CurrencyCode = other.CurrencyCode; + } + if (other.amount_ != null) { + if (amount_ == null) { + amount_ = new global::Hipstershop.MoneyAmount(); + } + Amount.MergeFrom(other.Amount); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + CurrencyCode = input.ReadString(); + break; + } + case 18: { + if (amount_ == null) { + amount_ = new global::Hipstershop.MoneyAmount(); + } + input.ReadMessage(amount_); + break; + } + } + } + } + + } + + public sealed partial class GetSupportedCurrenciesResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetSupportedCurrenciesResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[20]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetSupportedCurrenciesResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetSupportedCurrenciesResponse(GetSupportedCurrenciesResponse other) : this() { + currencyCodes_ = other.currencyCodes_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetSupportedCurrenciesResponse Clone() { + return new GetSupportedCurrenciesResponse(this); + } + + /// Field number for the "currency_codes" field. + public const int CurrencyCodesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_currencyCodes_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField currencyCodes_ = new pbc::RepeatedField(); + /// + /// The 3-letter currency code defined in ISO 4217. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField CurrencyCodes { + get { return currencyCodes_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetSupportedCurrenciesResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetSupportedCurrenciesResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!currencyCodes_.Equals(other.currencyCodes_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= currencyCodes_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + currencyCodes_.WriteTo(output, _repeated_currencyCodes_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += currencyCodes_.CalculateSize(_repeated_currencyCodes_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetSupportedCurrenciesResponse other) { + if (other == null) { + return; + } + currencyCodes_.Add(other.currencyCodes_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + currencyCodes_.AddEntriesFrom(input, _repeated_currencyCodes_codec); + break; + } + } + } + } + + } + + public sealed partial class ConversionRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConversionRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[21]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ConversionRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ConversionRequest(ConversionRequest other) : this() { + From = other.from_ != null ? other.From.Clone() : null; + toCode_ = other.toCode_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ConversionRequest Clone() { + return new ConversionRequest(this); + } + + /// Field number for the "from" field. + public const int FromFieldNumber = 1; + private global::Hipstershop.Money from_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Money From { + get { return from_; } + set { + from_ = value; + } + } + + /// Field number for the "to_code" field. + public const int ToCodeFieldNumber = 2; + private string toCode_ = ""; + /// + /// The 3-letter currency code defined in ISO 4217. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ToCode { + get { return toCode_; } + set { + toCode_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ConversionRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ConversionRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(From, other.From)) return false; + if (ToCode != other.ToCode) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (from_ != null) hash ^= From.GetHashCode(); + if (ToCode.Length != 0) hash ^= ToCode.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (from_ != null) { + output.WriteRawTag(10); + output.WriteMessage(From); + } + if (ToCode.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ToCode); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (from_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(From); + } + if (ToCode.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ToCode); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ConversionRequest other) { + if (other == null) { + return; + } + if (other.from_ != null) { + if (from_ == null) { + from_ = new global::Hipstershop.Money(); + } + From.MergeFrom(other.From); + } + if (other.ToCode.Length != 0) { + ToCode = other.ToCode; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (from_ == null) { + from_ = new global::Hipstershop.Money(); + } + input.ReadMessage(from_); + break; + } + case 18: { + ToCode = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class ConversionResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConversionResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[22]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ConversionResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ConversionResponse(ConversionResponse other) : this() { + Result = other.result_ != null ? other.Result.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ConversionResponse Clone() { + return new ConversionResponse(this); + } + + /// Field number for the "result" field. + public const int ResultFieldNumber = 1; + private global::Hipstershop.Money result_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Money Result { + get { return result_; } + set { + result_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ConversionResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ConversionResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Result, other.Result)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (result_ != null) hash ^= Result.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (result_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Result); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (result_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Result); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ConversionResponse other) { + if (other == null) { + return; + } + if (other.result_ != null) { + if (result_ == null) { + result_ = new global::Hipstershop.Money(); + } + Result.MergeFrom(other.Result); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (result_ == null) { + result_ = new global::Hipstershop.Money(); + } + input.ReadMessage(result_); + break; + } + } + } + } + + } + + public sealed partial class CreditCardInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreditCardInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[23]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreditCardInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreditCardInfo(CreditCardInfo other) : this() { + creditCardNumber_ = other.creditCardNumber_; + creditCardCvv_ = other.creditCardCvv_; + creditCardExpirationYear_ = other.creditCardExpirationYear_; + creditCardExpirationMonth_ = other.creditCardExpirationMonth_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreditCardInfo Clone() { + return new CreditCardInfo(this); + } + + /// Field number for the "credit_card_number" field. + public const int CreditCardNumberFieldNumber = 1; + private string creditCardNumber_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string CreditCardNumber { + get { return creditCardNumber_; } + set { + creditCardNumber_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "credit_card_cvv" field. + public const int CreditCardCvvFieldNumber = 2; + private int creditCardCvv_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CreditCardCvv { + get { return creditCardCvv_; } + set { + creditCardCvv_ = value; + } + } + + /// Field number for the "credit_card_expiration_year" field. + public const int CreditCardExpirationYearFieldNumber = 3; + private int creditCardExpirationYear_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CreditCardExpirationYear { + get { return creditCardExpirationYear_; } + set { + creditCardExpirationYear_ = value; + } + } + + /// Field number for the "credit_card_expiration_month" field. + public const int CreditCardExpirationMonthFieldNumber = 4; + private int creditCardExpirationMonth_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CreditCardExpirationMonth { + get { return creditCardExpirationMonth_; } + set { + creditCardExpirationMonth_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CreditCardInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CreditCardInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CreditCardNumber != other.CreditCardNumber) return false; + if (CreditCardCvv != other.CreditCardCvv) return false; + if (CreditCardExpirationYear != other.CreditCardExpirationYear) return false; + if (CreditCardExpirationMonth != other.CreditCardExpirationMonth) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (CreditCardNumber.Length != 0) hash ^= CreditCardNumber.GetHashCode(); + if (CreditCardCvv != 0) hash ^= CreditCardCvv.GetHashCode(); + if (CreditCardExpirationYear != 0) hash ^= CreditCardExpirationYear.GetHashCode(); + if (CreditCardExpirationMonth != 0) hash ^= CreditCardExpirationMonth.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (CreditCardNumber.Length != 0) { + output.WriteRawTag(10); + output.WriteString(CreditCardNumber); + } + if (CreditCardCvv != 0) { + output.WriteRawTag(16); + output.WriteInt32(CreditCardCvv); + } + if (CreditCardExpirationYear != 0) { + output.WriteRawTag(24); + output.WriteInt32(CreditCardExpirationYear); + } + if (CreditCardExpirationMonth != 0) { + output.WriteRawTag(32); + output.WriteInt32(CreditCardExpirationMonth); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (CreditCardNumber.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CreditCardNumber); + } + if (CreditCardCvv != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CreditCardCvv); + } + if (CreditCardExpirationYear != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CreditCardExpirationYear); + } + if (CreditCardExpirationMonth != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CreditCardExpirationMonth); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CreditCardInfo other) { + if (other == null) { + return; + } + if (other.CreditCardNumber.Length != 0) { + CreditCardNumber = other.CreditCardNumber; + } + if (other.CreditCardCvv != 0) { + CreditCardCvv = other.CreditCardCvv; + } + if (other.CreditCardExpirationYear != 0) { + CreditCardExpirationYear = other.CreditCardExpirationYear; + } + if (other.CreditCardExpirationMonth != 0) { + CreditCardExpirationMonth = other.CreditCardExpirationMonth; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + CreditCardNumber = input.ReadString(); + break; + } + case 16: { + CreditCardCvv = input.ReadInt32(); + break; + } + case 24: { + CreditCardExpirationYear = input.ReadInt32(); + break; + } + case 32: { + CreditCardExpirationMonth = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class ChargeRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChargeRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[24]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeRequest(ChargeRequest other) : this() { + Amount = other.amount_ != null ? other.Amount.Clone() : null; + CreditCard = other.creditCard_ != null ? other.CreditCard.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeRequest Clone() { + return new ChargeRequest(this); + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 1; + private global::Hipstershop.Money amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Money Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + /// Field number for the "credit_card" field. + public const int CreditCardFieldNumber = 2; + private global::Hipstershop.CreditCardInfo creditCard_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.CreditCardInfo CreditCard { + get { return creditCard_; } + set { + creditCard_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChargeRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChargeRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Amount, other.Amount)) return false; + if (!object.Equals(CreditCard, other.CreditCard)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (amount_ != null) hash ^= Amount.GetHashCode(); + if (creditCard_ != null) hash ^= CreditCard.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (amount_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Amount); + } + if (creditCard_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CreditCard); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (amount_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Amount); + } + if (creditCard_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CreditCard); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChargeRequest other) { + if (other == null) { + return; + } + if (other.amount_ != null) { + if (amount_ == null) { + amount_ = new global::Hipstershop.Money(); + } + Amount.MergeFrom(other.Amount); + } + if (other.creditCard_ != null) { + if (creditCard_ == null) { + creditCard_ = new global::Hipstershop.CreditCardInfo(); + } + CreditCard.MergeFrom(other.CreditCard); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (amount_ == null) { + amount_ = new global::Hipstershop.Money(); + } + input.ReadMessage(amount_); + break; + } + case 18: { + if (creditCard_ == null) { + creditCard_ = new global::Hipstershop.CreditCardInfo(); + } + input.ReadMessage(creditCard_); + break; + } + } + } + } + + } + + public sealed partial class ChargeResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChargeResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[25]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeResponse(ChargeResponse other) : this() { + transactionId_ = other.transactionId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChargeResponse Clone() { + return new ChargeResponse(this); + } + + /// Field number for the "transaction_id" field. + public const int TransactionIdFieldNumber = 1; + private string transactionId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TransactionId { + get { return transactionId_; } + set { + transactionId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChargeResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChargeResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TransactionId != other.TransactionId) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TransactionId.Length != 0) hash ^= TransactionId.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (TransactionId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TransactionId); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TransactionId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TransactionId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChargeResponse other) { + if (other == null) { + return; + } + if (other.TransactionId.Length != 0) { + TransactionId = other.TransactionId; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TransactionId = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class OrderItem : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OrderItem()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[26]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrderItem() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrderItem(OrderItem other) : this() { + Item = other.item_ != null ? other.Item.Clone() : null; + Cost = other.cost_ != null ? other.Cost.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrderItem Clone() { + return new OrderItem(this); + } + + /// Field number for the "item" field. + public const int ItemFieldNumber = 1; + private global::Hipstershop.CartItem item_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.CartItem Item { + get { return item_; } + set { + item_ = value; + } + } + + /// Field number for the "cost" field. + public const int CostFieldNumber = 2; + private global::Hipstershop.Money cost_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Money Cost { + get { return cost_; } + set { + cost_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OrderItem); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OrderItem other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Item, other.Item)) return false; + if (!object.Equals(Cost, other.Cost)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (item_ != null) hash ^= Item.GetHashCode(); + if (cost_ != null) hash ^= Cost.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (item_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Item); + } + if (cost_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Cost); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (item_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Item); + } + if (cost_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Cost); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OrderItem other) { + if (other == null) { + return; + } + if (other.item_ != null) { + if (item_ == null) { + item_ = new global::Hipstershop.CartItem(); + } + Item.MergeFrom(other.Item); + } + if (other.cost_ != null) { + if (cost_ == null) { + cost_ = new global::Hipstershop.Money(); + } + Cost.MergeFrom(other.Cost); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (item_ == null) { + item_ = new global::Hipstershop.CartItem(); + } + input.ReadMessage(item_); + break; + } + case 18: { + if (cost_ == null) { + cost_ = new global::Hipstershop.Money(); + } + input.ReadMessage(cost_); + break; + } + } + } + } + + } + + public sealed partial class OrderResult : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OrderResult()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[27]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrderResult() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrderResult(OrderResult other) : this() { + orderId_ = other.orderId_; + shippingTrackingId_ = other.shippingTrackingId_; + ShippingCost = other.shippingCost_ != null ? other.ShippingCost.Clone() : null; + ShippingAddress = other.shippingAddress_ != null ? other.ShippingAddress.Clone() : null; + items_ = other.items_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OrderResult Clone() { + return new OrderResult(this); + } + + /// Field number for the "order_id" field. + public const int OrderIdFieldNumber = 1; + private string orderId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string OrderId { + get { return orderId_; } + set { + orderId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "shipping_tracking_id" field. + public const int ShippingTrackingIdFieldNumber = 2; + private string shippingTrackingId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ShippingTrackingId { + get { return shippingTrackingId_; } + set { + shippingTrackingId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "shipping_cost" field. + public const int ShippingCostFieldNumber = 3; + private global::Hipstershop.Money shippingCost_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Money ShippingCost { + get { return shippingCost_; } + set { + shippingCost_ = value; + } + } + + /// Field number for the "shipping_address" field. + public const int ShippingAddressFieldNumber = 4; + private global::Hipstershop.Address shippingAddress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Address ShippingAddress { + get { return shippingAddress_; } + set { + shippingAddress_ = value; + } + } + + /// Field number for the "items" field. + public const int ItemsFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_items_codec + = pb::FieldCodec.ForMessage(42, global::Hipstershop.OrderItem.Parser); + private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Items { + get { return items_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OrderResult); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OrderResult other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OrderId != other.OrderId) return false; + if (ShippingTrackingId != other.ShippingTrackingId) return false; + if (!object.Equals(ShippingCost, other.ShippingCost)) return false; + if (!object.Equals(ShippingAddress, other.ShippingAddress)) return false; + if(!items_.Equals(other.items_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (OrderId.Length != 0) hash ^= OrderId.GetHashCode(); + if (ShippingTrackingId.Length != 0) hash ^= ShippingTrackingId.GetHashCode(); + if (shippingCost_ != null) hash ^= ShippingCost.GetHashCode(); + if (shippingAddress_ != null) hash ^= ShippingAddress.GetHashCode(); + hash ^= items_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (OrderId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(OrderId); + } + if (ShippingTrackingId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ShippingTrackingId); + } + if (shippingCost_ != null) { + output.WriteRawTag(26); + output.WriteMessage(ShippingCost); + } + if (shippingAddress_ != null) { + output.WriteRawTag(34); + output.WriteMessage(ShippingAddress); + } + items_.WriteTo(output, _repeated_items_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (OrderId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OrderId); + } + if (ShippingTrackingId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ShippingTrackingId); + } + if (shippingCost_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ShippingCost); + } + if (shippingAddress_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ShippingAddress); + } + size += items_.CalculateSize(_repeated_items_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OrderResult other) { + if (other == null) { + return; + } + if (other.OrderId.Length != 0) { + OrderId = other.OrderId; + } + if (other.ShippingTrackingId.Length != 0) { + ShippingTrackingId = other.ShippingTrackingId; + } + if (other.shippingCost_ != null) { + if (shippingCost_ == null) { + shippingCost_ = new global::Hipstershop.Money(); + } + ShippingCost.MergeFrom(other.ShippingCost); + } + if (other.shippingAddress_ != null) { + if (shippingAddress_ == null) { + shippingAddress_ = new global::Hipstershop.Address(); + } + ShippingAddress.MergeFrom(other.ShippingAddress); + } + items_.Add(other.items_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + OrderId = input.ReadString(); + break; + } + case 18: { + ShippingTrackingId = input.ReadString(); + break; + } + case 26: { + if (shippingCost_ == null) { + shippingCost_ = new global::Hipstershop.Money(); + } + input.ReadMessage(shippingCost_); + break; + } + case 34: { + if (shippingAddress_ == null) { + shippingAddress_ = new global::Hipstershop.Address(); + } + input.ReadMessage(shippingAddress_); + break; + } + case 42: { + items_.AddEntriesFrom(input, _repeated_items_codec); + break; + } + } + } + } + + } + + public sealed partial class SendOrderConfirmationRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SendOrderConfirmationRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[28]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SendOrderConfirmationRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SendOrderConfirmationRequest(SendOrderConfirmationRequest other) : this() { + email_ = other.email_; + Order = other.order_ != null ? other.Order.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SendOrderConfirmationRequest Clone() { + return new SendOrderConfirmationRequest(this); + } + + /// Field number for the "email" field. + public const int EmailFieldNumber = 1; + private string email_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Email { + get { return email_; } + set { + email_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "order" field. + public const int OrderFieldNumber = 2; + private global::Hipstershop.OrderResult order_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.OrderResult Order { + get { return order_; } + set { + order_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SendOrderConfirmationRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SendOrderConfirmationRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Email != other.Email) return false; + if (!object.Equals(Order, other.Order)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Email.Length != 0) hash ^= Email.GetHashCode(); + if (order_ != null) hash ^= Order.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Email.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Email); + } + if (order_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Order); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Email.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Email); + } + if (order_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Order); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SendOrderConfirmationRequest other) { + if (other == null) { + return; + } + if (other.Email.Length != 0) { + Email = other.Email; + } + if (other.order_ != null) { + if (order_ == null) { + order_ = new global::Hipstershop.OrderResult(); + } + Order.MergeFrom(other.Order); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Email = input.ReadString(); + break; + } + case 18: { + if (order_ == null) { + order_ = new global::Hipstershop.OrderResult(); + } + input.ReadMessage(order_); + break; + } + } + } + } + + } + + public sealed partial class CreateOrderRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateOrderRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[29]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateOrderRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateOrderRequest(CreateOrderRequest other) : this() { + userId_ = other.userId_; + userCurrency_ = other.userCurrency_; + Address = other.address_ != null ? other.Address.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateOrderRequest Clone() { + return new CreateOrderRequest(this); + } + + /// Field number for the "user_id" field. + public const int UserIdFieldNumber = 1; + private string userId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UserId { + get { return userId_; } + set { + userId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "user_currency" field. + public const int UserCurrencyFieldNumber = 2; + private string userCurrency_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UserCurrency { + get { return userCurrency_; } + set { + userCurrency_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 3; + private global::Hipstershop.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CreateOrderRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CreateOrderRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UserId != other.UserId) return false; + if (UserCurrency != other.UserCurrency) return false; + if (!object.Equals(Address, other.Address)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (UserId.Length != 0) hash ^= UserId.GetHashCode(); + if (UserCurrency.Length != 0) hash ^= UserCurrency.GetHashCode(); + if (address_ != null) hash ^= Address.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (UserId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(UserId); + } + if (UserCurrency.Length != 0) { + output.WriteRawTag(18); + output.WriteString(UserCurrency); + } + if (address_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Address); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (UserId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UserId); + } + if (UserCurrency.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UserCurrency); + } + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CreateOrderRequest other) { + if (other == null) { + return; + } + if (other.UserId.Length != 0) { + UserId = other.UserId; + } + if (other.UserCurrency.Length != 0) { + UserCurrency = other.UserCurrency; + } + if (other.address_ != null) { + if (address_ == null) { + address_ = new global::Hipstershop.Address(); + } + Address.MergeFrom(other.Address); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + UserId = input.ReadString(); + break; + } + case 18: { + UserCurrency = input.ReadString(); + break; + } + case 26: { + if (address_ == null) { + address_ = new global::Hipstershop.Address(); + } + input.ReadMessage(address_); + break; + } + } + } + } + + } + + public sealed partial class CreateOrderResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateOrderResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[30]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateOrderResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateOrderResponse(CreateOrderResponse other) : this() { + items_ = other.items_.Clone(); + ShippingCost = other.shippingCost_ != null ? other.ShippingCost.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CreateOrderResponse Clone() { + return new CreateOrderResponse(this); + } + + /// Field number for the "items" field. + public const int ItemsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_items_codec + = pb::FieldCodec.ForMessage(10, global::Hipstershop.OrderItem.Parser); + private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Items { + get { return items_; } + } + + /// Field number for the "shipping_cost" field. + public const int ShippingCostFieldNumber = 2; + private global::Hipstershop.Money shippingCost_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Money ShippingCost { + get { return shippingCost_; } + set { + shippingCost_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CreateOrderResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CreateOrderResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!items_.Equals(other.items_)) return false; + if (!object.Equals(ShippingCost, other.ShippingCost)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= items_.GetHashCode(); + if (shippingCost_ != null) hash ^= ShippingCost.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + items_.WriteTo(output, _repeated_items_codec); + if (shippingCost_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ShippingCost); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += items_.CalculateSize(_repeated_items_codec); + if (shippingCost_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ShippingCost); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CreateOrderResponse other) { + if (other == null) { + return; + } + items_.Add(other.items_); + if (other.shippingCost_ != null) { + if (shippingCost_ == null) { + shippingCost_ = new global::Hipstershop.Money(); + } + ShippingCost.MergeFrom(other.ShippingCost); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + items_.AddEntriesFrom(input, _repeated_items_codec); + break; + } + case 18: { + if (shippingCost_ == null) { + shippingCost_ = new global::Hipstershop.Money(); + } + input.ReadMessage(shippingCost_); + break; + } + } + } + } + + } + + public sealed partial class PlaceOrderRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PlaceOrderRequest()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[31]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlaceOrderRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlaceOrderRequest(PlaceOrderRequest other) : this() { + userId_ = other.userId_; + userCurrency_ = other.userCurrency_; + Address = other.address_ != null ? other.Address.Clone() : null; + email_ = other.email_; + CreditCard = other.creditCard_ != null ? other.CreditCard.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlaceOrderRequest Clone() { + return new PlaceOrderRequest(this); + } + + /// Field number for the "user_id" field. + public const int UserIdFieldNumber = 1; + private string userId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UserId { + get { return userId_; } + set { + userId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "user_currency" field. + public const int UserCurrencyFieldNumber = 2; + private string userCurrency_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UserCurrency { + get { return userCurrency_; } + set { + userCurrency_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "address" field. + public const int AddressFieldNumber = 3; + private global::Hipstershop.Address address_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Address Address { + get { return address_; } + set { + address_ = value; + } + } + + /// Field number for the "email" field. + public const int EmailFieldNumber = 5; + private string email_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Email { + get { return email_; } + set { + email_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "credit_card" field. + public const int CreditCardFieldNumber = 6; + private global::Hipstershop.CreditCardInfo creditCard_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.CreditCardInfo CreditCard { + get { return creditCard_; } + set { + creditCard_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as PlaceOrderRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(PlaceOrderRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UserId != other.UserId) return false; + if (UserCurrency != other.UserCurrency) return false; + if (!object.Equals(Address, other.Address)) return false; + if (Email != other.Email) return false; + if (!object.Equals(CreditCard, other.CreditCard)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (UserId.Length != 0) hash ^= UserId.GetHashCode(); + if (UserCurrency.Length != 0) hash ^= UserCurrency.GetHashCode(); + if (address_ != null) hash ^= Address.GetHashCode(); + if (Email.Length != 0) hash ^= Email.GetHashCode(); + if (creditCard_ != null) hash ^= CreditCard.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (UserId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(UserId); + } + if (UserCurrency.Length != 0) { + output.WriteRawTag(18); + output.WriteString(UserCurrency); + } + if (address_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Address); + } + if (Email.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Email); + } + if (creditCard_ != null) { + output.WriteRawTag(50); + output.WriteMessage(CreditCard); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (UserId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UserId); + } + if (UserCurrency.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UserCurrency); + } + if (address_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Address); + } + if (Email.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Email); + } + if (creditCard_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CreditCard); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(PlaceOrderRequest other) { + if (other == null) { + return; + } + if (other.UserId.Length != 0) { + UserId = other.UserId; + } + if (other.UserCurrency.Length != 0) { + UserCurrency = other.UserCurrency; + } + if (other.address_ != null) { + if (address_ == null) { + address_ = new global::Hipstershop.Address(); + } + Address.MergeFrom(other.Address); + } + if (other.Email.Length != 0) { + Email = other.Email; + } + if (other.creditCard_ != null) { + if (creditCard_ == null) { + creditCard_ = new global::Hipstershop.CreditCardInfo(); + } + CreditCard.MergeFrom(other.CreditCard); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + UserId = input.ReadString(); + break; + } + case 18: { + UserCurrency = input.ReadString(); + break; + } + case 26: { + if (address_ == null) { + address_ = new global::Hipstershop.Address(); + } + input.ReadMessage(address_); + break; + } + case 42: { + Email = input.ReadString(); + break; + } + case 50: { + if (creditCard_ == null) { + creditCard_ = new global::Hipstershop.CreditCardInfo(); + } + input.ReadMessage(creditCard_); + break; + } + } + } + } + + } + + public sealed partial class PlaceOrderResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PlaceOrderResponse()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Hipstershop.DemoReflection.Descriptor.MessageTypes[32]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlaceOrderResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlaceOrderResponse(PlaceOrderResponse other) : this() { + Order = other.order_ != null ? other.Order.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlaceOrderResponse Clone() { + return new PlaceOrderResponse(this); + } + + /// Field number for the "order" field. + public const int OrderFieldNumber = 1; + private global::Hipstershop.OrderResult order_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.OrderResult Order { + get { return order_; } + set { + order_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as PlaceOrderResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(PlaceOrderResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Order, other.Order)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (order_ != null) hash ^= Order.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (order_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Order); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (order_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Order); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(PlaceOrderResponse other) { + if (other == null) { + return; + } + if (other.order_ != null) { + if (order_ == null) { + order_ = new global::Hipstershop.OrderResult(); + } + Order.MergeFrom(other.Order); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (order_ == null) { + order_ = new global::Hipstershop.OrderResult(); + } + input.ReadMessage(order_); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/cartservice/DemoGrpc.cs b/src/cartservice/DemoGrpc.cs new file mode 100644 index 0000000..1d0e195 --- /dev/null +++ b/src/cartservice/DemoGrpc.cs @@ -0,0 +1,908 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: demo.proto +// +#pragma warning disable 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Hipstershop { + public static partial class CartService + { + static readonly string __ServiceName = "hipstershop.CartService"; + + static readonly grpc::Marshaller __Marshaller_AddItemRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.AddItemRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.Empty.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_GetCartRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.GetCartRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Cart = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.Cart.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_EmptyCartRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.EmptyCartRequest.Parser.ParseFrom); + + static readonly grpc::Method __Method_AddItem = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "AddItem", + __Marshaller_AddItemRequest, + __Marshaller_Empty); + + static readonly grpc::Method __Method_GetCart = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "GetCart", + __Marshaller_GetCartRequest, + __Marshaller_Cart); + + static readonly grpc::Method __Method_EmptyCart = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "EmptyCart", + __Marshaller_EmptyCartRequest, + __Marshaller_Empty); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Hipstershop.DemoReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of CartService + public abstract partial class CartServiceBase + { + public virtual global::System.Threading.Tasks.Task AddItem(global::Hipstershop.AddItemRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + public virtual global::System.Threading.Tasks.Task GetCart(global::Hipstershop.GetCartRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + public virtual global::System.Threading.Tasks.Task EmptyCart(global::Hipstershop.EmptyCartRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for CartService + public partial class CartServiceClient : grpc::ClientBase + { + /// Creates a new client for CartService + /// The channel to use to make remote calls. + public CartServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for CartService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public CartServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected CartServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected CartServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Hipstershop.Empty AddItem(global::Hipstershop.AddItemRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return AddItem(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.Empty AddItem(global::Hipstershop.AddItemRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_AddItem, null, options, request); + } + public virtual grpc::AsyncUnaryCall AddItemAsync(global::Hipstershop.AddItemRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return AddItemAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall AddItemAsync(global::Hipstershop.AddItemRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_AddItem, null, options, request); + } + public virtual global::Hipstershop.Cart GetCart(global::Hipstershop.GetCartRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetCart(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.Cart GetCart(global::Hipstershop.GetCartRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_GetCart, null, options, request); + } + public virtual grpc::AsyncUnaryCall GetCartAsync(global::Hipstershop.GetCartRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetCartAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall GetCartAsync(global::Hipstershop.GetCartRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_GetCart, null, options, request); + } + public virtual global::Hipstershop.Empty EmptyCart(global::Hipstershop.EmptyCartRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return EmptyCart(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.Empty EmptyCart(global::Hipstershop.EmptyCartRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_EmptyCart, null, options, request); + } + public virtual grpc::AsyncUnaryCall EmptyCartAsync(global::Hipstershop.EmptyCartRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return EmptyCartAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall EmptyCartAsync(global::Hipstershop.EmptyCartRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_EmptyCart, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override CartServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new CartServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(CartServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_AddItem, serviceImpl.AddItem) + .AddMethod(__Method_GetCart, serviceImpl.GetCart) + .AddMethod(__Method_EmptyCart, serviceImpl.EmptyCart).Build(); + } + + } + public static partial class RecommendationService + { + static readonly string __ServiceName = "hipstershop.RecommendationService"; + + static readonly grpc::Marshaller __Marshaller_ListRecommendationsRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.ListRecommendationsRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ListRecommendationsResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.ListRecommendationsResponse.Parser.ParseFrom); + + static readonly grpc::Method __Method_ListRecommendations = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "ListRecommendations", + __Marshaller_ListRecommendationsRequest, + __Marshaller_ListRecommendationsResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Hipstershop.DemoReflection.Descriptor.Services[1]; } + } + + /// Base class for server-side implementations of RecommendationService + public abstract partial class RecommendationServiceBase + { + public virtual global::System.Threading.Tasks.Task ListRecommendations(global::Hipstershop.ListRecommendationsRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for RecommendationService + public partial class RecommendationServiceClient : grpc::ClientBase + { + /// Creates a new client for RecommendationService + /// The channel to use to make remote calls. + public RecommendationServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for RecommendationService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public RecommendationServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected RecommendationServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected RecommendationServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Hipstershop.ListRecommendationsResponse ListRecommendations(global::Hipstershop.ListRecommendationsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ListRecommendations(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.ListRecommendationsResponse ListRecommendations(global::Hipstershop.ListRecommendationsRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_ListRecommendations, null, options, request); + } + public virtual grpc::AsyncUnaryCall ListRecommendationsAsync(global::Hipstershop.ListRecommendationsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ListRecommendationsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall ListRecommendationsAsync(global::Hipstershop.ListRecommendationsRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_ListRecommendations, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override RecommendationServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new RecommendationServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(RecommendationServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_ListRecommendations, serviceImpl.ListRecommendations).Build(); + } + + } + public static partial class ProductCatalogService + { + static readonly string __ServiceName = "hipstershop.ProductCatalogService"; + + static readonly grpc::Marshaller __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.Empty.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ListProductsResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.ListProductsResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_GetProductRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.GetProductRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Product = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.Product.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_SearchProductsRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.SearchProductsRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_SearchProductsResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.SearchProductsResponse.Parser.ParseFrom); + + static readonly grpc::Method __Method_ListProducts = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "ListProducts", + __Marshaller_Empty, + __Marshaller_ListProductsResponse); + + static readonly grpc::Method __Method_GetProduct = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "GetProduct", + __Marshaller_GetProductRequest, + __Marshaller_Product); + + static readonly grpc::Method __Method_SearchProducts = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "SearchProducts", + __Marshaller_SearchProductsRequest, + __Marshaller_SearchProductsResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Hipstershop.DemoReflection.Descriptor.Services[2]; } + } + + /// Base class for server-side implementations of ProductCatalogService + public abstract partial class ProductCatalogServiceBase + { + public virtual global::System.Threading.Tasks.Task ListProducts(global::Hipstershop.Empty request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + public virtual global::System.Threading.Tasks.Task GetProduct(global::Hipstershop.GetProductRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + public virtual global::System.Threading.Tasks.Task SearchProducts(global::Hipstershop.SearchProductsRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for ProductCatalogService + public partial class ProductCatalogServiceClient : grpc::ClientBase + { + /// Creates a new client for ProductCatalogService + /// The channel to use to make remote calls. + public ProductCatalogServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for ProductCatalogService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public ProductCatalogServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected ProductCatalogServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected ProductCatalogServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Hipstershop.ListProductsResponse ListProducts(global::Hipstershop.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ListProducts(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.ListProductsResponse ListProducts(global::Hipstershop.Empty request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_ListProducts, null, options, request); + } + public virtual grpc::AsyncUnaryCall ListProductsAsync(global::Hipstershop.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ListProductsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall ListProductsAsync(global::Hipstershop.Empty request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_ListProducts, null, options, request); + } + public virtual global::Hipstershop.Product GetProduct(global::Hipstershop.GetProductRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetProduct(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.Product GetProduct(global::Hipstershop.GetProductRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_GetProduct, null, options, request); + } + public virtual grpc::AsyncUnaryCall GetProductAsync(global::Hipstershop.GetProductRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetProductAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall GetProductAsync(global::Hipstershop.GetProductRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_GetProduct, null, options, request); + } + public virtual global::Hipstershop.SearchProductsResponse SearchProducts(global::Hipstershop.SearchProductsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SearchProducts(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.SearchProductsResponse SearchProducts(global::Hipstershop.SearchProductsRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_SearchProducts, null, options, request); + } + public virtual grpc::AsyncUnaryCall SearchProductsAsync(global::Hipstershop.SearchProductsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SearchProductsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall SearchProductsAsync(global::Hipstershop.SearchProductsRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_SearchProducts, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override ProductCatalogServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new ProductCatalogServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(ProductCatalogServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_ListProducts, serviceImpl.ListProducts) + .AddMethod(__Method_GetProduct, serviceImpl.GetProduct) + .AddMethod(__Method_SearchProducts, serviceImpl.SearchProducts).Build(); + } + + } + public static partial class ShippingService + { + static readonly string __ServiceName = "hipstershop.ShippingService"; + + static readonly grpc::Marshaller __Marshaller_GetQuoteRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.GetQuoteRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_GetQuoteResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.GetQuoteResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ShipOrderRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.ShipOrderRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ShipOrderResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.ShipOrderResponse.Parser.ParseFrom); + + static readonly grpc::Method __Method_GetQuote = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "GetQuote", + __Marshaller_GetQuoteRequest, + __Marshaller_GetQuoteResponse); + + static readonly grpc::Method __Method_ShipOrder = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "ShipOrder", + __Marshaller_ShipOrderRequest, + __Marshaller_ShipOrderResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Hipstershop.DemoReflection.Descriptor.Services[3]; } + } + + /// Base class for server-side implementations of ShippingService + public abstract partial class ShippingServiceBase + { + public virtual global::System.Threading.Tasks.Task GetQuote(global::Hipstershop.GetQuoteRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + public virtual global::System.Threading.Tasks.Task ShipOrder(global::Hipstershop.ShipOrderRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for ShippingService + public partial class ShippingServiceClient : grpc::ClientBase + { + /// Creates a new client for ShippingService + /// The channel to use to make remote calls. + public ShippingServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for ShippingService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public ShippingServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected ShippingServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected ShippingServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Hipstershop.GetQuoteResponse GetQuote(global::Hipstershop.GetQuoteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetQuote(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.GetQuoteResponse GetQuote(global::Hipstershop.GetQuoteRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_GetQuote, null, options, request); + } + public virtual grpc::AsyncUnaryCall GetQuoteAsync(global::Hipstershop.GetQuoteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetQuoteAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall GetQuoteAsync(global::Hipstershop.GetQuoteRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_GetQuote, null, options, request); + } + public virtual global::Hipstershop.ShipOrderResponse ShipOrder(global::Hipstershop.ShipOrderRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ShipOrder(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.ShipOrderResponse ShipOrder(global::Hipstershop.ShipOrderRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_ShipOrder, null, options, request); + } + public virtual grpc::AsyncUnaryCall ShipOrderAsync(global::Hipstershop.ShipOrderRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ShipOrderAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall ShipOrderAsync(global::Hipstershop.ShipOrderRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_ShipOrder, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override ShippingServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new ShippingServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(ShippingServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_GetQuote, serviceImpl.GetQuote) + .AddMethod(__Method_ShipOrder, serviceImpl.ShipOrder).Build(); + } + + } + public static partial class CurrencyService + { + static readonly string __ServiceName = "hipstershop.CurrencyService"; + + static readonly grpc::Marshaller __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.Empty.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_GetSupportedCurrenciesResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.GetSupportedCurrenciesResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ConversionRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.ConversionRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ConversionResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.ConversionResponse.Parser.ParseFrom); + + static readonly grpc::Method __Method_GetSupportedCurrencies = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "GetSupportedCurrencies", + __Marshaller_Empty, + __Marshaller_GetSupportedCurrenciesResponse); + + static readonly grpc::Method __Method_Convert = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Convert", + __Marshaller_ConversionRequest, + __Marshaller_ConversionResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Hipstershop.DemoReflection.Descriptor.Services[4]; } + } + + /// Base class for server-side implementations of CurrencyService + public abstract partial class CurrencyServiceBase + { + public virtual global::System.Threading.Tasks.Task GetSupportedCurrencies(global::Hipstershop.Empty request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + public virtual global::System.Threading.Tasks.Task Convert(global::Hipstershop.ConversionRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for CurrencyService + public partial class CurrencyServiceClient : grpc::ClientBase + { + /// Creates a new client for CurrencyService + /// The channel to use to make remote calls. + public CurrencyServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for CurrencyService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public CurrencyServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected CurrencyServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected CurrencyServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Hipstershop.GetSupportedCurrenciesResponse GetSupportedCurrencies(global::Hipstershop.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetSupportedCurrencies(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.GetSupportedCurrenciesResponse GetSupportedCurrencies(global::Hipstershop.Empty request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_GetSupportedCurrencies, null, options, request); + } + public virtual grpc::AsyncUnaryCall GetSupportedCurrenciesAsync(global::Hipstershop.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetSupportedCurrenciesAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall GetSupportedCurrenciesAsync(global::Hipstershop.Empty request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_GetSupportedCurrencies, null, options, request); + } + public virtual global::Hipstershop.ConversionResponse Convert(global::Hipstershop.ConversionRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Convert(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.ConversionResponse Convert(global::Hipstershop.ConversionRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Convert, null, options, request); + } + public virtual grpc::AsyncUnaryCall ConvertAsync(global::Hipstershop.ConversionRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ConvertAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall ConvertAsync(global::Hipstershop.ConversionRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Convert, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override CurrencyServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new CurrencyServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(CurrencyServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_GetSupportedCurrencies, serviceImpl.GetSupportedCurrencies) + .AddMethod(__Method_Convert, serviceImpl.Convert).Build(); + } + + } + public static partial class PaymentService + { + static readonly string __ServiceName = "hipstershop.PaymentService"; + + static readonly grpc::Marshaller __Marshaller_ChargeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.ChargeRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_ChargeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.ChargeResponse.Parser.ParseFrom); + + static readonly grpc::Method __Method_Charge = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Charge", + __Marshaller_ChargeRequest, + __Marshaller_ChargeResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Hipstershop.DemoReflection.Descriptor.Services[5]; } + } + + /// Base class for server-side implementations of PaymentService + public abstract partial class PaymentServiceBase + { + public virtual global::System.Threading.Tasks.Task Charge(global::Hipstershop.ChargeRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for PaymentService + public partial class PaymentServiceClient : grpc::ClientBase + { + /// Creates a new client for PaymentService + /// The channel to use to make remote calls. + public PaymentServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for PaymentService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public PaymentServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected PaymentServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected PaymentServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Hipstershop.ChargeResponse Charge(global::Hipstershop.ChargeRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Charge(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.ChargeResponse Charge(global::Hipstershop.ChargeRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Charge, null, options, request); + } + public virtual grpc::AsyncUnaryCall ChargeAsync(global::Hipstershop.ChargeRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return ChargeAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall ChargeAsync(global::Hipstershop.ChargeRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Charge, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override PaymentServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new PaymentServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(PaymentServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_Charge, serviceImpl.Charge).Build(); + } + + } + public static partial class EmailService + { + static readonly string __ServiceName = "hipstershop.EmailService"; + + static readonly grpc::Marshaller __Marshaller_SendOrderConfirmationRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.SendOrderConfirmationRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.Empty.Parser.ParseFrom); + + static readonly grpc::Method __Method_SendOrderConfirmation = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "SendOrderConfirmation", + __Marshaller_SendOrderConfirmationRequest, + __Marshaller_Empty); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Hipstershop.DemoReflection.Descriptor.Services[6]; } + } + + /// Base class for server-side implementations of EmailService + public abstract partial class EmailServiceBase + { + public virtual global::System.Threading.Tasks.Task SendOrderConfirmation(global::Hipstershop.SendOrderConfirmationRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for EmailService + public partial class EmailServiceClient : grpc::ClientBase + { + /// Creates a new client for EmailService + /// The channel to use to make remote calls. + public EmailServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for EmailService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public EmailServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected EmailServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected EmailServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Hipstershop.Empty SendOrderConfirmation(global::Hipstershop.SendOrderConfirmationRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SendOrderConfirmation(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.Empty SendOrderConfirmation(global::Hipstershop.SendOrderConfirmationRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_SendOrderConfirmation, null, options, request); + } + public virtual grpc::AsyncUnaryCall SendOrderConfirmationAsync(global::Hipstershop.SendOrderConfirmationRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return SendOrderConfirmationAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall SendOrderConfirmationAsync(global::Hipstershop.SendOrderConfirmationRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_SendOrderConfirmation, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override EmailServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new EmailServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(EmailServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_SendOrderConfirmation, serviceImpl.SendOrderConfirmation).Build(); + } + + } + public static partial class CheckoutService + { + static readonly string __ServiceName = "hipstershop.CheckoutService"; + + static readonly grpc::Marshaller __Marshaller_CreateOrderRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.CreateOrderRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_CreateOrderResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.CreateOrderResponse.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_PlaceOrderRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.PlaceOrderRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_PlaceOrderResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.PlaceOrderResponse.Parser.ParseFrom); + + static readonly grpc::Method __Method_CreateOrder = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "CreateOrder", + __Marshaller_CreateOrderRequest, + __Marshaller_CreateOrderResponse); + + static readonly grpc::Method __Method_PlaceOrder = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "PlaceOrder", + __Marshaller_PlaceOrderRequest, + __Marshaller_PlaceOrderResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Hipstershop.DemoReflection.Descriptor.Services[7]; } + } + + /// Base class for server-side implementations of CheckoutService + public abstract partial class CheckoutServiceBase + { + public virtual global::System.Threading.Tasks.Task CreateOrder(global::Hipstershop.CreateOrderRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + public virtual global::System.Threading.Tasks.Task PlaceOrder(global::Hipstershop.PlaceOrderRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for CheckoutService + public partial class CheckoutServiceClient : grpc::ClientBase + { + /// Creates a new client for CheckoutService + /// The channel to use to make remote calls. + public CheckoutServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for CheckoutService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public CheckoutServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected CheckoutServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected CheckoutServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Hipstershop.CreateOrderResponse CreateOrder(global::Hipstershop.CreateOrderRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CreateOrder(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.CreateOrderResponse CreateOrder(global::Hipstershop.CreateOrderRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_CreateOrder, null, options, request); + } + public virtual grpc::AsyncUnaryCall CreateOrderAsync(global::Hipstershop.CreateOrderRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CreateOrderAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall CreateOrderAsync(global::Hipstershop.CreateOrderRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_CreateOrder, null, options, request); + } + public virtual global::Hipstershop.PlaceOrderResponse PlaceOrder(global::Hipstershop.PlaceOrderRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return PlaceOrder(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.PlaceOrderResponse PlaceOrder(global::Hipstershop.PlaceOrderRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_PlaceOrder, null, options, request); + } + public virtual grpc::AsyncUnaryCall PlaceOrderAsync(global::Hipstershop.PlaceOrderRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return PlaceOrderAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall PlaceOrderAsync(global::Hipstershop.PlaceOrderRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_PlaceOrder, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override CheckoutServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new CheckoutServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(CheckoutServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_CreateOrder, serviceImpl.CreateOrder) + .AddMethod(__Method_PlaceOrder, serviceImpl.PlaceOrder).Build(); + } + + } +} +#endregion diff --git a/src/cartservice/Program.cs b/src/cartservice/Program.cs new file mode 100644 index 0000000..8d4e396 --- /dev/null +++ b/src/cartservice/Program.cs @@ -0,0 +1,59 @@ +using System; +using CommandLine; +using Grpc.Core; + +namespace cartservice +{ + class Program + { + [Verb("start", HelpText = "Starts the server listening on provided port")] + class ServerOptions + { + + [Option('p', "port", HelpText = "The port on for running the server", Required = true)] + public int Port { get; set; } + } + + static object StartServer(string host, int port) + { + var store = new CartStore(); + Server server = new Server + { + Services = { Hipstershop.CartService.BindService(new CartServiceImpl(store)) }, + Ports = { new ServerPort(host, port, ServerCredentials.Insecure) } + }; + + Console.WriteLine("Cart server is listening on port " + port); + Console.WriteLine("Press any key to stop the server..."); + server.Start(); + + Console.ReadKey(); + + server.ShutdownAsync().Wait(); + + return null; + } + static void Main(string[] args) + { + if (args.Length == 0) + { + Console.WriteLine("Invalid number of arguments supplied"); + Environment.Exit(-1); + } + + switch (args[0]) + { + case "start": + Parser.Default.ParseArguments(args).MapResult( + (ServerOptions options) => StartServer("localhost", options.Port), + errs => 1); + break; + default: + Console.WriteLine("Invalid command"); + break; + } + + Console.WriteLine("Hello World!"); + } + } +} diff --git a/src/cartservice/cartservice.csproj b/src/cartservice/cartservice.csproj new file mode 100644 index 0000000..fddba5c --- /dev/null +++ b/src/cartservice/cartservice.csproj @@ -0,0 +1,16 @@ + + + + Exe + netcoreapp2.0 + + + + + + + + + + + diff --git a/src/cartservice/generate_protos.bat b/src/cartservice/generate_protos.bat new file mode 100644 index 0000000..2a427e6 --- /dev/null +++ b/src/cartservice/generate_protos.bat @@ -0,0 +1,27 @@ +@rem Copyright 2018 gRPC authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@rem Generate the C# code for .proto files + +setlocal + +@rem enter this directory +cd /d %~dp0 + +set NUGET_PATH=%UserProfile%\.nuget\packages +set TOOLS_PATH=%NUGET_PATH%\Grpc.Tools\1.12.0\tools\windows_x64 + +%TOOLS_PATH%\protoc.exe -I%~dp0/../../pb;%NUGET_PATH%\google.protobuf.tools\3.5.1\tools\ --csharp_out %~dp0 %~dp0\..\..\pb\demo.proto --grpc_out %~dp0 --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe + +endlocal