Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: math.proto |
| 3 | #region Designer generated code |
Jan Tattermusch | a7fff86 | 2015-02-13 11:08:08 -0800 | [diff] [blame] | 4 | |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 5 | using System; |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 6 | using System.Threading; |
| 7 | using System.Threading.Tasks; |
| 8 | using Grpc.Core; |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 9 | |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 10 | namespace math { |
| 11 | public static class Math |
| 12 | { |
| 13 | static readonly string __ServiceName = "math.Math"; |
| 14 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 15 | static readonly Marshaller<global::math.DivArgs> __Marshaller_DivArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::math.DivArgs.ParseFrom); |
| 16 | static readonly Marshaller<global::math.DivReply> __Marshaller_DivReply = Marshallers.Create((arg) => arg.ToByteArray(), global::math.DivReply.ParseFrom); |
| 17 | static readonly Marshaller<global::math.FibArgs> __Marshaller_FibArgs = Marshallers.Create((arg) => arg.ToByteArray(), global::math.FibArgs.ParseFrom); |
| 18 | static readonly Marshaller<global::math.Num> __Marshaller_Num = Marshallers.Create((arg) => arg.ToByteArray(), global::math.Num.ParseFrom); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 19 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 20 | static readonly Method<global::math.DivArgs, global::math.DivReply> __Method_Div = new Method<global::math.DivArgs, global::math.DivReply>( |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 21 | MethodType.Unary, |
| 22 | "Div", |
| 23 | __Marshaller_DivArgs, |
| 24 | __Marshaller_DivReply); |
| 25 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 26 | static readonly Method<global::math.DivArgs, global::math.DivReply> __Method_DivMany = new Method<global::math.DivArgs, global::math.DivReply>( |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 27 | MethodType.DuplexStreaming, |
| 28 | "DivMany", |
| 29 | __Marshaller_DivArgs, |
| 30 | __Marshaller_DivReply); |
| 31 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 32 | static readonly Method<global::math.FibArgs, global::math.Num> __Method_Fib = new Method<global::math.FibArgs, global::math.Num>( |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 33 | MethodType.ServerStreaming, |
| 34 | "Fib", |
| 35 | __Marshaller_FibArgs, |
| 36 | __Marshaller_Num); |
| 37 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 38 | static readonly Method<global::math.Num, global::math.Num> __Method_Sum = new Method<global::math.Num, global::math.Num>( |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 39 | MethodType.ClientStreaming, |
| 40 | "Sum", |
| 41 | __Marshaller_Num, |
| 42 | __Marshaller_Num); |
| 43 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 44 | // client interface |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 45 | public interface IMathClient |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 46 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 47 | global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 48 | AsyncUnaryCall<global::math.DivReply> DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 49 | AsyncDuplexStreamingCall<global::math.DivArgs, global::math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 50 | AsyncServerStreamingCall<global::math.Num> Fib(global::math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 51 | AsyncClientStreamingCall<global::math.Num, global::math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 52 | } |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 53 | |
| 54 | // server-side interface |
| 55 | public interface IMath |
| 56 | { |
Jan Tattermusch | 25bb2ef | 2015-07-21 12:15:53 -0700 | [diff] [blame] | 57 | Task<global::math.DivReply> Div(global::math.DivArgs request, ServerCallContext context); |
| 58 | Task DivMany(IAsyncStreamReader<global::math.DivArgs> requestStream, IServerStreamWriter<global::math.DivReply> responseStream, ServerCallContext context); |
| 59 | Task Fib(global::math.FibArgs request, IServerStreamWriter<global::math.Num> responseStream, ServerCallContext context); |
| 60 | Task<global::math.Num> Sum(IAsyncStreamReader<global::math.Num> requestStream, ServerCallContext context); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | // client stub |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 64 | public class MathClient : ClientBase, IMathClient |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 65 | { |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 66 | public MathClient(Channel channel) : base(channel) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 67 | { |
| 68 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 69 | public global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 70 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 71 | var call = CreateCall(__ServiceName, __Method_Div, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 72 | return Calls.BlockingUnaryCall(call, request, cancellationToken); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 73 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 74 | public AsyncUnaryCall<global::math.DivReply> DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 75 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 76 | var call = CreateCall(__ServiceName, __Method_Div, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 77 | return Calls.AsyncUnaryCall(call, request, cancellationToken); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 78 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 79 | public AsyncDuplexStreamingCall<global::math.DivArgs, global::math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 80 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 81 | var call = CreateCall(__ServiceName, __Method_DivMany, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 82 | return Calls.AsyncDuplexStreamingCall(call, cancellationToken); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 83 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 84 | public AsyncServerStreamingCall<global::math.Num> Fib(global::math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 85 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 86 | var call = CreateCall(__ServiceName, __Method_Fib, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 87 | return Calls.AsyncServerStreamingCall(call, request, cancellationToken); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 88 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 89 | public AsyncClientStreamingCall<global::math.Num, global::math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 90 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame] | 91 | var call = CreateCall(__ServiceName, __Method_Sum, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 92 | return Calls.AsyncClientStreamingCall(call, cancellationToken); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 93 | } |
| 94 | } |
| 95 | |
| 96 | // creates service definition that can be registered with a server |
| 97 | public static ServerServiceDefinition BindService(IMath serviceImpl) |
| 98 | { |
| 99 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 100 | .AddMethod(__Method_Div, serviceImpl.Div) |
| 101 | .AddMethod(__Method_DivMany, serviceImpl.DivMany) |
| 102 | .AddMethod(__Method_Fib, serviceImpl.Fib) |
| 103 | .AddMethod(__Method_Sum, serviceImpl.Sum).Build(); |
| 104 | } |
| 105 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 106 | // creates a new client |
| 107 | public static MathClient NewClient(Channel channel) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 108 | { |
| 109 | return new MathClient(channel); |
| 110 | } |
| 111 | |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 112 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 113 | } |
Jan Tattermusch | cd7e313 | 2015-05-07 15:10:23 -0700 | [diff] [blame] | 114 | #endregion |