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 | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 10 | namespace Math { |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 11 | public static class Math |
| 12 | { |
| 13 | static readonly string __ServiceName = "math.Math"; |
| 14 | |
Jan Tattermusch | 7db4613 | 2015-08-03 09:25:38 -0700 | [diff] [blame] | 15 | static readonly Marshaller<global::Math.DivArgs> __Marshaller_DivArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 16 | static readonly Marshaller<global::Math.DivReply> __Marshaller_DivReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom); |
| 17 | static readonly Marshaller<global::Math.FibArgs> __Marshaller_FibArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom); |
| 18 | static readonly Marshaller<global::Math.Num> __Marshaller_Num = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 19 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -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, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 22 | __ServiceName, |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 23 | "Div", |
| 24 | __Marshaller_DivArgs, |
| 25 | __Marshaller_DivReply); |
| 26 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 27 | 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] | 28 | MethodType.DuplexStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 29 | __ServiceName, |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 30 | "DivMany", |
| 31 | __Marshaller_DivArgs, |
| 32 | __Marshaller_DivReply); |
| 33 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 34 | 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] | 35 | MethodType.ServerStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 36 | __ServiceName, |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 37 | "Fib", |
| 38 | __Marshaller_FibArgs, |
| 39 | __Marshaller_Num); |
| 40 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 41 | 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] | 42 | MethodType.ClientStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 43 | __ServiceName, |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 44 | "Sum", |
| 45 | __Marshaller_Num, |
| 46 | __Marshaller_Num); |
| 47 | |
Jan Tattermusch | 9ee27e1 | 2015-08-03 10:32:48 -0700 | [diff] [blame] | 48 | // service descriptor |
| 49 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 50 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 51 | get { return global::Math.MathReflection.Descriptor.Services[0]; } |
Jan Tattermusch | 9ee27e1 | 2015-08-03 10:32:48 -0700 | [diff] [blame] | 52 | } |
| 53 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 54 | // client interface |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 55 | public interface IMathClient |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 56 | { |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 57 | global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 58 | global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 59 | AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 60 | AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 61 | AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 62 | AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 63 | AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 64 | AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 65 | AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 66 | AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(CallOptions options); |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 67 | } |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 68 | |
| 69 | // server-side interface |
| 70 | public interface IMath |
| 71 | { |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 72 | Task<global::Math.DivReply> Div(global::Math.DivArgs request, ServerCallContext context); |
| 73 | Task DivMany(IAsyncStreamReader<global::Math.DivArgs> requestStream, IServerStreamWriter<global::Math.DivReply> responseStream, ServerCallContext context); |
| 74 | Task Fib(global::Math.FibArgs request, IServerStreamWriter<global::Math.Num> responseStream, ServerCallContext context); |
| 75 | Task<global::Math.Num> Sum(IAsyncStreamReader<global::Math.Num> requestStream, ServerCallContext context); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | // client stub |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 79 | public class MathClient : ClientBase, IMathClient |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 80 | { |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 81 | public MathClient(Channel channel) : base(channel) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 82 | { |
| 83 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 84 | 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] | 85 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 86 | var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 87 | return Calls.BlockingUnaryCall(call, request); |
| 88 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 89 | public global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 90 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 91 | var call = CreateCall(__Method_Div, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 92 | return Calls.BlockingUnaryCall(call, request); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 93 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 94 | 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] | 95 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 96 | var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 97 | return Calls.AsyncUnaryCall(call, request); |
| 98 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 99 | public AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 100 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 101 | var call = CreateCall(__Method_Div, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 102 | return Calls.AsyncUnaryCall(call, request); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 103 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 104 | 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] | 105 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 106 | var call = CreateCall(__Method_DivMany, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 107 | return Calls.AsyncDuplexStreamingCall(call); |
| 108 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 109 | public AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 110 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 111 | var call = CreateCall(__Method_DivMany, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 112 | return Calls.AsyncDuplexStreamingCall(call); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 113 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 114 | 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] | 115 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 116 | var call = CreateCall(__Method_Fib, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 117 | return Calls.AsyncServerStreamingCall(call, request); |
| 118 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 119 | public AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 120 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 121 | var call = CreateCall(__Method_Fib, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 122 | return Calls.AsyncServerStreamingCall(call, request); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 123 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 124 | 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] | 125 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 126 | var call = CreateCall(__Method_Sum, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 127 | return Calls.AsyncClientStreamingCall(call); |
| 128 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 129 | public AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 130 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 131 | var call = CreateCall(__Method_Sum, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 132 | return Calls.AsyncClientStreamingCall(call); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 133 | } |
| 134 | } |
| 135 | |
| 136 | // creates service definition that can be registered with a server |
| 137 | public static ServerServiceDefinition BindService(IMath serviceImpl) |
| 138 | { |
| 139 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 140 | .AddMethod(__Method_Div, serviceImpl.Div) |
| 141 | .AddMethod(__Method_DivMany, serviceImpl.DivMany) |
| 142 | .AddMethod(__Method_Fib, serviceImpl.Fib) |
| 143 | .AddMethod(__Method_Sum, serviceImpl.Sum).Build(); |
| 144 | } |
| 145 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 146 | // creates a new client |
| 147 | public static MathClient NewClient(Channel channel) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 148 | { |
| 149 | return new MathClient(channel); |
| 150 | } |
| 151 | |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 152 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 153 | } |
Jan Tattermusch | cd7e313 | 2015-05-07 15:10:23 -0700 | [diff] [blame] | 154 | #endregion |