Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 2 | // source: test/proto/test.proto |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 3 | #region Designer generated code |
| 4 | |
| 5 | using System; |
| 6 | using System.Threading; |
| 7 | using System.Threading.Tasks; |
| 8 | using Grpc.Core; |
| 9 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 10 | namespace Grpc.Testing { |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 11 | public static class TestService |
| 12 | { |
| 13 | static readonly string __ServiceName = "grpc.testing.TestService"; |
| 14 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 15 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 16 | static readonly Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); |
| 17 | static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); |
| 18 | static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallRequest> __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom); |
| 19 | static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallResponse> __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom); |
| 20 | static readonly Marshaller<global::Grpc.Testing.StreamingInputCallRequest> __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom); |
| 21 | static readonly Marshaller<global::Grpc.Testing.StreamingInputCallResponse> __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 22 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -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, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 25 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 26 | "EmptyCall", |
| 27 | __Marshaller_Empty, |
| 28 | __Marshaller_Empty); |
| 29 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 30 | 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] | 31 | MethodType.Unary, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 32 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 33 | "UnaryCall", |
| 34 | __Marshaller_SimpleRequest, |
| 35 | __Marshaller_SimpleResponse); |
| 36 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 37 | 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] | 38 | MethodType.ServerStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 39 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 40 | "StreamingOutputCall", |
| 41 | __Marshaller_StreamingOutputCallRequest, |
| 42 | __Marshaller_StreamingOutputCallResponse); |
| 43 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 44 | 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] | 45 | MethodType.ClientStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 46 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 47 | "StreamingInputCall", |
| 48 | __Marshaller_StreamingInputCallRequest, |
| 49 | __Marshaller_StreamingInputCallResponse); |
| 50 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 51 | 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] | 52 | MethodType.DuplexStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 53 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 54 | "FullDuplexCall", |
| 55 | __Marshaller_StreamingOutputCallRequest, |
| 56 | __Marshaller_StreamingOutputCallResponse); |
| 57 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 58 | 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] | 59 | MethodType.DuplexStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 60 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 61 | "HalfDuplexCall", |
| 62 | __Marshaller_StreamingOutputCallRequest, |
| 63 | __Marshaller_StreamingOutputCallResponse); |
| 64 | |
Jan Tattermusch | e6af5d1 | 2015-08-03 10:57:43 -0700 | [diff] [blame] | 65 | // service descriptor |
| 66 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 67 | { |
| 68 | get { return global::Grpc.Testing.Test.Descriptor.Services[0]; } |
| 69 | } |
| 70 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 71 | // client interface |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 72 | public interface ITestServiceClient |
| 73 | { |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 74 | global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 75 | global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 76 | AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 77 | AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 78 | global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 79 | global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 80 | AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 81 | AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 82 | AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 83 | AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 84 | AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 85 | AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 86 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 87 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 88 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 89 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | // server-side interface |
| 93 | public interface ITestService |
| 94 | { |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 95 | Task<global::Grpc.Testing.Empty> EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context); |
| 96 | Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); |
| 97 | Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
| 98 | Task<global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<global::Grpc.Testing.StreamingInputCallRequest> requestStream, ServerCallContext context); |
| 99 | Task FullDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
| 100 | 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] | 101 | } |
| 102 | |
| 103 | // client stub |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 104 | public class TestServiceClient : ClientBase, ITestServiceClient |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 105 | { |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 106 | public TestServiceClient(Channel channel) : base(channel) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 107 | { |
| 108 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 109 | 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] | 110 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 111 | var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 112 | return Calls.BlockingUnaryCall(call, request); |
| 113 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 114 | public global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 115 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 116 | var call = CreateCall(__Method_EmptyCall, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 117 | return Calls.BlockingUnaryCall(call, request); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 118 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 119 | 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] | 120 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 121 | var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 122 | return Calls.AsyncUnaryCall(call, request); |
| 123 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 124 | public AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 125 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 126 | var call = CreateCall(__Method_EmptyCall, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 127 | return Calls.AsyncUnaryCall(call, request); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 128 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 129 | 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] | 130 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 131 | var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 132 | return Calls.BlockingUnaryCall(call, request); |
| 133 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 134 | public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 135 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 136 | var call = CreateCall(__Method_UnaryCall, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 137 | return Calls.BlockingUnaryCall(call, request); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 138 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 139 | 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] | 140 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 141 | var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 142 | return Calls.AsyncUnaryCall(call, request); |
| 143 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 144 | public AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 145 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 146 | var call = CreateCall(__Method_UnaryCall, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 147 | return Calls.AsyncUnaryCall(call, request); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 148 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 149 | 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] | 150 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 151 | var call = CreateCall(__Method_StreamingOutputCall, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 152 | return Calls.AsyncServerStreamingCall(call, request); |
| 153 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 154 | public AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 155 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 156 | var call = CreateCall(__Method_StreamingOutputCall, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 157 | return Calls.AsyncServerStreamingCall(call, request); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 158 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 159 | 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] | 160 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 161 | var call = CreateCall(__Method_StreamingInputCall, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 162 | return Calls.AsyncClientStreamingCall(call); |
| 163 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 164 | public AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 165 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 166 | var call = CreateCall(__Method_StreamingInputCall, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 167 | return Calls.AsyncClientStreamingCall(call); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 168 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 169 | 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] | 170 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 171 | var call = CreateCall(__Method_FullDuplexCall, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 172 | return Calls.AsyncDuplexStreamingCall(call); |
| 173 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 174 | public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 175 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 176 | var call = CreateCall(__Method_FullDuplexCall, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 177 | return Calls.AsyncDuplexStreamingCall(call); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 178 | } |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 179 | 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] | 180 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 181 | var call = CreateCall(__Method_HalfDuplexCall, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 182 | return Calls.AsyncDuplexStreamingCall(call); |
| 183 | } |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 184 | public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 185 | { |
Jan Tattermusch | ffa17b1 | 2015-08-05 14:56:59 -0700 | [diff] [blame] | 186 | var call = CreateCall(__Method_HalfDuplexCall, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 187 | return Calls.AsyncDuplexStreamingCall(call); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 188 | } |
| 189 | } |
| 190 | |
| 191 | // creates service definition that can be registered with a server |
| 192 | public static ServerServiceDefinition BindService(ITestService serviceImpl) |
| 193 | { |
| 194 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 195 | .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) |
| 196 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 197 | .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall) |
| 198 | .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall) |
| 199 | .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall) |
| 200 | .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(); |
| 201 | } |
| 202 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 203 | // creates a new client |
| 204 | public static TestServiceClient NewClient(Channel channel) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 205 | { |
| 206 | return new TestServiceClient(channel); |
| 207 | } |
| 208 | |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 209 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 210 | public static class UnimplementedService |
| 211 | { |
| 212 | static readonly string __ServiceName = "grpc.testing.UnimplementedService"; |
| 213 | |
| 214 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 215 | |
| 216 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>( |
| 217 | MethodType.Unary, |
| 218 | __ServiceName, |
| 219 | "UnimplementedCall", |
| 220 | __Marshaller_Empty, |
| 221 | __Marshaller_Empty); |
| 222 | |
| 223 | // service descriptor |
| 224 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 225 | { |
| 226 | get { return global::Grpc.Testing.Test.Descriptor.Services[1]; } |
| 227 | } |
| 228 | |
| 229 | // client interface |
| 230 | public interface IUnimplementedServiceClient |
| 231 | { |
| 232 | global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 233 | global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options); |
| 234 | AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 235 | AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options); |
| 236 | } |
| 237 | |
| 238 | // server-side interface |
| 239 | public interface IUnimplementedService |
| 240 | { |
| 241 | Task<global::Grpc.Testing.Empty> UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context); |
| 242 | } |
| 243 | |
| 244 | // client stub |
| 245 | public class UnimplementedServiceClient : ClientBase, IUnimplementedServiceClient |
| 246 | { |
| 247 | public UnimplementedServiceClient(Channel channel) : base(channel) |
| 248 | { |
| 249 | } |
| 250 | public global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 251 | { |
| 252 | var call = CreateCall(__Method_UnimplementedCall, new CallOptions(headers, deadline, cancellationToken)); |
| 253 | return Calls.BlockingUnaryCall(call, request); |
| 254 | } |
| 255 | public global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options) |
| 256 | { |
| 257 | var call = CreateCall(__Method_UnimplementedCall, options); |
| 258 | return Calls.BlockingUnaryCall(call, request); |
| 259 | } |
| 260 | public AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 261 | { |
| 262 | var call = CreateCall(__Method_UnimplementedCall, new CallOptions(headers, deadline, cancellationToken)); |
| 263 | return Calls.AsyncUnaryCall(call, request); |
| 264 | } |
| 265 | public AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options) |
| 266 | { |
| 267 | var call = CreateCall(__Method_UnimplementedCall, options); |
| 268 | return Calls.AsyncUnaryCall(call, request); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | // creates service definition that can be registered with a server |
| 273 | public static ServerServiceDefinition BindService(IUnimplementedService serviceImpl) |
| 274 | { |
| 275 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 276 | .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build(); |
| 277 | } |
| 278 | |
| 279 | // creates a new client |
| 280 | public static UnimplementedServiceClient NewClient(Channel channel) |
| 281 | { |
| 282 | return new UnimplementedServiceClient(channel); |
| 283 | } |
| 284 | |
| 285 | } |
| 286 | public static class ReconnectService |
| 287 | { |
| 288 | static readonly string __ServiceName = "grpc.testing.ReconnectService"; |
| 289 | |
| 290 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 291 | static readonly Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_ReconnectInfo = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom); |
| 292 | |
| 293 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_Start = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>( |
| 294 | MethodType.Unary, |
| 295 | __ServiceName, |
| 296 | "Start", |
| 297 | __Marshaller_Empty, |
| 298 | __Marshaller_Empty); |
| 299 | |
| 300 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo> __Method_Stop = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo>( |
| 301 | MethodType.Unary, |
| 302 | __ServiceName, |
| 303 | "Stop", |
| 304 | __Marshaller_Empty, |
| 305 | __Marshaller_ReconnectInfo); |
| 306 | |
| 307 | // service descriptor |
| 308 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 309 | { |
| 310 | get { return global::Grpc.Testing.Test.Descriptor.Services[2]; } |
| 311 | } |
| 312 | |
| 313 | // client interface |
| 314 | public interface IReconnectServiceClient |
| 315 | { |
| 316 | global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 317 | global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, CallOptions options); |
| 318 | AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 319 | AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.Empty request, CallOptions options); |
| 320 | global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 321 | global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options); |
| 322 | AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 323 | AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options); |
| 324 | } |
| 325 | |
| 326 | // server-side interface |
| 327 | public interface IReconnectService |
| 328 | { |
| 329 | Task<global::Grpc.Testing.Empty> Start(global::Grpc.Testing.Empty request, ServerCallContext context); |
| 330 | Task<global::Grpc.Testing.ReconnectInfo> Stop(global::Grpc.Testing.Empty request, ServerCallContext context); |
| 331 | } |
| 332 | |
| 333 | // client stub |
| 334 | public class ReconnectServiceClient : ClientBase, IReconnectServiceClient |
| 335 | { |
| 336 | public ReconnectServiceClient(Channel channel) : base(channel) |
| 337 | { |
| 338 | } |
| 339 | public global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 340 | { |
| 341 | var call = CreateCall(__Method_Start, new CallOptions(headers, deadline, cancellationToken)); |
| 342 | return Calls.BlockingUnaryCall(call, request); |
| 343 | } |
| 344 | public global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, CallOptions options) |
| 345 | { |
| 346 | var call = CreateCall(__Method_Start, options); |
| 347 | return Calls.BlockingUnaryCall(call, request); |
| 348 | } |
| 349 | public AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 350 | { |
| 351 | var call = CreateCall(__Method_Start, new CallOptions(headers, deadline, cancellationToken)); |
| 352 | return Calls.AsyncUnaryCall(call, request); |
| 353 | } |
| 354 | public AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.Empty request, CallOptions options) |
| 355 | { |
| 356 | var call = CreateCall(__Method_Start, options); |
| 357 | return Calls.AsyncUnaryCall(call, request); |
| 358 | } |
| 359 | public global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 360 | { |
| 361 | var call = CreateCall(__Method_Stop, new CallOptions(headers, deadline, cancellationToken)); |
| 362 | return Calls.BlockingUnaryCall(call, request); |
| 363 | } |
| 364 | public global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options) |
| 365 | { |
| 366 | var call = CreateCall(__Method_Stop, options); |
| 367 | return Calls.BlockingUnaryCall(call, request); |
| 368 | } |
| 369 | public AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 370 | { |
| 371 | var call = CreateCall(__Method_Stop, new CallOptions(headers, deadline, cancellationToken)); |
| 372 | return Calls.AsyncUnaryCall(call, request); |
| 373 | } |
| 374 | public AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options) |
| 375 | { |
| 376 | var call = CreateCall(__Method_Stop, options); |
| 377 | return Calls.AsyncUnaryCall(call, request); |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | // creates service definition that can be registered with a server |
| 382 | public static ServerServiceDefinition BindService(IReconnectService serviceImpl) |
| 383 | { |
| 384 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 385 | .AddMethod(__Method_Start, serviceImpl.Start) |
| 386 | .AddMethod(__Method_Stop, serviceImpl.Stop).Build(); |
| 387 | } |
| 388 | |
| 389 | // creates a new client |
| 390 | public static ReconnectServiceClient NewClient(Channel channel) |
| 391 | { |
| 392 | return new ReconnectServiceClient(channel); |
| 393 | } |
| 394 | |
| 395 | } |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 396 | } |
Jan Tattermusch | cd7e313 | 2015-05-07 15:10:23 -0700 | [diff] [blame] | 397 | #endregion |