From 59a7d9d74fc61b223c01b3c122456865c0644fcf Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 07:14:08 -0700 Subject: [PATCH 01/26] upgrade protobuf to HEAD --- third_party/protobuf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/protobuf b/third_party/protobuf index 3e2c8a5dd79..415f72e0791 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit 3e2c8a5dd79481e1d36572cdf65be93514ba6581 +Subproject commit 415f72e07919cefdd7768f6460de9f32576c3248 From 741e64c8721798a1daba28ae782c9c0e08064505 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 08:08:56 -0700 Subject: [PATCH 02/26] update compiler --- src/compiler/csharp_generator.cc | 45 +++++--------------------------- src/compiler/csharp_generator.h | 4 +++ 2 files changed, 10 insertions(+), 39 deletions(-) diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index 9432bdda96b..5443cd47015 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -35,10 +35,15 @@ #include #include +#include "src/compiler/csharp_generator.h" #include "src/compiler/config.h" #include "src/compiler/csharp_generator_helpers.h" #include "src/compiler/csharp_generator.h" + +using google::protobuf::compiler::csharp::GetFileNamespace; +using google::protobuf::compiler::csharp::GetClassName; +using google::protobuf::compiler::csharp::GetUmbrellaClassName; using grpc::protobuf::FileDescriptor; using grpc::protobuf::Descriptor; using grpc::protobuf::ServiceDescriptor; @@ -55,47 +60,10 @@ using grpc_generator::StringReplace; using std::map; using std::vector; + namespace grpc_csharp_generator { namespace { -// TODO(jtattermusch): make GetFileNamespace part of libprotoc public API. -// NOTE: Implementation needs to match exactly to GetFileNamespace -// defined in csharp_helpers.h in protoc csharp plugin. -// We cannot reference it directly because google3 protobufs -// don't have a csharp protoc plugin. -std::string GetFileNamespace(const FileDescriptor* file) { - if (file->options().has_csharp_namespace()) { - return file->options().csharp_namespace(); - } - return file->package(); -} - -std::string ToCSharpName(const std::string& name, const FileDescriptor* file) { - std::string result = GetFileNamespace(file); - if (result != "") { - result += '.'; - } - std::string classname; - if (file->package().empty()) { - classname = name; - } else { - // Strip the proto package from full_name since we've replaced it with - // the C# namespace. - classname = name.substr(file->package().size() + 1); - } - result += StringReplace(classname, ".", ".Types.", false); - return "global::" + result; -} - -// TODO(jtattermusch): make GetClassName part of libprotoc public API. -// NOTE: Implementation needs to match exactly to GetClassName -// defined in csharp_helpers.h in protoc csharp plugin. -// We cannot reference it directly because google3 protobufs -// don't have a csharp protoc plugin. -std::string GetClassName(const Descriptor* message) { - return ToCSharpName(message->full_name(), message->file()); -} - std::string GetServiceClassName(const ServiceDescriptor* service) { return service->name(); } @@ -539,7 +507,6 @@ grpc::string GetServices(const FileDescriptor *file) { out.Print("using System.Threading;\n"); out.Print("using System.Threading.Tasks;\n"); out.Print("using Grpc.Core;\n"); - // TODO(jtattermusch): add using for protobuf message classes out.Print("\n"); out.Print("namespace $namespace$ {\n", "namespace", GetFileNamespace(file)); diff --git a/src/compiler/csharp_generator.h b/src/compiler/csharp_generator.h index ec537d3f1d2..0610f5e9fba 100644 --- a/src/compiler/csharp_generator.h +++ b/src/compiler/csharp_generator.h @@ -36,6 +36,10 @@ #include "src/compiler/config.h" +using namespace std; + +#include + namespace grpc_csharp_generator { grpc::string GetServices(const grpc::protobuf::FileDescriptor *file); From 2c4f4ecb63ae2d3b5d62a10ce7eeb73eb3d75662 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 08:10:48 -0700 Subject: [PATCH 03/26] update generate script --- src/csharp/generate_proto_csharp.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/csharp/generate_proto_csharp.sh b/src/csharp/generate_proto_csharp.sh index 7c3ba709220..56c9418e393 100755 --- a/src/csharp/generate_proto_csharp.sh +++ b/src/csharp/generate_proto_csharp.sh @@ -38,11 +38,11 @@ EXAMPLES_DIR=Grpc.Examples INTEROP_DIR=Grpc.IntegrationTesting HEALTHCHECK_DIR=Grpc.HealthCheck -$PROTOC --plugin=$PLUGIN --grpc_out=$EXAMPLES_DIR \ +$PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR \ -I $EXAMPLES_DIR/proto $EXAMPLES_DIR/proto/math.proto -$PROTOC --plugin=$PLUGIN --grpc_out=$INTEROP_DIR \ +$PROTOC --plugin=$PLUGIN --csharp_out=$INTEROP_DIR --grpc_out=$INTEROP_DIR \ -I $INTEROP_DIR/proto $INTEROP_DIR/proto/test.proto -$PROTOC --plugin=$PLUGIN --grpc_out=$HEALTHCHECK_DIR \ +$PROTOC --plugin=$PLUGIN --csharp_out=$HEALTHCHECK_DIR --grpc_out=$HEALTHCHECK_DIR \ -I $HEALTHCHECK_DIR/proto $HEALTHCHECK_DIR/proto/health.proto From 85f24b5862d93ebfd312d648cafb072462b12135 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 08:11:40 -0700 Subject: [PATCH 04/26] update proto files --- src/csharp/Grpc.Examples/proto/math.proto | 16 ++++----- .../Grpc.HealthCheck/proto/health.proto | 8 ++--- .../Grpc.IntegrationTesting/proto/empty.proto | 2 +- .../proto/messages.proto | 36 +++++++++---------- .../Grpc.IntegrationTesting/proto/test.proto | 2 +- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/csharp/Grpc.Examples/proto/math.proto b/src/csharp/Grpc.Examples/proto/math.proto index 5485d580c32..311e148c021 100644 --- a/src/csharp/Grpc.Examples/proto/math.proto +++ b/src/csharp/Grpc.Examples/proto/math.proto @@ -28,30 +28,30 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -syntax = "proto2"; +syntax = "proto3"; package math; message DivArgs { - optional int64 dividend = 1; - optional int64 divisor = 2; + int64 dividend = 1; + int64 divisor = 2; } message DivReply { - optional int64 quotient = 1; - optional int64 remainder = 2; + int64 quotient = 1; + int64 remainder = 2; } message FibArgs { - optional int64 limit = 1; + int64 limit = 1; } message Num { - optional int64 num = 1; + int64 num = 1; } message FibReply { - optional int64 count = 1; + int64 count = 1; } service Math { diff --git a/src/csharp/Grpc.HealthCheck/proto/health.proto b/src/csharp/Grpc.HealthCheck/proto/health.proto index 08df7e104e1..01aa3fcf577 100644 --- a/src/csharp/Grpc.HealthCheck/proto/health.proto +++ b/src/csharp/Grpc.HealthCheck/proto/health.proto @@ -28,14 +28,14 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // TODO(jtattermusch): switch to proto3 once C# supports that. -syntax = "proto2"; +syntax = "proto3"; package grpc.health.v1alpha; option csharp_namespace = "Grpc.Health.V1Alpha"; message HealthCheckRequest { - optional string host = 1; - optional string service = 2; + string host = 1; + string service = 2; } message HealthCheckResponse { @@ -44,7 +44,7 @@ message HealthCheckResponse { SERVING = 1; NOT_SERVING = 2; } - optional ServingStatus status = 1; + ServingStatus status = 1; } service Health { diff --git a/src/csharp/Grpc.IntegrationTesting/proto/empty.proto b/src/csharp/Grpc.IntegrationTesting/proto/empty.proto index 4295a0a960c..6d0eb937d67 100644 --- a/src/csharp/Grpc.IntegrationTesting/proto/empty.proto +++ b/src/csharp/Grpc.IntegrationTesting/proto/empty.proto @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -syntax = "proto2"; +syntax = "proto3"; package grpc.testing; diff --git a/src/csharp/Grpc.IntegrationTesting/proto/messages.proto b/src/csharp/Grpc.IntegrationTesting/proto/messages.proto index 65a81404652..7df85e3c136 100644 --- a/src/csharp/Grpc.IntegrationTesting/proto/messages.proto +++ b/src/csharp/Grpc.IntegrationTesting/proto/messages.proto @@ -30,7 +30,7 @@ // Message definitions to be used by integration test service definitions. -syntax = "proto2"; +syntax = "proto3"; package grpc.testing; @@ -49,46 +49,46 @@ enum PayloadType { // A block of data, to simply increase gRPC message size. message Payload { // The type of data in body. - optional PayloadType type = 1; + PayloadType type = 1; // Primary contents of payload. - optional bytes body = 2; + bytes body = 2; } // Unary request. message SimpleRequest { // Desired payload type in the response from the server. // If response_type is RANDOM, server randomly chooses one from other formats. - optional PayloadType response_type = 1; + PayloadType response_type = 1; // Desired payload size in the response from the server. // If response_type is COMPRESSABLE, this denotes the size before compression. - optional int32 response_size = 2; + int32 response_size = 2; // Optional input payload sent along with the request. - optional Payload payload = 3; + Payload payload = 3; // Whether SimpleResponse should include username. - optional bool fill_username = 4; + bool fill_username = 4; // Whether SimpleResponse should include OAuth scope. - optional bool fill_oauth_scope = 5; + bool fill_oauth_scope = 5; } // Unary response, as configured by the request. message SimpleResponse { // Payload to increase message size. - optional Payload payload = 1; + Payload payload = 1; // The user the request came from, for verifying authentication was // successful when the client expected it. - optional string username = 2; + string username = 2; // OAuth scope. - optional string oauth_scope = 3; + string oauth_scope = 3; } // Client-streaming request. message StreamingInputCallRequest { // Optional input payload sent along with the request. - optional Payload payload = 1; + Payload payload = 1; // Not expecting any payload from the response. } @@ -96,18 +96,18 @@ message StreamingInputCallRequest { // Client-streaming response. message StreamingInputCallResponse { // Aggregated size of payloads received from the client. - optional int32 aggregated_payload_size = 1; + int32 aggregated_payload_size = 1; } // Configuration for a particular response. message ResponseParameters { // Desired payload sizes in responses from the server. // If response_type is COMPRESSABLE, this denotes the size before compression. - optional int32 size = 1; + int32 size = 1; // Desired interval between consecutive responses in the response stream in // microseconds. - optional int32 interval_us = 2; + int32 interval_us = 2; } // Server-streaming request. @@ -116,17 +116,17 @@ message StreamingOutputCallRequest { // If response_type is RANDOM, the payload from each response in the stream // might be of different types. This is to simulate a mixed type of payload // stream. - optional PayloadType response_type = 1; + PayloadType response_type = 1; // Configuration for each expected response message. repeated ResponseParameters response_parameters = 2; // Optional input payload sent along with the request. - optional Payload payload = 3; + Payload payload = 3; } // Server-streaming response, as configured by the request and parameters. message StreamingOutputCallResponse { // Payload to increase response size. - optional Payload payload = 1; + Payload payload = 1; } diff --git a/src/csharp/Grpc.IntegrationTesting/proto/test.proto b/src/csharp/Grpc.IntegrationTesting/proto/test.proto index 927a3a83aa2..f9e0d2a0396 100644 --- a/src/csharp/Grpc.IntegrationTesting/proto/test.proto +++ b/src/csharp/Grpc.IntegrationTesting/proto/test.proto @@ -30,7 +30,7 @@ // An integration test service that covers all the method signature permutations // of unary/streaming requests/responses. -syntax = "proto2"; +syntax = "proto3"; import "empty.proto"; import "messages.proto"; From 5c42d8daea5d35fb09323f78fc96c9ad4611902f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 08:14:30 -0700 Subject: [PATCH 05/26] regenerate protos --- src/csharp/Grpc.Examples/Math.cs | 1661 ++++------------- src/csharp/Grpc.Examples/MathGrpc.cs | 44 +- src/csharp/Grpc.Examples/MathServiceImpl.cs | 2 +- src/csharp/Grpc.HealthCheck/Health.cs | 720 ++----- .../Grpc.IntegrationTesting.csproj | 46 +- src/csharp/Grpc.IntegrationTesting/Test.cs | 48 + .../Grpc.IntegrationTesting/TestGrpc.cs | 67 +- 7 files changed, 686 insertions(+), 1902 deletions(-) create mode 100644 src/csharp/Grpc.IntegrationTesting/Test.cs diff --git a/src/csharp/Grpc.Examples/Math.cs b/src/csharp/Grpc.Examples/Math.cs index 75b1e9dbc2a..953895e9705 100644 --- a/src/csharp/Grpc.Examples/Math.cs +++ b/src/csharp/Grpc.Examples/Math.cs @@ -1,80 +1,46 @@ -// Generated by ProtoGen, Version=2.4.1.521, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT! +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: math.proto #pragma warning disable 1591, 0612, 3021 #region Designer generated code -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace math { +namespace Math { namespace Proto { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Math { - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_math_DivArgs__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_math_DivArgs__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_math_DivReply__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_math_DivReply__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_math_FibArgs__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_math_FibArgs__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_math_Num__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_math_Num__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_math_FibReply__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_math_FibReply__FieldAccessorTable; - #endregion #region Descriptor - public static pbd::FileDescriptor Descriptor { + public static pbr::FileDescriptor Descriptor { get { return descriptor; } } - private static pbd::FileDescriptor descriptor; + private static pbr::FileDescriptor descriptor; static Math() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CgptYXRoLnByb3RvEgRtYXRoIiwKB0RpdkFyZ3MSEAoIZGl2aWRlbmQYASAB", - "KAMSDwoHZGl2aXNvchgCIAEoAyIvCghEaXZSZXBseRIQCghxdW90aWVudBgB", - "IAEoAxIRCglyZW1haW5kZXIYAiABKAMiGAoHRmliQXJncxINCgVsaW1pdBgB", - "IAEoAyISCgNOdW0SCwoDbnVtGAEgASgDIhkKCEZpYlJlcGx5Eg0KBWNvdW50", - "GAEgASgDMqQBCgRNYXRoEiYKA0RpdhINLm1hdGguRGl2QXJncxoOLm1hdGgu", - "RGl2UmVwbHkiABIuCgdEaXZNYW55Eg0ubWF0aC5EaXZBcmdzGg4ubWF0aC5E", - "aXZSZXBseSIAKAEwARIjCgNGaWISDS5tYXRoLkZpYkFyZ3MaCS5tYXRoLk51", - "bSIAMAESHwoDU3VtEgkubWF0aC5OdW0aCS5tYXRoLk51bSIAKAE=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_math_DivArgs__Descriptor = Descriptor.MessageTypes[0]; - internal__static_math_DivArgs__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_math_DivArgs__Descriptor, - new string[] { "Dividend", "Divisor", }); - internal__static_math_DivReply__Descriptor = Descriptor.MessageTypes[1]; - internal__static_math_DivReply__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_math_DivReply__Descriptor, - new string[] { "Quotient", "Remainder", }); - internal__static_math_FibArgs__Descriptor = Descriptor.MessageTypes[2]; - internal__static_math_FibArgs__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_math_FibArgs__Descriptor, - new string[] { "Limit", }); - internal__static_math_Num__Descriptor = Descriptor.MessageTypes[3]; - internal__static_math_Num__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_math_Num__Descriptor, - new string[] { "Num_", }); - internal__static_math_FibReply__Descriptor = Descriptor.MessageTypes[4]; - internal__static_math_FibReply__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_math_FibReply__Descriptor, - new string[] { "Count", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); + "CgptYXRoLnByb3RvEgRtYXRoIiwKB0RpdkFyZ3MSEAoIZGl2aWRlbmQYASAB", + "KAMSDwoHZGl2aXNvchgCIAEoAyIvCghEaXZSZXBseRIQCghxdW90aWVudBgB", + "IAEoAxIRCglyZW1haW5kZXIYAiABKAMiGAoHRmliQXJncxINCgVsaW1pdBgB", + "IAEoAyISCgNOdW0SCwoDbnVtGAEgASgDIhkKCEZpYlJlcGx5Eg0KBWNvdW50", + "GAEgASgDMqQBCgRNYXRoEiYKA0RpdhINLm1hdGguRGl2QXJncxoOLm1hdGgu", + "RGl2UmVwbHkiABIuCgdEaXZNYW55Eg0ubWF0aC5EaXZBcmdzGg4ubWF0aC5E", + "aXZSZXBseSIAKAEwARIjCgNGaWISDS5tYXRoLkZpYkFyZ3MaCS5tYXRoLk51", + "bSIAMAESHwoDU3VtEgkubWF0aC5OdW0aCS5tYXRoLk51bSIAKAFiBnByb3Rv", + "Mw==")); + descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Math.DivArgs), new[]{ "Dividend", "Divisor" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Math.DivReply), new[]{ "Quotient", "Remainder" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Math.FibArgs), new[]{ "Limit" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Math.Num), new[]{ "Num_" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Math.FibReply), new[]{ "Count" }, null, null, null) + })); } #endregion @@ -82,1448 +48,587 @@ namespace math { } #region Messages [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DivArgs : pb::GeneratedMessage { - private DivArgs() { } - private static readonly DivArgs defaultInstance = new DivArgs().MakeReadOnly(); - private static readonly string[] _divArgsFieldNames = new string[] { "dividend", "divisor" }; - private static readonly uint[] _divArgsFieldTags = new uint[] { 8, 16 }; - public static DivArgs DefaultInstance { - get { return defaultInstance; } + public sealed partial class DivArgs : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DivArgs()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Math.Proto.Math.Descriptor.MessageTypes[0]; } } - public override DivArgs DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override DivArgs ThisMessage { - get { return this; } + public DivArgs() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::math.Proto.Math.internal__static_math_DivArgs__Descriptor; } + partial void OnConstruction(); + + public DivArgs(DivArgs other) : this() { + dividend_ = other.dividend_; + divisor_ = other.divisor_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::math.Proto.Math.internal__static_math_DivArgs__FieldAccessorTable; } + public DivArgs Clone() { + return new DivArgs(this); } public const int DividendFieldNumber = 1; - private bool hasDividend; private long dividend_; - public bool HasDividend { - get { return hasDividend; } - } public long Dividend { get { return dividend_; } + set { + dividend_ = value; + } } public const int DivisorFieldNumber = 2; - private bool hasDivisor; private long divisor_; - public bool HasDivisor { - get { return hasDivisor; } - } public long Divisor { get { return divisor_; } + set { + divisor_ = value; + } } - public override bool IsInitialized { - get { - return true; - } + public override bool Equals(object other) { + return Equals(other as DivArgs); } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _divArgsFieldNames; - if (hasDividend) { - output.WriteInt64(1, field_names[0], Dividend); + public bool Equals(DivArgs other) { + if (ReferenceEquals(other, null)) { + return false; } - if (hasDivisor) { - output.WriteInt64(2, field_names[1], Divisor); + if (ReferenceEquals(other, this)) { + return true; } - UnknownFields.WriteTo(output); + if (Dividend != other.Dividend) return false; + if (Divisor != other.Divisor) return false; + return true; } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDividend) { - size += pb::CodedOutputStream.ComputeInt64Size(1, Dividend); - } - if (hasDivisor) { - size += pb::CodedOutputStream.ComputeInt64Size(2, Divisor); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } + public override int GetHashCode() { + int hash = 1; + if (Dividend != 0L) hash ^= Dividend.GetHashCode(); + if (Divisor != 0L) hash ^= Divisor.GetHashCode(); + return hash; } - public static DivArgs ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DivArgs ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DivArgs ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DivArgs ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DivArgs ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DivArgs ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DivArgs ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DivArgs ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DivArgs ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DivArgs ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DivArgs MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DivArgs prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DivArgs cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; + public void WriteTo(pb::CodedOutputStream output) { + if (Dividend != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Dividend); } - - private bool resultIsReadOnly; - private DivArgs result; - - private DivArgs PrepareBuilder() { - if (resultIsReadOnly) { - DivArgs original = result; - result = new DivArgs(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DivArgs MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } + if (Divisor != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Divisor); } + } - public override pbd::MessageDescriptor DescriptorForType { - get { return global::math.DivArgs.Descriptor; } + public int CalculateSize() { + int size = 0; + if (Dividend != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Dividend); } - - public override DivArgs DefaultInstanceForType { - get { return global::math.DivArgs.DefaultInstance; } + if (Divisor != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Divisor); } + return size; + } - public override DivArgs BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + public void MergeFrom(DivArgs other) { + if (other == null) { + return; } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DivArgs) { - return MergeFrom((DivArgs) other); - } else { - base.MergeFrom(other); - return this; - } + if (other.Dividend != 0L) { + Dividend = other.Dividend; } - - public override Builder MergeFrom(DivArgs other) { - if (other == global::math.DivArgs.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDividend) { - Dividend = other.Dividend; - } - if (other.HasDivisor) { - Divisor = other.Divisor; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); + if (other.Divisor != 0L) { + Divisor = other.Divisor; } + } - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_divArgsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _divArgsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + Dividend = input.ReadInt64(); + break; } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasDividend = input.ReadInt64(ref result.dividend_); - break; - } - case 16: { - result.hasDivisor = input.ReadInt64(ref result.divisor_); - break; - } + case 16: { + Divisor = input.ReadInt64(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasDividend { - get { return result.hasDividend; } } - public long Dividend { - get { return result.Dividend; } - set { SetDividend(value); } - } - public Builder SetDividend(long value) { - PrepareBuilder(); - result.hasDividend = true; - result.dividend_ = value; - return this; - } - public Builder ClearDividend() { - PrepareBuilder(); - result.hasDividend = false; - result.dividend_ = 0L; - return this; - } - - public bool HasDivisor { - get { return result.hasDivisor; } - } - public long Divisor { - get { return result.Divisor; } - set { SetDivisor(value); } - } - public Builder SetDivisor(long value) { - PrepareBuilder(); - result.hasDivisor = true; - result.divisor_ = value; - return this; - } - public Builder ClearDivisor() { - PrepareBuilder(); - result.hasDivisor = false; - result.divisor_ = 0L; - return this; - } - } - static DivArgs() { - object.ReferenceEquals(global::math.Proto.Math.Descriptor, null); } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DivReply : pb::GeneratedMessage { - private DivReply() { } - private static readonly DivReply defaultInstance = new DivReply().MakeReadOnly(); - private static readonly string[] _divReplyFieldNames = new string[] { "quotient", "remainder" }; - private static readonly uint[] _divReplyFieldTags = new uint[] { 8, 16 }; - public static DivReply DefaultInstance { - get { return defaultInstance; } + public sealed partial class DivReply : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DivReply()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Math.Proto.Math.Descriptor.MessageTypes[1]; } } - public override DivReply DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override DivReply ThisMessage { - get { return this; } + public DivReply() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::math.Proto.Math.internal__static_math_DivReply__Descriptor; } + partial void OnConstruction(); + + public DivReply(DivReply other) : this() { + quotient_ = other.quotient_; + remainder_ = other.remainder_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::math.Proto.Math.internal__static_math_DivReply__FieldAccessorTable; } + public DivReply Clone() { + return new DivReply(this); } public const int QuotientFieldNumber = 1; - private bool hasQuotient; private long quotient_; - public bool HasQuotient { - get { return hasQuotient; } - } public long Quotient { get { return quotient_; } + set { + quotient_ = value; + } } public const int RemainderFieldNumber = 2; - private bool hasRemainder; private long remainder_; - public bool HasRemainder { - get { return hasRemainder; } - } public long Remainder { get { return remainder_; } - } - - public override bool IsInitialized { - get { - return true; + set { + remainder_ = value; } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _divReplyFieldNames; - if (hasQuotient) { - output.WriteInt64(1, field_names[0], Quotient); - } - if (hasRemainder) { - output.WriteInt64(2, field_names[1], Remainder); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as DivReply); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasQuotient) { - size += pb::CodedOutputStream.ComputeInt64Size(1, Quotient); - } - if (hasRemainder) { - size += pb::CodedOutputStream.ComputeInt64Size(2, Remainder); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(DivReply other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; } + if (Quotient != other.Quotient) return false; + if (Remainder != other.Remainder) return false; + return true; } - public static DivReply ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DivReply ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DivReply ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DivReply ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DivReply ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DivReply ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DivReply ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DivReply ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DivReply ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DivReply ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DivReply MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (Quotient != 0L) hash ^= Quotient.GetHashCode(); + if (Remainder != 0L) hash ^= Remainder.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DivReply prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DivReply cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; + public void WriteTo(pb::CodedOutputStream output) { + if (Quotient != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Quotient); } - - private bool resultIsReadOnly; - private DivReply result; - - private DivReply PrepareBuilder() { - if (resultIsReadOnly) { - DivReply original = result; - result = new DivReply(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DivReply MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } + if (Remainder != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Remainder); } + } - public override pbd::MessageDescriptor DescriptorForType { - get { return global::math.DivReply.Descriptor; } + public int CalculateSize() { + int size = 0; + if (Quotient != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Quotient); } - - public override DivReply DefaultInstanceForType { - get { return global::math.DivReply.DefaultInstance; } - } - - public override DivReply BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + if (Remainder != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Remainder); } + return size; + } - public override Builder MergeFrom(pb::IMessage other) { - if (other is DivReply) { - return MergeFrom((DivReply) other); - } else { - base.MergeFrom(other); - return this; - } + public void MergeFrom(DivReply other) { + if (other == null) { + return; } - - public override Builder MergeFrom(DivReply other) { - if (other == global::math.DivReply.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasQuotient) { - Quotient = other.Quotient; - } - if (other.HasRemainder) { - Remainder = other.Remainder; - } - this.MergeUnknownFields(other.UnknownFields); - return this; + if (other.Quotient != 0L) { + Quotient = other.Quotient; } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); + if (other.Remainder != 0L) { + Remainder = other.Remainder; } + } - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_divReplyFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _divReplyFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + Quotient = input.ReadInt64(); + break; } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasQuotient = input.ReadInt64(ref result.quotient_); - break; - } - case 16: { - result.hasRemainder = input.ReadInt64(ref result.remainder_); - break; - } + case 16: { + Remainder = input.ReadInt64(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; } - - - public bool HasQuotient { - get { return result.hasQuotient; } - } - public long Quotient { - get { return result.Quotient; } - set { SetQuotient(value); } - } - public Builder SetQuotient(long value) { - PrepareBuilder(); - result.hasQuotient = true; - result.quotient_ = value; - return this; - } - public Builder ClearQuotient() { - PrepareBuilder(); - result.hasQuotient = false; - result.quotient_ = 0L; - return this; - } - - public bool HasRemainder { - get { return result.hasRemainder; } - } - public long Remainder { - get { return result.Remainder; } - set { SetRemainder(value); } - } - public Builder SetRemainder(long value) { - PrepareBuilder(); - result.hasRemainder = true; - result.remainder_ = value; - return this; - } - public Builder ClearRemainder() { - PrepareBuilder(); - result.hasRemainder = false; - result.remainder_ = 0L; - return this; - } - } - static DivReply() { - object.ReferenceEquals(global::math.Proto.Math.Descriptor, null); } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FibArgs : pb::GeneratedMessage { - private FibArgs() { } - private static readonly FibArgs defaultInstance = new FibArgs().MakeReadOnly(); - private static readonly string[] _fibArgsFieldNames = new string[] { "limit" }; - private static readonly uint[] _fibArgsFieldTags = new uint[] { 8 }; - public static FibArgs DefaultInstance { - get { return defaultInstance; } + public sealed partial class FibArgs : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FibArgs()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Math.Proto.Math.Descriptor.MessageTypes[2]; } } - public override FibArgs DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override FibArgs ThisMessage { - get { return this; } + public FibArgs() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::math.Proto.Math.internal__static_math_FibArgs__Descriptor; } + partial void OnConstruction(); + + public FibArgs(FibArgs other) : this() { + limit_ = other.limit_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::math.Proto.Math.internal__static_math_FibArgs__FieldAccessorTable; } + public FibArgs Clone() { + return new FibArgs(this); } public const int LimitFieldNumber = 1; - private bool hasLimit; private long limit_; - public bool HasLimit { - get { return hasLimit; } - } public long Limit { get { return limit_; } - } - - public override bool IsInitialized { - get { - return true; + set { + limit_ = value; } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _fibArgsFieldNames; - if (hasLimit) { - output.WriteInt64(1, field_names[0], Limit); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as FibArgs); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasLimit) { - size += pb::CodedOutputStream.ComputeInt64Size(1, Limit); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(FibArgs other) { + if (ReferenceEquals(other, null)) { + return false; } + if (ReferenceEquals(other, this)) { + return true; + } + if (Limit != other.Limit) return false; + return true; } - public static FibArgs ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FibArgs ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FibArgs ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FibArgs ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FibArgs ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FibArgs ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FibArgs ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FibArgs ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FibArgs ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FibArgs ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FibArgs MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (Limit != 0L) hash ^= Limit.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FibArgs prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FibArgs cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FibArgs result; - - private FibArgs PrepareBuilder() { - if (resultIsReadOnly) { - FibArgs original = result; - result = new FibArgs(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FibArgs MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::math.FibArgs.Descriptor; } + public void WriteTo(pb::CodedOutputStream output) { + if (Limit != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Limit); } + } - public override FibArgs DefaultInstanceForType { - get { return global::math.FibArgs.DefaultInstance; } - } - - public override FibArgs BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + public int CalculateSize() { + int size = 0; + if (Limit != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Limit); } + return size; + } - public override Builder MergeFrom(pb::IMessage other) { - if (other is FibArgs) { - return MergeFrom((FibArgs) other); - } else { - base.MergeFrom(other); - return this; - } + public void MergeFrom(FibArgs other) { + if (other == null) { + return; } - - public override Builder MergeFrom(FibArgs other) { - if (other == global::math.FibArgs.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasLimit) { - Limit = other.Limit; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); + if (other.Limit != 0L) { + Limit = other.Limit; } + } - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fibArgsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fibArgsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + Limit = input.ReadInt64(); + break; } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasLimit = input.ReadInt64(ref result.limit_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); } - return this; } - - - public bool HasLimit { - get { return result.hasLimit; } - } - public long Limit { - get { return result.Limit; } - set { SetLimit(value); } - } - public Builder SetLimit(long value) { - PrepareBuilder(); - result.hasLimit = true; - result.limit_ = value; - return this; - } - public Builder ClearLimit() { - PrepareBuilder(); - result.hasLimit = false; - result.limit_ = 0L; - return this; - } - } - static FibArgs() { - object.ReferenceEquals(global::math.Proto.Math.Descriptor, null); } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Num : pb::GeneratedMessage { - private Num() { } - private static readonly Num defaultInstance = new Num().MakeReadOnly(); - private static readonly string[] _numFieldNames = new string[] { "num" }; - private static readonly uint[] _numFieldTags = new uint[] { 8 }; - public static Num DefaultInstance { - get { return defaultInstance; } + public sealed partial class Num : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Num()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Math.Proto.Math.Descriptor.MessageTypes[3]; } } - public override Num DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override Num ThisMessage { - get { return this; } + public Num() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::math.Proto.Math.internal__static_math_Num__Descriptor; } + partial void OnConstruction(); + + public Num(Num other) : this() { + num_ = other.num_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::math.Proto.Math.internal__static_math_Num__FieldAccessorTable; } + public Num Clone() { + return new Num(this); } public const int Num_FieldNumber = 1; - private bool hasNum_; private long num_; - public bool HasNum_ { - get { return hasNum_; } - } public long Num_ { get { return num_; } - } - - public override bool IsInitialized { - get { - return true; + set { + num_ = value; } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _numFieldNames; - if (hasNum_) { - output.WriteInt64(1, field_names[0], Num_); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as Num); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNum_) { - size += pb::CodedOutputStream.ComputeInt64Size(1, Num_); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(Num other) { + if (ReferenceEquals(other, null)) { + return false; } + if (ReferenceEquals(other, this)) { + return true; + } + if (Num_ != other.Num_) return false; + return true; } - public static Num ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Num ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Num ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Num ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Num ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Num ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Num ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Num ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Num ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Num ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Num MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (Num_ != 0L) hash ^= Num_.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Num prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Num cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Num result; - - private Num PrepareBuilder() { - if (resultIsReadOnly) { - Num original = result; - result = new Num(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Num MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::math.Num.Descriptor; } - } - - public override Num DefaultInstanceForType { - get { return global::math.Num.DefaultInstance; } - } - - public override Num BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + public void WriteTo(pb::CodedOutputStream output) { + if (Num_ != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Num_); } + } - public override Builder MergeFrom(pb::IMessage other) { - if (other is Num) { - return MergeFrom((Num) other); - } else { - base.MergeFrom(other); - return this; - } + public int CalculateSize() { + int size = 0; + if (Num_ != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Num_); } + return size; + } - public override Builder MergeFrom(Num other) { - if (other == global::math.Num.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNum_) { - Num_ = other.Num_; - } - this.MergeUnknownFields(other.UnknownFields); - return this; + public void MergeFrom(Num other) { + if (other == null) { + return; } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); + if (other.Num_ != 0L) { + Num_ = other.Num_; } + } - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_numFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _numFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasNum_ = input.ReadInt64(ref result.num_); - break; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + Num_ = input.ReadInt64(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNum_ { - get { return result.hasNum_; } - } - public long Num_ { - get { return result.Num_; } - set { SetNum_(value); } - } - public Builder SetNum_(long value) { - PrepareBuilder(); - result.hasNum_ = true; - result.num_ = value; - return this; - } - public Builder ClearNum_() { - PrepareBuilder(); - result.hasNum_ = false; - result.num_ = 0L; - return this; } } - static Num() { - object.ReferenceEquals(global::math.Proto.Math.Descriptor, null); - } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FibReply : pb::GeneratedMessage { - private FibReply() { } - private static readonly FibReply defaultInstance = new FibReply().MakeReadOnly(); - private static readonly string[] _fibReplyFieldNames = new string[] { "count" }; - private static readonly uint[] _fibReplyFieldTags = new uint[] { 8 }; - public static FibReply DefaultInstance { - get { return defaultInstance; } + public sealed partial class FibReply : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FibReply()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Math.Proto.Math.Descriptor.MessageTypes[4]; } } - public override FibReply DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override FibReply ThisMessage { - get { return this; } + public FibReply() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::math.Proto.Math.internal__static_math_FibReply__Descriptor; } + partial void OnConstruction(); + + public FibReply(FibReply other) : this() { + count_ = other.count_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::math.Proto.Math.internal__static_math_FibReply__FieldAccessorTable; } + public FibReply Clone() { + return new FibReply(this); } public const int CountFieldNumber = 1; - private bool hasCount; private long count_; - public bool HasCount { - get { return hasCount; } - } public long Count { get { return count_; } - } - - public override bool IsInitialized { - get { - return true; + set { + count_ = value; } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _fibReplyFieldNames; - if (hasCount) { - output.WriteInt64(1, field_names[0], Count); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as FibReply); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasCount) { - size += pb::CodedOutputStream.ComputeInt64Size(1, Count); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(FibReply other) { + if (ReferenceEquals(other, null)) { + return false; } + if (ReferenceEquals(other, this)) { + return true; + } + if (Count != other.Count) return false; + return true; } - public static FibReply ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FibReply ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FibReply ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FibReply ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FibReply ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FibReply ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FibReply ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FibReply ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FibReply ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FibReply ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FibReply MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (Count != 0L) hash ^= Count.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FibReply prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FibReply cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FibReply result; - - private FibReply PrepareBuilder() { - if (resultIsReadOnly) { - FibReply original = result; - result = new FibReply(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FibReply MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::math.FibReply.Descriptor; } - } - - public override FibReply DefaultInstanceForType { - get { return global::math.FibReply.DefaultInstance; } - } - - public override FibReply BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + public void WriteTo(pb::CodedOutputStream output) { + if (Count != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Count); } + } - public override Builder MergeFrom(pb::IMessage other) { - if (other is FibReply) { - return MergeFrom((FibReply) other); - } else { - base.MergeFrom(other); - return this; - } + public int CalculateSize() { + int size = 0; + if (Count != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Count); } + return size; + } - public override Builder MergeFrom(FibReply other) { - if (other == global::math.FibReply.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasCount) { - Count = other.Count; - } - this.MergeUnknownFields(other.UnknownFields); - return this; + public void MergeFrom(FibReply other) { + if (other == null) { + return; } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); + if (other.Count != 0L) { + Count = other.Count; } + } - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fibReplyFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fibReplyFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + Count = input.ReadInt64(); + break; } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasCount = input.ReadInt64(ref result.count_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); } - return this; } - - - public bool HasCount { - get { return result.hasCount; } - } - public long Count { - get { return result.Count; } - set { SetCount(value); } - } - public Builder SetCount(long value) { - PrepareBuilder(); - result.hasCount = true; - result.count_ = value; - return this; - } - public Builder ClearCount() { - PrepareBuilder(); - result.hasCount = false; - result.count_ = 0L; - return this; - } - } - static FibReply() { - object.ReferenceEquals(global::math.Proto.Math.Descriptor, null); } - } - #endregion + } - #region Services - /* - * Service generation is now disabled by default, use the following option to enable: - * option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - */ #endregion } diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 4941ff35f72..eb6b68849f6 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -7,38 +7,38 @@ using System.Threading; using System.Threading.Tasks; using Grpc.Core; -namespace math { +namespace Math { public static class Math { static readonly string __ServiceName = "math.Math"; - static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::math.DivArgs.ParseFrom); - static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), global::math.DivReply.ParseFrom); - static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::math.FibArgs.ParseFrom); - static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), global::math.Num.ParseFrom); + static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.DivArgs.ParseFrom); + static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.DivReply.ParseFrom); + static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.FibArgs.ParseFrom); + static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.Num.ParseFrom); - static readonly Method __Method_Div = new Method( + static readonly Method __Method_Div = new Method( MethodType.Unary, __ServiceName, "Div", __Marshaller_DivArgs, __Marshaller_DivReply); - static readonly Method __Method_DivMany = new Method( + static readonly Method __Method_DivMany = new Method( MethodType.DuplexStreaming, __ServiceName, "DivMany", __Marshaller_DivArgs, __Marshaller_DivReply); - static readonly Method __Method_Fib = new Method( + static readonly Method __Method_Fib = new Method( MethodType.ServerStreaming, __ServiceName, "Fib", __Marshaller_FibArgs, __Marshaller_Num); - static readonly Method __Method_Sum = new Method( + static readonly Method __Method_Sum = new Method( MethodType.ClientStreaming, __ServiceName, "Sum", @@ -48,6 +48,7 @@ namespace math { // client interface public interface IMathClient { +<<<<<<< HEAD global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); global::math.DivReply Div(global::math.DivArgs request, CallOptions options); AsyncUnaryCall DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); @@ -58,15 +59,22 @@ namespace math { AsyncServerStreamingCall Fib(global::math.FibArgs request, CallOptions options); AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncClientStreamingCall Sum(CallOptions options); +======= + global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncServerStreamingCall Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); +>>>>>>> 708e8de... regenerate protos } // server-side interface public interface IMath { - Task Div(global::math.DivArgs request, ServerCallContext context); - Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); - Task Fib(global::math.FibArgs request, IServerStreamWriter responseStream, ServerCallContext context); - Task Sum(IAsyncStreamReader requestStream, ServerCallContext context); + Task Div(global::Math.DivArgs request, ServerCallContext context); + Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + Task Fib(global::Math.FibArgs request, IServerStreamWriter responseStream, ServerCallContext context); + Task Sum(IAsyncStreamReader requestStream, ServerCallContext context); } // client stub @@ -75,7 +83,7 @@ namespace math { public MathClient(Channel channel) : base(channel) { } - public global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken)); return Calls.BlockingUnaryCall(call, request); @@ -85,7 +93,7 @@ namespace math { var call = CreateCall(__Method_Div, options); return Calls.BlockingUnaryCall(call, request); } - public AsyncUnaryCall DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncUnaryCall DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncUnaryCall(call, request); @@ -95,7 +103,7 @@ namespace math { var call = CreateCall(__Method_Div, options); return Calls.AsyncUnaryCall(call, request); } - public AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_DivMany, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncDuplexStreamingCall(call); @@ -105,7 +113,7 @@ namespace math { var call = CreateCall(__Method_DivMany, options); return Calls.AsyncDuplexStreamingCall(call); } - public AsyncServerStreamingCall Fib(global::math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncServerStreamingCall Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_Fib, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncServerStreamingCall(call, request); @@ -115,7 +123,7 @@ namespace math { var call = CreateCall(__Method_Fib, options); return Calls.AsyncServerStreamingCall(call, request); } - public AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_Sum, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncClientStreamingCall(call); diff --git a/src/csharp/Grpc.Examples/MathServiceImpl.cs b/src/csharp/Grpc.Examples/MathServiceImpl.cs index dd26b1d3501..29181bc858d 100644 --- a/src/csharp/Grpc.Examples/MathServiceImpl.cs +++ b/src/csharp/Grpc.Examples/MathServiceImpl.cs @@ -38,7 +38,7 @@ using System.Threading.Tasks; using Grpc.Core; using Grpc.Core.Utils; -namespace math +namespace Math { /// /// Implementation of MathService server diff --git a/src/csharp/Grpc.HealthCheck/Health.cs b/src/csharp/Grpc.HealthCheck/Health.cs index 361382d4bd6..de65c1a9de8 100644 --- a/src/csharp/Grpc.HealthCheck/Health.cs +++ b/src/csharp/Grpc.HealthCheck/Health.cs @@ -3,9 +3,9 @@ #pragma warning disable 1591, 0612, 3021 #region Designer generated code -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; +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.V1Alpha { @@ -14,21 +14,11 @@ namespace Grpc.Health.V1Alpha { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Health { - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_grpc_health_v1alpha_HealthCheckRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_health_v1alpha_HealthCheckRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_grpc_health_v1alpha_HealthCheckResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_health_v1alpha_HealthCheckResponse__FieldAccessorTable; - #endregion #region Descriptor - public static pbd::FileDescriptor Descriptor { + public static pbr::FileDescriptor Descriptor { get { return descriptor; } } - private static pbd::FileDescriptor descriptor; + private static pbr::FileDescriptor descriptor; static Health() { byte[] descriptorData = global::System.Convert.FromBase64String( @@ -41,24 +31,13 @@ namespace Grpc.Health.V1Alpha { "EAESDwoLTk9UX1NFUlZJTkcQAjJkCgZIZWFsdGgSWgoFQ2hlY2sSJy5ncnBj", "LmhlYWx0aC52MWFscGhhLkhlYWx0aENoZWNrUmVxdWVzdBooLmdycGMuaGVh", "bHRoLnYxYWxwaGEuSGVhbHRoQ2hlY2tSZXNwb25zZUIWqgITR3JwYy5IZWFs", - "dGguVjFBbHBoYQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_grpc_health_v1alpha_HealthCheckRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_grpc_health_v1alpha_HealthCheckRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_health_v1alpha_HealthCheckRequest__Descriptor, - new string[] { "Host", "Service", }); - internal__static_grpc_health_v1alpha_HealthCheckResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_grpc_health_v1alpha_HealthCheckResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_health_v1alpha_HealthCheckResponse__Descriptor, - new string[] { "Status", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); + "dGguVjFBbHBoYWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1Alpha.HealthCheckRequest), new[]{ "Host", "Service" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Health.V1Alpha.HealthCheckResponse), new[]{ "Status" }, null, new[]{ typeof(global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus) }, null) + })); } #endregion @@ -66,618 +45,253 @@ namespace Grpc.Health.V1Alpha { } #region Messages [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class HealthCheckRequest : pb::GeneratedMessage { - private HealthCheckRequest() { } - private static readonly HealthCheckRequest defaultInstance = new HealthCheckRequest().MakeReadOnly(); - private static readonly string[] _healthCheckRequestFieldNames = new string[] { "host", "service" }; - private static readonly uint[] _healthCheckRequestFieldTags = new uint[] { 10, 18 }; - public static HealthCheckRequest DefaultInstance { - get { return defaultInstance; } + public sealed partial class HealthCheckRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HealthCheckRequest()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Health.V1Alpha.Proto.Health.Descriptor.MessageTypes[0]; } } - public override HealthCheckRequest DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override HealthCheckRequest ThisMessage { - get { return this; } + public HealthCheckRequest() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::Grpc.Health.V1Alpha.Proto.Health.internal__static_grpc_health_v1alpha_HealthCheckRequest__Descriptor; } + partial void OnConstruction(); + + public HealthCheckRequest(HealthCheckRequest other) : this() { + host_ = other.host_; + service_ = other.service_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Grpc.Health.V1Alpha.Proto.Health.internal__static_grpc_health_v1alpha_HealthCheckRequest__FieldAccessorTable; } + public HealthCheckRequest Clone() { + return new HealthCheckRequest(this); } public const int HostFieldNumber = 1; - private bool hasHost; private string host_ = ""; - public bool HasHost { - get { return hasHost; } - } public string Host { get { return host_; } + set { + host_ = pb::Preconditions.CheckNotNull(value, "value"); + } } public const int ServiceFieldNumber = 2; - private bool hasService; private string service_ = ""; - public bool HasService { - get { return hasService; } - } public string Service { get { return service_; } - } - - public override bool IsInitialized { - get { - return true; + set { + service_ = pb::Preconditions.CheckNotNull(value, "value"); } } - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _healthCheckRequestFieldNames; - if (hasHost) { - output.WriteString(1, field_names[0], Host); - } - if (hasService) { - output.WriteString(2, field_names[1], Service); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } + public override bool Equals(object other) { + return Equals(other as HealthCheckRequest); } - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasHost) { - size += pb::CodedOutputStream.ComputeStringSize(1, Host); + public bool Equals(HealthCheckRequest other) { + if (ReferenceEquals(other, null)) { + return false; } - if (hasService) { - size += pb::CodedOutputStream.ComputeStringSize(2, Service); + if (ReferenceEquals(other, this)) { + return true; } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static HealthCheckRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HealthCheckRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HealthCheckRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HealthCheckRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HealthCheckRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HealthCheckRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static HealthCheckRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static HealthCheckRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static HealthCheckRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HealthCheckRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private HealthCheckRequest MakeReadOnly() { - return this; + if (Host != other.Host) return false; + if (Service != other.Service) return false; + return true; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(HealthCheckRequest prototype) { - return new Builder(prototype); + public override int GetHashCode() { + int hash = 1; + if (Host.Length != 0) hash ^= Host.GetHashCode(); + if (Service.Length != 0) hash ^= Service.GetHashCode(); + return hash; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(HealthCheckRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private HealthCheckRequest result; - - private HealthCheckRequest PrepareBuilder() { - if (resultIsReadOnly) { - HealthCheckRequest original = result; - result = new HealthCheckRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override HealthCheckRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); + } - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } + public void WriteTo(pb::CodedOutputStream output) { + if (Host.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Host); } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Grpc.Health.V1Alpha.HealthCheckRequest.Descriptor; } + if (Service.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Service); } + } - public override HealthCheckRequest DefaultInstanceForType { - get { return global::Grpc.Health.V1Alpha.HealthCheckRequest.DefaultInstance; } + public int CalculateSize() { + int size = 0; + if (Host.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Host); } - - public override HealthCheckRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + if (Service.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Service); } + return size; + } - public override Builder MergeFrom(pb::IMessage other) { - if (other is HealthCheckRequest) { - return MergeFrom((HealthCheckRequest) other); - } else { - base.MergeFrom(other); - return this; - } + public void MergeFrom(HealthCheckRequest other) { + if (other == null) { + return; } - - public override Builder MergeFrom(HealthCheckRequest other) { - if (other == global::Grpc.Health.V1Alpha.HealthCheckRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasHost) { - Host = other.Host; - } - if (other.HasService) { - Service = other.Service; - } - this.MergeUnknownFields(other.UnknownFields); - return this; + if (other.Host.Length != 0) { + Host = other.Host; } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); + if (other.Service.Length != 0) { + Service = other.Service; } + } - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_healthCheckRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _healthCheckRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 10: { + Host = input.ReadString(); + break; } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasHost = input.ReadString(ref result.host_); - break; - } - case 18: { - result.hasService = input.ReadString(ref result.service_); - break; - } + case 18: { + Service = input.ReadString(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasHost { - get { return result.hasHost; } - } - public string Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder ClearHost() { - PrepareBuilder(); - result.hasHost = false; - result.host_ = ""; - return this; - } - - public bool HasService { - get { return result.hasService; } - } - public string Service { - get { return result.Service; } - set { SetService(value); } - } - public Builder SetService(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasService = true; - result.service_ = value; - return this; } - public Builder ClearService() { - PrepareBuilder(); - result.hasService = false; - result.service_ = ""; - return this; - } - } - static HealthCheckRequest() { - object.ReferenceEquals(global::Grpc.Health.V1Alpha.Proto.Health.Descriptor, null); } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class HealthCheckResponse : pb::GeneratedMessage { - private HealthCheckResponse() { } - private static readonly HealthCheckResponse defaultInstance = new HealthCheckResponse().MakeReadOnly(); - private static readonly string[] _healthCheckResponseFieldNames = new string[] { "status" }; - private static readonly uint[] _healthCheckResponseFieldTags = new uint[] { 8 }; - public static HealthCheckResponse DefaultInstance { - get { return defaultInstance; } - } + public sealed partial class HealthCheckResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HealthCheckResponse()); + public static pb::MessageParser Parser { get { return _parser; } } - public override HealthCheckResponse DefaultInstanceForType { - get { return DefaultInstance; } + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Health.V1Alpha.Proto.Health.Descriptor.MessageTypes[1]; } } - protected override HealthCheckResponse ThisMessage { - get { return this; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - public static pbd::MessageDescriptor Descriptor { - get { return global::Grpc.Health.V1Alpha.Proto.Health.internal__static_grpc_health_v1alpha_HealthCheckResponse__Descriptor; } + public HealthCheckResponse() { + OnConstruction(); } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Grpc.Health.V1Alpha.Proto.Health.internal__static_grpc_health_v1alpha_HealthCheckResponse__FieldAccessorTable; } - } + partial void OnConstruction(); - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum ServingStatus { - UNKNOWN = 0, - SERVING = 1, - NOT_SERVING = 2, - } + public HealthCheckResponse(HealthCheckResponse other) : this() { + status_ = other.status_; + } + public HealthCheckResponse Clone() { + return new HealthCheckResponse(this); } - #endregion public const int StatusFieldNumber = 1; - private bool hasStatus; private global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus status_ = global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN; - public bool HasStatus { - get { return hasStatus; } - } public global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus Status { get { return status_; } - } - - public override bool IsInitialized { - get { - return true; + set { + status_ = value; } } - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _healthCheckResponseFieldNames; - if (hasStatus) { - output.WriteEnum(1, field_names[0], (int) Status, Status); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as HealthCheckResponse); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); + public bool Equals(HealthCheckResponse other) { + if (ReferenceEquals(other, null)) { + return false; } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasStatus) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Status); + if (ReferenceEquals(other, this)) { + return true; } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static HealthCheckResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HealthCheckResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HealthCheckResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HealthCheckResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HealthCheckResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HealthCheckResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static HealthCheckResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static HealthCheckResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static HealthCheckResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HealthCheckResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private HealthCheckResponse MakeReadOnly() { - return this; + if (Status != other.Status) return false; + return true; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(HealthCheckResponse prototype) { - return new Builder(prototype); + public override int GetHashCode() { + int hash = 1; + if (Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) hash ^= Status.GetHashCode(); + return hash; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(HealthCheckResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private HealthCheckResponse result; - - private HealthCheckResponse PrepareBuilder() { - if (resultIsReadOnly) { - HealthCheckResponse original = result; - result = new HealthCheckResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override HealthCheckResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Grpc.Health.V1Alpha.HealthCheckResponse.Descriptor; } - } - - public override HealthCheckResponse DefaultInstanceForType { - get { return global::Grpc.Health.V1Alpha.HealthCheckResponse.DefaultInstance; } - } + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); + } - public override HealthCheckResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + public void WriteTo(pb::CodedOutputStream output) { + if (Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { + output.WriteRawTag(8); + output.WriteEnum((int) Status); } + } - public override Builder MergeFrom(pb::IMessage other) { - if (other is HealthCheckResponse) { - return MergeFrom((HealthCheckResponse) other); - } else { - base.MergeFrom(other); - return this; - } + public int CalculateSize() { + int size = 0; + if (Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status); } + return size; + } - public override Builder MergeFrom(HealthCheckResponse other) { - if (other == global::Grpc.Health.V1Alpha.HealthCheckResponse.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasStatus) { - Status = other.Status; - } - this.MergeUnknownFields(other.UnknownFields); - return this; + public void MergeFrom(HealthCheckResponse other) { + if (other == null) { + return; } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); + if (other.Status != global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN) { + Status = other.Status; } + } - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_healthCheckResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _healthCheckResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.status_, out unknown)) { - result.hasStatus = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + status_ = (global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus) input.ReadEnum(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; } + } - - public bool HasStatus { - get { return result.hasStatus; } - } - public global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus Status { - get { return result.Status; } - set { SetStatus(value); } - } - public Builder SetStatus(global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus value) { - PrepareBuilder(); - result.hasStatus = true; - result.status_ = value; - return this; - } - public Builder ClearStatus() { - PrepareBuilder(); - result.hasStatus = false; - result.status_ = global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus.UNKNOWN; - return this; + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + public enum ServingStatus { + UNKNOWN = 0, + SERVING = 1, + NOT_SERVING = 2, } + } - static HealthCheckResponse() { - object.ReferenceEquals(global::Grpc.Health.V1Alpha.Proto.Health.Descriptor, null); - } + #endregion + } #endregion diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index 06a75a3351e..b307a0445c2 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -41,22 +41,6 @@ ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll - - False - ..\packages\Google.Apis.Auth.1.9.2\lib\net40\Google.Apis.Auth.dll - - - False - ..\packages\Google.Apis.Auth.1.9.2\lib\net40\Google.Apis.Auth.PlatformServices.dll - - - False - ..\packages\Google.Apis.Core.1.9.2\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll - - - False - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll @@ -69,14 +53,6 @@ - - False - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - - - False - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll - ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll @@ -87,6 +63,27 @@ ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll + + ..\packages\System.Collections.Immutable.1.1.36\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + + + ..\packages\Google.Apis.Auth.1.9.2\lib\net40\Google.Apis.Auth.dll + + + ..\packages\Google.Apis.Auth.1.9.2\lib\net40\Google.Apis.Auth.PlatformServices.dll + + + ..\packages\Google.Apis.Core.1.9.2\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll + + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + @@ -102,6 +99,7 @@ + diff --git a/src/csharp/Grpc.IntegrationTesting/Test.cs b/src/csharp/Grpc.IntegrationTesting/Test.cs new file mode 100644 index 00000000000..466ec57d3dc --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting/Test.cs @@ -0,0 +1,48 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: test.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.Testing { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Test { + + #region Descriptor + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static Test() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cgp0ZXN0LnByb3RvEgxncnBjLnRlc3RpbmcaC2VtcHR5LnByb3RvGg5tZXNz", + "YWdlcy5wcm90bzK7BAoLVGVzdFNlcnZpY2USNQoJRW1wdHlDYWxsEhMuZ3Jw", + "Yy50ZXN0aW5nLkVtcHR5GhMuZ3JwYy50ZXN0aW5nLkVtcHR5EkYKCVVuYXJ5", + "Q2FsbBIbLmdycGMudGVzdGluZy5TaW1wbGVSZXF1ZXN0GhwuZ3JwYy50ZXN0", + "aW5nLlNpbXBsZVJlc3BvbnNlEmwKE1N0cmVhbWluZ091dHB1dENhbGwSKC5n", + "cnBjLnRlc3RpbmcuU3RyZWFtaW5nT3V0cHV0Q2FsbFJlcXVlc3QaKS5ncnBj", + "LnRlc3RpbmcuU3RyZWFtaW5nT3V0cHV0Q2FsbFJlc3BvbnNlMAESaQoSU3Ry", + "ZWFtaW5nSW5wdXRDYWxsEicuZ3JwYy50ZXN0aW5nLlN0cmVhbWluZ0lucHV0", + "Q2FsbFJlcXVlc3QaKC5ncnBjLnRlc3RpbmcuU3RyZWFtaW5nSW5wdXRDYWxs", + "UmVzcG9uc2UoARJpCg5GdWxsRHVwbGV4Q2FsbBIoLmdycGMudGVzdGluZy5T", + "dHJlYW1pbmdPdXRwdXRDYWxsUmVxdWVzdBopLmdycGMudGVzdGluZy5TdHJl", + "YW1pbmdPdXRwdXRDYWxsUmVzcG9uc2UoATABEmkKDkhhbGZEdXBsZXhDYWxs", + "EiguZ3JwYy50ZXN0aW5nLlN0cmVhbWluZ091dHB1dENhbGxSZXF1ZXN0Giku", + "Z3JwYy50ZXN0aW5nLlN0cmVhbWluZ091dHB1dENhbGxSZXNwb25zZSgBMAFi", + "BnByb3RvMw==")); + descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbr::FileDescriptor[] { global::Grpc.Testing.Proto.Empty.Descriptor, global::Grpc.Testing.Messages.Descriptor, }, + new pbr::GeneratedCodeInfo(null, null)); + } + #endregion + + } +} + +#endregion Designer generated code diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index 697acb53d8d..522372582bb 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -7,55 +7,55 @@ using System.Threading; using System.Threading.Tasks; using Grpc.Core; -namespace grpc.testing { +namespace Grpc.Testing { public static class TestService { static readonly string __ServiceName = "grpc.testing.TestService"; - static readonly Marshaller __Marshaller_Empty = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.Empty.ParseFrom); - static readonly Marshaller __Marshaller_SimpleRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleRequest.ParseFrom); - static readonly Marshaller __Marshaller_SimpleResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleResponse.ParseFrom); - static readonly Marshaller __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallRequest.ParseFrom); - static readonly Marshaller __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallResponse.ParseFrom); - static readonly Marshaller __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallRequest.ParseFrom); - static readonly Marshaller __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallResponse.ParseFrom); + static readonly Marshaller __Marshaller_Empty = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.Empty.ParseFrom); + static readonly Marshaller __Marshaller_SimpleRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.SimpleRequest.ParseFrom); + static readonly Marshaller __Marshaller_SimpleResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.SimpleResponse.ParseFrom); + static readonly Marshaller __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.StreamingOutputCallRequest.ParseFrom); + static readonly Marshaller __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.StreamingOutputCallResponse.ParseFrom); + static readonly Marshaller __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.StreamingInputCallRequest.ParseFrom); + static readonly Marshaller __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.StreamingInputCallResponse.ParseFrom); - static readonly Method __Method_EmptyCall = new Method( + static readonly Method __Method_EmptyCall = new Method( MethodType.Unary, __ServiceName, "EmptyCall", __Marshaller_Empty, __Marshaller_Empty); - static readonly Method __Method_UnaryCall = new Method( + static readonly Method __Method_UnaryCall = new Method( MethodType.Unary, __ServiceName, "UnaryCall", __Marshaller_SimpleRequest, __Marshaller_SimpleResponse); - static readonly Method __Method_StreamingOutputCall = new Method( + static readonly Method __Method_StreamingOutputCall = new Method( MethodType.ServerStreaming, __ServiceName, "StreamingOutputCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); - static readonly Method __Method_StreamingInputCall = new Method( + static readonly Method __Method_StreamingInputCall = new Method( MethodType.ClientStreaming, __ServiceName, "StreamingInputCall", __Marshaller_StreamingInputCallRequest, __Marshaller_StreamingInputCallResponse); - static readonly Method __Method_FullDuplexCall = new Method( + static readonly Method __Method_FullDuplexCall = new Method( MethodType.DuplexStreaming, __ServiceName, "FullDuplexCall", __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); - static readonly Method __Method_HalfDuplexCall = new Method( + static readonly Method __Method_HalfDuplexCall = new Method( MethodType.DuplexStreaming, __ServiceName, "HalfDuplexCall", @@ -65,6 +65,7 @@ namespace grpc.testing { // client interface public interface ITestServiceClient { +<<<<<<< HEAD global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CallOptions options); AsyncUnaryCall EmptyCallAsync(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); @@ -81,17 +82,27 @@ namespace grpc.testing { AsyncDuplexStreamingCall FullDuplexCall(CallOptions options); AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); AsyncDuplexStreamingCall HalfDuplexCall(CallOptions options); +======= + global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); +>>>>>>> 708e8de... regenerate protos } // server-side interface public interface ITestService { - Task EmptyCall(global::grpc.testing.Empty request, ServerCallContext context); - Task UnaryCall(global::grpc.testing.SimpleRequest request, ServerCallContext context); - Task StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context); - Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context); - Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); - Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + Task EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context); + Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); + Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context); + Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context); + Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); } // client stub @@ -100,7 +111,7 @@ namespace grpc.testing { public TestServiceClient(Channel channel) : base(channel) { } - public global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.BlockingUnaryCall(call, request); @@ -110,7 +121,7 @@ namespace grpc.testing { var call = CreateCall(__Method_EmptyCall, options); return Calls.BlockingUnaryCall(call, request); } - public AsyncUnaryCall EmptyCallAsync(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncUnaryCall(call, request); @@ -120,7 +131,7 @@ namespace grpc.testing { var call = CreateCall(__Method_EmptyCall, options); return Calls.AsyncUnaryCall(call, request); } - public global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.BlockingUnaryCall(call, request); @@ -130,7 +141,7 @@ namespace grpc.testing { var call = CreateCall(__Method_UnaryCall, options); return Calls.BlockingUnaryCall(call, request); } - public AsyncUnaryCall UnaryCallAsync(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncUnaryCall(call, request); @@ -140,7 +151,7 @@ namespace grpc.testing { var call = CreateCall(__Method_UnaryCall, options); return Calls.AsyncUnaryCall(call, request); } - public AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_StreamingOutputCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncServerStreamingCall(call, request); @@ -150,7 +161,7 @@ namespace grpc.testing { var call = CreateCall(__Method_StreamingOutputCall, options); return Calls.AsyncServerStreamingCall(call, request); } - public AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_StreamingInputCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncClientStreamingCall(call); @@ -160,7 +171,7 @@ namespace grpc.testing { var call = CreateCall(__Method_StreamingInputCall, options); return Calls.AsyncClientStreamingCall(call); } - public AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_FullDuplexCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncDuplexStreamingCall(call); @@ -170,7 +181,7 @@ namespace grpc.testing { var call = CreateCall(__Method_FullDuplexCall, options); return Calls.AsyncDuplexStreamingCall(call); } - public AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { var call = CreateCall(__Method_HalfDuplexCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncDuplexStreamingCall(call); From 28526319e0dd6e575d349f05dcf06abdb69899f3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 09:21:38 -0700 Subject: [PATCH 06/26] upgraded NuGet package --- .../Grpc.Examples.MathClient/MathClient.cs | 2 +- .../Grpc.Examples.Tests.csproj | 6 ++-- .../MathClientServerTests.cs | 2 +- .../Grpc.Examples.Tests/packages.config | 2 +- src/csharp/Grpc.Examples/Grpc.Examples.csproj | 6 ++-- src/csharp/Grpc.Examples/MathExamples.cs | 28 +++++++++---------- src/csharp/Grpc.Examples/MathGrpc.cs | 9 +++--- src/csharp/Grpc.Examples/MathServiceImpl.cs | 8 +++--- src/csharp/Grpc.Examples/packages.config | 2 +- .../Grpc.HealthCheck.Tests.csproj | 7 ++--- .../Grpc.HealthCheck.Tests/packages.config | 2 +- .../Grpc.HealthCheck/Grpc.HealthCheck.csproj | 7 ++--- src/csharp/Grpc.HealthCheck/packages.config | 2 +- .../Grpc.IntegrationTesting.csproj | 6 ++-- .../Grpc.IntegrationTesting/packages.config | 2 +- 15 files changed, 43 insertions(+), 48 deletions(-) diff --git a/src/csharp/Grpc.Examples.MathClient/MathClient.cs b/src/csharp/Grpc.Examples.MathClient/MathClient.cs index f9839d99f1d..0df14984cbc 100644 --- a/src/csharp/Grpc.Examples.MathClient/MathClient.cs +++ b/src/csharp/Grpc.Examples.MathClient/MathClient.cs @@ -33,7 +33,7 @@ using System.Runtime.InteropServices; using System.Threading; using Grpc.Core; -namespace math +namespace Math { class MathClient { diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index 9a8f780b245..7eea632f36d 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -37,13 +37,13 @@ C:\keys\Grpc.snk + + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - ..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll - False ..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index 08aece7ef20..205a1ae3a28 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -40,7 +40,7 @@ using Grpc.Core; using Grpc.Core.Utils; using NUnit.Framework; -namespace math.Tests +namespace Math.Tests { /// /// Math client talks to local math server. diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config index cc6e9af40f6..7266fa1763c 100644 --- a/src/csharp/Grpc.Examples.Tests/packages.config +++ b/src/csharp/Grpc.Examples.Tests/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index c1aa40500e4..1ba1ed60819 100644 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -37,11 +37,11 @@ C:\keys\Grpc.snk + + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + - - ..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll - ..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll diff --git a/src/csharp/Grpc.Examples/MathExamples.cs b/src/csharp/Grpc.Examples/MathExamples.cs index 06d81a4d83d..e25384766f5 100644 --- a/src/csharp/Grpc.Examples/MathExamples.cs +++ b/src/csharp/Grpc.Examples/MathExamples.cs @@ -34,25 +34,25 @@ using System.Collections.Generic; using System.Threading.Tasks; using Grpc.Core.Utils; -namespace math +namespace Math { public static class MathExamples { public static void DivExample(Math.IMathClient client) { - DivReply result = client.Div(new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build()); + DivReply result = client.Div(new DivArgs { Dividend = 10, Divisor = 3 }); Console.WriteLine("Div Result: " + result); } public static async Task DivAsyncExample(Math.IMathClient client) { - DivReply result = await client.DivAsync(new DivArgs.Builder { Dividend = 4, Divisor = 5 }.Build()); + DivReply result = await client.DivAsync(new DivArgs { Dividend = 4, Divisor = 5 }); Console.WriteLine("DivAsync Result: " + result); } public static async Task FibExample(Math.IMathClient client) { - using (var call = client.Fib(new FibArgs.Builder { Limit = 5 }.Build())) + using (var call = client.Fib(new FibArgs { Limit = 5 })) { List result = await call.ResponseStream.ToList(); Console.WriteLine("Fib Result: " + string.Join("|", result)); @@ -63,9 +63,9 @@ namespace math { var numbers = new List { - new Num.Builder { Num_ = 1 }.Build(), - new Num.Builder { Num_ = 2 }.Build(), - new Num.Builder { Num_ = 3 }.Build() + new Num { Num_ = 1 }, + new Num { Num_ = 2 }, + new Num { Num_ = 3 } }; using (var call = client.Sum()) @@ -79,9 +79,9 @@ namespace math { var divArgsList = new List { - new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build(), - new DivArgs.Builder { Dividend = 100, Divisor = 21 }.Build(), - new DivArgs.Builder { Dividend = 7, Divisor = 2 }.Build() + new DivArgs { Dividend = 10, Divisor = 3 }, + new DivArgs { Dividend = 100, Divisor = 21 }, + new DivArgs { Dividend = 7, Divisor = 2 } }; using (var call = client.DivMany()) { @@ -94,9 +94,9 @@ namespace math { var numbers = new List { - new Num.Builder { Num_ = 1 }.Build(), - new Num.Builder { Num_ = 2 }.Build(), - new Num.Builder { Num_ = 3 }.Build() + new Num { Num_ = 1 }, + new Num { Num_ = 2 }, + new Num { Num_ = 3 } }; Num sum; @@ -106,7 +106,7 @@ namespace math sum = await sumCall.ResponseAsync; } - DivReply result = await client.DivAsync(new DivArgs.Builder { Dividend = sum.Num_, Divisor = numbers.Count }.Build()); + DivReply result = await client.DivAsync(new DivArgs { Dividend = sum.Num_, Divisor = numbers.Count }); Console.WriteLine("Avg Result: " + result); } } diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index eb6b68849f6..f008a0d7f2f 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -5,6 +5,7 @@ using System; using System.Threading; using System.Threading.Tasks; +using Google.Protobuf; using Grpc.Core; namespace Math { @@ -12,10 +13,10 @@ namespace Math { { static readonly string __ServiceName = "math.Math"; - static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.DivArgs.ParseFrom); - static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.DivReply.ParseFrom); - static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.FibArgs.ParseFrom); - static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.Num.ParseFrom); + static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.DivArgs.Parser.ParseFrom); + static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.DivReply.Parser.ParseFrom); + static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.FibArgs.Parser.ParseFrom); + static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.Num.Parser.ParseFrom); static readonly Method __Method_Div = new Method( MethodType.Unary, diff --git a/src/csharp/Grpc.Examples/MathServiceImpl.cs b/src/csharp/Grpc.Examples/MathServiceImpl.cs index 29181bc858d..788ce90343b 100644 --- a/src/csharp/Grpc.Examples/MathServiceImpl.cs +++ b/src/csharp/Grpc.Examples/MathServiceImpl.cs @@ -79,7 +79,7 @@ namespace Math { sum += num.Num_; }); - return Num.CreateBuilder().SetNum_(sum).Build(); + return new Num { Num_ = sum }; } public async Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) @@ -94,13 +94,13 @@ namespace Math { long quotient = args.Dividend / args.Divisor; long remainder = args.Dividend % args.Divisor; - return new DivReply.Builder { Quotient = quotient, Remainder = remainder }.Build(); + return new DivReply { Quotient = quotient, Remainder = remainder }; } static IEnumerable FibInternal(long n) { long a = 1; - yield return new Num.Builder { Num_ = a }.Build(); + yield return new Num { Num_ = a }; long b = 1; for (long i = 0; i < n - 1; i++) @@ -108,7 +108,7 @@ namespace Math long temp = a; a = b; b = temp + b; - yield return new Num.Builder { Num_ = a }.Build(); + yield return new Num { Num_ = a }; } } } diff --git a/src/csharp/Grpc.Examples/packages.config b/src/csharp/Grpc.Examples/packages.config index 4c8d60fa62a..adf8da2363d 100644 --- a/src/csharp/Grpc.Examples/packages.config +++ b/src/csharp/Grpc.Examples/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index c922ddfb9e7..ca24874d669 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -37,11 +37,8 @@ C:\keys\Grpc.snk - - ..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.dll - - - ..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.Serialization.dll + + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config index 050c4eaed67..40ffb852031 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/packages.config +++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj index 0b7a7b91c6b..c9eb862f487 100644 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj @@ -38,11 +38,8 @@ C:\keys\Grpc.snk - - ..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.dll - - - ..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.Serialization.dll + + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll diff --git a/src/csharp/Grpc.HealthCheck/packages.config b/src/csharp/Grpc.HealthCheck/packages.config index 094a30981e4..cafff6123a3 100644 --- a/src/csharp/Grpc.HealthCheck/packages.config +++ b/src/csharp/Grpc.HealthCheck/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index b307a0445c2..38a3961837d 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -41,13 +41,13 @@ ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll + + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - ..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll - ..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config index 7d1f84f3031..7b7bc42ff4f 100644 --- a/src/csharp/Grpc.IntegrationTesting/packages.config +++ b/src/csharp/Grpc.IntegrationTesting/packages.config @@ -3,7 +3,7 @@ - + From 7db46138d5fd835a38c1aabf79c961ef63ed13d6 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 09:25:38 -0700 Subject: [PATCH 07/26] progress --- src/csharp/Grpc.Examples/MathGrpc.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index f008a0d7f2f..1395a800107 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -5,7 +5,6 @@ using System; using System.Threading; using System.Threading.Tasks; -using Google.Protobuf; using Grpc.Core; namespace Math { @@ -13,7 +12,7 @@ namespace Math { { static readonly string __ServiceName = "math.Math"; - static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.DivArgs.Parser.ParseFrom); + static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom); static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.DivReply.Parser.ParseFrom); static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.FibArgs.Parser.ParseFrom); static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.Num.Parser.ParseFrom); From ad75dd136111696dad44e370cc563de57bdd4785 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 09:43:07 -0700 Subject: [PATCH 08/26] fix generator --- src/compiler/csharp_generator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index 5443cd47015..8a600904e7b 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -197,7 +197,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor *service) { for (size_t i = 0; i < used_messages.size(); i++) { const Descriptor *message = used_messages[i]; out->Print( - "static readonly Marshaller<$type$> $fieldname$ = Marshallers.Create((arg) => arg.ToByteArray(), $type$.ParseFrom);\n", + "static readonly Marshaller<$type$> $fieldname$ = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), $type$.Parser.ParseFrom);\n", "fieldname", GetMarshallerFieldName(message), "type", GetClassName(message)); } From 3030a92f3dc232e3db8a6098a4fddeac1a71df33 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 09:45:13 -0700 Subject: [PATCH 09/26] upgrade generate script --- src/csharp/generate_proto_csharp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/csharp/generate_proto_csharp.sh b/src/csharp/generate_proto_csharp.sh index 56c9418e393..a17f45b5874 100755 --- a/src/csharp/generate_proto_csharp.sh +++ b/src/csharp/generate_proto_csharp.sh @@ -42,7 +42,7 @@ $PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR \ -I $EXAMPLES_DIR/proto $EXAMPLES_DIR/proto/math.proto $PROTOC --plugin=$PLUGIN --csharp_out=$INTEROP_DIR --grpc_out=$INTEROP_DIR \ - -I $INTEROP_DIR/proto $INTEROP_DIR/proto/test.proto + -I $INTEROP_DIR/proto $INTEROP_DIR/proto/*.proto $PROTOC --plugin=$PLUGIN --csharp_out=$HEALTHCHECK_DIR --grpc_out=$HEALTHCHECK_DIR \ -I $HEALTHCHECK_DIR/proto $HEALTHCHECK_DIR/proto/health.proto From 475f75a0deaa5a201feb9a5fb3a9b35d8cac9dd4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 09:46:04 -0700 Subject: [PATCH 10/26] regenerate --- src/csharp/Grpc.Examples/MathGrpc.cs | 6 +- src/csharp/Grpc.HealthCheck/HealthGrpc.cs | 4 +- src/csharp/Grpc.IntegrationTesting/Empty.cs | 286 +- .../Grpc.IntegrationTesting/Messages.cs | 3233 ++++------------- .../Grpc.IntegrationTesting/TestGrpc.cs | 14 +- 5 files changed, 848 insertions(+), 2695 deletions(-) diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 1395a800107..c0cab6e4695 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -13,9 +13,9 @@ namespace Math { static readonly string __ServiceName = "math.Math"; static readonly Marshaller __Marshaller_DivArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom); - static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.DivReply.Parser.ParseFrom); - static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.FibArgs.Parser.ParseFrom); - static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), global::Math.Num.Parser.ParseFrom); + static readonly Marshaller __Marshaller_DivReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom); + static readonly Marshaller __Marshaller_FibArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom); + static readonly Marshaller __Marshaller_Num = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom); static readonly Method __Method_Div = new Method( MethodType.Unary, diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 0dabc91f7c2..9d452b0732f 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -12,8 +12,8 @@ namespace Grpc.Health.V1Alpha { { static readonly string __ServiceName = "grpc.health.v1alpha.Health"; - static readonly Marshaller __Marshaller_HealthCheckRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Health.V1Alpha.HealthCheckRequest.ParseFrom); - static readonly Marshaller __Marshaller_HealthCheckResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Health.V1Alpha.HealthCheckResponse.ParseFrom); + static readonly Marshaller __Marshaller_HealthCheckRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1Alpha.HealthCheckRequest.Parser.ParseFrom); + static readonly Marshaller __Marshaller_HealthCheckResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1Alpha.HealthCheckResponse.Parser.ParseFrom); static readonly Method __Method_Check = new Method( MethodType.Unary, diff --git a/src/csharp/Grpc.IntegrationTesting/Empty.cs b/src/csharp/Grpc.IntegrationTesting/Empty.cs index 7169ee2a4a5..fc8ea3889cb 100644 --- a/src/csharp/Grpc.IntegrationTesting/Empty.cs +++ b/src/csharp/Grpc.IntegrationTesting/Empty.cs @@ -1,47 +1,34 @@ -// Generated by ProtoGen, Version=2.4.1.521, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT! +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: empty.proto #pragma warning disable 1591, 0612, 3021 #region Designer generated code -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; +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.testing { +namespace Grpc.Testing { namespace Proto { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Empty { - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_grpc_testing_Empty__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_testing_Empty__FieldAccessorTable; - #endregion #region Descriptor - public static pbd::FileDescriptor Descriptor { + public static pbr::FileDescriptor Descriptor { get { return descriptor; } } - private static pbd::FileDescriptor descriptor; + private static pbr::FileDescriptor descriptor; static Empty() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CgtlbXB0eS5wcm90bxIMZ3JwYy50ZXN0aW5nIgcKBUVtcHR5")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_grpc_testing_Empty__Descriptor = Descriptor.MessageTypes[0]; - internal__static_grpc_testing_Empty__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_testing_Empty__Descriptor, - new string[] { }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); + "CgtlbXB0eS5wcm90bxIMZ3JwYy50ZXN0aW5nIgcKBUVtcHR5YgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Empty), null, null, null, null) + })); } #endregion @@ -49,230 +36,83 @@ namespace grpc.testing { } #region Messages [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Empty : pb::GeneratedMessage { - private Empty() { } - private static readonly Empty defaultInstance = new Empty().MakeReadOnly(); - private static readonly string[] _emptyFieldNames = new string[] { }; - private static readonly uint[] _emptyFieldTags = new uint[] { }; - public static Empty DefaultInstance { - get { return defaultInstance; } - } + public sealed partial class Empty : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); + public static pb::MessageParser Parser { get { return _parser; } } - public override Empty DefaultInstanceForType { - get { return DefaultInstance; } + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.Proto.Empty.Descriptor.MessageTypes[0]; } } - protected override Empty ThisMessage { - get { return this; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - public static pbd::MessageDescriptor Descriptor { - get { return global::grpc.testing.Proto.Empty.internal__static_grpc_testing_Empty__Descriptor; } + public Empty() { + OnConstruction(); } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::grpc.testing.Proto.Empty.internal__static_grpc_testing_Empty__FieldAccessorTable; } - } + partial void OnConstruction(); - public override bool IsInitialized { - get { - return true; - } + public Empty(Empty other) : this() { } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _emptyFieldNames; - UnknownFields.WriteTo(output); + public Empty Clone() { + return new Empty(this); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; + public override bool Equals(object other) { + return Equals(other as Empty); + } - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(Empty other) { + if (ReferenceEquals(other, null)) { + return false; } + if (ReferenceEquals(other, this)) { + return true; + } + return true; } - public static Empty ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Empty ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Empty ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Empty ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Empty ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Empty ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Empty ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Empty ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Empty ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Empty ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Empty MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Empty prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Empty cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Empty result; - - private Empty PrepareBuilder() { - if (resultIsReadOnly) { - Empty original = result; - result = new Empty(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Empty MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::grpc.testing.Empty.Descriptor; } - } - - public override Empty DefaultInstanceForType { - get { return global::grpc.testing.Empty.DefaultInstance; } - } - - public override Empty BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Empty) { - return MergeFrom((Empty) other); - } else { - base.MergeFrom(other); - return this; - } - } + public void WriteTo(pb::CodedOutputStream output) { + } - public override Builder MergeFrom(Empty other) { - if (other == global::grpc.testing.Empty.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } + public int CalculateSize() { + int size = 0; + return size; + } - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); + public void MergeFrom(Empty other) { + if (other == null) { + return; } + } - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_emptyFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _emptyFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); + break; } - return this; } - - } - static Empty() { - object.ReferenceEquals(global::grpc.testing.Proto.Empty.Descriptor, null); } + } #endregion diff --git a/src/csharp/Grpc.IntegrationTesting/Messages.cs b/src/csharp/Grpc.IntegrationTesting/Messages.cs index 386f377f08b..e5a9f382b6c 100644 --- a/src/csharp/Grpc.IntegrationTesting/Messages.cs +++ b/src/csharp/Grpc.IntegrationTesting/Messages.cs @@ -1,106 +1,58 @@ -// Generated by ProtoGen, Version=2.4.1.521, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT! +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: messages.proto #pragma warning disable 1591, 0612, 3021 #region Designer generated code -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; +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.testing { +namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Messages { - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_grpc_testing_Payload__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_testing_Payload__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_grpc_testing_SimpleRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_testing_SimpleRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_grpc_testing_SimpleResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_testing_SimpleResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_grpc_testing_StreamingInputCallRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_testing_StreamingInputCallRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_grpc_testing_StreamingInputCallResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_testing_StreamingInputCallResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_grpc_testing_ResponseParameters__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_testing_ResponseParameters__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_grpc_testing_StreamingOutputCallRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_testing_StreamingOutputCallRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_grpc_testing_StreamingOutputCallResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_grpc_testing_StreamingOutputCallResponse__FieldAccessorTable; - #endregion #region Descriptor - public static pbd::FileDescriptor Descriptor { + public static pbr::FileDescriptor Descriptor { get { return descriptor; } } - private static pbd::FileDescriptor descriptor; + private static pbr::FileDescriptor descriptor; static Messages() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cg5tZXNzYWdlcy5wcm90bxIMZ3JwYy50ZXN0aW5nIkAKB1BheWxvYWQSJwoE", - "dHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlwZRIMCgRib2R5", - "GAIgASgMIrEBCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5cGUYASAB", - "KA4yGS5ncnBjLnRlc3RpbmcuUGF5bG9hZFR5cGUSFQoNcmVzcG9uc2Vfc2l6", - "ZRgCIAEoBRImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxv", - "YWQSFQoNZmlsbF91c2VybmFtZRgEIAEoCBIYChBmaWxsX29hdXRoX3Njb3Bl", - "GAUgASgIIl8KDlNpbXBsZVJlc3BvbnNlEiYKB3BheWxvYWQYASABKAsyFS5n", - "cnBjLnRlc3RpbmcuUGF5bG9hZBIQCgh1c2VybmFtZRgCIAEoCRITCgtvYXV0", - "aF9zY29wZRgDIAEoCSJDChlTdHJlYW1pbmdJbnB1dENhbGxSZXF1ZXN0EiYK", - "B3BheWxvYWQYASABKAsyFS5ncnBjLnRlc3RpbmcuUGF5bG9hZCI9ChpTdHJl", - "YW1pbmdJbnB1dENhbGxSZXNwb25zZRIfChdhZ2dyZWdhdGVkX3BheWxvYWRf", - "c2l6ZRgBIAEoBSI3ChJSZXNwb25zZVBhcmFtZXRlcnMSDAoEc2l6ZRgBIAEo", - "BRITCgtpbnRlcnZhbF91cxgCIAEoBSK1AQoaU3RyZWFtaW5nT3V0cHV0Q2Fs", - "bFJlcXVlc3QSMAoNcmVzcG9uc2VfdHlwZRgBIAEoDjIZLmdycGMudGVzdGlu", - "Zy5QYXlsb2FkVHlwZRI9ChNyZXNwb25zZV9wYXJhbWV0ZXJzGAIgAygLMiAu", - "Z3JwYy50ZXN0aW5nLlJlc3BvbnNlUGFyYW1ldGVycxImCgdwYXlsb2FkGAMg", - "ASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxvYWQiRQobU3RyZWFtaW5nT3V0cHV0", - "Q2FsbFJlc3BvbnNlEiYKB3BheWxvYWQYASABKAsyFS5ncnBjLnRlc3Rpbmcu", - "UGF5bG9hZCo/CgtQYXlsb2FkVHlwZRIQCgxDT01QUkVTU0FCTEUQABISCg5V", - "TkNPTVBSRVNTQUJMRRABEgoKBlJBTkRPTRAC")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_grpc_testing_Payload__Descriptor = Descriptor.MessageTypes[0]; - internal__static_grpc_testing_Payload__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_testing_Payload__Descriptor, - new string[] { "Type", "Body", }); - internal__static_grpc_testing_SimpleRequest__Descriptor = Descriptor.MessageTypes[1]; - internal__static_grpc_testing_SimpleRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_testing_SimpleRequest__Descriptor, - new string[] { "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", }); - internal__static_grpc_testing_SimpleResponse__Descriptor = Descriptor.MessageTypes[2]; - internal__static_grpc_testing_SimpleResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_testing_SimpleResponse__Descriptor, - new string[] { "Payload", "Username", "OauthScope", }); - internal__static_grpc_testing_StreamingInputCallRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_grpc_testing_StreamingInputCallRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_testing_StreamingInputCallRequest__Descriptor, - new string[] { "Payload", }); - internal__static_grpc_testing_StreamingInputCallResponse__Descriptor = Descriptor.MessageTypes[4]; - internal__static_grpc_testing_StreamingInputCallResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_testing_StreamingInputCallResponse__Descriptor, - new string[] { "AggregatedPayloadSize", }); - internal__static_grpc_testing_ResponseParameters__Descriptor = Descriptor.MessageTypes[5]; - internal__static_grpc_testing_ResponseParameters__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_testing_ResponseParameters__Descriptor, - new string[] { "Size", "IntervalUs", }); - internal__static_grpc_testing_StreamingOutputCallRequest__Descriptor = Descriptor.MessageTypes[6]; - internal__static_grpc_testing_StreamingOutputCallRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_testing_StreamingOutputCallRequest__Descriptor, - new string[] { "ResponseType", "ResponseParameters", "Payload", }); - internal__static_grpc_testing_StreamingOutputCallResponse__Descriptor = Descriptor.MessageTypes[7]; - internal__static_grpc_testing_StreamingOutputCallResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_grpc_testing_StreamingOutputCallResponse__Descriptor, - new string[] { "Payload", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); + "Cg5tZXNzYWdlcy5wcm90bxIMZ3JwYy50ZXN0aW5nIkAKB1BheWxvYWQSJwoE", + "dHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlwZRIMCgRib2R5", + "GAIgASgMIrEBCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5cGUYASAB", + "KA4yGS5ncnBjLnRlc3RpbmcuUGF5bG9hZFR5cGUSFQoNcmVzcG9uc2Vfc2l6", + "ZRgCIAEoBRImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxv", + "YWQSFQoNZmlsbF91c2VybmFtZRgEIAEoCBIYChBmaWxsX29hdXRoX3Njb3Bl", + "GAUgASgIIl8KDlNpbXBsZVJlc3BvbnNlEiYKB3BheWxvYWQYASABKAsyFS5n", + "cnBjLnRlc3RpbmcuUGF5bG9hZBIQCgh1c2VybmFtZRgCIAEoCRITCgtvYXV0", + "aF9zY29wZRgDIAEoCSJDChlTdHJlYW1pbmdJbnB1dENhbGxSZXF1ZXN0EiYK", + "B3BheWxvYWQYASABKAsyFS5ncnBjLnRlc3RpbmcuUGF5bG9hZCI9ChpTdHJl", + "YW1pbmdJbnB1dENhbGxSZXNwb25zZRIfChdhZ2dyZWdhdGVkX3BheWxvYWRf", + "c2l6ZRgBIAEoBSI3ChJSZXNwb25zZVBhcmFtZXRlcnMSDAoEc2l6ZRgBIAEo", + "BRITCgtpbnRlcnZhbF91cxgCIAEoBSK1AQoaU3RyZWFtaW5nT3V0cHV0Q2Fs", + "bFJlcXVlc3QSMAoNcmVzcG9uc2VfdHlwZRgBIAEoDjIZLmdycGMudGVzdGlu", + "Zy5QYXlsb2FkVHlwZRI9ChNyZXNwb25zZV9wYXJhbWV0ZXJzGAIgAygLMiAu", + "Z3JwYy50ZXN0aW5nLlJlc3BvbnNlUGFyYW1ldGVycxImCgdwYXlsb2FkGAMg", + "ASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxvYWQiRQobU3RyZWFtaW5nT3V0cHV0", + "Q2FsbFJlc3BvbnNlEiYKB3BheWxvYWQYASABKAsyFS5ncnBjLnRlc3Rpbmcu", + "UGF5bG9hZCo/CgtQYXlsb2FkVHlwZRIQCgxDT01QUkVTU0FCTEUQABISCg5V", + "TkNPTVBSRVNTQUJMRRABEgoKBlJBTkRPTRACYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedCodeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Payload), new[]{ "Type", "Body" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.SimpleRequest), new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.SimpleResponse), new[]{ "Payload", "Username", "OauthScope" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingInputCallRequest), new[]{ "Payload" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingInputCallResponse), new[]{ "AggregatedPayloadSize" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ResponseParameters), new[]{ "Size", "IntervalUs" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingOutputCallRequest), new[]{ "ResponseType", "ResponseParameters", "Payload" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingOutputCallResponse), new[]{ "Payload" }, null, null, null) + })); } #endregion @@ -116,2772 +68,1133 @@ namespace grpc.testing { #region Messages [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Payload : pb::GeneratedMessage { - private Payload() { } - private static readonly Payload defaultInstance = new Payload().MakeReadOnly(); - private static readonly string[] _payloadFieldNames = new string[] { "body", "type" }; - private static readonly uint[] _payloadFieldTags = new uint[] { 18, 8 }; - public static Payload DefaultInstance { - get { return defaultInstance; } + public sealed partial class Payload : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Payload()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.Messages.Descriptor.MessageTypes[0]; } } - public override Payload DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override Payload ThisMessage { - get { return this; } + public Payload() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_Payload__Descriptor; } + partial void OnConstruction(); + + public Payload(Payload other) : this() { + type_ = other.type_; + body_ = other.body_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_Payload__FieldAccessorTable; } + public Payload Clone() { + return new Payload(this); } public const int TypeFieldNumber = 1; - private bool hasType; - private global::grpc.testing.PayloadType type_ = global::grpc.testing.PayloadType.COMPRESSABLE; - public bool HasType { - get { return hasType; } - } - public global::grpc.testing.PayloadType Type { + private global::Grpc.Testing.PayloadType type_ = global::Grpc.Testing.PayloadType.COMPRESSABLE; + public global::Grpc.Testing.PayloadType Type { get { return type_; } + set { + type_ = value; + } } public const int BodyFieldNumber = 2; - private bool hasBody; private pb::ByteString body_ = pb::ByteString.Empty; - public bool HasBody { - get { return hasBody; } - } public pb::ByteString Body { get { return body_; } - } - - public override bool IsInitialized { - get { - return true; + set { + body_ = pb::Preconditions.CheckNotNull(value, "value"); } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _payloadFieldNames; - if (hasType) { - output.WriteEnum(1, field_names[1], (int) Type, Type); - } - if (hasBody) { - output.WriteBytes(2, field_names[0], Body); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as Payload); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasType) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Type); - } - if (hasBody) { - size += pb::CodedOutputStream.ComputeBytesSize(2, Body); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(Payload other) { + if (ReferenceEquals(other, null)) { + return false; } + if (ReferenceEquals(other, this)) { + return true; + } + if (Type != other.Type) return false; + if (Body != other.Body) return false; + return true; } - public static Payload ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Payload ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Payload ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Payload ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Payload ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Payload ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Payload ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Payload ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Payload ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Payload ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Payload MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) hash ^= Type.GetHashCode(); + if (Body.Length != 0) hash ^= Body.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Payload prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Payload cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Payload result; - - private Payload PrepareBuilder() { - if (resultIsReadOnly) { - Payload original = result; - result = new Payload(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } + public void WriteTo(pb::CodedOutputStream output) { + if (Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); } - - protected override Payload MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; + if (Body.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(Body); } + } - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } + public int CalculateSize() { + int size = 0; + if (Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::grpc.testing.Payload.Descriptor; } + if (Body.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); } + return size; + } - public override Payload DefaultInstanceForType { - get { return global::grpc.testing.Payload.DefaultInstance; } + public void MergeFrom(Payload other) { + if (other == null) { + return; } - - public override Payload BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + if (other.Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) { + Type = other.Type; } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Payload) { - return MergeFrom((Payload) other); - } else { - base.MergeFrom(other); - return this; - } + if (other.Body.Length != 0) { + Body = other.Body; } + } - public override Builder MergeFrom(Payload other) { - if (other == global::grpc.testing.Payload.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasType) { - Type = other.Type; - } - if (other.HasBody) { - Body = other.Body; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_payloadFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _payloadFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + type_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); + break; } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.type_, out unknown)) { - result.hasType = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 18: { - result.hasBody = input.ReadBytes(ref result.body_); - break; - } + case 18: { + Body = input.ReadBytes(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasType { - get { return result.hasType; } - } - public global::grpc.testing.PayloadType Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(global::grpc.testing.PayloadType value) { - PrepareBuilder(); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - PrepareBuilder(); - result.hasType = false; - result.type_ = global::grpc.testing.PayloadType.COMPRESSABLE; - return this; - } - - public bool HasBody { - get { return result.hasBody; } } - public pb::ByteString Body { - get { return result.Body; } - set { SetBody(value); } - } - public Builder SetBody(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBody = true; - result.body_ = value; - return this; - } - public Builder ClearBody() { - PrepareBuilder(); - result.hasBody = false; - result.body_ = pb::ByteString.Empty; - return this; - } - } - static Payload() { - object.ReferenceEquals(global::grpc.testing.Messages.Descriptor, null); } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SimpleRequest : pb::GeneratedMessage { - private SimpleRequest() { } - private static readonly SimpleRequest defaultInstance = new SimpleRequest().MakeReadOnly(); - private static readonly string[] _simpleRequestFieldNames = new string[] { "fill_oauth_scope", "fill_username", "payload", "response_size", "response_type" }; - private static readonly uint[] _simpleRequestFieldTags = new uint[] { 40, 32, 26, 16, 8 }; - public static SimpleRequest DefaultInstance { - get { return defaultInstance; } + public sealed partial class SimpleRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleRequest()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.Messages.Descriptor.MessageTypes[1]; } } - public override SimpleRequest DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override SimpleRequest ThisMessage { - get { return this; } + public SimpleRequest() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_SimpleRequest__Descriptor; } + partial void OnConstruction(); + + public SimpleRequest(SimpleRequest other) : this() { + responseType_ = other.responseType_; + responseSize_ = other.responseSize_; + Payload = other.payload_ != null ? other.Payload.Clone() : null; + fillUsername_ = other.fillUsername_; + fillOauthScope_ = other.fillOauthScope_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_SimpleRequest__FieldAccessorTable; } + public SimpleRequest Clone() { + return new SimpleRequest(this); } public const int ResponseTypeFieldNumber = 1; - private bool hasResponseType; - private global::grpc.testing.PayloadType responseType_ = global::grpc.testing.PayloadType.COMPRESSABLE; - public bool HasResponseType { - get { return hasResponseType; } - } - public global::grpc.testing.PayloadType ResponseType { + private global::Grpc.Testing.PayloadType responseType_ = global::Grpc.Testing.PayloadType.COMPRESSABLE; + public global::Grpc.Testing.PayloadType ResponseType { get { return responseType_; } + set { + responseType_ = value; + } } public const int ResponseSizeFieldNumber = 2; - private bool hasResponseSize; private int responseSize_; - public bool HasResponseSize { - get { return hasResponseSize; } - } public int ResponseSize { get { return responseSize_; } + set { + responseSize_ = value; + } } public const int PayloadFieldNumber = 3; - private bool hasPayload; - private global::grpc.testing.Payload payload_; - public bool HasPayload { - get { return hasPayload; } - } - public global::grpc.testing.Payload Payload { - get { return payload_ ?? global::grpc.testing.Payload.DefaultInstance; } + private global::Grpc.Testing.Payload payload_; + public global::Grpc.Testing.Payload Payload { + get { return payload_; } + set { + payload_ = value; + } } public const int FillUsernameFieldNumber = 4; - private bool hasFillUsername; private bool fillUsername_; - public bool HasFillUsername { - get { return hasFillUsername; } - } public bool FillUsername { get { return fillUsername_; } + set { + fillUsername_ = value; + } } public const int FillOauthScopeFieldNumber = 5; - private bool hasFillOauthScope; private bool fillOauthScope_; - public bool HasFillOauthScope { - get { return hasFillOauthScope; } - } public bool FillOauthScope { get { return fillOauthScope_; } - } - - public override bool IsInitialized { - get { - return true; + set { + fillOauthScope_ = value; } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _simpleRequestFieldNames; - if (hasResponseType) { - output.WriteEnum(1, field_names[4], (int) ResponseType, ResponseType); - } - if (hasResponseSize) { - output.WriteInt32(2, field_names[3], ResponseSize); - } - if (hasPayload) { - output.WriteMessage(3, field_names[2], Payload); - } - if (hasFillUsername) { - output.WriteBool(4, field_names[1], FillUsername); - } - if (hasFillOauthScope) { - output.WriteBool(5, field_names[0], FillOauthScope); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as SimpleRequest); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasResponseType) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) ResponseType); - } - if (hasResponseSize) { - size += pb::CodedOutputStream.ComputeInt32Size(2, ResponseSize); - } - if (hasPayload) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Payload); - } - if (hasFillUsername) { - size += pb::CodedOutputStream.ComputeBoolSize(4, FillUsername); - } - if (hasFillOauthScope) { - size += pb::CodedOutputStream.ComputeBoolSize(5, FillOauthScope); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(SimpleRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; } + if (ResponseType != other.ResponseType) return false; + if (ResponseSize != other.ResponseSize) return false; + if (!object.Equals(Payload, other.Payload)) return false; + if (FillUsername != other.FillUsername) return false; + if (FillOauthScope != other.FillOauthScope) return false; + return true; } - public static SimpleRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SimpleRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SimpleRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SimpleRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SimpleRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SimpleRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SimpleRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SimpleRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SimpleRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SimpleRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SimpleRequest MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) hash ^= ResponseType.GetHashCode(); + if (ResponseSize != 0) hash ^= ResponseSize.GetHashCode(); + if (payload_ != null) hash ^= Payload.GetHashCode(); + if (FillUsername != false) hash ^= FillUsername.GetHashCode(); + if (FillOauthScope != false) hash ^= FillOauthScope.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SimpleRequest prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } + public void WriteTo(pb::CodedOutputStream output) { + if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { + output.WriteRawTag(8); + output.WriteEnum((int) ResponseType); } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; + if (ResponseSize != 0) { + output.WriteRawTag(16); + output.WriteInt32(ResponseSize); } - internal Builder(SimpleRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; + if (payload_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Payload); } - - private bool resultIsReadOnly; - private SimpleRequest result; - - private SimpleRequest PrepareBuilder() { - if (resultIsReadOnly) { - SimpleRequest original = result; - result = new SimpleRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; + if (FillUsername != false) { + output.WriteRawTag(32); + output.WriteBool(FillUsername); } - - public override bool IsInitialized { - get { return result.IsInitialized; } + if (FillOauthScope != false) { + output.WriteRawTag(40); + output.WriteBool(FillOauthScope); } + } - protected override SimpleRequest MessageBeingBuilt { - get { return PrepareBuilder(); } + public int CalculateSize() { + int size = 0; + if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseType); } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; + if (ResponseSize != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ResponseSize); } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } + if (payload_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::grpc.testing.SimpleRequest.Descriptor; } + if (FillUsername != false) { + size += 1 + 1; } - - public override SimpleRequest DefaultInstanceForType { - get { return global::grpc.testing.SimpleRequest.DefaultInstance; } + if (FillOauthScope != false) { + size += 1 + 1; } + return size; + } - public override SimpleRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + public void MergeFrom(SimpleRequest other) { + if (other == null) { + return; } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SimpleRequest) { - return MergeFrom((SimpleRequest) other); - } else { - base.MergeFrom(other); - return this; + if (other.ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { + ResponseType = other.ResponseType; + } + if (other.ResponseSize != 0) { + ResponseSize = other.ResponseSize; + } + if (other.payload_ != null) { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); } + Payload.MergeFrom(other.Payload); + } + if (other.FillUsername != false) { + FillUsername = other.FillUsername; } + if (other.FillOauthScope != false) { + FillOauthScope = other.FillOauthScope; + } + } - public override Builder MergeFrom(SimpleRequest other) { - if (other == global::grpc.testing.SimpleRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasResponseType) { - ResponseType = other.ResponseType; - } - if (other.HasResponseSize) { - ResponseSize = other.ResponseSize; - } - if (other.HasPayload) { - MergePayload(other.Payload); - } - if (other.HasFillUsername) { - FillUsername = other.FillUsername; - } - if (other.HasFillOauthScope) { - FillOauthScope = other.FillOauthScope; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_simpleRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _simpleRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + responseType_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); + break; } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.responseType_, out unknown)) { - result.hasResponseType = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 16: { - result.hasResponseSize = input.ReadInt32(ref result.responseSize_); - break; - } - case 26: { - global::grpc.testing.Payload.Builder subBuilder = global::grpc.testing.Payload.CreateBuilder(); - if (result.hasPayload) { - subBuilder.MergeFrom(Payload); - } - input.ReadMessage(subBuilder, extensionRegistry); - Payload = subBuilder.BuildPartial(); - break; - } - case 32: { - result.hasFillUsername = input.ReadBool(ref result.fillUsername_); - break; - } - case 40: { - result.hasFillOauthScope = input.ReadBool(ref result.fillOauthScope_); - break; + case 16: { + ResponseSize = input.ReadInt32(); + break; + } + case 26: { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); } + input.ReadMessage(payload_); + break; + } + case 32: { + FillUsername = input.ReadBool(); + break; + } + case 40: { + FillOauthScope = input.ReadBool(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasResponseType { - get { return result.hasResponseType; } - } - public global::grpc.testing.PayloadType ResponseType { - get { return result.ResponseType; } - set { SetResponseType(value); } - } - public Builder SetResponseType(global::grpc.testing.PayloadType value) { - PrepareBuilder(); - result.hasResponseType = true; - result.responseType_ = value; - return this; - } - public Builder ClearResponseType() { - PrepareBuilder(); - result.hasResponseType = false; - result.responseType_ = global::grpc.testing.PayloadType.COMPRESSABLE; - return this; - } - - public bool HasResponseSize { - get { return result.hasResponseSize; } - } - public int ResponseSize { - get { return result.ResponseSize; } - set { SetResponseSize(value); } - } - public Builder SetResponseSize(int value) { - PrepareBuilder(); - result.hasResponseSize = true; - result.responseSize_ = value; - return this; - } - public Builder ClearResponseSize() { - PrepareBuilder(); - result.hasResponseSize = false; - result.responseSize_ = 0; - return this; - } - - public bool HasPayload { - get { return result.hasPayload; } - } - public global::grpc.testing.Payload Payload { - get { return result.Payload; } - set { SetPayload(value); } - } - public Builder SetPayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = value; - return this; - } - public Builder SetPayload(global::grpc.testing.Payload.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = builderForValue.Build(); - return this; - } - public Builder MergePayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasPayload && - result.payload_ != global::grpc.testing.Payload.DefaultInstance) { - result.payload_ = global::grpc.testing.Payload.CreateBuilder(result.payload_).MergeFrom(value).BuildPartial(); - } else { - result.payload_ = value; - } - result.hasPayload = true; - return this; - } - public Builder ClearPayload() { - PrepareBuilder(); - result.hasPayload = false; - result.payload_ = null; - return this; - } - - public bool HasFillUsername { - get { return result.hasFillUsername; } - } - public bool FillUsername { - get { return result.FillUsername; } - set { SetFillUsername(value); } - } - public Builder SetFillUsername(bool value) { - PrepareBuilder(); - result.hasFillUsername = true; - result.fillUsername_ = value; - return this; - } - public Builder ClearFillUsername() { - PrepareBuilder(); - result.hasFillUsername = false; - result.fillUsername_ = false; - return this; - } - - public bool HasFillOauthScope { - get { return result.hasFillOauthScope; } - } - public bool FillOauthScope { - get { return result.FillOauthScope; } - set { SetFillOauthScope(value); } - } - public Builder SetFillOauthScope(bool value) { - PrepareBuilder(); - result.hasFillOauthScope = true; - result.fillOauthScope_ = value; - return this; - } - public Builder ClearFillOauthScope() { - PrepareBuilder(); - result.hasFillOauthScope = false; - result.fillOauthScope_ = false; - return this; } } - static SimpleRequest() { - object.ReferenceEquals(global::grpc.testing.Messages.Descriptor, null); - } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SimpleResponse : pb::GeneratedMessage { - private SimpleResponse() { } - private static readonly SimpleResponse defaultInstance = new SimpleResponse().MakeReadOnly(); - private static readonly string[] _simpleResponseFieldNames = new string[] { "oauth_scope", "payload", "username" }; - private static readonly uint[] _simpleResponseFieldTags = new uint[] { 26, 10, 18 }; - public static SimpleResponse DefaultInstance { - get { return defaultInstance; } + public sealed partial class SimpleResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleResponse()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.Messages.Descriptor.MessageTypes[2]; } } - public override SimpleResponse DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override SimpleResponse ThisMessage { - get { return this; } + public SimpleResponse() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_SimpleResponse__Descriptor; } + partial void OnConstruction(); + + public SimpleResponse(SimpleResponse other) : this() { + Payload = other.payload_ != null ? other.Payload.Clone() : null; + username_ = other.username_; + oauthScope_ = other.oauthScope_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_SimpleResponse__FieldAccessorTable; } + public SimpleResponse Clone() { + return new SimpleResponse(this); } public const int PayloadFieldNumber = 1; - private bool hasPayload; - private global::grpc.testing.Payload payload_; - public bool HasPayload { - get { return hasPayload; } - } - public global::grpc.testing.Payload Payload { - get { return payload_ ?? global::grpc.testing.Payload.DefaultInstance; } + private global::Grpc.Testing.Payload payload_; + public global::Grpc.Testing.Payload Payload { + get { return payload_; } + set { + payload_ = value; + } } public const int UsernameFieldNumber = 2; - private bool hasUsername; private string username_ = ""; - public bool HasUsername { - get { return hasUsername; } - } public string Username { get { return username_; } + set { + username_ = pb::Preconditions.CheckNotNull(value, "value"); + } } public const int OauthScopeFieldNumber = 3; - private bool hasOauthScope; private string oauthScope_ = ""; - public bool HasOauthScope { - get { return hasOauthScope; } - } public string OauthScope { get { return oauthScope_; } - } - - public override bool IsInitialized { - get { - return true; + set { + oauthScope_ = pb::Preconditions.CheckNotNull(value, "value"); } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _simpleResponseFieldNames; - if (hasPayload) { - output.WriteMessage(1, field_names[1], Payload); - } - if (hasUsername) { - output.WriteString(2, field_names[2], Username); - } - if (hasOauthScope) { - output.WriteString(3, field_names[0], OauthScope); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as SimpleResponse); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPayload) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Payload); - } - if (hasUsername) { - size += pb::CodedOutputStream.ComputeStringSize(2, Username); - } - if (hasOauthScope) { - size += pb::CodedOutputStream.ComputeStringSize(3, OauthScope); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(SimpleResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; } + if (!object.Equals(Payload, other.Payload)) return false; + if (Username != other.Username) return false; + if (OauthScope != other.OauthScope) return false; + return true; } - public static SimpleResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SimpleResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SimpleResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SimpleResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SimpleResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SimpleResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SimpleResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SimpleResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SimpleResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SimpleResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SimpleResponse MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (payload_ != null) hash ^= Payload.GetHashCode(); + if (Username.Length != 0) hash ^= Username.GetHashCode(); + if (OauthScope.Length != 0) hash ^= OauthScope.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SimpleResponse prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } + public void WriteTo(pb::CodedOutputStream output) { + if (payload_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Payload); } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; + if (Username.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Username); } - internal Builder(SimpleResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; + if (OauthScope.Length != 0) { + output.WriteRawTag(26); + output.WriteString(OauthScope); } + } - private bool resultIsReadOnly; - private SimpleResponse result; - - private SimpleResponse PrepareBuilder() { - if (resultIsReadOnly) { - SimpleResponse original = result; - result = new SimpleResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; + public int CalculateSize() { + int size = 0; + if (payload_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); } - - public override bool IsInitialized { - get { return result.IsInitialized; } + if (Username.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Username); } - - protected override SimpleResponse MessageBeingBuilt { - get { return PrepareBuilder(); } + if (OauthScope.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OauthScope); } + return size; + } - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; + public void MergeFrom(SimpleResponse other) { + if (other == null) { + return; } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); + if (other.payload_ != null) { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); } + Payload.MergeFrom(other.Payload); } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::grpc.testing.SimpleResponse.Descriptor; } - } - - public override SimpleResponse DefaultInstanceForType { - get { return global::grpc.testing.SimpleResponse.DefaultInstance; } - } - - public override SimpleResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + if (other.Username.Length != 0) { + Username = other.Username; } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SimpleResponse) { - return MergeFrom((SimpleResponse) other); - } else { - base.MergeFrom(other); - return this; - } + if (other.OauthScope.Length != 0) { + OauthScope = other.OauthScope; } + } - public override Builder MergeFrom(SimpleResponse other) { - if (other == global::grpc.testing.SimpleResponse.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPayload) { - MergePayload(other.Payload); - } - if (other.HasUsername) { - Username = other.Username; - } - if (other.HasOauthScope) { - OauthScope = other.OauthScope; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_simpleResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _simpleResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::grpc.testing.Payload.Builder subBuilder = global::grpc.testing.Payload.CreateBuilder(); - if (result.hasPayload) { - subBuilder.MergeFrom(Payload); - } - input.ReadMessage(subBuilder, extensionRegistry); - Payload = subBuilder.BuildPartial(); - break; - } - case 18: { - result.hasUsername = input.ReadString(ref result.username_); - break; - } - case 26: { - result.hasOauthScope = input.ReadString(ref result.oauthScope_); - break; + break; + case 10: { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); } + input.ReadMessage(payload_); + break; + } + case 18: { + Username = input.ReadString(); + break; + } + case 26: { + OauthScope = input.ReadString(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasPayload { - get { return result.hasPayload; } - } - public global::grpc.testing.Payload Payload { - get { return result.Payload; } - set { SetPayload(value); } - } - public Builder SetPayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = value; - return this; - } - public Builder SetPayload(global::grpc.testing.Payload.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = builderForValue.Build(); - return this; - } - public Builder MergePayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasPayload && - result.payload_ != global::grpc.testing.Payload.DefaultInstance) { - result.payload_ = global::grpc.testing.Payload.CreateBuilder(result.payload_).MergeFrom(value).BuildPartial(); - } else { - result.payload_ = value; - } - result.hasPayload = true; - return this; - } - public Builder ClearPayload() { - PrepareBuilder(); - result.hasPayload = false; - result.payload_ = null; - return this; - } - - public bool HasUsername { - get { return result.hasUsername; } - } - public string Username { - get { return result.Username; } - set { SetUsername(value); } } - public Builder SetUsername(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUsername = true; - result.username_ = value; - return this; - } - public Builder ClearUsername() { - PrepareBuilder(); - result.hasUsername = false; - result.username_ = ""; - return this; - } - - public bool HasOauthScope { - get { return result.hasOauthScope; } - } - public string OauthScope { - get { return result.OauthScope; } - set { SetOauthScope(value); } - } - public Builder SetOauthScope(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOauthScope = true; - result.oauthScope_ = value; - return this; - } - public Builder ClearOauthScope() { - PrepareBuilder(); - result.hasOauthScope = false; - result.oauthScope_ = ""; - return this; - } - } - static SimpleResponse() { - object.ReferenceEquals(global::grpc.testing.Messages.Descriptor, null); } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class StreamingInputCallRequest : pb::GeneratedMessage { - private StreamingInputCallRequest() { } - private static readonly StreamingInputCallRequest defaultInstance = new StreamingInputCallRequest().MakeReadOnly(); - private static readonly string[] _streamingInputCallRequestFieldNames = new string[] { "payload" }; - private static readonly uint[] _streamingInputCallRequestFieldTags = new uint[] { 10 }; - public static StreamingInputCallRequest DefaultInstance { - get { return defaultInstance; } + public sealed partial class StreamingInputCallRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingInputCallRequest()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.Messages.Descriptor.MessageTypes[3]; } } - public override StreamingInputCallRequest DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override StreamingInputCallRequest ThisMessage { - get { return this; } + public StreamingInputCallRequest() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_StreamingInputCallRequest__Descriptor; } + partial void OnConstruction(); + + public StreamingInputCallRequest(StreamingInputCallRequest other) : this() { + Payload = other.payload_ != null ? other.Payload.Clone() : null; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_StreamingInputCallRequest__FieldAccessorTable; } + public StreamingInputCallRequest Clone() { + return new StreamingInputCallRequest(this); } public const int PayloadFieldNumber = 1; - private bool hasPayload; - private global::grpc.testing.Payload payload_; - public bool HasPayload { - get { return hasPayload; } + private global::Grpc.Testing.Payload payload_; + public global::Grpc.Testing.Payload Payload { + get { return payload_; } + set { + payload_ = value; + } } - public global::grpc.testing.Payload Payload { - get { return payload_ ?? global::grpc.testing.Payload.DefaultInstance; } + + public override bool Equals(object other) { + return Equals(other as StreamingInputCallRequest); } - public override bool IsInitialized { - get { + public bool Equals(StreamingInputCallRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { return true; } + if (!object.Equals(Payload, other.Payload)) return false; + return true; } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _streamingInputCallRequestFieldNames; - if (hasPayload) { - output.WriteMessage(1, field_names[0], Payload); - } - UnknownFields.WriteTo(output); + public override int GetHashCode() { + int hash = 1; + if (payload_ != null) hash ^= Payload.GetHashCode(); + return hash; } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPayload) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Payload); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - public static StreamingInputCallRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StreamingInputCallRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StreamingInputCallRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StreamingInputCallRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StreamingInputCallRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StreamingInputCallRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StreamingInputCallRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StreamingInputCallRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StreamingInputCallRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StreamingInputCallRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private StreamingInputCallRequest MakeReadOnly() { - return this; + public void WriteTo(pb::CodedOutputStream output) { + if (payload_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Payload); + } } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StreamingInputCallRequest prototype) { - return new Builder(prototype); + public int CalculateSize() { + int size = 0; + if (payload_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); + } + return size; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } + public void MergeFrom(StreamingInputCallRequest other) { + if (other == null) { + return; } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(StreamingInputCallRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; + if (other.payload_ != null) { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); + } + Payload.MergeFrom(other.Payload); } + } - private bool resultIsReadOnly; - private StreamingInputCallRequest result; - - private StreamingInputCallRequest PrepareBuilder() { - if (resultIsReadOnly) { - StreamingInputCallRequest original = result; - result = new StreamingInputCallRequest(); - resultIsReadOnly = false; - MergeFrom(original); + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; + } + break; + case 10: { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); + } + input.ReadMessage(payload_); + break; + } } - return result; } + } - public override bool IsInitialized { - get { return result.IsInitialized; } - } + } - protected override StreamingInputCallRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::grpc.testing.StreamingInputCallRequest.Descriptor; } - } - - public override StreamingInputCallRequest DefaultInstanceForType { - get { return global::grpc.testing.StreamingInputCallRequest.DefaultInstance; } - } - - public override StreamingInputCallRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StreamingInputCallRequest) { - return MergeFrom((StreamingInputCallRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StreamingInputCallRequest other) { - if (other == global::grpc.testing.StreamingInputCallRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPayload) { - MergePayload(other.Payload); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_streamingInputCallRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _streamingInputCallRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::grpc.testing.Payload.Builder subBuilder = global::grpc.testing.Payload.CreateBuilder(); - if (result.hasPayload) { - subBuilder.MergeFrom(Payload); - } - input.ReadMessage(subBuilder, extensionRegistry); - Payload = subBuilder.BuildPartial(); - break; - } - } - } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class StreamingInputCallResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingInputCallResponse()); + public static pb::MessageParser Parser { get { return _parser; } } - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasPayload { - get { return result.hasPayload; } - } - public global::grpc.testing.Payload Payload { - get { return result.Payload; } - set { SetPayload(value); } - } - public Builder SetPayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = value; - return this; - } - public Builder SetPayload(global::grpc.testing.Payload.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = builderForValue.Build(); - return this; - } - public Builder MergePayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasPayload && - result.payload_ != global::grpc.testing.Payload.DefaultInstance) { - result.payload_ = global::grpc.testing.Payload.CreateBuilder(result.payload_).MergeFrom(value).BuildPartial(); - } else { - result.payload_ = value; - } - result.hasPayload = true; - return this; - } - public Builder ClearPayload() { - PrepareBuilder(); - result.hasPayload = false; - result.payload_ = null; - return this; - } + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.Messages.Descriptor.MessageTypes[4]; } } - static StreamingInputCallRequest() { - object.ReferenceEquals(global::grpc.testing.Messages.Descriptor, null); - } - } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class StreamingInputCallResponse : pb::GeneratedMessage { - private StreamingInputCallResponse() { } - private static readonly StreamingInputCallResponse defaultInstance = new StreamingInputCallResponse().MakeReadOnly(); - private static readonly string[] _streamingInputCallResponseFieldNames = new string[] { "aggregated_payload_size" }; - private static readonly uint[] _streamingInputCallResponseFieldTags = new uint[] { 8 }; - public static StreamingInputCallResponse DefaultInstance { - get { return defaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - public override StreamingInputCallResponse DefaultInstanceForType { - get { return DefaultInstance; } + public StreamingInputCallResponse() { + OnConstruction(); } - protected override StreamingInputCallResponse ThisMessage { - get { return this; } - } + partial void OnConstruction(); - public static pbd::MessageDescriptor Descriptor { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_StreamingInputCallResponse__Descriptor; } + public StreamingInputCallResponse(StreamingInputCallResponse other) : this() { + aggregatedPayloadSize_ = other.aggregatedPayloadSize_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_StreamingInputCallResponse__FieldAccessorTable; } + public StreamingInputCallResponse Clone() { + return new StreamingInputCallResponse(this); } public const int AggregatedPayloadSizeFieldNumber = 1; - private bool hasAggregatedPayloadSize; private int aggregatedPayloadSize_; - public bool HasAggregatedPayloadSize { - get { return hasAggregatedPayloadSize; } - } public int AggregatedPayloadSize { get { return aggregatedPayloadSize_; } - } - - public override bool IsInitialized { - get { - return true; + set { + aggregatedPayloadSize_ = value; } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _streamingInputCallResponseFieldNames; - if (hasAggregatedPayloadSize) { - output.WriteInt32(1, field_names[0], AggregatedPayloadSize); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as StreamingInputCallResponse); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasAggregatedPayloadSize) { - size += pb::CodedOutputStream.ComputeInt32Size(1, AggregatedPayloadSize); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(StreamingInputCallResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; } + if (AggregatedPayloadSize != other.AggregatedPayloadSize) return false; + return true; } - public static StreamingInputCallResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StreamingInputCallResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StreamingInputCallResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StreamingInputCallResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StreamingInputCallResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StreamingInputCallResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StreamingInputCallResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StreamingInputCallResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StreamingInputCallResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StreamingInputCallResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private StreamingInputCallResponse MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (AggregatedPayloadSize != 0) hash ^= AggregatedPayloadSize.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StreamingInputCallResponse prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(StreamingInputCallResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private StreamingInputCallResponse result; - - private StreamingInputCallResponse PrepareBuilder() { - if (resultIsReadOnly) { - StreamingInputCallResponse original = result; - result = new StreamingInputCallResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override StreamingInputCallResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::grpc.testing.StreamingInputCallResponse.Descriptor; } + public void WriteTo(pb::CodedOutputStream output) { + if (AggregatedPayloadSize != 0) { + output.WriteRawTag(8); + output.WriteInt32(AggregatedPayloadSize); } + } - public override StreamingInputCallResponse DefaultInstanceForType { - get { return global::grpc.testing.StreamingInputCallResponse.DefaultInstance; } + public int CalculateSize() { + int size = 0; + if (AggregatedPayloadSize != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregatedPayloadSize); } + return size; + } - public override StreamingInputCallResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + public void MergeFrom(StreamingInputCallResponse other) { + if (other == null) { + return; } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StreamingInputCallResponse) { - return MergeFrom((StreamingInputCallResponse) other); - } else { - base.MergeFrom(other); - return this; - } + if (other.AggregatedPayloadSize != 0) { + AggregatedPayloadSize = other.AggregatedPayloadSize; } + } - public override Builder MergeFrom(StreamingInputCallResponse other) { - if (other == global::grpc.testing.StreamingInputCallResponse.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasAggregatedPayloadSize) { - AggregatedPayloadSize = other.AggregatedPayloadSize; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_streamingInputCallResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _streamingInputCallResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasAggregatedPayloadSize = input.ReadInt32(ref result.aggregatedPayloadSize_); - break; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + AggregatedPayloadSize = input.ReadInt32(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasAggregatedPayloadSize { - get { return result.hasAggregatedPayloadSize; } - } - public int AggregatedPayloadSize { - get { return result.AggregatedPayloadSize; } - set { SetAggregatedPayloadSize(value); } - } - public Builder SetAggregatedPayloadSize(int value) { - PrepareBuilder(); - result.hasAggregatedPayloadSize = true; - result.aggregatedPayloadSize_ = value; - return this; } - public Builder ClearAggregatedPayloadSize() { - PrepareBuilder(); - result.hasAggregatedPayloadSize = false; - result.aggregatedPayloadSize_ = 0; - return this; - } - } - static StreamingInputCallResponse() { - object.ReferenceEquals(global::grpc.testing.Messages.Descriptor, null); } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ResponseParameters : pb::GeneratedMessage { - private ResponseParameters() { } - private static readonly ResponseParameters defaultInstance = new ResponseParameters().MakeReadOnly(); - private static readonly string[] _responseParametersFieldNames = new string[] { "interval_us", "size" }; - private static readonly uint[] _responseParametersFieldTags = new uint[] { 16, 8 }; - public static ResponseParameters DefaultInstance { - get { return defaultInstance; } + public sealed partial class ResponseParameters : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResponseParameters()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.Messages.Descriptor.MessageTypes[5]; } } - public override ResponseParameters DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override ResponseParameters ThisMessage { - get { return this; } + public ResponseParameters() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_ResponseParameters__Descriptor; } + partial void OnConstruction(); + + public ResponseParameters(ResponseParameters other) : this() { + size_ = other.size_; + intervalUs_ = other.intervalUs_; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_ResponseParameters__FieldAccessorTable; } + public ResponseParameters Clone() { + return new ResponseParameters(this); } public const int SizeFieldNumber = 1; - private bool hasSize; private int size_; - public bool HasSize { - get { return hasSize; } - } public int Size { get { return size_; } + set { + size_ = value; + } } public const int IntervalUsFieldNumber = 2; - private bool hasIntervalUs; private int intervalUs_; - public bool HasIntervalUs { - get { return hasIntervalUs; } - } public int IntervalUs { get { return intervalUs_; } - } - - public override bool IsInitialized { - get { - return true; + set { + intervalUs_ = value; } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _responseParametersFieldNames; - if (hasSize) { - output.WriteInt32(1, field_names[1], Size); - } - if (hasIntervalUs) { - output.WriteInt32(2, field_names[0], IntervalUs); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as ResponseParameters); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasSize) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Size); - } - if (hasIntervalUs) { - size += pb::CodedOutputStream.ComputeInt32Size(2, IntervalUs); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(ResponseParameters other) { + if (ReferenceEquals(other, null)) { + return false; } + if (ReferenceEquals(other, this)) { + return true; + } + if (Size != other.Size) return false; + if (IntervalUs != other.IntervalUs) return false; + return true; } - public static ResponseParameters ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ResponseParameters ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ResponseParameters ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ResponseParameters ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ResponseParameters ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ResponseParameters ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ResponseParameters ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ResponseParameters ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ResponseParameters ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ResponseParameters ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ResponseParameters MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (Size != 0) hash ^= Size.GetHashCode(); + if (IntervalUs != 0) hash ^= IntervalUs.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ResponseParameters prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ResponseParameters cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ResponseParameters result; - - private ResponseParameters PrepareBuilder() { - if (resultIsReadOnly) { - ResponseParameters original = result; - result = new ResponseParameters(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; + public void WriteTo(pb::CodedOutputStream output) { + if (Size != 0) { + output.WriteRawTag(8); + output.WriteInt32(Size); } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ResponseParameters MessageBeingBuilt { - get { return PrepareBuilder(); } + if (IntervalUs != 0) { + output.WriteRawTag(16); + output.WriteInt32(IntervalUs); } + } - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; + public int CalculateSize() { + int size = 0; + if (Size != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Size); } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::grpc.testing.ResponseParameters.Descriptor; } + if (IntervalUs != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntervalUs); } + return size; + } - public override ResponseParameters DefaultInstanceForType { - get { return global::grpc.testing.ResponseParameters.DefaultInstance; } + public void MergeFrom(ResponseParameters other) { + if (other == null) { + return; } - - public override ResponseParameters BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + if (other.Size != 0) { + Size = other.Size; } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ResponseParameters) { - return MergeFrom((ResponseParameters) other); - } else { - base.MergeFrom(other); - return this; - } + if (other.IntervalUs != 0) { + IntervalUs = other.IntervalUs; } + } - public override Builder MergeFrom(ResponseParameters other) { - if (other == global::grpc.testing.ResponseParameters.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasSize) { - Size = other.Size; - } - if (other.HasIntervalUs) { - IntervalUs = other.IntervalUs; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_responseParametersFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _responseParametersFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + Size = input.ReadInt32(); + break; } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasSize = input.ReadInt32(ref result.size_); - break; - } - case 16: { - result.hasIntervalUs = input.ReadInt32(ref result.intervalUs_); - break; - } + case 16: { + IntervalUs = input.ReadInt32(); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasSize { - get { return result.hasSize; } - } - public int Size { - get { return result.Size; } - set { SetSize(value); } - } - public Builder SetSize(int value) { - PrepareBuilder(); - result.hasSize = true; - result.size_ = value; - return this; - } - public Builder ClearSize() { - PrepareBuilder(); - result.hasSize = false; - result.size_ = 0; - return this; - } - - public bool HasIntervalUs { - get { return result.hasIntervalUs; } - } - public int IntervalUs { - get { return result.IntervalUs; } - set { SetIntervalUs(value); } } - public Builder SetIntervalUs(int value) { - PrepareBuilder(); - result.hasIntervalUs = true; - result.intervalUs_ = value; - return this; - } - public Builder ClearIntervalUs() { - PrepareBuilder(); - result.hasIntervalUs = false; - result.intervalUs_ = 0; - return this; - } - } - static ResponseParameters() { - object.ReferenceEquals(global::grpc.testing.Messages.Descriptor, null); } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class StreamingOutputCallRequest : pb::GeneratedMessage { - private StreamingOutputCallRequest() { } - private static readonly StreamingOutputCallRequest defaultInstance = new StreamingOutputCallRequest().MakeReadOnly(); - private static readonly string[] _streamingOutputCallRequestFieldNames = new string[] { "payload", "response_parameters", "response_type" }; - private static readonly uint[] _streamingOutputCallRequestFieldTags = new uint[] { 26, 18, 8 }; - public static StreamingOutputCallRequest DefaultInstance { - get { return defaultInstance; } + public sealed partial class StreamingOutputCallRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingOutputCallRequest()); + public static pb::MessageParser Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.Messages.Descriptor.MessageTypes[6]; } } - public override StreamingOutputCallRequest DefaultInstanceForType { - get { return DefaultInstance; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - protected override StreamingOutputCallRequest ThisMessage { - get { return this; } + public StreamingOutputCallRequest() { + OnConstruction(); } - public static pbd::MessageDescriptor Descriptor { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_StreamingOutputCallRequest__Descriptor; } + partial void OnConstruction(); + + public StreamingOutputCallRequest(StreamingOutputCallRequest other) : this() { + responseType_ = other.responseType_; + responseParameters_ = other.responseParameters_.Clone(); + Payload = other.payload_ != null ? other.Payload.Clone() : null; } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_StreamingOutputCallRequest__FieldAccessorTable; } + public StreamingOutputCallRequest Clone() { + return new StreamingOutputCallRequest(this); } public const int ResponseTypeFieldNumber = 1; - private bool hasResponseType; - private global::grpc.testing.PayloadType responseType_ = global::grpc.testing.PayloadType.COMPRESSABLE; - public bool HasResponseType { - get { return hasResponseType; } - } - public global::grpc.testing.PayloadType ResponseType { + private global::Grpc.Testing.PayloadType responseType_ = global::Grpc.Testing.PayloadType.COMPRESSABLE; + public global::Grpc.Testing.PayloadType ResponseType { get { return responseType_; } + set { + responseType_ = value; + } } public const int ResponseParametersFieldNumber = 2; - private pbc::PopsicleList responseParameters_ = new pbc::PopsicleList(); - public scg::IList ResponseParametersList { + private static readonly pb::FieldCodec _repeated_responseParameters_codec + = pb::FieldCodec.ForMessage(18, global::Grpc.Testing.ResponseParameters.Parser); + private readonly pbc::RepeatedField responseParameters_ = new pbc::RepeatedField(); + public pbc::RepeatedField ResponseParameters { get { return responseParameters_; } } - public int ResponseParametersCount { - get { return responseParameters_.Count; } - } - public global::grpc.testing.ResponseParameters GetResponseParameters(int index) { - return responseParameters_[index]; - } public const int PayloadFieldNumber = 3; - private bool hasPayload; - private global::grpc.testing.Payload payload_; - public bool HasPayload { - get { return hasPayload; } - } - public global::grpc.testing.Payload Payload { - get { return payload_ ?? global::grpc.testing.Payload.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; + private global::Grpc.Testing.Payload payload_; + public global::Grpc.Testing.Payload Payload { + get { return payload_; } + set { + payload_ = value; } } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _streamingOutputCallRequestFieldNames; - if (hasResponseType) { - output.WriteEnum(1, field_names[2], (int) ResponseType, ResponseType); - } - if (responseParameters_.Count > 0) { - output.WriteMessageArray(2, field_names[1], responseParameters_); - } - if (hasPayload) { - output.WriteMessage(3, field_names[0], Payload); - } - UnknownFields.WriteTo(output); + public override bool Equals(object other) { + return Equals(other as StreamingOutputCallRequest); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasResponseType) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) ResponseType); - } - foreach (global::grpc.testing.ResponseParameters element in ResponseParametersList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasPayload) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Payload); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(StreamingOutputCallRequest other) { + if (ReferenceEquals(other, null)) { + return false; } + if (ReferenceEquals(other, this)) { + return true; + } + if (ResponseType != other.ResponseType) return false; + if(!responseParameters_.Equals(other.responseParameters_)) return false; + if (!object.Equals(Payload, other.Payload)) return false; + return true; } - public static StreamingOutputCallRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StreamingOutputCallRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StreamingOutputCallRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StreamingOutputCallRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StreamingOutputCallRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StreamingOutputCallRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StreamingOutputCallRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StreamingOutputCallRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StreamingOutputCallRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StreamingOutputCallRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private StreamingOutputCallRequest MakeReadOnly() { - responseParameters_.MakeReadOnly(); - return this; + public override int GetHashCode() { + int hash = 1; + if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) hash ^= ResponseType.GetHashCode(); + hash ^= responseParameters_.GetHashCode(); + if (payload_ != null) hash ^= Payload.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StreamingOutputCallRequest prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(StreamingOutputCallRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private StreamingOutputCallRequest result; - - private StreamingOutputCallRequest PrepareBuilder() { - if (resultIsReadOnly) { - StreamingOutputCallRequest original = result; - result = new StreamingOutputCallRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; + public void WriteTo(pb::CodedOutputStream output) { + if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { + output.WriteRawTag(8); + output.WriteEnum((int) ResponseType); } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override StreamingOutputCallRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; + responseParameters_.WriteTo(output, _repeated_responseParameters_codec); + if (payload_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Payload); } + } - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } + public int CalculateSize() { + int size = 0; + if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseType); } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::grpc.testing.StreamingOutputCallRequest.Descriptor; } + size += responseParameters_.CalculateSize(_repeated_responseParameters_codec); + if (payload_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); } + return size; + } - public override StreamingOutputCallRequest DefaultInstanceForType { - get { return global::grpc.testing.StreamingOutputCallRequest.DefaultInstance; } + public void MergeFrom(StreamingOutputCallRequest other) { + if (other == null) { + return; } - - public override StreamingOutputCallRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + if (other.ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { + ResponseType = other.ResponseType; } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StreamingOutputCallRequest) { - return MergeFrom((StreamingOutputCallRequest) other); - } else { - base.MergeFrom(other); - return this; + responseParameters_.Add(other.responseParameters_); + if (other.payload_ != null) { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); } + Payload.MergeFrom(other.Payload); } + } - public override Builder MergeFrom(StreamingOutputCallRequest other) { - if (other == global::grpc.testing.StreamingOutputCallRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasResponseType) { - ResponseType = other.ResponseType; - } - if (other.responseParameters_.Count != 0) { - result.responseParameters_.Add(other.responseParameters_); - } - if (other.HasPayload) { - MergePayload(other.Payload); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_streamingOutputCallRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _streamingOutputCallRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 8: { + responseType_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); + break; } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.responseType_, out unknown)) { - result.hasResponseType = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.responseParameters_, global::grpc.testing.ResponseParameters.DefaultInstance, extensionRegistry); - break; - } - case 26: { - global::grpc.testing.Payload.Builder subBuilder = global::grpc.testing.Payload.CreateBuilder(); - if (result.hasPayload) { - subBuilder.MergeFrom(Payload); - } - input.ReadMessage(subBuilder, extensionRegistry); - Payload = subBuilder.BuildPartial(); - break; + case 18: { + responseParameters_.AddEntriesFrom(input, _repeated_responseParameters_codec); + break; + } + case 26: { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); } + input.ReadMessage(payload_); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasResponseType { - get { return result.hasResponseType; } - } - public global::grpc.testing.PayloadType ResponseType { - get { return result.ResponseType; } - set { SetResponseType(value); } - } - public Builder SetResponseType(global::grpc.testing.PayloadType value) { - PrepareBuilder(); - result.hasResponseType = true; - result.responseType_ = value; - return this; - } - public Builder ClearResponseType() { - PrepareBuilder(); - result.hasResponseType = false; - result.responseType_ = global::grpc.testing.PayloadType.COMPRESSABLE; - return this; - } - - public pbc::IPopsicleList ResponseParametersList { - get { return PrepareBuilder().responseParameters_; } - } - public int ResponseParametersCount { - get { return result.ResponseParametersCount; } - } - public global::grpc.testing.ResponseParameters GetResponseParameters(int index) { - return result.GetResponseParameters(index); - } - public Builder SetResponseParameters(int index, global::grpc.testing.ResponseParameters value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.responseParameters_[index] = value; - return this; - } - public Builder SetResponseParameters(int index, global::grpc.testing.ResponseParameters.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.responseParameters_[index] = builderForValue.Build(); - return this; - } - public Builder AddResponseParameters(global::grpc.testing.ResponseParameters value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.responseParameters_.Add(value); - return this; - } - public Builder AddResponseParameters(global::grpc.testing.ResponseParameters.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.responseParameters_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeResponseParameters(scg::IEnumerable values) { - PrepareBuilder(); - result.responseParameters_.Add(values); - return this; - } - public Builder ClearResponseParameters() { - PrepareBuilder(); - result.responseParameters_.Clear(); - return this; - } - - public bool HasPayload { - get { return result.hasPayload; } - } - public global::grpc.testing.Payload Payload { - get { return result.Payload; } - set { SetPayload(value); } - } - public Builder SetPayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = value; - return this; - } - public Builder SetPayload(global::grpc.testing.Payload.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = builderForValue.Build(); - return this; - } - public Builder MergePayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasPayload && - result.payload_ != global::grpc.testing.Payload.DefaultInstance) { - result.payload_ = global::grpc.testing.Payload.CreateBuilder(result.payload_).MergeFrom(value).BuildPartial(); - } else { - result.payload_ = value; - } - result.hasPayload = true; - return this; - } - public Builder ClearPayload() { - PrepareBuilder(); - result.hasPayload = false; - result.payload_ = null; - return this; } } - static StreamingOutputCallRequest() { - object.ReferenceEquals(global::grpc.testing.Messages.Descriptor, null); - } + } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class StreamingOutputCallResponse : pb::GeneratedMessage { - private StreamingOutputCallResponse() { } - private static readonly StreamingOutputCallResponse defaultInstance = new StreamingOutputCallResponse().MakeReadOnly(); - private static readonly string[] _streamingOutputCallResponseFieldNames = new string[] { "payload" }; - private static readonly uint[] _streamingOutputCallResponseFieldTags = new uint[] { 10 }; - public static StreamingOutputCallResponse DefaultInstance { - get { return defaultInstance; } - } + public sealed partial class StreamingOutputCallResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingOutputCallResponse()); + public static pb::MessageParser Parser { get { return _parser; } } - public override StreamingOutputCallResponse DefaultInstanceForType { - get { return DefaultInstance; } + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.Messages.Descriptor.MessageTypes[7]; } } - protected override StreamingOutputCallResponse ThisMessage { - get { return this; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } - public static pbd::MessageDescriptor Descriptor { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_StreamingOutputCallResponse__Descriptor; } + public StreamingOutputCallResponse() { + OnConstruction(); } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::grpc.testing.Messages.internal__static_grpc_testing_StreamingOutputCallResponse__FieldAccessorTable; } - } + partial void OnConstruction(); - public const int PayloadFieldNumber = 1; - private bool hasPayload; - private global::grpc.testing.Payload payload_; - public bool HasPayload { - get { return hasPayload; } - } - public global::grpc.testing.Payload Payload { - get { return payload_ ?? global::grpc.testing.Payload.DefaultInstance; } + public StreamingOutputCallResponse(StreamingOutputCallResponse other) : this() { + Payload = other.payload_ != null ? other.Payload.Clone() : null; } - public override bool IsInitialized { - get { - return true; - } + public StreamingOutputCallResponse Clone() { + return new StreamingOutputCallResponse(this); } - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _streamingOutputCallResponseFieldNames; - if (hasPayload) { - output.WriteMessage(1, field_names[0], Payload); + public const int PayloadFieldNumber = 1; + private global::Grpc.Testing.Payload payload_; + public global::Grpc.Testing.Payload Payload { + get { return payload_; } + set { + payload_ = value; } - UnknownFields.WriteTo(output); } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; + public override bool Equals(object other) { + return Equals(other as StreamingOutputCallResponse); + } - size = 0; - if (hasPayload) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Payload); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; + public bool Equals(StreamingOutputCallResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; } + if (!object.Equals(Payload, other.Payload)) return false; + return true; } - public static StreamingOutputCallResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StreamingOutputCallResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StreamingOutputCallResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StreamingOutputCallResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StreamingOutputCallResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StreamingOutputCallResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StreamingOutputCallResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StreamingOutputCallResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StreamingOutputCallResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StreamingOutputCallResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private StreamingOutputCallResponse MakeReadOnly() { - return this; + public override int GetHashCode() { + int hash = 1; + if (payload_ != null) hash ^= Payload.GetHashCode(); + return hash; } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StreamingOutputCallResponse prototype) { - return new Builder(prototype); + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(StreamingOutputCallResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private StreamingOutputCallResponse result; - - private StreamingOutputCallResponse PrepareBuilder() { - if (resultIsReadOnly) { - StreamingOutputCallResponse original = result; - result = new StreamingOutputCallResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override StreamingOutputCallResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::grpc.testing.StreamingOutputCallResponse.Descriptor; } + public void WriteTo(pb::CodedOutputStream output) { + if (payload_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Payload); } + } - public override StreamingOutputCallResponse DefaultInstanceForType { - get { return global::grpc.testing.StreamingOutputCallResponse.DefaultInstance; } + public int CalculateSize() { + int size = 0; + if (payload_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); } + return size; + } - public override StreamingOutputCallResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); + public void MergeFrom(StreamingOutputCallResponse other) { + if (other == null) { + return; } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StreamingOutputCallResponse) { - return MergeFrom((StreamingOutputCallResponse) other); - } else { - base.MergeFrom(other); - return this; + if (other.payload_ != null) { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); } + Payload.MergeFrom(other.Payload); } + } - public override Builder MergeFrom(StreamingOutputCallResponse other) { - if (other == global::grpc.testing.StreamingOutputCallResponse.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPayload) { - MergePayload(other.Payload); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_streamingOutputCallResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _streamingOutputCallResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::grpc.testing.Payload.Builder subBuilder = global::grpc.testing.Payload.CreateBuilder(); - if (result.hasPayload) { - subBuilder.MergeFrom(Payload); - } - input.ReadMessage(subBuilder, extensionRegistry); - Payload = subBuilder.BuildPartial(); - break; + break; + case 10: { + if (payload_ == null) { + payload_ = new global::Grpc.Testing.Payload(); } + input.ReadMessage(payload_); + break; } } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasPayload { - get { return result.hasPayload; } - } - public global::grpc.testing.Payload Payload { - get { return result.Payload; } - set { SetPayload(value); } - } - public Builder SetPayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = value; - return this; - } - public Builder SetPayload(global::grpc.testing.Payload.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasPayload = true; - result.payload_ = builderForValue.Build(); - return this; - } - public Builder MergePayload(global::grpc.testing.Payload value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasPayload && - result.payload_ != global::grpc.testing.Payload.DefaultInstance) { - result.payload_ = global::grpc.testing.Payload.CreateBuilder(result.payload_).MergeFrom(value).BuildPartial(); - } else { - result.payload_ = value; - } - result.hasPayload = true; - return this; - } - public Builder ClearPayload() { - PrepareBuilder(); - result.hasPayload = false; - result.payload_ = null; - return this; } } - static StreamingOutputCallResponse() { - object.ReferenceEquals(global::grpc.testing.Messages.Descriptor, null); - } + } #endregion diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index 522372582bb..1b5a30d7577 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -12,13 +12,13 @@ namespace Grpc.Testing { { static readonly string __ServiceName = "grpc.testing.TestService"; - static readonly Marshaller __Marshaller_Empty = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.Empty.ParseFrom); - static readonly Marshaller __Marshaller_SimpleRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.SimpleRequest.ParseFrom); - static readonly Marshaller __Marshaller_SimpleResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.SimpleResponse.ParseFrom); - static readonly Marshaller __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.StreamingOutputCallRequest.ParseFrom); - static readonly Marshaller __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.StreamingOutputCallResponse.ParseFrom); - static readonly Marshaller __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.StreamingInputCallRequest.ParseFrom); - static readonly Marshaller __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Testing.StreamingInputCallResponse.ParseFrom); + static readonly Marshaller __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); + static readonly Marshaller __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); + static readonly Marshaller __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); + static readonly Marshaller __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom); + static readonly Marshaller __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom); + static readonly Marshaller __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom); + static readonly Marshaller __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom); static readonly Method __Method_EmptyCall = new Method( MethodType.Unary, From 8644aeaa71c5186e0dbef97fd0f1e044bf4d3b44 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 10:21:18 -0700 Subject: [PATCH 11/26] migrated code to proto3 --- .../Grpc.Examples.MathServer/MathServer.cs | 2 +- .../MathClientServerTests.cs | 24 ++-- .../HealthClientServerTest.cs | 4 +- .../HealthServiceImplTest.cs | 2 +- .../Grpc.HealthCheck/HealthServiceImpl.cs | 6 +- .../Grpc.IntegrationTesting/InteropClient.cs | 131 ++++++++++-------- .../InteropClientServerTest.cs | 2 +- .../Grpc.IntegrationTesting/InteropServer.cs | 3 +- .../SslCredentialsTest.cs | 4 +- .../TestCredentials.cs | 2 - .../TestServiceImpl.cs | 23 ++- 11 files changed, 105 insertions(+), 98 deletions(-) diff --git a/src/csharp/Grpc.Examples.MathServer/MathServer.cs b/src/csharp/Grpc.Examples.MathServer/MathServer.cs index 5f7e717b0c8..1b71c60141e 100644 --- a/src/csharp/Grpc.Examples.MathServer/MathServer.cs +++ b/src/csharp/Grpc.Examples.MathServer/MathServer.cs @@ -34,7 +34,7 @@ using System.Runtime.InteropServices; using System.Threading; using Grpc.Core; -namespace math +namespace Math { class MainClass { diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index 205a1ae3a28..a2348defc36 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -76,7 +76,7 @@ namespace Math.Tests [Test] public void Div1() { - DivReply response = client.Div(new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build()); + DivReply response = client.Div(new DivArgs { Dividend = 10, Divisor = 3 }); Assert.AreEqual(3, response.Quotient); Assert.AreEqual(1, response.Remainder); } @@ -84,7 +84,7 @@ namespace Math.Tests [Test] public void Div2() { - DivReply response = client.Div(new DivArgs.Builder { Dividend = 0, Divisor = 1 }.Build()); + DivReply response = client.Div(new DivArgs { Dividend = 0, Divisor = 1 }); Assert.AreEqual(0, response.Quotient); Assert.AreEqual(0, response.Remainder); } @@ -94,7 +94,7 @@ namespace Math.Tests { try { - DivReply response = client.Div(new DivArgs.Builder { Dividend = 0, Divisor = 0 }.Build()); + DivReply response = client.Div(new DivArgs { Dividend = 0, Divisor = 0 }); Assert.Fail(); } catch (RpcException e) @@ -106,7 +106,7 @@ namespace Math.Tests [Test] public async Task DivAsync() { - DivReply response = await client.DivAsync(new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build()); + DivReply response = await client.DivAsync(new DivArgs { Dividend = 10, Divisor = 3 }); Assert.AreEqual(3, response.Quotient); Assert.AreEqual(1, response.Remainder); } @@ -114,7 +114,7 @@ namespace Math.Tests [Test] public async Task Fib() { - using (var call = client.Fib(new FibArgs.Builder { Limit = 6 }.Build())) + using (var call = client.Fib(new FibArgs { Limit = 6 })) { var responses = await call.ResponseStream.ToList(); CollectionAssert.AreEqual(new List { 1, 1, 2, 3, 5, 8 }, @@ -127,8 +127,7 @@ namespace Math.Tests { var cts = new CancellationTokenSource(); - using (var call = client.Fib(new FibArgs.Builder { Limit = 0 }.Build(), - cancellationToken: cts.Token)) + using (var call = client.Fib(new FibArgs { Limit = 0 }, cancellationToken: cts.Token)) { List responses = new List(); @@ -155,7 +154,7 @@ namespace Math.Tests [Test] public async Task FibWithDeadline() { - using (var call = client.Fib(new FibArgs.Builder { Limit = 0 }.Build(), + using (var call = client.Fib(new FibArgs { Limit = 0 }, deadline: DateTime.UtcNow.AddMilliseconds(500))) { try @@ -176,8 +175,7 @@ namespace Math.Tests { using (var call = client.Sum()) { - var numbers = new List { 10, 20, 30 }.ConvertAll( - n => Num.CreateBuilder().SetNum_(n).Build()); + var numbers = new List { 10, 20, 30 }.ConvertAll(n => new Num{ Num_ = n }); await call.RequestStream.WriteAll(numbers); var result = await call.ResponseAsync; @@ -190,9 +188,9 @@ namespace Math.Tests { var divArgsList = new List { - new DivArgs.Builder { Dividend = 10, Divisor = 3 }.Build(), - new DivArgs.Builder { Dividend = 100, Divisor = 21 }.Build(), - new DivArgs.Builder { Dividend = 7, Divisor = 2 }.Build() + new DivArgs { Dividend = 10, Divisor = 3 }, + new DivArgs { Dividend = 100, Divisor = 21 }, + new DivArgs { Dividend = 7, Divisor = 2 } }; using (var call = client.DivMany()) diff --git a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs index 024377e2162..98e24698f3c 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs @@ -82,14 +82,14 @@ namespace Grpc.HealthCheck.Tests { serviceImpl.SetStatus("", "", HealthCheckResponse.Types.ServingStatus.SERVING); - var response = client.Check(HealthCheckRequest.CreateBuilder().SetHost("").SetService("").Build()); + var response = client.Check(new HealthCheckRequest { Host = "", Service = "" }); Assert.AreEqual(HealthCheckResponse.Types.ServingStatus.SERVING, response.Status); } [Test] public void ServiceDoesntExist() { - Assert.Throws(Is.TypeOf(typeof(RpcException)).And.Property("Status").Property("StatusCode").EqualTo(StatusCode.NotFound), () => client.Check(HealthCheckRequest.CreateBuilder().SetHost("").SetService("nonexistent.service").Build())); + Assert.Throws(Is.TypeOf(typeof(RpcException)).And.Property("Status").Property("StatusCode").EqualTo(StatusCode.NotFound), () => client.Check(new HealthCheckRequest{ Host = "", Service = "nonexistent.service" })); } // TODO(jtattermusch): add test with timeout once timeouts are supported diff --git a/src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs b/src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs index 71844156556..04660cd3960 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/HealthServiceImplTest.cs @@ -101,7 +101,7 @@ namespace Grpc.HealthCheck.Tests private static HealthCheckResponse.Types.ServingStatus GetStatusHelper(HealthServiceImpl impl, string host, string service) { - return impl.Check(HealthCheckRequest.CreateBuilder().SetHost(host).SetService(service).Build(), null).Result.Status; + return impl.Check(new HealthCheckRequest{ Host = host, Service = service}, null).Result.Status; } } } diff --git a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs index 3c3b9c35f13..0fad62d5f16 100644 --- a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs +++ b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs @@ -99,8 +99,8 @@ namespace Grpc.HealthCheck { lock (myLock) { - var host = request.HasHost ? request.Host : ""; - var service = request.HasService ? request.Service : ""; + var host = request.Host; + var service = request.Service; HealthCheckResponse.Types.ServingStatus status; if (!statusMap.TryGetValue(CreateKey(host, service), out status)) @@ -108,7 +108,7 @@ namespace Grpc.HealthCheck // TODO(jtattermusch): returning specific status from server handler is not supported yet. throw new RpcException(new Status(StatusCode.NotFound, "")); } - return Task.FromResult(HealthCheckResponse.CreateBuilder().SetStatus(status).Build()); + return Task.FromResult(new HealthCheckResponse { Status = status }); } } diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs index 7411d91d5a7..93d0bbe7721 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs @@ -37,12 +37,12 @@ using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; -using Google.ProtocolBuffers; -using grpc.testing; using Grpc.Auth; using Grpc.Core; using Grpc.Core.Utils; +using Grpc.Testing; using NUnit.Framework; +using Google.Protobuf; namespace Grpc.IntegrationTesting { @@ -186,7 +186,7 @@ namespace Grpc.IntegrationTesting public static void RunEmptyUnary(TestService.ITestServiceClient client) { Console.WriteLine("running empty_unary"); - var response = client.EmptyCall(Empty.DefaultInstance); + var response = client.EmptyCall(new Empty()); Assert.IsNotNull(response); Console.WriteLine("Passed!"); } @@ -194,11 +194,12 @@ namespace Grpc.IntegrationTesting public static void RunLargeUnary(TestService.ITestServiceClient client) { Console.WriteLine("running large_unary"); - var request = SimpleRequest.CreateBuilder() - .SetResponseType(PayloadType.COMPRESSABLE) - .SetResponseSize(314159) - .SetPayload(CreateZerosPayload(271828)) - .Build(); + var request = new SimpleRequest + { + ResponseType = PayloadType.COMPRESSABLE, + ResponseSize = 314159, + Payload = CreateZerosPayload(271828) + }; var response = client.UnaryCall(request); @@ -211,7 +212,7 @@ namespace Grpc.IntegrationTesting { Console.WriteLine("running client_streaming"); - var bodySizes = new List { 27182, 8, 1828, 45904 }.ConvertAll((size) => StreamingInputCallRequest.CreateBuilder().SetPayload(CreateZerosPayload(size)).Build()); + var bodySizes = new List { 27182, 8, 1828, 45904 }.ConvertAll((size) => new StreamingInputCallRequest { Payload = CreateZerosPayload(size) }); using (var call = client.StreamingInputCall()) { @@ -229,11 +230,11 @@ namespace Grpc.IntegrationTesting var bodySizes = new List { 31415, 9, 2653, 58979 }; - var request = StreamingOutputCallRequest.CreateBuilder() - .SetResponseType(PayloadType.COMPRESSABLE) - .AddRangeResponseParameters(bodySizes.ConvertAll( - (size) => ResponseParameters.CreateBuilder().SetSize(size).Build())) - .Build(); + var request = new StreamingOutputCallRequest + { + ResponseType = PayloadType.COMPRESSABLE, + ResponseParameters = { bodySizes.ConvertAll((size) => new ResponseParameters { Size = size }) } + }; using (var call = client.StreamingOutputCall(request)) { @@ -253,37 +254,45 @@ namespace Grpc.IntegrationTesting using (var call = client.FullDuplexCall()) { - await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() - .SetResponseType(PayloadType.COMPRESSABLE) - .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(31415)) - .SetPayload(CreateZerosPayload(27182)).Build()); + await call.RequestStream.WriteAsync(new StreamingOutputCallRequest + { + ResponseType = PayloadType.COMPRESSABLE, + ResponseParameters = { new ResponseParameters { Size = 31415 } }, + Payload = CreateZerosPayload(27182) + }); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(31415, call.ResponseStream.Current.Payload.Body.Length); - await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() - .SetResponseType(PayloadType.COMPRESSABLE) - .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(9)) - .SetPayload(CreateZerosPayload(8)).Build()); + await call.RequestStream.WriteAsync(new StreamingOutputCallRequest + { + ResponseType = PayloadType.COMPRESSABLE, + ResponseParameters = { new ResponseParameters { Size = 9 } }, + Payload = CreateZerosPayload(8) + }); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(9, call.ResponseStream.Current.Payload.Body.Length); - await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() - .SetResponseType(PayloadType.COMPRESSABLE) - .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(2653)) - .SetPayload(CreateZerosPayload(1828)).Build()); + await call.RequestStream.WriteAsync(new StreamingOutputCallRequest + { + ResponseType = PayloadType.COMPRESSABLE, + ResponseParameters = { new ResponseParameters { Size = 2653 } }, + Payload = CreateZerosPayload(1828) + }); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(2653, call.ResponseStream.Current.Payload.Body.Length); - await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() - .SetResponseType(PayloadType.COMPRESSABLE) - .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(58979)) - .SetPayload(CreateZerosPayload(45904)).Build()); + await call.RequestStream.WriteAsync(new StreamingOutputCallRequest + { + ResponseType = PayloadType.COMPRESSABLE, + ResponseParameters = { new ResponseParameters { Size = 58979 } }, + Payload = CreateZerosPayload(45904) + }); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); @@ -312,13 +321,14 @@ namespace Grpc.IntegrationTesting public static void RunServiceAccountCreds(TestService.ITestServiceClient client) { Console.WriteLine("running service_account_creds"); - var request = SimpleRequest.CreateBuilder() - .SetResponseType(PayloadType.COMPRESSABLE) - .SetResponseSize(314159) - .SetPayload(CreateZerosPayload(271828)) - .SetFillUsername(true) - .SetFillOauthScope(true) - .Build(); + var request = new SimpleRequest + { + ResponseType = PayloadType.COMPRESSABLE, + ResponseSize = 314159, + Payload = CreateZerosPayload(271828), + FillUsername = true, + FillOauthScope = true + }; var response = client.UnaryCall(request); @@ -332,13 +342,14 @@ namespace Grpc.IntegrationTesting public static void RunComputeEngineCreds(TestService.ITestServiceClient client) { Console.WriteLine("running compute_engine_creds"); - var request = SimpleRequest.CreateBuilder() - .SetResponseType(PayloadType.COMPRESSABLE) - .SetResponseSize(314159) - .SetPayload(CreateZerosPayload(271828)) - .SetFillUsername(true) - .SetFillOauthScope(true) - .Build(); + var request = new SimpleRequest + { + ResponseType = PayloadType.COMPRESSABLE, + ResponseSize = 314159, + Payload = CreateZerosPayload(271828), + FillUsername = true, + FillOauthScope = true + }; var response = client.UnaryCall(request); @@ -358,10 +369,11 @@ namespace Grpc.IntegrationTesting client.HeaderInterceptor = OAuth2Interceptors.FromAccessToken(oauth2Token); - var request = SimpleRequest.CreateBuilder() - .SetFillUsername(true) - .SetFillOauthScope(true) - .Build(); + var request = new SimpleRequest + { + FillUsername = true, + FillOauthScope = true + }; var response = client.UnaryCall(request); @@ -379,10 +391,11 @@ namespace Grpc.IntegrationTesting string oauth2Token = credential.Token.AccessToken; var headerInterceptor = OAuth2Interceptors.FromAccessToken(oauth2Token); - var request = SimpleRequest.CreateBuilder() - .SetFillUsername(true) - .SetFillOauthScope(true) - .Build(); + var request = new SimpleRequest + { + FillUsername = true, + FillOauthScope = true + }; var headers = new Metadata(); headerInterceptor(headers); @@ -424,10 +437,12 @@ namespace Grpc.IntegrationTesting var cts = new CancellationTokenSource(); using (var call = client.FullDuplexCall(cancellationToken: cts.Token)) { - await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() - .SetResponseType(PayloadType.COMPRESSABLE) - .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(31415)) - .SetPayload(CreateZerosPayload(27182)).Build()); + await call.RequestStream.WriteAsync(new StreamingOutputCallRequest + { + ResponseType = PayloadType.COMPRESSABLE, + ResponseParameters = { new ResponseParameters { Size = 31415 } }, + Payload = CreateZerosPayload(27182) + }); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); @@ -452,12 +467,12 @@ namespace Grpc.IntegrationTesting public static void RunBenchmarkEmptyUnary(TestService.ITestServiceClient client) { BenchmarkUtil.RunBenchmark(10000, 10000, - () => { client.EmptyCall(Empty.DefaultInstance); }); + () => { client.EmptyCall(new Empty()); }); } private static Payload CreateZerosPayload(int size) { - return Payload.CreateBuilder().SetBody(ByteString.CopyFrom(new byte[size])).Build(); + return new Payload { Body = ByteString.CopyFrom(new byte[size]) }; } private static ClientOptions ParseArguments(string[] args) diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs index 6fa721bc1cc..a827aedbdd4 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs @@ -36,9 +36,9 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; -using grpc.testing; using Grpc.Core; using Grpc.Core.Utils; +using Grpc.Testing; using NUnit.Framework; namespace Grpc.IntegrationTesting diff --git a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs index 504fd118571..dea0ce752b2 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs @@ -37,10 +37,9 @@ using System.Diagnostics; using System.IO; using System.Text.RegularExpressions; using System.Threading.Tasks; -using Google.ProtocolBuffers; -using grpc.testing; using Grpc.Core; using Grpc.Core.Utils; +using Grpc.Testing; using NUnit.Framework; namespace Grpc.IntegrationTesting diff --git a/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs b/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs index 1c398eb84eb..08a2d9b31c1 100644 --- a/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs @@ -37,9 +37,9 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; -using grpc.testing; using Grpc.Core; using Grpc.Core.Utils; +using Grpc.Testing; using NUnit.Framework; namespace Grpc.IntegrationTesting @@ -93,7 +93,7 @@ namespace Grpc.IntegrationTesting [Test] public void AuthenticatedClientAndServer() { - var response = client.UnaryCall(SimpleRequest.CreateBuilder().SetResponseSize(10).Build()); + var response = client.UnaryCall(new SimpleRequest { ResponseSize = 10 }); Assert.AreEqual(10, response.Payload.Body.Length); } } diff --git a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs index da0b7fb910b..7a48d6e92ed 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs @@ -37,8 +37,6 @@ using System.Diagnostics; using System.IO; using System.Text.RegularExpressions; using System.Threading.Tasks; -using Google.ProtocolBuffers; -using grpc.testing; using Grpc.Core; using Grpc.Core.Utils; using NUnit.Framework; diff --git a/src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs b/src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs index ccf9fe6ced6..4ab1266f25c 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs @@ -35,11 +35,11 @@ using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Google.ProtocolBuffers; +using Google.Protobuf; using Grpc.Core; using Grpc.Core.Utils; -namespace grpc.testing +namespace Grpc.Testing { /// /// Implementation of TestService server @@ -48,22 +48,20 @@ namespace grpc.testing { public Task EmptyCall(Empty request, ServerCallContext context) { - return Task.FromResult(Empty.DefaultInstance); + return Task.FromResult(new Empty()); } public Task UnaryCall(SimpleRequest request, ServerCallContext context) { - var response = SimpleResponse.CreateBuilder() - .SetPayload(CreateZerosPayload(request.ResponseSize)).Build(); + var response = new SimpleResponse { Payload = CreateZerosPayload(request.ResponseSize) }; return Task.FromResult(response); } public async Task StreamingOutputCall(StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context) { - foreach (var responseParam in request.ResponseParametersList) + foreach (var responseParam in request.ResponseParameters) { - var response = StreamingOutputCallResponse.CreateBuilder() - .SetPayload(CreateZerosPayload(responseParam.Size)).Build(); + var response = new StreamingOutputCallResponse { Payload = CreateZerosPayload(responseParam.Size) }; await responseStream.WriteAsync(response); } } @@ -75,17 +73,16 @@ namespace grpc.testing { sum += request.Payload.Body.Length; }); - return StreamingInputCallResponse.CreateBuilder().SetAggregatedPayloadSize(sum).Build(); + return new StreamingInputCallResponse { AggregatedPayloadSize = sum }; } public async Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { await requestStream.ForEach(async request => { - foreach (var responseParam in request.ResponseParametersList) + foreach (var responseParam in request.ResponseParameters) { - var response = StreamingOutputCallResponse.CreateBuilder() - .SetPayload(CreateZerosPayload(responseParam.Size)).Build(); + var response = new StreamingOutputCallResponse { Payload = CreateZerosPayload(responseParam.Size) }; await responseStream.WriteAsync(response); } }); @@ -98,7 +95,7 @@ namespace grpc.testing private static Payload CreateZerosPayload(int size) { - return Payload.CreateBuilder().SetBody(ByteString.CopyFrom(new byte[size])).Build(); + return new Payload { Body = ByteString.CopyFrom(new byte[size]) }; } } } From 9ee27e10bac6f2406dd49e376206c084febbd169 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 10:32:48 -0700 Subject: [PATCH 12/26] service descriptor --- src/csharp/Grpc.Examples/MathGrpc.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index c0cab6e4695..42372d59a38 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -45,6 +45,12 @@ namespace Math { __Marshaller_Num, __Marshaller_Num); + // service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Math.Proto.Math.Descriptor.Services[0]; } + } + // client interface public interface IMathClient { From e6af5d10ec7575645359db4b8a529f026815df16 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Aug 2015 10:57:43 -0700 Subject: [PATCH 13/26] add service descriptor property to generated code --- src/compiler/csharp_generator.cc | 12 ++++++++++++ src/compiler/csharp_generator.h | 1 + src/csharp/Grpc.Examples/MathGrpc.cs | 2 +- src/csharp/Grpc.HealthCheck/HealthGrpc.cs | 6 ++++++ src/csharp/Grpc.IntegrationTesting/TestGrpc.cs | 6 ++++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index 8a600904e7b..51d8d982e2d 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -44,6 +44,7 @@ using google::protobuf::compiler::csharp::GetFileNamespace; using google::protobuf::compiler::csharp::GetClassName; using google::protobuf::compiler::csharp::GetUmbrellaClassName; +using google::protobuf::SimpleItoa; using grpc::protobuf::FileDescriptor; using grpc::protobuf::Descriptor; using grpc::protobuf::ServiceDescriptor; @@ -226,6 +227,16 @@ void GenerateStaticMethodField(Printer* out, const MethodDescriptor *method) { out->Outdent(); } +void GenerateServiceDescriptorProperty(Printer* out, const ServiceDescriptor *service) { + out->Print("// service descriptor\n"); + out->Print("public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor\n"); + out->Print("{\n"); + out->Print(" get { return $umbrella$.Descriptor.Services[$index$]; }\n", + "umbrella", GetUmbrellaClassName(service->file()), "index", SimpleItoa(service->index())); + out->Print("}\n"); + out->Print("\n"); +} + void GenerateClientInterface(Printer* out, const ServiceDescriptor *service) { out->Print("// client interface\n"); out->Print("public interface $name$\n", "name", @@ -472,6 +483,7 @@ void GenerateService(Printer* out, const ServiceDescriptor *service) { for (int i = 0; i < service->method_count(); i++) { GenerateStaticMethodField(out, service->method(i)); } + GenerateServiceDescriptorProperty(out, service); GenerateClientInterface(out, service); GenerateServerInterface(out, service); GenerateClientStub(out, service); diff --git a/src/compiler/csharp_generator.h b/src/compiler/csharp_generator.h index 0610f5e9fba..67e3ee30b54 100644 --- a/src/compiler/csharp_generator.h +++ b/src/compiler/csharp_generator.h @@ -39,6 +39,7 @@ using namespace std; #include +#include namespace grpc_csharp_generator { diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 42372d59a38..2e98f2166cc 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -48,7 +48,7 @@ namespace Math { // service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Math.Proto.Math.Descriptor.Services[0]; } + get { return global::Math.Proto.Math.Descriptor.Services[0]; } } // client interface diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 9d452b0732f..da721ce5f6a 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -22,6 +22,12 @@ namespace Grpc.Health.V1Alpha { __Marshaller_HealthCheckRequest, __Marshaller_HealthCheckResponse); + // service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Grpc.Health.V1Alpha.Proto.Health.Descriptor.Services[0]; } + } + // client interface public interface IHealthClient { diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index 1b5a30d7577..71e701b624b 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -62,6 +62,12 @@ namespace Grpc.Testing { __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); + // service descriptor + public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor + { + get { return global::Grpc.Testing.Test.Descriptor.Services[0]; } + } + // client interface public interface ITestServiceClient { From 429a12f98cff4ab60ebc1a5d1e60a20ee36c79a4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 8 Aug 2015 00:35:50 -0700 Subject: [PATCH 14/26] upgrade to latest protobuf --- third_party/protobuf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/protobuf b/third_party/protobuf index 415f72e0791..e58cdbd2146 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit 415f72e07919cefdd7768f6460de9f32576c3248 +Subproject commit e58cdbd2146bc8e2e2f5bf4bc8a7576f82535ae6 From 38536a7c77b6edc9d02221d88163757e01714987 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 8 Aug 2015 00:45:52 -0700 Subject: [PATCH 15/26] regenerate protos --- src/csharp/Grpc.Examples/Math.cs | 40 +++--------- src/csharp/Grpc.Examples/MathGrpc.cs | 28 +++----- src/csharp/Grpc.HealthCheck/Health.cs | 16 ++--- src/csharp/Grpc.IntegrationTesting/Empty.cs | 8 +-- .../Grpc.IntegrationTesting/Messages.cs | 64 +++++-------------- .../Grpc.IntegrationTesting/TestGrpc.cs | 43 +++++-------- 6 files changed, 58 insertions(+), 141 deletions(-) diff --git a/src/csharp/Grpc.Examples/Math.cs b/src/csharp/Grpc.Examples/Math.cs index 953895e9705..d0e1ee8aae5 100644 --- a/src/csharp/Grpc.Examples/Math.cs +++ b/src/csharp/Grpc.Examples/Math.cs @@ -156,14 +156,10 @@ namespace Math { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { Dividend = input.ReadInt64(); @@ -288,14 +284,10 @@ namespace Math { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { Quotient = input.ReadInt64(); @@ -398,14 +390,10 @@ namespace Math { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { Limit = input.ReadInt64(); @@ -504,14 +492,10 @@ namespace Math { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { Num_ = input.ReadInt64(); @@ -610,14 +594,10 @@ namespace Math { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { Count = input.ReadInt64(); diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 2e98f2166cc..175d110f764 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -54,24 +54,16 @@ namespace Math { // client interface public interface IMathClient { -<<<<<<< HEAD - global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - global::math.DivReply Div(global::math.DivArgs request, CallOptions options); - AsyncUnaryCall DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncUnaryCall DivAsync(global::math.DivArgs request, CallOptions options); - AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncDuplexStreamingCall DivMany(CallOptions options); - AsyncServerStreamingCall Fib(global::math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncServerStreamingCall Fib(global::math.FibArgs request, CallOptions options); - AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncClientStreamingCall Sum(CallOptions options); -======= global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options); AsyncUnaryCall DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall DivAsync(global::Math.DivArgs request, CallOptions options); AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncDuplexStreamingCall DivMany(CallOptions options); AsyncServerStreamingCall Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncServerStreamingCall Fib(global::Math.FibArgs request, CallOptions options); AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); ->>>>>>> 708e8de... regenerate protos + AsyncClientStreamingCall Sum(CallOptions options); } // server-side interface @@ -94,7 +86,7 @@ namespace Math { var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken)); return Calls.BlockingUnaryCall(call, request); } - public global::math.DivReply Div(global::math.DivArgs request, CallOptions options) + public global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options) { var call = CreateCall(__Method_Div, options); return Calls.BlockingUnaryCall(call, request); @@ -104,7 +96,7 @@ namespace Math { var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncUnaryCall(call, request); } - public AsyncUnaryCall DivAsync(global::math.DivArgs request, CallOptions options) + public AsyncUnaryCall DivAsync(global::Math.DivArgs request, CallOptions options) { var call = CreateCall(__Method_Div, options); return Calls.AsyncUnaryCall(call, request); @@ -114,7 +106,7 @@ namespace Math { var call = CreateCall(__Method_DivMany, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncDuplexStreamingCall(call); } - public AsyncDuplexStreamingCall DivMany(CallOptions options) + public AsyncDuplexStreamingCall DivMany(CallOptions options) { var call = CreateCall(__Method_DivMany, options); return Calls.AsyncDuplexStreamingCall(call); @@ -124,7 +116,7 @@ namespace Math { var call = CreateCall(__Method_Fib, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncServerStreamingCall(call, request); } - public AsyncServerStreamingCall Fib(global::math.FibArgs request, CallOptions options) + public AsyncServerStreamingCall Fib(global::Math.FibArgs request, CallOptions options) { var call = CreateCall(__Method_Fib, options); return Calls.AsyncServerStreamingCall(call, request); @@ -134,7 +126,7 @@ namespace Math { var call = CreateCall(__Method_Sum, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncClientStreamingCall(call); } - public AsyncClientStreamingCall Sum(CallOptions options) + public AsyncClientStreamingCall Sum(CallOptions options) { var call = CreateCall(__Method_Sum, options); return Calls.AsyncClientStreamingCall(call); diff --git a/src/csharp/Grpc.HealthCheck/Health.cs b/src/csharp/Grpc.HealthCheck/Health.cs index de65c1a9de8..570e274544e 100644 --- a/src/csharp/Grpc.HealthCheck/Health.cs +++ b/src/csharp/Grpc.HealthCheck/Health.cs @@ -153,14 +153,10 @@ namespace Grpc.Health.V1Alpha { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 10: { Host = input.ReadString(); @@ -263,14 +259,10 @@ namespace Grpc.Health.V1Alpha { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { status_ = (global::Grpc.Health.V1Alpha.HealthCheckResponse.Types.ServingStatus) input.ReadEnum(); diff --git a/src/csharp/Grpc.IntegrationTesting/Empty.cs b/src/csharp/Grpc.IntegrationTesting/Empty.cs index fc8ea3889cb..28c28c9afd5 100644 --- a/src/csharp/Grpc.IntegrationTesting/Empty.cs +++ b/src/csharp/Grpc.IntegrationTesting/Empty.cs @@ -100,14 +100,10 @@ namespace Grpc.Testing { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; } } diff --git a/src/csharp/Grpc.IntegrationTesting/Messages.cs b/src/csharp/Grpc.IntegrationTesting/Messages.cs index e5a9f382b6c..a3cbb7d76eb 100644 --- a/src/csharp/Grpc.IntegrationTesting/Messages.cs +++ b/src/csharp/Grpc.IntegrationTesting/Messages.cs @@ -176,14 +176,10 @@ namespace Grpc.Testing { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { type_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); @@ -377,14 +373,10 @@ namespace Grpc.Testing { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { responseType_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); @@ -549,14 +541,10 @@ namespace Grpc.Testing { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 10: { if (payload_ == null) { @@ -669,14 +657,10 @@ namespace Grpc.Testing { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 10: { if (payload_ == null) { @@ -778,14 +762,10 @@ namespace Grpc.Testing { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { AggregatedPayloadSize = input.ReadInt32(); @@ -906,14 +886,10 @@ namespace Grpc.Testing { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { Size = input.ReadInt32(); @@ -1055,14 +1031,10 @@ namespace Grpc.Testing { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 8: { responseType_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); @@ -1175,14 +1147,10 @@ namespace Grpc.Testing { public void MergeFrom(pb::CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) { + while ((tag = input.ReadTag()) != 0) { switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } + input.SkipLastField(); break; case 10: { if (payload_ == null) { diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index 71e701b624b..f63e1484759 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -71,33 +71,22 @@ namespace Grpc.Testing { // client interface public interface ITestServiceClient { -<<<<<<< HEAD - global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CallOptions options); - AsyncUnaryCall EmptyCallAsync(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncUnaryCall EmptyCallAsync(global::grpc.testing.Empty request, CallOptions options); - global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CallOptions options); - AsyncUnaryCall UnaryCallAsync(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncUnaryCall UnaryCallAsync(global::grpc.testing.SimpleRequest request, CallOptions options); - AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CallOptions options); - AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncClientStreamingCall StreamingInputCall(CallOptions options); - AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncDuplexStreamingCall FullDuplexCall(CallOptions options); - AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - AsyncDuplexStreamingCall HalfDuplexCall(CallOptions options); -======= global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options); AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options); global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options); AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options); AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options); AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncClientStreamingCall StreamingInputCall(CallOptions options); AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + AsyncDuplexStreamingCall FullDuplexCall(CallOptions options); AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); ->>>>>>> 708e8de... regenerate protos + AsyncDuplexStreamingCall HalfDuplexCall(CallOptions options); } // server-side interface @@ -122,7 +111,7 @@ namespace Grpc.Testing { var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.BlockingUnaryCall(call, request); } - public global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CallOptions options) + public global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options) { var call = CreateCall(__Method_EmptyCall, options); return Calls.BlockingUnaryCall(call, request); @@ -132,7 +121,7 @@ namespace Grpc.Testing { var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncUnaryCall(call, request); } - public AsyncUnaryCall EmptyCallAsync(global::grpc.testing.Empty request, CallOptions options) + public AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options) { var call = CreateCall(__Method_EmptyCall, options); return Calls.AsyncUnaryCall(call, request); @@ -142,7 +131,7 @@ namespace Grpc.Testing { var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.BlockingUnaryCall(call, request); } - public global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CallOptions options) + public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) { var call = CreateCall(__Method_UnaryCall, options); return Calls.BlockingUnaryCall(call, request); @@ -152,7 +141,7 @@ namespace Grpc.Testing { var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncUnaryCall(call, request); } - public AsyncUnaryCall UnaryCallAsync(global::grpc.testing.SimpleRequest request, CallOptions options) + public AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) { var call = CreateCall(__Method_UnaryCall, options); return Calls.AsyncUnaryCall(call, request); @@ -162,7 +151,7 @@ namespace Grpc.Testing { var call = CreateCall(__Method_StreamingOutputCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncServerStreamingCall(call, request); } - public AsyncServerStreamingCall StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CallOptions options) + public AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options) { var call = CreateCall(__Method_StreamingOutputCall, options); return Calls.AsyncServerStreamingCall(call, request); @@ -172,7 +161,7 @@ namespace Grpc.Testing { var call = CreateCall(__Method_StreamingInputCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncClientStreamingCall(call); } - public AsyncClientStreamingCall StreamingInputCall(CallOptions options) + public AsyncClientStreamingCall StreamingInputCall(CallOptions options) { var call = CreateCall(__Method_StreamingInputCall, options); return Calls.AsyncClientStreamingCall(call); @@ -182,7 +171,7 @@ namespace Grpc.Testing { var call = CreateCall(__Method_FullDuplexCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncDuplexStreamingCall(call); } - public AsyncDuplexStreamingCall FullDuplexCall(CallOptions options) + public AsyncDuplexStreamingCall FullDuplexCall(CallOptions options) { var call = CreateCall(__Method_FullDuplexCall, options); return Calls.AsyncDuplexStreamingCall(call); @@ -192,7 +181,7 @@ namespace Grpc.Testing { var call = CreateCall(__Method_HalfDuplexCall, new CallOptions(headers, deadline, cancellationToken)); return Calls.AsyncDuplexStreamingCall(call); } - public AsyncDuplexStreamingCall HalfDuplexCall(CallOptions options) + public AsyncDuplexStreamingCall HalfDuplexCall(CallOptions options) { var call = CreateCall(__Method_HalfDuplexCall, options); return Calls.AsyncDuplexStreamingCall(call); From 4ef39ce75b243aede42e06e3d549c15f837fa517 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 8 Aug 2015 01:19:51 -0700 Subject: [PATCH 16/26] switched to protobuf from 20150808 --- src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj | 5 +++-- src/csharp/Grpc.Examples.Tests/packages.config | 2 +- src/csharp/Grpc.Examples/Grpc.Examples.csproj | 5 +++-- src/csharp/Grpc.Examples/packages.config | 2 +- .../Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj | 5 +++-- src/csharp/Grpc.HealthCheck.Tests/packages.config | 2 +- src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj | 5 +++-- src/csharp/Grpc.HealthCheck/packages.config | 2 +- .../Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj | 5 +++-- src/csharp/Grpc.IntegrationTesting/packages.config | 2 +- 10 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index 7eea632f36d..cb5707a53a1 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -37,8 +37,9 @@ C:\keys\Grpc.snk - - ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config index 7266fa1763c..ebcf575362e 100644 --- a/src/csharp/Grpc.Examples.Tests/packages.config +++ b/src/csharp/Grpc.Examples.Tests/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index 1ba1ed60819..26df9c92239 100644 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -37,8 +37,9 @@ C:\keys\Grpc.snk - - ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll diff --git a/src/csharp/Grpc.Examples/packages.config b/src/csharp/Grpc.Examples/packages.config index adf8da2363d..915995af40d 100644 --- a/src/csharp/Grpc.Examples/packages.config +++ b/src/csharp/Grpc.Examples/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index ca24874d669..3723dd3fb54 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -37,8 +37,9 @@ C:\keys\Grpc.snk - - ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config index 40ffb852031..a839c9d7ddc 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/packages.config +++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj index c9eb862f487..2f54fb0844d 100644 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj @@ -38,8 +38,9 @@ C:\keys\Grpc.snk - - ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll diff --git a/src/csharp/Grpc.HealthCheck/packages.config b/src/csharp/Grpc.HealthCheck/packages.config index cafff6123a3..5d140125321 100644 --- a/src/csharp/Grpc.HealthCheck/packages.config +++ b/src/csharp/Grpc.HealthCheck/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index 38a3961837d..24a7d2e7eba 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -41,8 +41,9 @@ ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll - - ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config index 7b7bc42ff4f..10612a1cbf1 100644 --- a/src/csharp/Grpc.IntegrationTesting/packages.config +++ b/src/csharp/Grpc.IntegrationTesting/packages.config @@ -3,7 +3,7 @@ - + From a96167c0e2cbbd85e1712947d2ed32f7d34bcfc7 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 8 Aug 2015 01:31:33 -0700 Subject: [PATCH 17/26] setup build packages to build preview version --- src/csharp/Grpc.Core/VersionInfo.cs | 2 +- src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec | 2 +- src/csharp/build_packages.bat | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index 656a3d47bbe..eb55af8a138 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -8,6 +8,6 @@ namespace Grpc.Core /// /// Current version of gRPC /// - public const string CurrentVersion = "0.6.0"; + public const string CurrentVersion = "0.7.0"; } } diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec index acdfba42c81..66386288df1 100644 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.nuspec @@ -14,7 +14,7 @@ Copyright 2015, Google Inc. gRPC health check - + diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index 9e1253bf0bd..395fb439701 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -1,8 +1,9 @@ @rem Builds gRPC NuGet packages @rem Current package versions -set VERSION=0.6.0 -set CORE_VERSION=0.10.0 +set VERSION=0.7.0-preview20150808 +set CORE_VERSION=0.11.0-preview20150808 +set PROTOBUF_VERSION=3.0.0-a20150808-e58cdbd214 @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe @@ -17,7 +18,7 @@ endlocal %NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp_ext.nuspec -Version %CORE_VERSION% || goto :error %NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error %NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% -Properties GrpcNativeCsharpExtVersion=%CORE_VERSION% || goto :error -%NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION% || goto :error +%NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error %NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error From 012b2e9489bb6f36f05b9af35dd0ca70337cf428 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 8 Aug 2015 01:44:07 -0700 Subject: [PATCH 18/26] update Grpc.Tools.nuspec --- src/csharp/Grpc.Tools.nuspec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/csharp/Grpc.Tools.nuspec b/src/csharp/Grpc.Tools.nuspec index eabf5dc7dbc..b6e116f537d 100644 --- a/src/csharp/Grpc.Tools.nuspec +++ b/src/csharp/Grpc.Tools.nuspec @@ -4,19 +4,18 @@ Grpc.Tools gRPC C# Tools Tools for C# implementation of gRPC - an RPC library and framework - Precompiled Windows binaries for generating protocol buffer messages and gRPC client/server code + Precompiled Windows binary for generating gRPC client/server code $version$ Google Inc. grpc-packages https://github.com/grpc/grpc/blob/master/LICENSE https://github.com/grpc/grpc false - protoc.exe - protocol buffer compiler v3.0.0-alpha-3; grpc_csharp_plugin.exe - gRPC C# protoc plugin version $version$ + grpc_csharp_plugin.exe - gRPC C# protoc plugin version $version$ Copyright 2015, Google Inc. gRPC RPC Protocol HTTP/2 - From 214cd59ae0752bd7a98bc15ce26ecdab7e1d671a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 8 Aug 2015 02:18:43 -0700 Subject: [PATCH 19/26] update .props for protobuf --- vsprojects/protobuf.props | 2 +- vsprojects/protoc.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vsprojects/protobuf.props b/vsprojects/protobuf.props index d2685f7762b..4a3c49266f0 100644 --- a/vsprojects/protobuf.props +++ b/vsprojects/protobuf.props @@ -6,7 +6,7 @@ libprotobuf.lib;%(AdditionalDependencies) - $(ProjectDir)\..\..\third_party\protobuf\vsprojects\$(Configuration);%(AdditionalLibraryDirectories) + $(ProjectDir)\..\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories) diff --git a/vsprojects/protoc.props b/vsprojects/protoc.props index 6024022690f..fc89694633d 100644 --- a/vsprojects/protoc.props +++ b/vsprojects/protoc.props @@ -6,7 +6,7 @@ libprotoc.lib;%(AdditionalDependencies) - $(ProjectDir)\..\..\third_party\protobuf\vsprojects\$(Configuration);%(AdditionalLibraryDirectories) + $(ProjectDir)\..\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories) From 448672ea2a321cc891eb7f0483d5e5e995b79054 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 8 Aug 2015 16:47:56 -0700 Subject: [PATCH 20/26] update instructions to build protoc plugins --- vsprojects/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vsprojects/README.md b/vsprojects/README.md index e6cbf833590..05c13bb8664 100644 --- a/vsprojects/README.md +++ b/vsprojects/README.md @@ -80,7 +80,10 @@ Individual tests can be run by directly running the executable in `/vsprojects/r For generating service stub code, gRPC relies on plugins for `protoc` (the protocol buffer compiler). The solution `grpc_protoc_plugins.sln` allows you to build Windows .exe binaries of gRPC protoc plugins. -1. Open solution `third_party\protobuf\vsprojects\protobuf.sln` -2. Accept the conversion to newer Visual Studio version and ignore errors about gtest. -3. Build libprotoc in Release mode. -4. Open solution `vsprojects\grpc_protoc_plugins.sln` and build it in Release mode. As a result, you should obtain a set of gRPC protoc plugin binaries (`grpc_cpp_plugin.exe`, `grpc_csharp_plugin.exe`, ...) +1. Follow instructions in `third_party\protobuf\cmake\README.md` to create Visual Studio 2013 projects for protobuf. +``` +$ cd third_party/protobuf/cmake +$ cmake -G "Visual Studio 12 2013" +``` + +2. Open solution `vsprojects\grpc_protoc_plugins.sln` and build it in Release mode. As a result, you should obtain a set of gRPC protoc plugin binaries (`grpc_cpp_plugin.exe`, `grpc_csharp_plugin.exe`, ...) From d9a8fb207e0c1792cdabb80dbd442fbba0958371 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 8 Aug 2015 18:40:51 -0700 Subject: [PATCH 21/26] add protobuf.props to plugin projects --- templates/vsprojects/vcxproj_defs.include | 2 +- vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj | 1 + vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj | 1 + .../grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj | 1 + vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj | 1 + vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/vsprojects/vcxproj_defs.include b/templates/vsprojects/vcxproj_defs.include index 507c9a52042..b1ed89897f1 100644 --- a/templates/vsprojects/vcxproj_defs.include +++ b/templates/vsprojects/vcxproj_defs.include @@ -23,7 +23,7 @@ props.extend(['cpptest']) if configuration_type == 'Application': if target.build == 'protoc': - props.extend(['protoc']) + props.extend(['protoc', 'protobuf']) else: props.extend(['winsock', 'protobuf', 'zlib', 'openssl']) else: diff --git a/vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj b/vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj index 1693a48438a..1fd03e185d4 100644 --- a/vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj +++ b/vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj @@ -48,6 +48,7 @@ + diff --git a/vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj b/vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj index aae82723e44..2d63a8496ba 100644 --- a/vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj +++ b/vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj @@ -48,6 +48,7 @@ + diff --git a/vsprojects/grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj b/vsprojects/grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj index 07a837a8042..46e064f3e35 100644 --- a/vsprojects/grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj +++ b/vsprojects/grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj @@ -48,6 +48,7 @@ + diff --git a/vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj b/vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj index 02bab1c61b5..a1e3a4aa6c6 100644 --- a/vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj +++ b/vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj @@ -48,6 +48,7 @@ + diff --git a/vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj b/vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj index 4763d148580..7f316785300 100644 --- a/vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj +++ b/vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj @@ -48,6 +48,7 @@ + From d37e5e865a07968ce56e43aaf345673bc98466ef Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 13 Aug 2015 09:48:48 -0700 Subject: [PATCH 22/26] upgrade protobuf to the latest version --- third_party/protobuf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/protobuf b/third_party/protobuf index e58cdbd2146..2093749caf6 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit e58cdbd2146bc8e2e2f5bf4bc8a7576f82535ae6 +Subproject commit 2093749caf6add1f1be63194e585fffd5ef98ecb From 23df064b34abc25bf0ab6f5d1451a8b80744a53a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 13 Aug 2015 10:00:56 -0700 Subject: [PATCH 23/26] update instructions on building protoc plugins --- vsprojects/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vsprojects/README.md b/vsprojects/README.md index 05c13bb8664..b95b468465c 100644 --- a/vsprojects/README.md +++ b/vsprojects/README.md @@ -86,4 +86,6 @@ $ cd third_party/protobuf/cmake $ cmake -G "Visual Studio 12 2013" ``` -2. Open solution `vsprojects\grpc_protoc_plugins.sln` and build it in Release mode. As a result, you should obtain a set of gRPC protoc plugin binaries (`grpc_cpp_plugin.exe`, `grpc_csharp_plugin.exe`, ...) +2. Open solution `third_party\protobuf\cmake\protobuf.sln` and build it in Release mode. That will build libraries `libprotobuf.lib` and `libprotoc.lib` needed for the next step. + +3. Open solution `vsprojects\grpc_protoc_plugins.sln` and build it in Release mode. As a result, you should obtain a set of gRPC protoc plugin binaries (`grpc_cpp_plugin.exe`, `grpc_csharp_plugin.exe`, ...) From 58d637444187f36181d3662e85e42aa1d23af92a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 13 Aug 2015 10:17:09 -0700 Subject: [PATCH 24/26] upgrade to latest protobufs --- src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj | 5 ++--- src/csharp/Grpc.Examples.Tests/packages.config | 2 +- src/csharp/Grpc.Examples/Grpc.Examples.csproj | 5 ++--- src/csharp/Grpc.Examples/packages.config | 2 +- .../Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj | 5 ++--- src/csharp/Grpc.HealthCheck.Tests/packages.config | 2 +- src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj | 5 ++--- src/csharp/Grpc.HealthCheck/packages.config | 2 +- .../Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj | 5 ++--- src/csharp/Grpc.IntegrationTesting/packages.config | 2 +- src/csharp/build_packages.bat | 6 +++--- 11 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index cb5707a53a1..8b05c9cad87 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -37,9 +37,8 @@ C:\keys\Grpc.snk - - False - ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config index ebcf575362e..d84b85822f7 100644 --- a/src/csharp/Grpc.Examples.Tests/packages.config +++ b/src/csharp/Grpc.Examples.Tests/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index 26df9c92239..cb99c20079a 100644 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -37,9 +37,8 @@ C:\keys\Grpc.snk - - False - ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll diff --git a/src/csharp/Grpc.Examples/packages.config b/src/csharp/Grpc.Examples/packages.config index 915995af40d..27e9d2ce15d 100644 --- a/src/csharp/Grpc.Examples/packages.config +++ b/src/csharp/Grpc.Examples/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index 3723dd3fb54..7f0ff66fa16 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -37,9 +37,8 @@ C:\keys\Grpc.snk - - False - ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config index a839c9d7ddc..228e0725c8c 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/packages.config +++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj index 2f54fb0844d..dac8c21d70a 100644 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj @@ -38,9 +38,8 @@ C:\keys\Grpc.snk - - False - ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll diff --git a/src/csharp/Grpc.HealthCheck/packages.config b/src/csharp/Grpc.HealthCheck/packages.config index 5d140125321..7f9cb2dd483 100644 --- a/src/csharp/Grpc.HealthCheck/packages.config +++ b/src/csharp/Grpc.HealthCheck/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index 24a7d2e7eba..a8d85e4ef6a 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -41,9 +41,8 @@ ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll - - False - ..\packages\Google.Protobuf.3.0.0-a20150808-e58cdbd214\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config index 10612a1cbf1..b6ed3c85320 100644 --- a/src/csharp/Grpc.IntegrationTesting/packages.config +++ b/src/csharp/Grpc.IntegrationTesting/packages.config @@ -3,7 +3,7 @@ - + diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index 395fb439701..6aa5e4b0b77 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -1,9 +1,9 @@ @rem Builds gRPC NuGet packages @rem Current package versions -set VERSION=0.7.0-preview20150808 -set CORE_VERSION=0.11.0-preview20150808 -set PROTOBUF_VERSION=3.0.0-a20150808-e58cdbd214 +set VERSION=0.7.0-preview20150813 +set CORE_VERSION=0.11.0-preview20150813 +set PROTOBUF_VERSION=3.0.0-a20150813-2093749ca @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe From d68ef4f9ae4ed077d576d6870d8f79514e9b9a94 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 26 Aug 2015 11:43:45 -0700 Subject: [PATCH 25/26] upgrade third_party/protobufs to 3.0.0-beta-1 --- src/csharp/.gitignore | 3 +++ .../Grpc.Examples.Tests.csproj | 5 ++-- .../Grpc.Examples.Tests/packages.config | 2 +- src/csharp/Grpc.Examples/Grpc.Examples.csproj | 5 ++-- src/csharp/Grpc.Examples/packages.config | 2 +- .../Grpc.HealthCheck.Tests.csproj | 5 ++-- .../Grpc.HealthCheck.Tests/packages.config | 2 +- .../Grpc.HealthCheck/Grpc.HealthCheck.csproj | 5 ++-- src/csharp/Grpc.HealthCheck/packages.config | 2 +- .../Grpc.IntegrationTesting.csproj | 7 +++--- .../Grpc.IntegrationTesting/packages.config | 2 +- src/csharp/Grpc.Tools.nuspec | 2 +- src/csharp/build_packages.bat | 8 ++++--- third_party/protobuf | 2 +- tools/run_tests/run_sanity.sh | 2 +- vsprojects/build_plugins.bat | 23 +++++++++++++++++++ 16 files changed, 55 insertions(+), 22 deletions(-) create mode 100644 vsprojects/build_plugins.bat diff --git a/src/csharp/.gitignore b/src/csharp/.gitignore index 48365e32a59..deac55029ee 100644 --- a/src/csharp/.gitignore +++ b/src/csharp/.gitignore @@ -4,6 +4,9 @@ StyleCop.Cache test-results packages Grpc.v12.suo +Grpc.sdf + TestResult.xml /TestResults +.vs/ *.nupkg diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index 8b05c9cad87..ba7fad8633a 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -37,8 +37,9 @@ C:\keys\Grpc.snk - - ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config index d84b85822f7..7c8fd1ebe53 100644 --- a/src/csharp/Grpc.Examples.Tests/packages.config +++ b/src/csharp/Grpc.Examples.Tests/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index cb99c20079a..e97474b8ae0 100644 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -37,8 +37,9 @@ C:\keys\Grpc.snk - - ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll diff --git a/src/csharp/Grpc.Examples/packages.config b/src/csharp/Grpc.Examples/packages.config index 27e9d2ce15d..126b775ac56 100644 --- a/src/csharp/Grpc.Examples/packages.config +++ b/src/csharp/Grpc.Examples/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index 7f0ff66fa16..89935e22c03 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -37,8 +37,9 @@ C:\keys\Grpc.snk - - ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config index 228e0725c8c..7c85c0eee06 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/packages.config +++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj index dac8c21d70a..feaf47b531b 100644 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj @@ -38,8 +38,9 @@ C:\keys\Grpc.snk - - ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll diff --git a/src/csharp/Grpc.HealthCheck/packages.config b/src/csharp/Grpc.HealthCheck/packages.config index 7f9cb2dd483..e1de987afbd 100644 --- a/src/csharp/Grpc.HealthCheck/packages.config +++ b/src/csharp/Grpc.HealthCheck/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index b115eac909b..1dbd0a4c56b 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -42,9 +42,6 @@ False ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll - - ..\packages\Google.Protobuf.3.0.0-a20150813-2093749ca\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - False ..\packages\Google.Apis.Auth.1.9.3\lib\net40\Google.Apis.Auth.dll @@ -57,6 +54,10 @@ False ..\packages\Google.Apis.Core.1.9.3\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll + + False + ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + False ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config index 54b594bb63a..3891f7b475d 100644 --- a/src/csharp/Grpc.IntegrationTesting/packages.config +++ b/src/csharp/Grpc.IntegrationTesting/packages.config @@ -1,9 +1,9 @@  - + diff --git a/src/csharp/Grpc.Tools.nuspec b/src/csharp/Grpc.Tools.nuspec index b6e116f537d..48a7b1f3af2 100644 --- a/src/csharp/Grpc.Tools.nuspec +++ b/src/csharp/Grpc.Tools.nuspec @@ -16,6 +16,6 @@ gRPC RPC Protocol HTTP/2 - + diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index 6aa5e4b0b77..540b6178750 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -1,9 +1,9 @@ @rem Builds gRPC NuGet packages @rem Current package versions -set VERSION=0.7.0-preview20150813 -set CORE_VERSION=0.11.0-preview20150813 -set PROTOBUF_VERSION=3.0.0-a20150813-2093749ca +set VERSION=0.7.0-preview20150826 +set CORE_VERSION=0.11.0-preview20150826 +set PROTOBUF_VERSION=3.0.0-a20150826-7e05a2d @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe @@ -15,6 +15,8 @@ endlocal @call buildall.bat BUILD_SIGNED || goto :error +@call ..\..\vsprojects\build_plugins.bat || goto :error + %NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp_ext.nuspec -Version %CORE_VERSION% || goto :error %NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error %NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% -Properties GrpcNativeCsharpExtVersion=%CORE_VERSION% || goto :error diff --git a/third_party/protobuf b/third_party/protobuf index 2093749caf6..23408684b4d 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit 2093749caf6add1f1be63194e585fffd5ef98ecb +Subproject commit 23408684b4d2bf1b25e14314413a14d542c18bc4 diff --git a/tools/run_tests/run_sanity.sh b/tools/run_tests/run_sanity.sh index ac331b54d32..2737e564c6d 100755 --- a/tools/run_tests/run_sanity.sh +++ b/tools/run_tests/run_sanity.sh @@ -46,7 +46,7 @@ diff -u $submodules - << EOF 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f) c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0) 33dd08320648ac71d7d9d732be774ed3818dccc5 third_party/openssl (OpenSSL_1_0_2d) - 3e2c8a5dd79481e1d36572cdf65be93514ba6581 third_party/protobuf (v3.0.0-alpha-1-1048-g3e2c8a5) + 23408684b4d2bf1b25e14314413a14d542c18bc4 third_party/protobuf (v3.0.0-alpha-1-1592-g2340868) 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) EOF diff --git a/vsprojects/build_plugins.bat b/vsprojects/build_plugins.bat new file mode 100644 index 00000000000..4c33a584ad4 --- /dev/null +++ b/vsprojects/build_plugins.bat @@ -0,0 +1,23 @@ +@rem Convenience script to build gRPC protoc plugins from command line. protoc plugins are used to generate service stub code from .proto service defintions. + +setlocal + +@rem enter this directory +cd /d %~dp0 + +@rem Set VS variables (uses Visual Studio 2013) +@call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86 + +@rem Build third_party/protobuf +msbuild ..\third_party\protobuf\cmake\protobuf.sln /p:Configuration=Release || goto :error + +@rem Build the C# protoc plugins +msbuild grpc_protoc_plugins.sln /p:Configuration=Release || goto :error + +endlocal + +goto :EOF + +:error +echo Failed! +exit /b %errorlevel% From 939ccbe0ffb1ece37eca300fe218830000b847b5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 27 Aug 2015 08:51:36 -0700 Subject: [PATCH 26/26] switch C# projects to Google.Protobuf 3.0.0-alpha4 package --- src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj | 2 +- src/csharp/Grpc.Examples.Tests/packages.config | 2 +- src/csharp/Grpc.Examples/Grpc.Examples.csproj | 2 +- src/csharp/Grpc.Examples/packages.config | 2 +- .../Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj | 2 +- src/csharp/Grpc.HealthCheck.Tests/packages.config | 2 +- src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj | 2 +- src/csharp/Grpc.HealthCheck/packages.config | 2 +- .../Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj | 2 +- src/csharp/Grpc.IntegrationTesting/packages.config | 2 +- src/csharp/build_packages.bat | 6 +++--- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index ba7fad8633a..c4c1ee6d006 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -39,7 +39,7 @@ False - ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config index 7c8fd1ebe53..7266fa1763c 100644 --- a/src/csharp/Grpc.Examples.Tests/packages.config +++ b/src/csharp/Grpc.Examples.Tests/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index e97474b8ae0..55462e02fd5 100644 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -39,7 +39,7 @@ False - ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll diff --git a/src/csharp/Grpc.Examples/packages.config b/src/csharp/Grpc.Examples/packages.config index 126b775ac56..adf8da2363d 100644 --- a/src/csharp/Grpc.Examples/packages.config +++ b/src/csharp/Grpc.Examples/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index 89935e22c03..396dc43a021 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -39,7 +39,7 @@ False - ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll ..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config index 7c85c0eee06..40ffb852031 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/packages.config +++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj index feaf47b531b..8fce5d39aab 100644 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj @@ -40,7 +40,7 @@ False - ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll diff --git a/src/csharp/Grpc.HealthCheck/packages.config b/src/csharp/Grpc.HealthCheck/packages.config index e1de987afbd..cafff6123a3 100644 --- a/src/csharp/Grpc.HealthCheck/packages.config +++ b/src/csharp/Grpc.HealthCheck/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index 1dbd0a4c56b..a5945be922b 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -56,7 +56,7 @@ False - ..\packages\Google.Protobuf.3.0.0-a20150826-7e05a2d\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll False diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config index 3891f7b475d..8dfded1964f 100644 --- a/src/csharp/Grpc.IntegrationTesting/packages.config +++ b/src/csharp/Grpc.IntegrationTesting/packages.config @@ -3,7 +3,7 @@ - + diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index 540b6178750..255b7469ab6 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -1,9 +1,9 @@ @rem Builds gRPC NuGet packages @rem Current package versions -set VERSION=0.7.0-preview20150826 -set CORE_VERSION=0.11.0-preview20150826 -set PROTOBUF_VERSION=3.0.0-a20150826-7e05a2d +set VERSION=0.7.0 +set CORE_VERSION=0.11.0 +set PROTOBUF_VERSION=3.0.0-alpha4 @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe