From 07d84cb6a10298a27e2addf68ff69fd88ef7c2a9 Mon Sep 17 00:00:00 2001 From: Simon Zeltser Date: Thu, 20 Sep 2018 16:46:35 -0700 Subject: [PATCH] Introducing super basic health check for cart service - Generated C# proto implementation for grpc health check - Moved all C# protos to a dedicated folder - Implemented basic health checking to ping CartStore (which is Redis in default implementation) - Base plumbing for health checks --- src/cartservice/HealthImpl.cs | 22 + src/cartservice/grpc_generated/Demo.cs | 5191 ++++++++++++++++++ src/cartservice/grpc_generated/DemoGrpc.cs | 962 ++++ src/cartservice/grpc_generated/Health.cs | 323 ++ src/cartservice/grpc_generated/HealthGrpc.cs | 115 + 5 files changed, 6613 insertions(+) create mode 100644 src/cartservice/HealthImpl.cs create mode 100644 src/cartservice/grpc_generated/Demo.cs create mode 100644 src/cartservice/grpc_generated/DemoGrpc.cs create mode 100644 src/cartservice/grpc_generated/Health.cs create mode 100644 src/cartservice/grpc_generated/HealthGrpc.cs diff --git a/src/cartservice/HealthImpl.cs b/src/cartservice/HealthImpl.cs new file mode 100644 index 0000000..5ac6551 --- /dev/null +++ b/src/cartservice/HealthImpl.cs @@ -0,0 +1,22 @@ +using System; +using cartservice.interfaces; +using Grpc.Health.V1; +using StackExchange.Redis; +using static Grpc.Health.V1.Health; + +namespace cartservice { + internal class HealthImpl : HealthBase { + private ICartStore dependency { get; } + public HealthImpl (ICartStore dependency) { + this.dependency = dependency; + } + + public HealthCheckResponse Check (HealthCheckRequest request) { + Console.WriteLine ("Checking CartService Health"); + + return new HealthCheckResponse { + Status = dependency.Ping() ? HealthCheckResponse.Types.ServingStatus.Serving : HealthCheckResponse.Types.ServingStatus.NotServing + }; + } + } +} \ No newline at end of file diff --git a/src/cartservice/grpc_generated/Demo.cs b/src/cartservice/grpc_generated/Demo.cs new file mode 100644 index 0000000..f196131 --- /dev/null +++ b/src/cartservice/grpc_generated/Demo.cs @@ -0,0 +1,5191 @@ +// +// 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", + "GAEgAygJInAKB1Byb2R1Y3QSCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRIT", + "CgtkZXNjcmlwdGlvbhgDIAEoCRIPCgdwaWN0dXJlGAQgASgJEiUKCXByaWNl", + "X3VzZBgFIAEoCzISLmhpcHN0ZXJzaG9wLk1vbmV5Ij4KFExpc3RQcm9kdWN0", + "c1Jlc3BvbnNlEiYKCHByb2R1Y3RzGAEgAygLMhQuaGlwc3RlcnNob3AuUHJv", + "ZHVjdCIfChFHZXRQcm9kdWN0UmVxdWVzdBIKCgJpZBgBIAEoCSImChVTZWFy", + "Y2hQcm9kdWN0c1JlcXVlc3QSDQoFcXVlcnkYASABKAkiPwoWU2VhcmNoUHJv", + "ZHVjdHNSZXNwb25zZRIlCgdyZXN1bHRzGAEgAygLMhQuaGlwc3RlcnNob3Au", + "UHJvZHVjdCJeCg9HZXRRdW90ZVJlcXVlc3QSJQoHYWRkcmVzcxgBIAEoCzIU", + "LmhpcHN0ZXJzaG9wLkFkZHJlc3MSJAoFaXRlbXMYAiADKAsyFS5oaXBzdGVy", + "c2hvcC5DYXJ0SXRlbSI4ChBHZXRRdW90ZVJlc3BvbnNlEiQKCGNvc3RfdXNk", + "GAEgASgLMhIuaGlwc3RlcnNob3AuTW9uZXkiXwoQU2hpcE9yZGVyUmVxdWVz", + "dBIlCgdhZGRyZXNzGAEgASgLMhQuaGlwc3RlcnNob3AuQWRkcmVzcxIkCgVp", + "dGVtcxgCIAMoCzIVLmhpcHN0ZXJzaG9wLkNhcnRJdGVtIigKEVNoaXBPcmRl", + "clJlc3BvbnNlEhMKC3RyYWNraW5nX2lkGAEgASgJImEKB0FkZHJlc3MSFgoO", + "c3RyZWV0X2FkZHJlc3MYASABKAkSDAoEY2l0eRgCIAEoCRINCgVzdGF0ZRgD", + "IAEoCRIPCgdjb3VudHJ5GAQgASgJEhAKCHppcF9jb2RlGAUgASgFIjwKBU1v", + "bmV5EhUKDWN1cnJlbmN5X2NvZGUYASABKAkSDQoFdW5pdHMYAiABKAMSDQoF", + "bmFub3MYAyABKAUiOAoeR2V0U3VwcG9ydGVkQ3VycmVuY2llc1Jlc3BvbnNl", + "EhYKDmN1cnJlbmN5X2NvZGVzGAEgAygJIk4KGUN1cnJlbmN5Q29udmVyc2lv", + "blJlcXVlc3QSIAoEZnJvbRgBIAEoCzISLmhpcHN0ZXJzaG9wLk1vbmV5Eg8K", + "B3RvX2NvZGUYAiABKAkikAEKDkNyZWRpdENhcmRJbmZvEhoKEmNyZWRpdF9j", + "YXJkX251bWJlchgBIAEoCRIXCg9jcmVkaXRfY2FyZF9jdnYYAiABKAUSIwob", + "Y3JlZGl0X2NhcmRfZXhwaXJhdGlvbl95ZWFyGAMgASgFEiQKHGNyZWRpdF9j", + "YXJkX2V4cGlyYXRpb25fbW9udGgYBCABKAUiZQoNQ2hhcmdlUmVxdWVzdBIi", + "CgZhbW91bnQYASABKAsyEi5oaXBzdGVyc2hvcC5Nb25leRIwCgtjcmVkaXRf", + "Y2FyZBgCIAEoCzIbLmhpcHN0ZXJzaG9wLkNyZWRpdENhcmRJbmZvIigKDkNo", + "YXJnZVJlc3BvbnNlEhYKDnRyYW5zYWN0aW9uX2lkGAEgASgJIlIKCU9yZGVy", + "SXRlbRIjCgRpdGVtGAEgASgLMhUuaGlwc3RlcnNob3AuQ2FydEl0ZW0SIAoE", + "Y29zdBgCIAEoCzISLmhpcHN0ZXJzaG9wLk1vbmV5Ir8BCgtPcmRlclJlc3Vs", + "dBIQCghvcmRlcl9pZBgBIAEoCRIcChRzaGlwcGluZ190cmFja2luZ19pZBgC", + "IAEoCRIpCg1zaGlwcGluZ19jb3N0GAMgASgLMhIuaGlwc3RlcnNob3AuTW9u", + "ZXkSLgoQc2hpcHBpbmdfYWRkcmVzcxgEIAEoCzIULmhpcHN0ZXJzaG9wLkFk", + "ZHJlc3MSJQoFaXRlbXMYBSADKAsyFi5oaXBzdGVyc2hvcC5PcmRlckl0ZW0i", + "VgocU2VuZE9yZGVyQ29uZmlybWF0aW9uUmVxdWVzdBINCgVlbWFpbBgBIAEo", + "CRInCgVvcmRlchgCIAEoCzIYLmhpcHN0ZXJzaG9wLk9yZGVyUmVzdWx0IqMB", + "ChFQbGFjZU9yZGVyUmVxdWVzdBIPCgd1c2VyX2lkGAEgASgJEhUKDXVzZXJf", + "Y3VycmVuY3kYAiABKAkSJQoHYWRkcmVzcxgDIAEoCzIULmhpcHN0ZXJzaG9w", + "LkFkZHJlc3MSDQoFZW1haWwYBSABKAkSMAoLY3JlZGl0X2NhcmQYBiABKAsy", + "Gy5oaXBzdGVyc2hvcC5DcmVkaXRDYXJkSW5mbyI9ChJQbGFjZU9yZGVyUmVz", + "cG9uc2USJwoFb3JkZXIYASABKAsyGC5oaXBzdGVyc2hvcC5PcmRlclJlc3Vs", + "dCIhCglBZFJlcXVlc3QSFAoMY29udGV4dF9rZXlzGAEgAygJIioKCkFkUmVz", + "cG9uc2USHAoDYWRzGAEgAygLMg8uaGlwc3RlcnNob3AuQWQiKAoCQWQSFAoM", + "cmVkaXJlY3RfdXJsGAEgASgJEgwKBHRleHQYAiABKAkyygEKC0NhcnRTZXJ2", + "aWNlEjwKB0FkZEl0ZW0SGy5oaXBzdGVyc2hvcC5BZGRJdGVtUmVxdWVzdBoS", + "LmhpcHN0ZXJzaG9wLkVtcHR5IgASOwoHR2V0Q2FydBIbLmhpcHN0ZXJzaG9w", + "LkdldENhcnRSZXF1ZXN0GhEuaGlwc3RlcnNob3AuQ2FydCIAEkAKCUVtcHR5", + "Q2FydBIdLmhpcHN0ZXJzaG9wLkVtcHR5Q2FydFJlcXVlc3QaEi5oaXBzdGVy", + "c2hvcC5FbXB0eSIAMoMBChVSZWNvbW1lbmRhdGlvblNlcnZpY2USagoTTGlz", + "dFJlY29tbWVuZGF0aW9ucxInLmhpcHN0ZXJzaG9wLkxpc3RSZWNvbW1lbmRh", + "dGlvbnNSZXF1ZXN0GiguaGlwc3RlcnNob3AuTGlzdFJlY29tbWVuZGF0aW9u", + "c1Jlc3BvbnNlIgAygwIKFVByb2R1Y3RDYXRhbG9nU2VydmljZRJHCgxMaXN0", + "UHJvZHVjdHMSEi5oaXBzdGVyc2hvcC5FbXB0eRohLmhpcHN0ZXJzaG9wLkxp", + "c3RQcm9kdWN0c1Jlc3BvbnNlIgASRAoKR2V0UHJvZHVjdBIeLmhpcHN0ZXJz", + "aG9wLkdldFByb2R1Y3RSZXF1ZXN0GhQuaGlwc3RlcnNob3AuUHJvZHVjdCIA", + "ElsKDlNlYXJjaFByb2R1Y3RzEiIuaGlwc3RlcnNob3AuU2VhcmNoUHJvZHVj", + "dHNSZXF1ZXN0GiMuaGlwc3RlcnNob3AuU2VhcmNoUHJvZHVjdHNSZXNwb25z", + "ZSIAMqoBCg9TaGlwcGluZ1NlcnZpY2USSQoIR2V0UXVvdGUSHC5oaXBzdGVy", + "c2hvcC5HZXRRdW90ZVJlcXVlc3QaHS5oaXBzdGVyc2hvcC5HZXRRdW90ZVJl", + "c3BvbnNlIgASTAoJU2hpcE9yZGVyEh0uaGlwc3RlcnNob3AuU2hpcE9yZGVy", + "UmVxdWVzdBoeLmhpcHN0ZXJzaG9wLlNoaXBPcmRlclJlc3BvbnNlIgAytwEK", + "D0N1cnJlbmN5U2VydmljZRJbChZHZXRTdXBwb3J0ZWRDdXJyZW5jaWVzEhIu", + "aGlwc3RlcnNob3AuRW1wdHkaKy5oaXBzdGVyc2hvcC5HZXRTdXBwb3J0ZWRD", + "dXJyZW5jaWVzUmVzcG9uc2UiABJHCgdDb252ZXJ0EiYuaGlwc3RlcnNob3Au", + "Q3VycmVuY3lDb252ZXJzaW9uUmVxdWVzdBoSLmhpcHN0ZXJzaG9wLk1vbmV5", + "IgAyVQoOUGF5bWVudFNlcnZpY2USQwoGQ2hhcmdlEhouaGlwc3RlcnNob3Au", + "Q2hhcmdlUmVxdWVzdBobLmhpcHN0ZXJzaG9wLkNoYXJnZVJlc3BvbnNlIgAy", + "aAoMRW1haWxTZXJ2aWNlElgKFVNlbmRPcmRlckNvbmZpcm1hdGlvbhIpLmhp", + "cHN0ZXJzaG9wLlNlbmRPcmRlckNvbmZpcm1hdGlvblJlcXVlc3QaEi5oaXBz", + "dGVyc2hvcC5FbXB0eSIAMmIKD0NoZWNrb3V0U2VydmljZRJPCgpQbGFjZU9y", + "ZGVyEh4uaGlwc3RlcnNob3AuUGxhY2VPcmRlclJlcXVlc3QaHy5oaXBzdGVy", + "c2hvcC5QbGFjZU9yZGVyUmVzcG9uc2UiADJICglBZFNlcnZpY2USOwoGR2V0", + "QWRzEhYuaGlwc3RlcnNob3AuQWRSZXF1ZXN0GhcuaGlwc3RlcnNob3AuQWRS", + "ZXNwb25zZSIAYgZwcm90bzM=")); + 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[]{ "StreetAddress", "City", "State", "Country", "ZipCode" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.Money), global::Hipstershop.Money.Parser, new[]{ "CurrencyCode", "Units", "Nanos" }, 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.CurrencyConversionRequest), global::Hipstershop.CurrencyConversionRequest.Parser, new[]{ "From", "ToCode" }, 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.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), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.AdRequest), global::Hipstershop.AdRequest.Parser, new[]{ "ContextKeys" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.AdResponse), global::Hipstershop.AdResponse.Parser, new[]{ "Ads" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Hipstershop.Ad), global::Hipstershop.Ad.Parser, new[]{ "RedirectUrl", "Text" }, 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.Money priceUsd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Money 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.Money(); + } + 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.Money(); + } + 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.Money costUsd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Hipstershop.Money 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.Money(); + } + 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.Money(); + } + 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() { + streetAddress_ = other.streetAddress_; + city_ = other.city_; + state_ = other.state_; + 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" field. + public const int StreetAddressFieldNumber = 1; + private string streetAddress_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string StreetAddress { + get { return streetAddress_; } + set { + streetAddress_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "city" field. + public const int CityFieldNumber = 2; + private string city_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string City { + get { return city_; } + set { + city_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "state" field. + public const int StateFieldNumber = 3; + private string state_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string State { + get { return state_; } + set { + state_ = 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 (StreetAddress != other.StreetAddress) return false; + if (City != other.City) return false; + if (State != other.State) 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 (StreetAddress.Length != 0) hash ^= StreetAddress.GetHashCode(); + if (City.Length != 0) hash ^= City.GetHashCode(); + if (State.Length != 0) hash ^= State.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 (StreetAddress.Length != 0) { + output.WriteRawTag(10); + output.WriteString(StreetAddress); + } + if (City.Length != 0) { + output.WriteRawTag(18); + output.WriteString(City); + } + if (State.Length != 0) { + output.WriteRawTag(26); + output.WriteString(State); + } + 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 (StreetAddress.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(StreetAddress); + } + if (City.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(City); + } + if (State.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(State); + } + 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.StreetAddress.Length != 0) { + StreetAddress = other.StreetAddress; + } + if (other.City.Length != 0) { + City = other.City; + } + if (other.State.Length != 0) { + State = other.State; + } + 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: { + StreetAddress = input.ReadString(); + break; + } + case 18: { + City = input.ReadString(); + break; + } + case 26: { + State = input.ReadString(); + break; + } + case 34: { + Country = input.ReadString(); + break; + } + case 40: { + ZipCode = input.ReadInt32(); + break; + } + } + } + } + + } + + /// + /// Represents an amount of money with its currency type. + /// + 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[18]; } + } + + [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_; + units_ = other.units_; + nanos_ = other.nanos_; + _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 "units" field. + public const int UnitsFieldNumber = 2; + private long units_; + /// + /// The whole units of the amount. + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Units { + get { return units_; } + set { + units_ = value; + } + } + + /// Field number for the "nanos" field. + public const int NanosFieldNumber = 3; + private int nanos_; + /// + /// Number of nano (10^-9) units of the amount. + /// The value must be between -999,999,999 and +999,999,999 inclusive. + /// If `units` is positive, `nanos` must be positive or zero. + /// If `units` is zero, `nanos` can be positive, zero, or negative. + /// If `units` is negative, `nanos` must be negative or zero. + /// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Nanos { + get { return nanos_; } + set { + nanos_ = 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 (Units != other.Units) return false; + if (Nanos != other.Nanos) 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 (Units != 0L) hash ^= Units.GetHashCode(); + if (Nanos != 0) hash ^= Nanos.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 (Units != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Units); + } + if (Nanos != 0) { + output.WriteRawTag(24); + output.WriteInt32(Nanos); + } + 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 (Units != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Units); + } + if (Nanos != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); + } + 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.Units != 0L) { + Units = other.Units; + } + if (other.Nanos != 0) { + Nanos = other.Nanos; + } + _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 16: { + Units = input.ReadInt64(); + break; + } + case 24: { + Nanos = input.ReadInt32(); + 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[19]; } + } + + [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 CurrencyConversionRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CurrencyConversionRequest()); + 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 CurrencyConversionRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CurrencyConversionRequest(CurrencyConversionRequest other) : this() { + From = other.from_ != null ? other.From.Clone() : null; + toCode_ = other.toCode_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CurrencyConversionRequest Clone() { + return new CurrencyConversionRequest(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 CurrencyConversionRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CurrencyConversionRequest 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(CurrencyConversionRequest 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 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[21]; } + } + + [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[22]; } + } + + [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[23]; } + } + + [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[24]; } + } + + [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[25]; } + } + + [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[26]; } + } + + [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 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[27]; } + } + + [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[28]; } + } + + [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; + } + } + } + } + + } + + public sealed partial class AdRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AdRequest()); + 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 AdRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdRequest(AdRequest other) : this() { + contextKeys_ = other.contextKeys_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdRequest Clone() { + return new AdRequest(this); + } + + /// Field number for the "context_keys" field. + public const int ContextKeysFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_contextKeys_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField contextKeys_ = new pbc::RepeatedField(); + /// + /// List of important key words from the current page describing the context. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ContextKeys { + get { return contextKeys_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AdRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AdRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!contextKeys_.Equals(other.contextKeys_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= contextKeys_.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) { + contextKeys_.WriteTo(output, _repeated_contextKeys_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += contextKeys_.CalculateSize(_repeated_contextKeys_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AdRequest other) { + if (other == null) { + return; + } + contextKeys_.Add(other.contextKeys_); + _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: { + contextKeys_.AddEntriesFrom(input, _repeated_contextKeys_codec); + break; + } + } + } + } + + } + + public sealed partial class AdResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AdResponse()); + 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 AdResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdResponse(AdResponse other) : this() { + ads_ = other.ads_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AdResponse Clone() { + return new AdResponse(this); + } + + /// Field number for the "ads" field. + public const int AdsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_ads_codec + = pb::FieldCodec.ForMessage(10, global::Hipstershop.Ad.Parser); + private readonly pbc::RepeatedField ads_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Ads { + get { return ads_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AdResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AdResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!ads_.Equals(other.ads_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= ads_.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) { + ads_.WriteTo(output, _repeated_ads_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += ads_.CalculateSize(_repeated_ads_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AdResponse other) { + if (other == null) { + return; + } + ads_.Add(other.ads_); + _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: { + ads_.AddEntriesFrom(input, _repeated_ads_codec); + break; + } + } + } + } + + } + + public sealed partial class Ad : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Ad()); + 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 Ad() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Ad(Ad other) : this() { + redirectUrl_ = other.redirectUrl_; + text_ = other.text_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Ad Clone() { + return new Ad(this); + } + + /// Field number for the "redirect_url" field. + public const int RedirectUrlFieldNumber = 1; + private string redirectUrl_ = ""; + /// + /// url to redirect to when an ad is clicked. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string RedirectUrl { + get { return redirectUrl_; } + set { + redirectUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "text" field. + public const int TextFieldNumber = 2; + private string text_ = ""; + /// + /// short advertisement text to display. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Text { + get { return text_; } + set { + text_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Ad); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Ad other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RedirectUrl != other.RedirectUrl) return false; + if (Text != other.Text) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (RedirectUrl.Length != 0) hash ^= RedirectUrl.GetHashCode(); + if (Text.Length != 0) hash ^= Text.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 (RedirectUrl.Length != 0) { + output.WriteRawTag(10); + output.WriteString(RedirectUrl); + } + if (Text.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Text); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (RedirectUrl.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(RedirectUrl); + } + if (Text.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Text); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Ad other) { + if (other == null) { + return; + } + if (other.RedirectUrl.Length != 0) { + RedirectUrl = other.RedirectUrl; + } + if (other.Text.Length != 0) { + Text = other.Text; + } + _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: { + RedirectUrl = input.ReadString(); + break; + } + case 18: { + Text = input.ReadString(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/cartservice/grpc_generated/DemoGrpc.cs b/src/cartservice/grpc_generated/DemoGrpc.cs new file mode 100644 index 0000000..fa263ae --- /dev/null +++ b/src/cartservice/grpc_generated/DemoGrpc.cs @@ -0,0 +1,962 @@ +// +// 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_CurrencyConversionRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.CurrencyConversionRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_Money = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.Money.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_CurrencyConversionRequest, + __Marshaller_Money); + + /// 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.CurrencyConversionRequest 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.Money Convert(global::Hipstershop.CurrencyConversionRequest 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.Money Convert(global::Hipstershop.CurrencyConversionRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Convert, null, options, request); + } + public virtual grpc::AsyncUnaryCall ConvertAsync(global::Hipstershop.CurrencyConversionRequest 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.CurrencyConversionRequest 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_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_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 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.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_PlaceOrder, serviceImpl.PlaceOrder).Build(); + } + + } + public static partial class AdService + { + static readonly string __ServiceName = "hipstershop.AdService"; + + static readonly grpc::Marshaller __Marshaller_AdRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.AdRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_AdResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Hipstershop.AdResponse.Parser.ParseFrom); + + static readonly grpc::Method __Method_GetAds = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "GetAds", + __Marshaller_AdRequest, + __Marshaller_AdResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Hipstershop.DemoReflection.Descriptor.Services[8]; } + } + + /// Base class for server-side implementations of AdService + public abstract partial class AdServiceBase + { + public virtual global::System.Threading.Tasks.Task GetAds(global::Hipstershop.AdRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for AdService + public partial class AdServiceClient : grpc::ClientBase + { + /// Creates a new client for AdService + /// The channel to use to make remote calls. + public AdServiceClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for AdService that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public AdServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected AdServiceClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected AdServiceClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Hipstershop.AdResponse GetAds(global::Hipstershop.AdRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetAds(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Hipstershop.AdResponse GetAds(global::Hipstershop.AdRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_GetAds, null, options, request); + } + public virtual grpc::AsyncUnaryCall GetAdsAsync(global::Hipstershop.AdRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return GetAdsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall GetAdsAsync(global::Hipstershop.AdRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_GetAds, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override AdServiceClient NewInstance(ClientBaseConfiguration configuration) + { + return new AdServiceClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(AdServiceBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_GetAds, serviceImpl.GetAds).Build(); + } + + } +} +#endregion diff --git a/src/cartservice/grpc_generated/Health.cs b/src/cartservice/grpc_generated/Health.cs new file mode 100644 index 0000000..a90f261 --- /dev/null +++ b/src/cartservice/grpc_generated/Health.cs @@ -0,0 +1,323 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grpc/health/v1/health.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 Grpc.Health.V1 { + + /// Holder for reflection information generated from grpc/health/v1/health.proto + public static partial class HealthReflection { + + #region Descriptor + /// File descriptor for grpc/health/v1/health.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HealthReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChtncnBjL2hlYWx0aC92MS9oZWFsdGgucHJvdG8SDmdycGMuaGVhbHRoLnYx", + "IiUKEkhlYWx0aENoZWNrUmVxdWVzdBIPCgdzZXJ2aWNlGAEgASgJIpQBChNI", + "ZWFsdGhDaGVja1Jlc3BvbnNlEkEKBnN0YXR1cxgBIAEoDjIxLmdycGMuaGVh", + "bHRoLnYxLkhlYWx0aENoZWNrUmVzcG9uc2UuU2VydmluZ1N0YXR1cyI6Cg1T", + "ZXJ2aW5nU3RhdHVzEgsKB1VOS05PV04QABILCgdTRVJWSU5HEAESDwoLTk9U", + "X1NFUlZJTkcQAjJaCgZIZWFsdGgSUAoFQ2hlY2sSIi5ncnBjLmhlYWx0aC52", + "MS5IZWFsdGhDaGVja1JlcXVlc3QaIy5ncnBjLmhlYWx0aC52MS5IZWFsdGhD", + "aGVja1Jlc3BvbnNlQmEKEWlvLmdycGMuaGVhbHRoLnYxQgtIZWFsdGhQcm90", + "b1ABWixnb29nbGUuZ29sYW5nLm9yZy9ncnBjL2hlYWx0aC9ncnBjX2hlYWx0", + "aF92MaoCDkdycGMuSGVhbHRoLlYxYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Health.V1.HealthCheckRequest), global::Grpc.Health.V1.HealthCheckRequest.Parser, new[]{ "Service" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Health.V1.HealthCheckResponse), global::Grpc.Health.V1.HealthCheckResponse.Parser, new[]{ "Status" }, null, new[]{ typeof(global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus) }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class HealthCheckRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HealthCheckRequest()); + 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::Grpc.Health.V1.HealthReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HealthCheckRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HealthCheckRequest(HealthCheckRequest other) : this() { + service_ = other.service_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HealthCheckRequest Clone() { + return new HealthCheckRequest(this); + } + + /// Field number for the "service" field. + public const int ServiceFieldNumber = 1; + private string service_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Service { + get { return service_; } + set { + service_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HealthCheckRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HealthCheckRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Service != other.Service) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Service.Length != 0) hash ^= Service.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 (Service.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Service); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Service.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HealthCheckRequest other) { + if (other == null) { + return; + } + if (other.Service.Length != 0) { + Service = other.Service; + } + _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: { + Service = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class HealthCheckResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HealthCheckResponse()); + 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::Grpc.Health.V1.HealthReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HealthCheckResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HealthCheckResponse(HealthCheckResponse other) : this() { + status_ = other.status_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HealthCheckResponse Clone() { + return new HealthCheckResponse(this); + } + + /// Field number for the "status" field. + public const int StatusFieldNumber = 1; + private global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus status_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus Status { + get { return status_; } + set { + status_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HealthCheckResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HealthCheckResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Status != other.Status) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Status != 0) hash ^= Status.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 (Status != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Status); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Status != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HealthCheckResponse other) { + if (other == null) { + return; + } + if (other.Status != 0) { + Status = other.Status; + } + _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: { + status_ = (global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus) input.ReadEnum(); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the HealthCheckResponse message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + public enum ServingStatus { + [pbr::OriginalName("UNKNOWN")] Unknown = 0, + [pbr::OriginalName("SERVING")] Serving = 1, + [pbr::OriginalName("NOT_SERVING")] NotServing = 2, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/cartservice/grpc_generated/HealthGrpc.cs b/src/cartservice/grpc_generated/HealthGrpc.cs new file mode 100644 index 0000000..a26f483 --- /dev/null +++ b/src/cartservice/grpc_generated/HealthGrpc.cs @@ -0,0 +1,115 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grpc/health/v1/health.proto +// +// Original file comments: +// Copyright 2015 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// The canonical version of this proto can be found at +// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto +// +#pragma warning disable 1591 +#region Designer generated code + +using grpc = global::Grpc.Core; + +namespace Grpc.Health.V1 { + public static partial class Health + { + static readonly string __ServiceName = "grpc.health.v1.Health"; + + static readonly grpc::Marshaller __Marshaller_HealthCheckRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom); + static readonly grpc::Marshaller __Marshaller_HealthCheckResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom); + + static readonly grpc::Method __Method_Check = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "Check", + __Marshaller_HealthCheckRequest, + __Marshaller_HealthCheckResponse); + + /// Service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Grpc.Health.V1.HealthReflection.Descriptor.Services[0]; } + } + + /// Base class for server-side implementations of Health + public abstract partial class HealthBase + { + public virtual global::System.Threading.Tasks.Task Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + + } + + /// Client for Health + public partial class HealthClient : grpc::ClientBase + { + /// Creates a new client for Health + /// The channel to use to make remote calls. + public HealthClient(grpc::Channel channel) : base(channel) + { + } + /// Creates a new client for Health that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. + public HealthClient(grpc::CallInvoker callInvoker) : base(callInvoker) + { + } + /// Protected parameterless constructor to allow creation of test doubles. + protected HealthClient() : base() + { + } + /// Protected constructor to allow creation of configured clients. + /// The client configuration. + protected HealthClient(ClientBaseConfiguration configuration) : base(configuration) + { + } + + public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return Check(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_Check, null, options, request); + } + public virtual grpc::AsyncUnaryCall CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return CheckAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + public virtual grpc::AsyncUnaryCall CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request); + } + /// Creates a new instance of client from given ClientBaseConfiguration. + protected override HealthClient NewInstance(ClientBaseConfiguration configuration) + { + return new HealthClient(configuration); + } + } + + /// Creates service definition that can be registered with a server + /// An object implementing the server-side handling logic. + public static grpc::ServerServiceDefinition BindService(HealthBase serviceImpl) + { + return grpc::ServerServiceDefinition.CreateBuilder() + .AddMethod(__Method_Check, serviceImpl.Check).Build(); + } + + } +} +#endregion