Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 2 | // source: src/proto/grpc/testing/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 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 68 | get { return global::Grpc.Testing.TestReflection.Descriptor.Services[0]; } |
Jan Tattermusch | e6af5d1 | 2015-08-03 10:57:43 -0700 | [diff] [blame] | 69 | } |
| 70 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 71 | // client interface |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 72 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 73 | public interface ITestServiceClient |
| 74 | { |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 75 | 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] | 76 | global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 77 | 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] | 78 | 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] | 79 | 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] | 80 | global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 81 | 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] | 82 | 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] | 83 | 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] | 84 | 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] | 85 | 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] | 86 | AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 87 | 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] | 88 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options); |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 89 | 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] | 90 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | // server-side interface |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 94 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 95 | public interface ITestService |
| 96 | { |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 97 | Task<global::Grpc.Testing.Empty> EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context); |
| 98 | Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); |
| 99 | Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
| 100 | Task<global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<global::Grpc.Testing.StreamingInputCallRequest> requestStream, ServerCallContext context); |
| 101 | Task FullDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
| 102 | 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] | 103 | } |
| 104 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 105 | // server-side abstract class |
| 106 | public abstract class TestServiceBase |
| 107 | { |
| 108 | public virtual Task<global::Grpc.Testing.Empty> EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context) |
| 109 | { |
| 110 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 111 | } |
| 112 | |
| 113 | public virtual Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) |
| 114 | { |
| 115 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 116 | } |
| 117 | |
| 118 | public virtual Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context) |
| 119 | { |
| 120 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 121 | } |
| 122 | |
| 123 | public virtual Task<global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<global::Grpc.Testing.StreamingInputCallRequest> requestStream, ServerCallContext context) |
| 124 | { |
| 125 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 126 | } |
| 127 | |
| 128 | public virtual Task FullDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context) |
| 129 | { |
| 130 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 131 | } |
| 132 | |
| 133 | public virtual Task HalfDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context) |
| 134 | { |
| 135 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 136 | } |
| 137 | |
| 138 | } |
| 139 | |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 140 | // client stub |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 141 | public class TestServiceClient : ClientBase<TestServiceClient>, ITestServiceClient |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 142 | { |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 143 | public TestServiceClient(Channel channel) : base(channel) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 144 | { |
| 145 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 146 | public TestServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 147 | { |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 148 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 149 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 150 | protected TestServiceClient() : base() |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 151 | { |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 152 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 153 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 154 | protected TestServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 155 | { |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 156 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 157 | |
| 158 | public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 159 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 160 | return EmptyCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 161 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 162 | public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 163 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 164 | return CallInvoker.BlockingUnaryCall(__Method_EmptyCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 165 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 166 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 167 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 168 | return EmptyCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 169 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 170 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 171 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 172 | return CallInvoker.AsyncUnaryCall(__Method_EmptyCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 173 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 174 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 175 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 176 | return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 177 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 178 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 179 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 180 | return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 181 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 182 | public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 183 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 184 | return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 185 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 186 | public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 187 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 188 | return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 189 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 190 | public virtual AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 191 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 192 | return StreamingOutputCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 193 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 194 | public virtual AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 195 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 196 | return CallInvoker.AsyncServerStreamingCall(__Method_StreamingOutputCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 197 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 198 | public virtual AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 199 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 200 | return StreamingInputCall(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 201 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 202 | public virtual AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 203 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 204 | return CallInvoker.AsyncClientStreamingCall(__Method_StreamingInputCall, null, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 205 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 206 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 207 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 208 | return FullDuplexCall(new CallOptions(headers, deadline, cancellationToken)); |
| 209 | } |
| 210 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options) |
| 211 | { |
| 212 | return CallInvoker.AsyncDuplexStreamingCall(__Method_FullDuplexCall, null, options); |
| 213 | } |
| 214 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 215 | { |
| 216 | return HalfDuplexCall(new CallOptions(headers, deadline, cancellationToken)); |
| 217 | } |
| 218 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options) |
| 219 | { |
| 220 | return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options); |
| 221 | } |
| 222 | protected override TestServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 223 | { |
| 224 | return new TestServiceClient(configuration); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 225 | } |
| 226 | } |
| 227 | |
| 228 | // creates service definition that can be registered with a server |
| 229 | public static ServerServiceDefinition BindService(ITestService serviceImpl) |
| 230 | { |
| 231 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 232 | .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) |
| 233 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 234 | .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall) |
| 235 | .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall) |
| 236 | .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall) |
| 237 | .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(); |
| 238 | } |
| 239 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 240 | // creates service definition that can be registered with a server |
| 241 | public static ServerServiceDefinition BindService(TestServiceBase serviceImpl) |
| 242 | { |
| 243 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 244 | .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) |
| 245 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 246 | .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall) |
| 247 | .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall) |
| 248 | .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall) |
| 249 | .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(); |
| 250 | } |
| 251 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 252 | // creates a new client |
| 253 | public static TestServiceClient NewClient(Channel channel) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 254 | { |
| 255 | return new TestServiceClient(channel); |
| 256 | } |
| 257 | |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 258 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 259 | public static class UnimplementedService |
| 260 | { |
| 261 | static readonly string __ServiceName = "grpc.testing.UnimplementedService"; |
| 262 | |
| 263 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 264 | |
| 265 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>( |
| 266 | MethodType.Unary, |
| 267 | __ServiceName, |
| 268 | "UnimplementedCall", |
| 269 | __Marshaller_Empty, |
| 270 | __Marshaller_Empty); |
| 271 | |
| 272 | // service descriptor |
| 273 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 274 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 275 | get { return global::Grpc.Testing.TestReflection.Descriptor.Services[1]; } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 276 | } |
| 277 | |
| 278 | // client interface |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 279 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 280 | public interface IUnimplementedServiceClient |
| 281 | { |
| 282 | global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 283 | global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options); |
| 284 | AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 285 | AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options); |
| 286 | } |
| 287 | |
| 288 | // server-side interface |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 289 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 290 | public interface IUnimplementedService |
| 291 | { |
| 292 | Task<global::Grpc.Testing.Empty> UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context); |
| 293 | } |
| 294 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 295 | // server-side abstract class |
| 296 | public abstract class UnimplementedServiceBase |
| 297 | { |
| 298 | public virtual Task<global::Grpc.Testing.Empty> UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context) |
| 299 | { |
| 300 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 301 | } |
| 302 | |
| 303 | } |
| 304 | |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 305 | // client stub |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 306 | public class UnimplementedServiceClient : ClientBase<UnimplementedServiceClient>, IUnimplementedServiceClient |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 307 | { |
| 308 | public UnimplementedServiceClient(Channel channel) : base(channel) |
| 309 | { |
| 310 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 311 | public UnimplementedServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 312 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 313 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 314 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 315 | protected UnimplementedServiceClient() : base() |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 316 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 317 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 318 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 319 | protected UnimplementedServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 320 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 321 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 322 | |
| 323 | public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 324 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 325 | return UnimplementedCall(request, new CallOptions(headers, deadline, cancellationToken)); |
| 326 | } |
| 327 | public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options) |
| 328 | { |
| 329 | return CallInvoker.BlockingUnaryCall(__Method_UnimplementedCall, null, options, request); |
| 330 | } |
| 331 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 332 | { |
| 333 | return UnimplementedCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 334 | } |
| 335 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options) |
| 336 | { |
| 337 | return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request); |
| 338 | } |
| 339 | protected override UnimplementedServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 340 | { |
| 341 | return new UnimplementedServiceClient(configuration); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 342 | } |
| 343 | } |
| 344 | |
| 345 | // creates service definition that can be registered with a server |
| 346 | public static ServerServiceDefinition BindService(IUnimplementedService serviceImpl) |
| 347 | { |
| 348 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 349 | .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build(); |
| 350 | } |
| 351 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 352 | // creates service definition that can be registered with a server |
| 353 | public static ServerServiceDefinition BindService(UnimplementedServiceBase serviceImpl) |
| 354 | { |
| 355 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 356 | .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build(); |
| 357 | } |
| 358 | |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 359 | // creates a new client |
| 360 | public static UnimplementedServiceClient NewClient(Channel channel) |
| 361 | { |
| 362 | return new UnimplementedServiceClient(channel); |
| 363 | } |
| 364 | |
| 365 | } |
| 366 | public static class ReconnectService |
| 367 | { |
| 368 | static readonly string __ServiceName = "grpc.testing.ReconnectService"; |
| 369 | |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 370 | static readonly Marshaller<global::Grpc.Testing.ReconnectParams> __Marshaller_ReconnectParams = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectParams.Parser.ParseFrom); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 371 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 372 | static readonly Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_ReconnectInfo = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom); |
| 373 | |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 374 | static readonly Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty> __Method_Start = new Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty>( |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 375 | MethodType.Unary, |
| 376 | __ServiceName, |
| 377 | "Start", |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 378 | __Marshaller_ReconnectParams, |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 379 | __Marshaller_Empty); |
| 380 | |
| 381 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo> __Method_Stop = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo>( |
| 382 | MethodType.Unary, |
| 383 | __ServiceName, |
| 384 | "Stop", |
| 385 | __Marshaller_Empty, |
| 386 | __Marshaller_ReconnectInfo); |
| 387 | |
| 388 | // service descriptor |
| 389 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 390 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 391 | get { return global::Grpc.Testing.TestReflection.Descriptor.Services[2]; } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | // client interface |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 395 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 396 | public interface IReconnectServiceClient |
| 397 | { |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 398 | global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 399 | global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, CallOptions options); |
| 400 | AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 401 | AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, CallOptions options); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 402 | global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 403 | global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options); |
| 404 | AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 405 | AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options); |
| 406 | } |
| 407 | |
| 408 | // server-side interface |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 409 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 410 | public interface IReconnectService |
| 411 | { |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 412 | Task<global::Grpc.Testing.Empty> Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 413 | Task<global::Grpc.Testing.ReconnectInfo> Stop(global::Grpc.Testing.Empty request, ServerCallContext context); |
| 414 | } |
| 415 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 416 | // server-side abstract class |
| 417 | public abstract class ReconnectServiceBase |
| 418 | { |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 419 | public virtual Task<global::Grpc.Testing.Empty> Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 420 | { |
| 421 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 422 | } |
| 423 | |
| 424 | public virtual Task<global::Grpc.Testing.ReconnectInfo> Stop(global::Grpc.Testing.Empty request, ServerCallContext context) |
| 425 | { |
| 426 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 427 | } |
| 428 | |
| 429 | } |
| 430 | |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 431 | // client stub |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 432 | public class ReconnectServiceClient : ClientBase<ReconnectServiceClient>, IReconnectServiceClient |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 433 | { |
| 434 | public ReconnectServiceClient(Channel channel) : base(channel) |
| 435 | { |
| 436 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 437 | public ReconnectServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 438 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 439 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 440 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 441 | protected ReconnectServiceClient() : base() |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 442 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 443 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 444 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 445 | protected ReconnectServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 446 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 447 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 448 | |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 449 | public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 450 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 451 | return Start(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 452 | } |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 453 | public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, CallOptions options) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 454 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 455 | return CallInvoker.BlockingUnaryCall(__Method_Start, null, options, request); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 456 | } |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 457 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 458 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 459 | return StartAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 460 | } |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame^] | 461 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, CallOptions options) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 462 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 463 | return CallInvoker.AsyncUnaryCall(__Method_Start, null, options, request); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 464 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 465 | public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 466 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 467 | return Stop(request, new CallOptions(headers, deadline, cancellationToken)); |
| 468 | } |
| 469 | public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options) |
| 470 | { |
| 471 | return CallInvoker.BlockingUnaryCall(__Method_Stop, null, options, request); |
| 472 | } |
| 473 | public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 474 | { |
| 475 | return StopAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 476 | } |
| 477 | public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options) |
| 478 | { |
| 479 | return CallInvoker.AsyncUnaryCall(__Method_Stop, null, options, request); |
| 480 | } |
| 481 | protected override ReconnectServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 482 | { |
| 483 | return new ReconnectServiceClient(configuration); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 484 | } |
| 485 | } |
| 486 | |
| 487 | // creates service definition that can be registered with a server |
| 488 | public static ServerServiceDefinition BindService(IReconnectService serviceImpl) |
| 489 | { |
| 490 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 491 | .AddMethod(__Method_Start, serviceImpl.Start) |
| 492 | .AddMethod(__Method_Stop, serviceImpl.Stop).Build(); |
| 493 | } |
| 494 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 495 | // creates service definition that can be registered with a server |
| 496 | public static ServerServiceDefinition BindService(ReconnectServiceBase serviceImpl) |
| 497 | { |
| 498 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 499 | .AddMethod(__Method_Start, serviceImpl.Start) |
| 500 | .AddMethod(__Method_Stop, serviceImpl.Stop).Build(); |
| 501 | } |
| 502 | |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 503 | // creates a new client |
| 504 | public static ReconnectServiceClient NewClient(Channel channel) |
| 505 | { |
| 506 | return new ReconnectServiceClient(channel); |
| 507 | } |
| 508 | |
| 509 | } |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 510 | } |
Jan Tattermusch | cd7e313 | 2015-05-07 15:10:23 -0700 | [diff] [blame] | 511 | #endregion |