From bfee01ddc88b8f655fbfb88f83566a170f1ae3a3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 28 Apr 2016 10:52:41 -0700 Subject: [PATCH] regenerate C# sources --- src/csharp/Grpc.Examples/MathGrpc.cs | 176 ++++++++++- src/csharp/Grpc.HealthCheck/HealthGrpc.cs | 46 ++- .../Grpc.IntegrationTesting/MetricsGrpc.cs | 106 ++++++- .../Grpc.IntegrationTesting/ServicesGrpc.cs | 284 ++++++++++++++++- .../Grpc.IntegrationTesting/TestGrpc.cs | 296 ++++++++++++++++-- 5 files changed, 844 insertions(+), 64 deletions(-) diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index edbce913b89..2d3034d28b5 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -1,5 +1,35 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: math.proto +// Original file comments: +// Copyright 2015, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// #region Designer generated code using System; @@ -45,56 +75,140 @@ namespace Math { __Marshaller_Num, __Marshaller_Num); - // service descriptor + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Math.MathReflection.Descriptor.Services[0]; } } - // client interface + /// Client for Math [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] public interface IMathClient { + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options); + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// AsyncUnaryCall DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// AsyncUnaryCall DivAsync(global::Math.DivArgs request, CallOptions options); + /// + /// DivMany accepts an arbitrary number of division args from the client stream + /// and sends back the results in the reply stream. The stream continues until + /// the client closes its end; the server does the same after sending all the + /// replies. The stream ends immediately if either end aborts. + /// AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// DivMany accepts an arbitrary number of division args from the client stream + /// and sends back the results in the reply stream. The stream continues until + /// the client closes its end; the server does the same after sending all the + /// replies. The stream ends immediately if either end aborts. + /// AsyncDuplexStreamingCall DivMany(CallOptions options); + /// + /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib + /// generates up to limit numbers; otherwise it continues until the call is + /// canceled. Unlike Fib above, Fib has no final FibReply. + /// AsyncServerStreamingCall Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib + /// generates up to limit numbers; otherwise it continues until the call is + /// canceled. Unlike Fib above, Fib has no final FibReply. + /// AsyncServerStreamingCall Fib(global::Math.FibArgs request, CallOptions options); + /// + /// Sum sums a stream of numbers, returning the final result once the stream + /// is closed. + /// AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Sum sums a stream of numbers, returning the final result once the stream + /// is closed. + /// AsyncClientStreamingCall Sum(CallOptions options); } - // server-side interface + /// Interface of server-side implementations of Math [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface IMath { + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// Task Div(global::Math.DivArgs request, ServerCallContext context); + /// + /// DivMany accepts an arbitrary number of division args from the client stream + /// and sends back the results in the reply stream. The stream continues until + /// the client closes its end; the server does the same after sending all the + /// replies. The stream ends immediately if either end aborts. + /// Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + /// + /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib + /// generates up to limit numbers; otherwise it continues until the call is + /// canceled. Unlike Fib above, Fib has no final FibReply. + /// Task Fib(global::Math.FibArgs request, IServerStreamWriter responseStream, ServerCallContext context); + /// + /// Sum sums a stream of numbers, returning the final result once the stream + /// is closed. + /// Task Sum(IAsyncStreamReader requestStream, ServerCallContext context); } - // server-side abstract class + /// Base class for server-side implementations of Math public abstract class MathBase { + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// public virtual Task Div(global::Math.DivArgs request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// DivMany accepts an arbitrary number of division args from the client stream + /// and sends back the results in the reply stream. The stream continues until + /// the client closes its end; the server does the same after sending all the + /// replies. The stream ends immediately if either end aborts. + /// public virtual Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib + /// generates up to limit numbers; otherwise it continues until the call is + /// canceled. Unlike Fib above, Fib has no final FibReply. + /// public virtual Task Fib(global::Math.FibArgs request, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// Sum sums a stream of numbers, returning the final result once the stream + /// is closed. + /// public virtual Task Sum(IAsyncStreamReader requestStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); @@ -102,7 +216,7 @@ namespace Math { } - // client stub + /// Client for Math #pragma warning disable 0618 public class MathClient : ClientBase, IMathClient #pragma warning restore 0618 @@ -122,42 +236,88 @@ namespace Math { { } + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// public virtual global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return Div(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// public virtual global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_Div, null, options, request); } + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// public virtual AsyncUnaryCall DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return DivAsync(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Div divides args.dividend by args.divisor and returns the quotient and + /// remainder. + /// public virtual AsyncUnaryCall DivAsync(global::Math.DivArgs request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_Div, null, options, request); } + /// + /// DivMany accepts an arbitrary number of division args from the client stream + /// and sends back the results in the reply stream. The stream continues until + /// the client closes its end; the server does the same after sending all the + /// replies. The stream ends immediately if either end aborts. + /// public virtual AsyncDuplexStreamingCall DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return DivMany(new CallOptions(headers, deadline, cancellationToken)); } + /// + /// DivMany accepts an arbitrary number of division args from the client stream + /// and sends back the results in the reply stream. The stream continues until + /// the client closes its end; the server does the same after sending all the + /// replies. The stream ends immediately if either end aborts. + /// public virtual AsyncDuplexStreamingCall DivMany(CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_DivMany, null, options); } + /// + /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib + /// generates up to limit numbers; otherwise it continues until the call is + /// canceled. Unlike Fib above, Fib has no final FibReply. + /// public virtual AsyncServerStreamingCall Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return Fib(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib + /// generates up to limit numbers; otherwise it continues until the call is + /// canceled. Unlike Fib above, Fib has no final FibReply. + /// public virtual AsyncServerStreamingCall Fib(global::Math.FibArgs request, CallOptions options) { return CallInvoker.AsyncServerStreamingCall(__Method_Fib, null, options, request); } + /// + /// Sum sums a stream of numbers, returning the final result once the stream + /// is closed. + /// public virtual AsyncClientStreamingCall Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return Sum(new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Sum sums a stream of numbers, returning the final result once the stream + /// is closed. + /// public virtual AsyncClientStreamingCall Sum(CallOptions options) { return CallInvoker.AsyncClientStreamingCall(__Method_Sum, null, options); @@ -168,13 +328,13 @@ namespace Math { } } - // creates a new client + /// Creates a new client for Math public static MathClient NewClient(Channel channel) { return new MathClient(channel); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(IMath serviceImpl) #pragma warning restore 0618 @@ -186,7 +346,7 @@ namespace Math { .AddMethod(__Method_Sum, serviceImpl.Sum).Build(); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(MathBase serviceImpl) #pragma warning restore 0618 diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index e2cdabf011d..967d1170bed 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -1,5 +1,35 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: health.proto +// Original file comments: +// Copyright 2015, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// #region Designer generated code using System; @@ -22,13 +52,13 @@ namespace Grpc.Health.V1 { __Marshaller_HealthCheckRequest, __Marshaller_HealthCheckResponse); - // service descriptor + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Grpc.Health.V1.HealthReflection.Descriptor.Services[0]; } } - // client interface + /// Client for Health [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] public interface IHealthClient { @@ -38,14 +68,14 @@ namespace Grpc.Health.V1 { AsyncUnaryCall CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, CallOptions options); } - // server-side interface + /// Interface of server-side implementations of Health [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface IHealth { Task Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context); } - // server-side abstract class + /// Base class for server-side implementations of Health public abstract class HealthBase { public virtual Task Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context) @@ -55,7 +85,7 @@ namespace Grpc.Health.V1 { } - // client stub + /// Client for Health #pragma warning disable 0618 public class HealthClient : ClientBase, IHealthClient #pragma warning restore 0618 @@ -97,13 +127,13 @@ namespace Grpc.Health.V1 { } } - // creates a new client + /// Creates a new client for Health public static HealthClient NewClient(Channel channel) { return new HealthClient(channel); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(IHealth serviceImpl) #pragma warning restore 0618 @@ -112,7 +142,7 @@ namespace Grpc.Health.V1 { .AddMethod(__Method_Check, serviceImpl.Check).Build(); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(HealthBase serviceImpl) #pragma warning restore 0618 diff --git a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs index 0f701a837f4..aa4f1c5c3ec 100644 --- a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs @@ -1,5 +1,41 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/proto/grpc/testing/metrics.proto +// Original file comments: +// Copyright 2015-2016, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Contains the definitions for a metrics service and the type of metrics +// exposed by the service. +// +// Currently, 'Gauge' (i.e a metric that represents the measured value of +// something at an instant of time) is the only metric type supported by the +// service. #region Designer generated code using System; @@ -30,40 +66,74 @@ namespace Grpc.Testing { __Marshaller_GaugeRequest, __Marshaller_GaugeResponse); - // service descriptor + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Grpc.Testing.MetricsReflection.Descriptor.Services[0]; } } - // client interface + /// Client for MetricsService [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] public interface IMetricsServiceClient { + /// + /// Returns the values of all the gauges that are currently being maintained by + /// the service + /// AsyncServerStreamingCall GetAllGauges(global::Grpc.Testing.EmptyMessage request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns the values of all the gauges that are currently being maintained by + /// the service + /// AsyncServerStreamingCall GetAllGauges(global::Grpc.Testing.EmptyMessage request, CallOptions options); + /// + /// Returns the value of one gauge + /// global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns the value of one gauge + /// global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, CallOptions options); + /// + /// Returns the value of one gauge + /// AsyncUnaryCall GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns the value of one gauge + /// AsyncUnaryCall GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, CallOptions options); } - // server-side interface + /// Interface of server-side implementations of MetricsService [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface IMetricsService { + /// + /// Returns the values of all the gauges that are currently being maintained by + /// the service + /// Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter responseStream, ServerCallContext context); + /// + /// Returns the value of one gauge + /// Task GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context); } - // server-side abstract class + /// Base class for server-side implementations of MetricsService public abstract class MetricsServiceBase { + /// + /// Returns the values of all the gauges that are currently being maintained by + /// the service + /// public virtual Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// Returns the value of one gauge + /// public virtual Task GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); @@ -71,7 +141,7 @@ namespace Grpc.Testing { } - // client stub + /// Client for MetricsService #pragma warning disable 0618 public class MetricsServiceClient : ClientBase, IMetricsServiceClient #pragma warning restore 0618 @@ -91,26 +161,46 @@ namespace Grpc.Testing { { } + /// + /// Returns the values of all the gauges that are currently being maintained by + /// the service + /// public virtual AsyncServerStreamingCall GetAllGauges(global::Grpc.Testing.EmptyMessage request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return GetAllGauges(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Returns the values of all the gauges that are currently being maintained by + /// the service + /// public virtual AsyncServerStreamingCall GetAllGauges(global::Grpc.Testing.EmptyMessage request, CallOptions options) { return CallInvoker.AsyncServerStreamingCall(__Method_GetAllGauges, null, options, request); } + /// + /// Returns the value of one gauge + /// public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return GetGauge(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Returns the value of one gauge + /// public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_GetGauge, null, options, request); } + /// + /// Returns the value of one gauge + /// public virtual AsyncUnaryCall GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return GetGaugeAsync(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Returns the value of one gauge + /// public virtual AsyncUnaryCall GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_GetGauge, null, options, request); @@ -121,13 +211,13 @@ namespace Grpc.Testing { } } - // creates a new client + /// Creates a new client for MetricsService public static MetricsServiceClient NewClient(Channel channel) { return new MetricsServiceClient(channel); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(IMetricsService serviceImpl) #pragma warning restore 0618 @@ -137,7 +227,7 @@ namespace Grpc.Testing { .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build(); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(MetricsServiceBase serviceImpl) #pragma warning restore 0618 diff --git a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs index 3f07a7aeb63..42bf5e0b582 100644 --- a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs @@ -1,5 +1,37 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/proto/grpc/testing/services.proto +// Original file comments: +// Copyright 2015, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. #region Designer generated code using System; @@ -29,40 +61,80 @@ namespace Grpc.Testing { __Marshaller_SimpleRequest, __Marshaller_SimpleResponse); - // service descriptor + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; } } - // client interface + /// Client for BenchmarkService [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] public interface IBenchmarkServiceClient { + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options); + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options); + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// AsyncDuplexStreamingCall StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// AsyncDuplexStreamingCall StreamingCall(CallOptions options); } - // server-side interface + /// Interface of server-side implementations of BenchmarkService [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface IBenchmarkService { + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// Task StreamingCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); } - // server-side abstract class + /// Base class for server-side implementations of BenchmarkService public abstract class BenchmarkServiceBase { + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// public virtual Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// public virtual Task StreamingCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); @@ -70,7 +142,7 @@ namespace Grpc.Testing { } - // client stub + /// Client for BenchmarkService #pragma warning disable 0618 public class BenchmarkServiceClient : ClientBase, IBenchmarkServiceClient #pragma warning restore 0618 @@ -90,26 +162,50 @@ namespace Grpc.Testing { { } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// public virtual AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// public virtual AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// public virtual AsyncDuplexStreamingCall StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return StreamingCall(new CallOptions(headers, deadline, cancellationToken)); } + /// + /// One request followed by one response. + /// The server returns the client payload as-is. + /// public virtual AsyncDuplexStreamingCall StreamingCall(CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); @@ -120,13 +216,13 @@ namespace Grpc.Testing { } } - // creates a new client + /// Creates a new client for BenchmarkService public static BenchmarkServiceClient NewClient(Channel channel) { return new BenchmarkServiceClient(channel); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(IBenchmarkService serviceImpl) #pragma warning restore 0618 @@ -136,7 +232,7 @@ namespace Grpc.Testing { .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build(); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) #pragma warning restore 0618 @@ -187,58 +283,158 @@ namespace Grpc.Testing { __Marshaller_Void, __Marshaller_Void); - // service descriptor + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; } } - // client interface + /// Client for WorkerService [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] public interface IWorkerServiceClient { + /// + /// Start server with specified workload. + /// First request sent specifies the ServerConfig followed by ServerStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test server + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// AsyncDuplexStreamingCall RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Start server with specified workload. + /// First request sent specifies the ServerConfig followed by ServerStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test server + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// AsyncDuplexStreamingCall RunServer(CallOptions options); + /// + /// Start client with specified workload. + /// First request sent specifies the ClientConfig followed by ClientStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test client + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// AsyncDuplexStreamingCall RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Start client with specified workload. + /// First request sent specifies the ClientConfig followed by ClientStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test client + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// AsyncDuplexStreamingCall RunClient(CallOptions options); + /// + /// Just return the core count - unary call + /// global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Just return the core count - unary call + /// global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options); + /// + /// Just return the core count - unary call + /// AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Just return the core count - unary call + /// AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options); + /// + /// Quit this worker + /// global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Quit this worker + /// global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options); + /// + /// Quit this worker + /// AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Quit this worker + /// AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options); } - // server-side interface + /// Interface of server-side implementations of WorkerService [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface IWorkerService { + /// + /// Start server with specified workload. + /// First request sent specifies the ServerConfig followed by ServerStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test server + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// Task RunServer(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + /// + /// Start client with specified workload. + /// First request sent specifies the ClientConfig followed by ClientStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test client + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// Task RunClient(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + /// + /// Just return the core count - unary call + /// Task CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context); + /// + /// Quit this worker + /// Task QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context); } - // server-side abstract class + /// Base class for server-side implementations of WorkerService public abstract class WorkerServiceBase { + /// + /// Start server with specified workload. + /// First request sent specifies the ServerConfig followed by ServerStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test server + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// public virtual Task RunServer(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// Start client with specified workload. + /// First request sent specifies the ClientConfig followed by ClientStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test client + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// public virtual Task RunClient(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// Just return the core count - unary call + /// public virtual Task CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// Quit this worker + /// public virtual Task QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); @@ -246,7 +442,7 @@ namespace Grpc.Testing { } - // client stub + /// Client for WorkerService #pragma warning disable 0618 public class WorkerServiceClient : ClientBase, IWorkerServiceClient #pragma warning restore 0618 @@ -266,50 +462,106 @@ namespace Grpc.Testing { { } + /// + /// Start server with specified workload. + /// First request sent specifies the ServerConfig followed by ServerStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test server + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// public virtual AsyncDuplexStreamingCall RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return RunServer(new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Start server with specified workload. + /// First request sent specifies the ServerConfig followed by ServerStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test server + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// public virtual AsyncDuplexStreamingCall RunServer(CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); } + /// + /// Start client with specified workload. + /// First request sent specifies the ClientConfig followed by ClientStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test client + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// public virtual AsyncDuplexStreamingCall RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return RunClient(new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Start client with specified workload. + /// First request sent specifies the ClientConfig followed by ClientStatus + /// response. After that, a "Mark" can be sent anytime to request the latest + /// stats. Closing the stream will initiate shutdown of the test client + /// and once the shutdown has finished, the OK status is sent to terminate + /// this RPC. + /// public virtual AsyncDuplexStreamingCall RunClient(CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); } + /// + /// Just return the core count - unary call + /// public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return CoreCount(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Just return the core count - unary call + /// public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); } + /// + /// Just return the core count - unary call + /// public virtual AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return CoreCountAsync(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Just return the core count - unary call + /// public virtual AsyncUnaryCall CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); } + /// + /// Quit this worker + /// public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return QuitWorker(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Quit this worker + /// public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); } + /// + /// Quit this worker + /// public virtual AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return QuitWorkerAsync(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// Quit this worker + /// public virtual AsyncUnaryCall QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); @@ -320,13 +572,13 @@ namespace Grpc.Testing { } } - // creates a new client + /// Creates a new client for WorkerService public static WorkerServiceClient NewClient(Channel channel) { return new WorkerServiceClient(channel); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(IWorkerService serviceImpl) #pragma warning restore 0618 @@ -338,7 +590,7 @@ namespace Grpc.Testing { .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) #pragma warning restore 0618 diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index 4efd35f81fd..f1878cbb556 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -1,5 +1,38 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/proto/grpc/testing/test.proto +// Original file comments: +// Copyright 2015-2016, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +// #region Designer generated code using System; @@ -8,6 +41,10 @@ using System.Threading.Tasks; using Grpc.Core; namespace Grpc.Testing { + /// + /// A simple service to test the various types of RPCs and experiment with + /// performance with various types of payload. + /// public static class TestService { static readonly string __ServiceName = "grpc.testing.TestService"; @@ -62,74 +99,186 @@ namespace Grpc.Testing { __Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallResponse); - // service descriptor + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Grpc.Testing.TestReflection.Descriptor.Services[0]; } } - // client interface + /// Client for TestService [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] public interface ITestServiceClient { + /// + /// One empty request followed by one empty response. + /// global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// One empty request followed by one empty response. + /// global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options); + /// + /// One empty request followed by one empty response. + /// AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// One empty request followed by one empty response. + /// AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options); + /// + /// One request followed by one response. + /// global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// One request followed by one response. + /// global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options); + /// + /// One request followed by one response. + /// AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// One request followed by one response. + /// AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options); + /// + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + /// AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + /// AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options); + /// + /// A sequence of requests followed by one response (streamed upload). + /// The server returns the aggregated size of client payload as the result. + /// AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// A sequence of requests followed by one response (streamed upload). + /// The server returns the aggregated size of client payload as the result. + /// AsyncClientStreamingCall StreamingInputCall(CallOptions options); + /// + /// A sequence of requests with each request served by the server immediately. + /// As one request could lead to multiple responses, this interface + /// demonstrates the idea of full duplexing. + /// AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// A sequence of requests with each request served by the server immediately. + /// As one request could lead to multiple responses, this interface + /// demonstrates the idea of full duplexing. + /// AsyncDuplexStreamingCall FullDuplexCall(CallOptions options); + /// + /// A sequence of requests followed by a sequence of responses. + /// The server buffers all the client requests and then serves them in order. A + /// stream of responses are returned to the client when the server starts with + /// first request. + /// AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// A sequence of requests followed by a sequence of responses. + /// The server buffers all the client requests and then serves them in order. A + /// stream of responses are returned to the client when the server starts with + /// first request. + /// AsyncDuplexStreamingCall HalfDuplexCall(CallOptions options); } - // server-side interface + /// Interface of server-side implementations of TestService [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface ITestService { + /// + /// One empty request followed by one empty response. + /// Task EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context); + /// + /// One request followed by one response. + /// Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); + /// + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + /// Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context); + /// + /// A sequence of requests followed by one response (streamed upload). + /// The server returns the aggregated size of client payload as the result. + /// Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context); + /// + /// A sequence of requests with each request served by the server immediately. + /// As one request could lead to multiple responses, this interface + /// demonstrates the idea of full duplexing. + /// Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + /// + /// A sequence of requests followed by a sequence of responses. + /// The server buffers all the client requests and then serves them in order. A + /// stream of responses are returned to the client when the server starts with + /// first request. + /// Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); } - // server-side abstract class + /// Base class for server-side implementations of TestService public abstract class TestServiceBase { + /// + /// One empty request followed by one empty response. + /// public virtual Task EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// One request followed by one response. + /// public virtual Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + /// public virtual Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// A sequence of requests followed by one response (streamed upload). + /// The server returns the aggregated size of client payload as the result. + /// public virtual Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// A sequence of requests with each request served by the server immediately. + /// As one request could lead to multiple responses, this interface + /// demonstrates the idea of full duplexing. + /// public virtual Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } + /// + /// A sequence of requests followed by a sequence of responses. + /// The server buffers all the client requests and then serves them in order. A + /// stream of responses are returned to the client when the server starts with + /// first request. + /// public virtual Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); @@ -137,7 +286,7 @@ namespace Grpc.Testing { } - // client stub + /// Client for TestService #pragma warning disable 0618 public class TestServiceClient : ClientBase, ITestServiceClient #pragma warning restore 0618 @@ -157,66 +306,128 @@ namespace Grpc.Testing { { } + /// + /// One empty request followed by one empty response. + /// public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return EmptyCall(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// One empty request followed by one empty response. + /// public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_EmptyCall, null, options, request); } + /// + /// One empty request followed by one empty response. + /// public virtual AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return EmptyCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// One empty request followed by one empty response. + /// public virtual AsyncUnaryCall EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_EmptyCall, null, options, request); } + /// + /// One request followed by one response. + /// public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// One request followed by one response. + /// public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); } + /// + /// One request followed by one response. + /// public virtual AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// One request followed by one response. + /// public virtual AsyncUnaryCall UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); } + /// + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + /// public virtual AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return StreamingOutputCall(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + /// public virtual AsyncServerStreamingCall StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options) { return CallInvoker.AsyncServerStreamingCall(__Method_StreamingOutputCall, null, options, request); } + /// + /// A sequence of requests followed by one response (streamed upload). + /// The server returns the aggregated size of client payload as the result. + /// public virtual AsyncClientStreamingCall StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return StreamingInputCall(new CallOptions(headers, deadline, cancellationToken)); } + /// + /// A sequence of requests followed by one response (streamed upload). + /// The server returns the aggregated size of client payload as the result. + /// public virtual AsyncClientStreamingCall StreamingInputCall(CallOptions options) { return CallInvoker.AsyncClientStreamingCall(__Method_StreamingInputCall, null, options); } + /// + /// A sequence of requests with each request served by the server immediately. + /// As one request could lead to multiple responses, this interface + /// demonstrates the idea of full duplexing. + /// public virtual AsyncDuplexStreamingCall FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return FullDuplexCall(new CallOptions(headers, deadline, cancellationToken)); } + /// + /// A sequence of requests with each request served by the server immediately. + /// As one request could lead to multiple responses, this interface + /// demonstrates the idea of full duplexing. + /// public virtual AsyncDuplexStreamingCall FullDuplexCall(CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_FullDuplexCall, null, options); } + /// + /// A sequence of requests followed by a sequence of responses. + /// The server buffers all the client requests and then serves them in order. A + /// stream of responses are returned to the client when the server starts with + /// first request. + /// public virtual AsyncDuplexStreamingCall HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return HalfDuplexCall(new CallOptions(headers, deadline, cancellationToken)); } + /// + /// A sequence of requests followed by a sequence of responses. + /// The server buffers all the client requests and then serves them in order. A + /// stream of responses are returned to the client when the server starts with + /// first request. + /// public virtual AsyncDuplexStreamingCall HalfDuplexCall(CallOptions options) { return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options); @@ -227,13 +438,13 @@ namespace Grpc.Testing { } } - // creates a new client + /// Creates a new client for TestService public static TestServiceClient NewClient(Channel channel) { return new TestServiceClient(channel); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(ITestService serviceImpl) #pragma warning restore 0618 @@ -247,7 +458,7 @@ namespace Grpc.Testing { .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(TestServiceBase serviceImpl) #pragma warning restore 0618 @@ -262,6 +473,10 @@ namespace Grpc.Testing { } } + /// + /// A simple service NOT implemented at servers so clients can test for + /// that case. + /// public static class UnimplementedService { static readonly string __ServiceName = "grpc.testing.UnimplementedService"; @@ -275,32 +490,50 @@ namespace Grpc.Testing { __Marshaller_Empty, __Marshaller_Empty); - // service descriptor + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Grpc.Testing.TestReflection.Descriptor.Services[1]; } } - // client interface + /// Client for UnimplementedService [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] public interface IUnimplementedServiceClient { + /// + /// A call that no server should implement + /// global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// A call that no server should implement + /// global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options); + /// + /// A call that no server should implement + /// AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// A call that no server should implement + /// AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options); } - // server-side interface + /// Interface of server-side implementations of UnimplementedService [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface IUnimplementedService { + /// + /// A call that no server should implement + /// Task UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context); } - // server-side abstract class + /// Base class for server-side implementations of UnimplementedService public abstract class UnimplementedServiceBase { + /// + /// A call that no server should implement + /// public virtual Task UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); @@ -308,7 +541,7 @@ namespace Grpc.Testing { } - // client stub + /// Client for UnimplementedService #pragma warning disable 0618 public class UnimplementedServiceClient : ClientBase, IUnimplementedServiceClient #pragma warning restore 0618 @@ -328,18 +561,30 @@ namespace Grpc.Testing { { } + /// + /// A call that no server should implement + /// public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return UnimplementedCall(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// A call that no server should implement + /// public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UnimplementedCall, null, options, request); } + /// + /// A call that no server should implement + /// public virtual AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) { return UnimplementedCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); } + /// + /// A call that no server should implement + /// public virtual AsyncUnaryCall UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request); @@ -350,13 +595,13 @@ namespace Grpc.Testing { } } - // creates a new client + /// Creates a new client for UnimplementedService public static UnimplementedServiceClient NewClient(Channel channel) { return new UnimplementedServiceClient(channel); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(IUnimplementedService serviceImpl) #pragma warning restore 0618 @@ -365,7 +610,7 @@ namespace Grpc.Testing { .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build(); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(UnimplementedServiceBase serviceImpl) #pragma warning restore 0618 @@ -375,6 +620,9 @@ namespace Grpc.Testing { } } + /// + /// A service used to control reconnect server. + /// public static class ReconnectService { static readonly string __ServiceName = "grpc.testing.ReconnectService"; @@ -397,13 +645,13 @@ namespace Grpc.Testing { __Marshaller_Empty, __Marshaller_ReconnectInfo); - // service descriptor + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Grpc.Testing.TestReflection.Descriptor.Services[2]; } } - // client interface + /// Client for ReconnectService [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] public interface IReconnectServiceClient { @@ -417,7 +665,7 @@ namespace Grpc.Testing { AsyncUnaryCall StopAsync(global::Grpc.Testing.Empty request, CallOptions options); } - // server-side interface + /// Interface of server-side implementations of ReconnectService [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface IReconnectService { @@ -425,7 +673,7 @@ namespace Grpc.Testing { Task Stop(global::Grpc.Testing.Empty request, ServerCallContext context); } - // server-side abstract class + /// Base class for server-side implementations of ReconnectService public abstract class ReconnectServiceBase { public virtual Task Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context) @@ -440,7 +688,7 @@ namespace Grpc.Testing { } - // client stub + /// Client for ReconnectService #pragma warning disable 0618 public class ReconnectServiceClient : ClientBase, IReconnectServiceClient #pragma warning restore 0618 @@ -498,13 +746,13 @@ namespace Grpc.Testing { } } - // creates a new client + /// Creates a new client for ReconnectService public static ReconnectServiceClient NewClient(Channel channel) { return new ReconnectServiceClient(channel); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(IReconnectService serviceImpl) #pragma warning restore 0618 @@ -514,7 +762,7 @@ namespace Grpc.Testing { .AddMethod(__Method_Stop, serviceImpl.Stop).Build(); } - // creates service definition that can be registered with a server + /// Creates service definition that can be registered with a server #pragma warning disable 0618 public static ServerServiceDefinition BindService(ReconnectServiceBase serviceImpl) #pragma warning restore 0618