Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: test.proto |
| 3 | #region Designer generated code |
| 4 | |
| 5 | using System; |
| 6 | using System.Threading; |
| 7 | using System.Threading.Tasks; |
| 8 | using Grpc.Core; |
| 9 | |
| 10 | namespace grpc.testing { |
| 11 | public static class TestService |
| 12 | { |
| 13 | static readonly string __ServiceName = "grpc.testing.TestService"; |
| 14 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 15 | static readonly Marshaller<global::grpc.testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.Empty.ParseFrom); |
| 16 | static readonly Marshaller<global::grpc.testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleRequest.ParseFrom); |
| 17 | static readonly Marshaller<global::grpc.testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleResponse.ParseFrom); |
| 18 | static readonly Marshaller<global::grpc.testing.StreamingOutputCallRequest> __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallRequest.ParseFrom); |
| 19 | static readonly Marshaller<global::grpc.testing.StreamingOutputCallResponse> __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallResponse.ParseFrom); |
| 20 | static readonly Marshaller<global::grpc.testing.StreamingInputCallRequest> __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallRequest.ParseFrom); |
| 21 | static readonly Marshaller<global::grpc.testing.StreamingInputCallResponse> __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallResponse.ParseFrom); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 22 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 23 | static readonly Method<global::grpc.testing.Empty, global::grpc.testing.Empty> __Method_EmptyCall = new Method<global::grpc.testing.Empty, global::grpc.testing.Empty>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 24 | MethodType.Unary, |
| 25 | "EmptyCall", |
| 26 | __Marshaller_Empty, |
| 27 | __Marshaller_Empty); |
| 28 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 29 | static readonly Method<global::grpc.testing.SimpleRequest, global::grpc.testing.SimpleResponse> __Method_UnaryCall = new Method<global::grpc.testing.SimpleRequest, global::grpc.testing.SimpleResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 30 | MethodType.Unary, |
| 31 | "UnaryCall", |
| 32 | __Marshaller_SimpleRequest, |
| 33 | __Marshaller_SimpleResponse); |
| 34 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 35 | static readonly Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 36 | MethodType.ServerStreaming, |
| 37 | "StreamingOutputCall", |
| 38 | __Marshaller_StreamingOutputCallRequest, |
| 39 | __Marshaller_StreamingOutputCallResponse); |
| 40 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 41 | static readonly Method<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> __Method_StreamingInputCall = new Method<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 42 | MethodType.ClientStreaming, |
| 43 | "StreamingInputCall", |
| 44 | __Marshaller_StreamingInputCallRequest, |
| 45 | __Marshaller_StreamingInputCallResponse); |
| 46 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 47 | static readonly Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> __Method_FullDuplexCall = new Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 48 | MethodType.DuplexStreaming, |
| 49 | "FullDuplexCall", |
| 50 | __Marshaller_StreamingOutputCallRequest, |
| 51 | __Marshaller_StreamingOutputCallResponse); |
| 52 | |
Jan Tattermusch | 3fffe60 | 2015-05-20 08:56:24 -0700 | [diff] [blame] | 53 | static readonly Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> __Method_HalfDuplexCall = new Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 54 | MethodType.DuplexStreaming, |
| 55 | "HalfDuplexCall", |
| 56 | __Marshaller_StreamingOutputCallRequest, |
| 57 | __Marshaller_StreamingOutputCallResponse); |
| 58 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 59 | // client interface |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 60 | public interface ITestServiceClient |
| 61 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 62 | global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 63 | AsyncUnaryCall<global::grpc.testing.Empty> EmptyCallAsync(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 64 | global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 65 | AsyncUnaryCall<global::grpc.testing.SimpleResponse> UnaryCallAsync(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 66 | AsyncServerStreamingCall<global::grpc.testing.StreamingOutputCallResponse> StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 67 | AsyncClientStreamingCall<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 68 | AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 69 | AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | // server-side interface |
| 73 | public interface ITestService |
| 74 | { |
Jan Tattermusch | 25bb2ef | 2015-07-21 12:15:53 -0700 | [diff] [blame] | 75 | Task<global::grpc.testing.Empty> EmptyCall(global::grpc.testing.Empty request, ServerCallContext context); |
| 76 | Task<global::grpc.testing.SimpleResponse> UnaryCall(global::grpc.testing.SimpleRequest request, ServerCallContext context); |
| 77 | Task StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, IServerStreamWriter<global::grpc.testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
| 78 | Task<global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<global::grpc.testing.StreamingInputCallRequest> requestStream, ServerCallContext context); |
| 79 | Task FullDuplexCall(IAsyncStreamReader<global::grpc.testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::grpc.testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
| 80 | Task HalfDuplexCall(IAsyncStreamReader<global::grpc.testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::grpc.testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | // client stub |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 84 | public class TestServiceClient : ClientBase, ITestServiceClient |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 85 | { |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 86 | public TestServiceClient(Channel channel) : base(channel) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 87 | { |
| 88 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 89 | public global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 90 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 91 | var call = CreateCall(__ServiceName, __Method_EmptyCall, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 92 | return Calls.BlockingUnaryCall(call, request, cancellationToken); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 93 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 94 | public AsyncUnaryCall<global::grpc.testing.Empty> EmptyCallAsync(global::grpc.testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 95 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 96 | var call = CreateCall(__ServiceName, __Method_EmptyCall, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 97 | return Calls.AsyncUnaryCall(call, request, cancellationToken); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 98 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 99 | public global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 100 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 101 | var call = CreateCall(__ServiceName, __Method_UnaryCall, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 102 | return Calls.BlockingUnaryCall(call, request, cancellationToken); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 103 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 104 | public AsyncUnaryCall<global::grpc.testing.SimpleResponse> UnaryCallAsync(global::grpc.testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 105 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 106 | var call = CreateCall(__ServiceName, __Method_UnaryCall, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 107 | return Calls.AsyncUnaryCall(call, request, cancellationToken); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 108 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 109 | public AsyncServerStreamingCall<global::grpc.testing.StreamingOutputCallResponse> StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 110 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 111 | var call = CreateCall(__ServiceName, __Method_StreamingOutputCall, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 112 | return Calls.AsyncServerStreamingCall(call, request, cancellationToken); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 113 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 114 | public AsyncClientStreamingCall<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 115 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 116 | var call = CreateCall(__ServiceName, __Method_StreamingInputCall, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 117 | return Calls.AsyncClientStreamingCall(call, cancellationToken); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 118 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 119 | public AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 120 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 121 | var call = CreateCall(__ServiceName, __Method_FullDuplexCall, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 122 | return Calls.AsyncDuplexStreamingCall(call, cancellationToken); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 123 | } |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 124 | public AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 125 | { |
Jan Tattermusch | 7452956 | 2015-07-23 14:04:51 -0700 | [diff] [blame^] | 126 | var call = CreateCall(__ServiceName, __Method_HalfDuplexCall, headers, deadline); |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 127 | return Calls.AsyncDuplexStreamingCall(call, cancellationToken); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 128 | } |
| 129 | } |
| 130 | |
| 131 | // creates service definition that can be registered with a server |
| 132 | public static ServerServiceDefinition BindService(ITestService serviceImpl) |
| 133 | { |
| 134 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 135 | .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) |
| 136 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 137 | .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall) |
| 138 | .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall) |
| 139 | .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall) |
| 140 | .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(); |
| 141 | } |
| 142 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 143 | // creates a new client |
| 144 | public static TestServiceClient NewClient(Channel channel) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 145 | { |
| 146 | return new TestServiceClient(channel); |
| 147 | } |
| 148 | |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 149 | } |
| 150 | } |
Jan Tattermusch | cd7e313 | 2015-05-07 15:10:23 -0700 | [diff] [blame] | 151 | #endregion |