blob: b84ec2d984ade80536ce30564e247fe748df2901 [file] [log] [blame]
Jan Tattermusch7eb3a762015-05-07 14:26:13 -07001// Generated by the protocol buffer compiler. DO NOT EDIT!
Jan Tattermusch72ce4422016-01-20 13:54:38 -08002// source: src/proto/grpc/testing/test.proto
Jan Tattermusch7eb3a762015-05-07 14:26:13 -07003#region Designer generated code
4
5using System;
6using System.Threading;
7using System.Threading.Tasks;
8using Grpc.Core;
9
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070010namespace Grpc.Testing {
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070011 public static class TestService
12 {
13 static readonly string __ServiceName = "grpc.testing.TestService";
14
Jan Tattermusch475f75a2015-08-03 09:46:04 -070015 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 Tattermusch7eb3a762015-05-07 14:26:13 -070022
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070023 static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_EmptyCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070024 MethodType.Unary,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070025 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070026 "EmptyCall",
27 __Marshaller_Empty,
28 __Marshaller_Empty);
29
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070030 static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070031 MethodType.Unary,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070032 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070033 "UnaryCall",
34 __Marshaller_SimpleRequest,
35 __Marshaller_SimpleResponse);
36
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070037 static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070038 MethodType.ServerStreaming,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070039 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070040 "StreamingOutputCall",
41 __Marshaller_StreamingOutputCallRequest,
42 __Marshaller_StreamingOutputCallResponse);
43
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070044 static readonly Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> __Method_StreamingInputCall = new Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070045 MethodType.ClientStreaming,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070046 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070047 "StreamingInputCall",
48 __Marshaller_StreamingInputCallRequest,
49 __Marshaller_StreamingInputCallResponse);
50
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070051 static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_FullDuplexCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070052 MethodType.DuplexStreaming,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070053 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070054 "FullDuplexCall",
55 __Marshaller_StreamingOutputCallRequest,
56 __Marshaller_StreamingOutputCallResponse);
57
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070058 static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_HalfDuplexCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070059 MethodType.DuplexStreaming,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070060 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070061 "HalfDuplexCall",
62 __Marshaller_StreamingOutputCallRequest,
63 __Marshaller_StreamingOutputCallResponse);
64
Jan Tattermusche6af5d12015-08-03 10:57:43 -070065 // service descriptor
66 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
67 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -080068 get { return global::Grpc.Testing.TestReflection.Descriptor.Services[0]; }
Jan Tattermusche6af5d12015-08-03 10:57:43 -070069 }
70
Jan Tattermuschb5332812015-07-14 19:29:35 -070071 // client interface
Jan Tattermuschddc4e342016-03-21 19:03:14 -070072 [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070073 public interface ITestServiceClient
74 {
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070075 global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermusch38536a72015-08-08 00:45:52 -070076 global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options);
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070077 AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermusch38536a72015-08-08 00:45:52 -070078 AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options);
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070079 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermusch38536a72015-08-08 00:45:52 -070080 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options);
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070081 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermusch38536a72015-08-08 00:45:52 -070082 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options);
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070083 AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermusch38536a72015-08-08 00:45:52 -070084 AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options);
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070085 AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermusch38536a72015-08-08 00:45:52 -070086 AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options);
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070087 AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermusch38536a72015-08-08 00:45:52 -070088 AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options);
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070089 AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermusch38536a72015-08-08 00:45:52 -070090 AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options);
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070091 }
92
93 // server-side interface
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070094 [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070095 public interface ITestService
96 {
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070097 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 Tattermusch7eb3a762015-05-07 14:26:13 -0700103 }
104
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700105 // 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 Tattermusch7eb3a762015-05-07 14:26:13 -0700140 // client stub
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700141 public class TestServiceClient : ClientBase<TestServiceClient>, ITestServiceClient
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700142 {
Jan Tattermuschb5332812015-07-14 19:29:35 -0700143 public TestServiceClient(Channel channel) : base(channel)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700144 {
145 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700146 public TestServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700147 {
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700148 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700149 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
150 protected TestServiceClient() : base()
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700151 {
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700152 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700153 ///<summary>Protected constructor to allow creation of configured clients.</summary>
154 protected TestServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700155 {
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700156 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700157
158 public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700159 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700160 return EmptyCall(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700161 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700162 public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700163 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700164 return CallInvoker.BlockingUnaryCall(__Method_EmptyCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700165 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700166 public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700167 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700168 return EmptyCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700169 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700170 public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700171 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700172 return CallInvoker.AsyncUnaryCall(__Method_EmptyCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700173 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700174 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700175 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700176 return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700177 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700178 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700179 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700180 return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700181 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700182 public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700183 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700184 return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700185 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700186 public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700187 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700188 return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700189 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700190 public virtual AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700191 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700192 return StreamingOutputCall(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700193 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700194 public virtual AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700195 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700196 return CallInvoker.AsyncServerStreamingCall(__Method_StreamingOutputCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700197 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700198 public virtual AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700199 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700200 return StreamingInputCall(new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700201 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700202 public virtual AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700203 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700204 return CallInvoker.AsyncClientStreamingCall(__Method_StreamingInputCall, null, options);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700205 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700206 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700207 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700208 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 Tattermusch7eb3a762015-05-07 14:26:13 -0700225 }
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 Tattermuscheeef5ed2016-03-14 16:08:39 -0700240 // 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 Tattermuschb5332812015-07-14 19:29:35 -0700252 // creates a new client
253 public static TestServiceClient NewClient(Channel channel)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700254 {
255 return new TestServiceClient(channel);
256 }
257
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700258 }
Jan Tattermusch70f86522015-10-07 18:23:51 -0700259 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 Tattermusch72ce4422016-01-20 13:54:38 -0800275 get { return global::Grpc.Testing.TestReflection.Descriptor.Services[1]; }
Jan Tattermusch70f86522015-10-07 18:23:51 -0700276 }
277
278 // client interface
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700279 [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
Jan Tattermusch70f86522015-10-07 18:23:51 -0700280 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 Tattermuscheeef5ed2016-03-14 16:08:39 -0700289 [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
Jan Tattermusch70f86522015-10-07 18:23:51 -0700290 public interface IUnimplementedService
291 {
292 Task<global::Grpc.Testing.Empty> UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context);
293 }
294
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700295 // 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 Tattermusch70f86522015-10-07 18:23:51 -0700305 // client stub
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700306 public class UnimplementedServiceClient : ClientBase<UnimplementedServiceClient>, IUnimplementedServiceClient
Jan Tattermusch70f86522015-10-07 18:23:51 -0700307 {
308 public UnimplementedServiceClient(Channel channel) : base(channel)
309 {
310 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700311 public UnimplementedServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700312 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700313 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700314 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
315 protected UnimplementedServiceClient() : base()
Jan Tattermusch70f86522015-10-07 18:23:51 -0700316 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700317 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700318 ///<summary>Protected constructor to allow creation of configured clients.</summary>
319 protected UnimplementedServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700320 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700321 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700322
323 public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch70f86522015-10-07 18:23:51 -0700324 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700325 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 Tattermusch70f86522015-10-07 18:23:51 -0700342 }
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 Tattermuscheeef5ed2016-03-14 16:08:39 -0700352 // 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 Tattermusch70f86522015-10-07 18:23:51 -0700359 // 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
370 static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
371 static readonly Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_ReconnectInfo = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom);
372
373 static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_Start = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
374 MethodType.Unary,
375 __ServiceName,
376 "Start",
377 __Marshaller_Empty,
378 __Marshaller_Empty);
379
380 static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo> __Method_Stop = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo>(
381 MethodType.Unary,
382 __ServiceName,
383 "Stop",
384 __Marshaller_Empty,
385 __Marshaller_ReconnectInfo);
386
387 // service descriptor
388 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
389 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -0800390 get { return global::Grpc.Testing.TestReflection.Descriptor.Services[2]; }
Jan Tattermusch70f86522015-10-07 18:23:51 -0700391 }
392
393 // client interface
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700394 [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
Jan Tattermusch70f86522015-10-07 18:23:51 -0700395 public interface IReconnectServiceClient
396 {
397 global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
398 global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, CallOptions options);
399 AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
400 AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.Empty request, CallOptions options);
401 global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
402 global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options);
403 AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
404 AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options);
405 }
406
407 // server-side interface
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700408 [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
Jan Tattermusch70f86522015-10-07 18:23:51 -0700409 public interface IReconnectService
410 {
411 Task<global::Grpc.Testing.Empty> Start(global::Grpc.Testing.Empty request, ServerCallContext context);
412 Task<global::Grpc.Testing.ReconnectInfo> Stop(global::Grpc.Testing.Empty request, ServerCallContext context);
413 }
414
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700415 // server-side abstract class
416 public abstract class ReconnectServiceBase
417 {
418 public virtual Task<global::Grpc.Testing.Empty> Start(global::Grpc.Testing.Empty request, ServerCallContext context)
419 {
420 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
421 }
422
423 public virtual Task<global::Grpc.Testing.ReconnectInfo> Stop(global::Grpc.Testing.Empty request, ServerCallContext context)
424 {
425 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
426 }
427
428 }
429
Jan Tattermusch70f86522015-10-07 18:23:51 -0700430 // client stub
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700431 public class ReconnectServiceClient : ClientBase<ReconnectServiceClient>, IReconnectServiceClient
Jan Tattermusch70f86522015-10-07 18:23:51 -0700432 {
433 public ReconnectServiceClient(Channel channel) : base(channel)
434 {
435 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700436 public ReconnectServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700437 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700438 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700439 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
440 protected ReconnectServiceClient() : base()
Jan Tattermusch70f86522015-10-07 18:23:51 -0700441 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700442 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700443 ///<summary>Protected constructor to allow creation of configured clients.</summary>
444 protected ReconnectServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700445 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700446 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700447
448 public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch70f86522015-10-07 18:23:51 -0700449 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700450 return Start(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch70f86522015-10-07 18:23:51 -0700451 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700452 public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, CallOptions options)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700453 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700454 return CallInvoker.BlockingUnaryCall(__Method_Start, null, options, request);
Jan Tattermusch70f86522015-10-07 18:23:51 -0700455 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700456 public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch70f86522015-10-07 18:23:51 -0700457 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700458 return StartAsync(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch70f86522015-10-07 18:23:51 -0700459 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700460 public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.Empty request, CallOptions options)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700461 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700462 return CallInvoker.AsyncUnaryCall(__Method_Start, null, options, request);
Jan Tattermusch70f86522015-10-07 18:23:51 -0700463 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700464 public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch70f86522015-10-07 18:23:51 -0700465 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700466 return Stop(request, new CallOptions(headers, deadline, cancellationToken));
467 }
468 public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options)
469 {
470 return CallInvoker.BlockingUnaryCall(__Method_Stop, null, options, request);
471 }
472 public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
473 {
474 return StopAsync(request, new CallOptions(headers, deadline, cancellationToken));
475 }
476 public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options)
477 {
478 return CallInvoker.AsyncUnaryCall(__Method_Stop, null, options, request);
479 }
480 protected override ReconnectServiceClient NewInstance(ClientBaseConfiguration configuration)
481 {
482 return new ReconnectServiceClient(configuration);
Jan Tattermusch70f86522015-10-07 18:23:51 -0700483 }
484 }
485
486 // creates service definition that can be registered with a server
487 public static ServerServiceDefinition BindService(IReconnectService serviceImpl)
488 {
489 return ServerServiceDefinition.CreateBuilder(__ServiceName)
490 .AddMethod(__Method_Start, serviceImpl.Start)
491 .AddMethod(__Method_Stop, serviceImpl.Stop).Build();
492 }
493
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700494 // creates service definition that can be registered with a server
495 public static ServerServiceDefinition BindService(ReconnectServiceBase serviceImpl)
496 {
497 return ServerServiceDefinition.CreateBuilder(__ServiceName)
498 .AddMethod(__Method_Start, serviceImpl.Start)
499 .AddMethod(__Method_Stop, serviceImpl.Stop).Build();
500 }
501
Jan Tattermusch70f86522015-10-07 18:23:51 -0700502 // creates a new client
503 public static ReconnectServiceClient NewClient(Channel channel)
504 {
505 return new ReconnectServiceClient(channel);
506 }
507
508 }
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700509}
Jan Tattermuschcd7e3132015-05-07 15:10:23 -0700510#endregion