blob: 67827e7b4f6408b8c00c1898913d6c32af09c914 [file] [log] [blame]
Jan Tattermusch085533e2015-05-07 14:34:45 -07001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: math.proto
3#region Designer generated code
Jan Tattermuscha7fff862015-02-13 11:08:08 -08004
Jan Tattermusch15111f52015-02-05 18:15:14 -08005using System;
Jan Tattermusch30868622015-02-19 09:22:33 -08006using System.Threading;
7using System.Threading.Tasks;
8using Grpc.Core;
Jan Tattermusch15111f52015-02-05 18:15:14 -08009
Jan Tattermusch085533e2015-05-07 14:34:45 -070010namespace math {
11 public static class Math
12 {
13 static readonly string __ServiceName = "math.Math";
14
Jan Tattermusch3fffe602015-05-20 08:56:24 -070015 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 Tattermusch085533e2015-05-07 14:34:45 -070019
Jan Tattermusch3fffe602015-05-20 08:56:24 -070020 static readonly Method<global::math.DivArgs, global::math.DivReply> __Method_Div = new Method<global::math.DivArgs, global::math.DivReply>(
Jan Tattermusch085533e2015-05-07 14:34:45 -070021 MethodType.Unary,
22 "Div",
23 __Marshaller_DivArgs,
24 __Marshaller_DivReply);
25
Jan Tattermusch3fffe602015-05-20 08:56:24 -070026 static readonly Method<global::math.DivArgs, global::math.DivReply> __Method_DivMany = new Method<global::math.DivArgs, global::math.DivReply>(
Jan Tattermusch085533e2015-05-07 14:34:45 -070027 MethodType.DuplexStreaming,
28 "DivMany",
29 __Marshaller_DivArgs,
30 __Marshaller_DivReply);
31
Jan Tattermusch3fffe602015-05-20 08:56:24 -070032 static readonly Method<global::math.FibArgs, global::math.Num> __Method_Fib = new Method<global::math.FibArgs, global::math.Num>(
Jan Tattermusch085533e2015-05-07 14:34:45 -070033 MethodType.ServerStreaming,
34 "Fib",
35 __Marshaller_FibArgs,
36 __Marshaller_Num);
37
Jan Tattermusch3fffe602015-05-20 08:56:24 -070038 static readonly Method<global::math.Num, global::math.Num> __Method_Sum = new Method<global::math.Num, global::math.Num>(
Jan Tattermusch085533e2015-05-07 14:34:45 -070039 MethodType.ClientStreaming,
40 "Sum",
41 __Marshaller_Num,
42 __Marshaller_Num);
43
Jan Tattermuschb5332812015-07-14 19:29:35 -070044 // client interface
Jan Tattermusch085533e2015-05-07 14:34:45 -070045 public interface IMathClient
Jan Tattermusch15111f52015-02-05 18:15:14 -080046 {
Jan Tattermusch74529562015-07-23 14:04:51 -070047 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 Tattermusch15111f52015-02-05 18:15:14 -080052 }
Jan Tattermusch085533e2015-05-07 14:34:45 -070053
54 // server-side interface
55 public interface IMath
56 {
Jan Tattermusch25bb2ef2015-07-21 12:15:53 -070057 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 Tattermusch085533e2015-05-07 14:34:45 -070061 }
62
63 // client stub
Jan Tattermuschb5332812015-07-14 19:29:35 -070064 public class MathClient : ClientBase, IMathClient
Jan Tattermusch085533e2015-05-07 14:34:45 -070065 {
Jan Tattermuschb5332812015-07-14 19:29:35 -070066 public MathClient(Channel channel) : base(channel)
Jan Tattermusch085533e2015-05-07 14:34:45 -070067 {
68 }
Jan Tattermusch74529562015-07-23 14:04:51 -070069 public global::math.DivReply Div(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch085533e2015-05-07 14:34:45 -070070 {
Jan Tattermusch74529562015-07-23 14:04:51 -070071 var call = CreateCall(__ServiceName, __Method_Div, headers, deadline);
Jan Tattermuschfd953a52015-07-14 21:41:29 -070072 return Calls.BlockingUnaryCall(call, request, cancellationToken);
Jan Tattermusch085533e2015-05-07 14:34:45 -070073 }
Jan Tattermusch74529562015-07-23 14:04:51 -070074 public AsyncUnaryCall<global::math.DivReply> DivAsync(global::math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch085533e2015-05-07 14:34:45 -070075 {
Jan Tattermusch74529562015-07-23 14:04:51 -070076 var call = CreateCall(__ServiceName, __Method_Div, headers, deadline);
Jan Tattermuschfd953a52015-07-14 21:41:29 -070077 return Calls.AsyncUnaryCall(call, request, cancellationToken);
Jan Tattermusch085533e2015-05-07 14:34:45 -070078 }
Jan Tattermusch74529562015-07-23 14:04:51 -070079 public AsyncDuplexStreamingCall<global::math.DivArgs, global::math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch085533e2015-05-07 14:34:45 -070080 {
Jan Tattermusch74529562015-07-23 14:04:51 -070081 var call = CreateCall(__ServiceName, __Method_DivMany, headers, deadline);
Jan Tattermuschfd953a52015-07-14 21:41:29 -070082 return Calls.AsyncDuplexStreamingCall(call, cancellationToken);
Jan Tattermusch085533e2015-05-07 14:34:45 -070083 }
Jan Tattermusch74529562015-07-23 14:04:51 -070084 public AsyncServerStreamingCall<global::math.Num> Fib(global::math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch085533e2015-05-07 14:34:45 -070085 {
Jan Tattermusch74529562015-07-23 14:04:51 -070086 var call = CreateCall(__ServiceName, __Method_Fib, headers, deadline);
Jan Tattermuschfd953a52015-07-14 21:41:29 -070087 return Calls.AsyncServerStreamingCall(call, request, cancellationToken);
Jan Tattermusch085533e2015-05-07 14:34:45 -070088 }
Jan Tattermusch74529562015-07-23 14:04:51 -070089 public AsyncClientStreamingCall<global::math.Num, global::math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch085533e2015-05-07 14:34:45 -070090 {
Jan Tattermusch74529562015-07-23 14:04:51 -070091 var call = CreateCall(__ServiceName, __Method_Sum, headers, deadline);
Jan Tattermuschfd953a52015-07-14 21:41:29 -070092 return Calls.AsyncClientStreamingCall(call, cancellationToken);
Jan Tattermusch085533e2015-05-07 14:34:45 -070093 }
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 Tattermuschb5332812015-07-14 19:29:35 -0700106 // creates a new client
107 public static MathClient NewClient(Channel channel)
Jan Tattermusch085533e2015-05-07 14:34:45 -0700108 {
109 return new MathClient(channel);
110 }
111
Jan Tattermusch085533e2015-05-07 14:34:45 -0700112 }
Craig Tiller190d3602015-02-18 09:23:38 -0800113}
Jan Tattermuschcd7e3132015-05-07 15:10:23 -0700114#endregion