blob: 6c252013f84cd15e86a4b6f72abe6e5421915956 [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 Tattermuschbfee01d2016-04-28 10:52:41 -07003// Original file comments:
4// Copyright 2015-2016, Google Inc.
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are
9// met:
10//
11// * Redistributions of source code must retain the above copyright
12// notice, this list of conditions and the following disclaimer.
13// * Redistributions in binary form must reproduce the above
14// copyright notice, this list of conditions and the following disclaimer
15// in the documentation and/or other materials provided with the
16// distribution.
17// * Neither the name of Google Inc. nor the names of its
18// contributors may be used to endorse or promote products derived from
19// this software without specific prior written permission.
20//
21// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32//
33// An integration test service that covers all the method signature permutations
34// of unary/streaming requests/responses.
35//
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070036#region Designer generated code
37
38using System;
39using System.Threading;
40using System.Threading.Tasks;
41using Grpc.Core;
42
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070043namespace Grpc.Testing {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070044 /// <summary>
45 /// A simple service to test the various types of RPCs and experiment with
46 /// performance with various types of payload.
47 /// </summary>
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070048 public static class TestService
49 {
50 static readonly string __ServiceName = "grpc.testing.TestService";
51
Jan Tattermusch475f75a2015-08-03 09:46:04 -070052 static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
53 static readonly Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
54 static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
55 static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallRequest> __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom);
56 static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallResponse> __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom);
57 static readonly Marshaller<global::Grpc.Testing.StreamingInputCallRequest> __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom);
58 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 -070059
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070060 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 -070061 MethodType.Unary,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070062 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070063 "EmptyCall",
64 __Marshaller_Empty,
65 __Marshaller_Empty);
66
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070067 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 -070068 MethodType.Unary,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070069 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070070 "UnaryCall",
71 __Marshaller_SimpleRequest,
72 __Marshaller_SimpleResponse);
73
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070074 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 -070075 MethodType.ServerStreaming,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070076 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070077 "StreamingOutputCall",
78 __Marshaller_StreamingOutputCallRequest,
79 __Marshaller_StreamingOutputCallResponse);
80
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070081 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 -070082 MethodType.ClientStreaming,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070083 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070084 "StreamingInputCall",
85 __Marshaller_StreamingInputCallRequest,
86 __Marshaller_StreamingInputCallResponse);
87
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070088 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 -070089 MethodType.DuplexStreaming,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070090 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070091 "FullDuplexCall",
92 __Marshaller_StreamingOutputCallRequest,
93 __Marshaller_StreamingOutputCallResponse);
94
Jan Tattermusch5c42d8d2015-08-03 08:14:30 -070095 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 -070096 MethodType.DuplexStreaming,
Jan Tattermuschcc97fed2015-08-05 00:44:29 -070097 __ServiceName,
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070098 "HalfDuplexCall",
99 __Marshaller_StreamingOutputCallRequest,
100 __Marshaller_StreamingOutputCallResponse);
101
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700102 /// <summary>Service descriptor</summary>
Jan Tattermusche6af5d12015-08-03 10:57:43 -0700103 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
104 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -0800105 get { return global::Grpc.Testing.TestReflection.Descriptor.Services[0]; }
Jan Tattermusche6af5d12015-08-03 10:57:43 -0700106 }
107
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700108 /// <summary>Base class for server-side implementations of TestService</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700109 public abstract class TestServiceBase
110 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700111 /// <summary>
112 /// One empty request followed by one empty response.
113 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700114 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700115 {
116 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
117 }
118
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700119 /// <summary>
120 /// One request followed by one response.
121 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700122 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700123 {
124 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
125 }
126
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700127 /// <summary>
128 /// One request followed by a sequence of responses (streamed download).
129 /// The server returns the payload with client desired type and sizes.
130 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700131 public virtual global::System.Threading.Tasks.Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700132 {
133 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
134 }
135
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700136 /// <summary>
137 /// A sequence of requests followed by one response (streamed upload).
138 /// The server returns the aggregated size of client payload as the result.
139 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700140 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<global::Grpc.Testing.StreamingInputCallRequest> requestStream, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700141 {
142 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
143 }
144
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700145 /// <summary>
146 /// A sequence of requests with each request served by the server immediately.
147 /// As one request could lead to multiple responses, this interface
148 /// demonstrates the idea of full duplexing.
149 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700150 public virtual global::System.Threading.Tasks.Task FullDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700151 {
152 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
153 }
154
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700155 /// <summary>
156 /// A sequence of requests followed by a sequence of responses.
157 /// The server buffers all the client requests and then serves them in order. A
158 /// stream of responses are returned to the client when the server starts with
159 /// first request.
160 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700161 public virtual global::System.Threading.Tasks.Task HalfDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700162 {
163 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
164 }
165
166 }
167
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700168 /// <summary>Client for TestService</summary>
Jan Tattermuschfcc8d972016-06-06 09:44:02 -0700169 public class TestServiceClient : ClientBase<TestServiceClient>
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700170 {
Jan Tattermuschb5332812015-07-14 19:29:35 -0700171 public TestServiceClient(Channel channel) : base(channel)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700172 {
173 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700174 public TestServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700175 {
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700176 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700177 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
178 protected TestServiceClient() : base()
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700179 {
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700180 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700181 ///<summary>Protected constructor to allow creation of configured clients.</summary>
182 protected TestServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700183 {
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700184 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700185
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700186 /// <summary>
187 /// One empty request followed by one empty response.
188 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700189 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 -0700190 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700191 return EmptyCall(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700192 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700193 /// <summary>
194 /// One empty request followed by one empty response.
195 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700196 public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700197 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700198 return CallInvoker.BlockingUnaryCall(__Method_EmptyCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700199 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700200 /// <summary>
201 /// One empty request followed by one empty response.
202 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700203 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 -0700204 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700205 return EmptyCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700206 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700207 /// <summary>
208 /// One empty request followed by one empty response.
209 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700210 public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700211 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700212 return CallInvoker.AsyncUnaryCall(__Method_EmptyCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700213 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700214 /// <summary>
215 /// One request followed by one response.
216 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700217 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 -0700218 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700219 return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700220 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700221 /// <summary>
222 /// One request followed by one response.
223 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700224 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700225 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700226 return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700227 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700228 /// <summary>
229 /// One request followed by one response.
230 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700231 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 -0700232 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700233 return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700234 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700235 /// <summary>
236 /// One request followed by one response.
237 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700238 public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700239 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700240 return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700241 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700242 /// <summary>
243 /// One request followed by a sequence of responses (streamed download).
244 /// The server returns the payload with client desired type and sizes.
245 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700246 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 -0700247 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700248 return StreamingOutputCall(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700249 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700250 /// <summary>
251 /// One request followed by a sequence of responses (streamed download).
252 /// The server returns the payload with client desired type and sizes.
253 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700254 public virtual AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700255 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700256 return CallInvoker.AsyncServerStreamingCall(__Method_StreamingOutputCall, null, options, request);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700257 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700258 /// <summary>
259 /// A sequence of requests followed by one response (streamed upload).
260 /// The server returns the aggregated size of client payload as the result.
261 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700262 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 -0700263 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700264 return StreamingInputCall(new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700265 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700266 /// <summary>
267 /// A sequence of requests followed by one response (streamed upload).
268 /// The server returns the aggregated size of client payload as the result.
269 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700270 public virtual AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700271 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700272 return CallInvoker.AsyncClientStreamingCall(__Method_StreamingInputCall, null, options);
Jan Tattermuschcc97fed2015-08-05 00:44:29 -0700273 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700274 /// <summary>
275 /// A sequence of requests with each request served by the server immediately.
276 /// As one request could lead to multiple responses, this interface
277 /// demonstrates the idea of full duplexing.
278 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700279 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 -0700280 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700281 return FullDuplexCall(new CallOptions(headers, deadline, cancellationToken));
282 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700283 /// <summary>
284 /// A sequence of requests with each request served by the server immediately.
285 /// As one request could lead to multiple responses, this interface
286 /// demonstrates the idea of full duplexing.
287 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700288 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options)
289 {
290 return CallInvoker.AsyncDuplexStreamingCall(__Method_FullDuplexCall, null, options);
291 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700292 /// <summary>
293 /// A sequence of requests followed by a sequence of responses.
294 /// The server buffers all the client requests and then serves them in order. A
295 /// stream of responses are returned to the client when the server starts with
296 /// first request.
297 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700298 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
299 {
300 return HalfDuplexCall(new CallOptions(headers, deadline, cancellationToken));
301 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700302 /// <summary>
303 /// A sequence of requests followed by a sequence of responses.
304 /// The server buffers all the client requests and then serves them in order. A
305 /// stream of responses are returned to the client when the server starts with
306 /// first request.
307 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700308 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options)
309 {
310 return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options);
311 }
312 protected override TestServiceClient NewInstance(ClientBaseConfiguration configuration)
313 {
314 return new TestServiceClient(configuration);
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700315 }
316 }
317
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700318 /// <summary>Creates a new client for TestService</summary>
Jan Tattermusch7c0e1ee2016-04-25 16:00:34 -0700319 public static TestServiceClient NewClient(Channel channel)
320 {
321 return new TestServiceClient(channel);
322 }
323
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700324 /// <summary>Creates service definition that can be registered with a server</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700325 public static ServerServiceDefinition BindService(TestServiceBase serviceImpl)
326 {
Jan Tattermusch562cd052016-06-06 08:47:17 -0700327 return ServerServiceDefinition.CreateBuilder()
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700328 .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall)
329 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
330 .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall)
331 .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall)
332 .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall)
333 .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build();
334 }
335
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700336 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700337 /// <summary>
338 /// A simple service NOT implemented at servers so clients can test for
339 /// that case.
340 /// </summary>
Jan Tattermusch70f86522015-10-07 18:23:51 -0700341 public static class UnimplementedService
342 {
343 static readonly string __ServiceName = "grpc.testing.UnimplementedService";
344
345 static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
346
347 static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
348 MethodType.Unary,
349 __ServiceName,
350 "UnimplementedCall",
351 __Marshaller_Empty,
352 __Marshaller_Empty);
353
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700354 /// <summary>Service descriptor</summary>
Jan Tattermusch70f86522015-10-07 18:23:51 -0700355 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
356 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -0800357 get { return global::Grpc.Testing.TestReflection.Descriptor.Services[1]; }
Jan Tattermusch70f86522015-10-07 18:23:51 -0700358 }
359
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700360 /// <summary>Base class for server-side implementations of UnimplementedService</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700361 public abstract class UnimplementedServiceBase
362 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700363 /// <summary>
364 /// A call that no server should implement
365 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700366 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700367 {
368 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
369 }
370
371 }
372
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700373 /// <summary>Client for UnimplementedService</summary>
Jan Tattermuschfcc8d972016-06-06 09:44:02 -0700374 public class UnimplementedServiceClient : ClientBase<UnimplementedServiceClient>
Jan Tattermusch70f86522015-10-07 18:23:51 -0700375 {
376 public UnimplementedServiceClient(Channel channel) : base(channel)
377 {
378 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700379 public UnimplementedServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700380 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700381 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700382 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
383 protected UnimplementedServiceClient() : base()
Jan Tattermusch70f86522015-10-07 18:23:51 -0700384 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700385 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700386 ///<summary>Protected constructor to allow creation of configured clients.</summary>
387 protected UnimplementedServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700388 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700389 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700390
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700391 /// <summary>
392 /// A call that no server should implement
393 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700394 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 -0700395 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700396 return UnimplementedCall(request, new CallOptions(headers, deadline, cancellationToken));
397 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700398 /// <summary>
399 /// A call that no server should implement
400 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700401 public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options)
402 {
403 return CallInvoker.BlockingUnaryCall(__Method_UnimplementedCall, null, options, request);
404 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700405 /// <summary>
406 /// A call that no server should implement
407 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700408 public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
409 {
410 return UnimplementedCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
411 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700412 /// <summary>
413 /// A call that no server should implement
414 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700415 public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options)
416 {
417 return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request);
418 }
419 protected override UnimplementedServiceClient NewInstance(ClientBaseConfiguration configuration)
420 {
421 return new UnimplementedServiceClient(configuration);
Jan Tattermusch70f86522015-10-07 18:23:51 -0700422 }
423 }
424
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700425 /// <summary>Creates a new client for UnimplementedService</summary>
Jan Tattermusch7c0e1ee2016-04-25 16:00:34 -0700426 public static UnimplementedServiceClient NewClient(Channel channel)
427 {
428 return new UnimplementedServiceClient(channel);
429 }
430
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700431 /// <summary>Creates service definition that can be registered with a server</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700432 public static ServerServiceDefinition BindService(UnimplementedServiceBase serviceImpl)
433 {
Jan Tattermusch562cd052016-06-06 08:47:17 -0700434 return ServerServiceDefinition.CreateBuilder()
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700435 .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build();
436 }
437
Jan Tattermusch70f86522015-10-07 18:23:51 -0700438 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700439 /// <summary>
440 /// A service used to control reconnect server.
441 /// </summary>
Jan Tattermusch70f86522015-10-07 18:23:51 -0700442 public static class ReconnectService
443 {
444 static readonly string __ServiceName = "grpc.testing.ReconnectService";
445
vjpai87bac952016-04-20 09:35:35 -0700446 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 Tattermusch70f86522015-10-07 18:23:51 -0700447 static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom);
448 static readonly Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_ReconnectInfo = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom);
449
vjpai87bac952016-04-20 09:35:35 -0700450 static readonly Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty> __Method_Start = new Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty>(
Jan Tattermusch70f86522015-10-07 18:23:51 -0700451 MethodType.Unary,
452 __ServiceName,
453 "Start",
vjpai87bac952016-04-20 09:35:35 -0700454 __Marshaller_ReconnectParams,
Jan Tattermusch70f86522015-10-07 18:23:51 -0700455 __Marshaller_Empty);
456
457 static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo> __Method_Stop = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo>(
458 MethodType.Unary,
459 __ServiceName,
460 "Stop",
461 __Marshaller_Empty,
462 __Marshaller_ReconnectInfo);
463
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700464 /// <summary>Service descriptor</summary>
Jan Tattermusch70f86522015-10-07 18:23:51 -0700465 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
466 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -0800467 get { return global::Grpc.Testing.TestReflection.Descriptor.Services[2]; }
Jan Tattermusch70f86522015-10-07 18:23:51 -0700468 }
469
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700470 /// <summary>Base class for server-side implementations of ReconnectService</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700471 public abstract class ReconnectServiceBase
472 {
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700473 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700474 {
475 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
476 }
477
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700478 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.ReconnectInfo> Stop(global::Grpc.Testing.Empty request, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700479 {
480 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
481 }
482
483 }
484
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700485 /// <summary>Client for ReconnectService</summary>
Jan Tattermuschfcc8d972016-06-06 09:44:02 -0700486 public class ReconnectServiceClient : ClientBase<ReconnectServiceClient>
Jan Tattermusch70f86522015-10-07 18:23:51 -0700487 {
488 public ReconnectServiceClient(Channel channel) : base(channel)
489 {
490 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700491 public ReconnectServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700492 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700493 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700494 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
495 protected ReconnectServiceClient() : base()
Jan Tattermusch70f86522015-10-07 18:23:51 -0700496 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700497 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700498 ///<summary>Protected constructor to allow creation of configured clients.</summary>
499 protected ReconnectServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700500 {
Jan Tattermusch70f86522015-10-07 18:23:51 -0700501 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700502
vjpai87bac952016-04-20 09:35:35 -0700503 public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch70f86522015-10-07 18:23:51 -0700504 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700505 return Start(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch70f86522015-10-07 18:23:51 -0700506 }
vjpai87bac952016-04-20 09:35:35 -0700507 public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, CallOptions options)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700508 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700509 return CallInvoker.BlockingUnaryCall(__Method_Start, null, options, request);
Jan Tattermusch70f86522015-10-07 18:23:51 -0700510 }
vjpai87bac952016-04-20 09:35:35 -0700511 public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch70f86522015-10-07 18:23:51 -0700512 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700513 return StartAsync(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch70f86522015-10-07 18:23:51 -0700514 }
vjpai87bac952016-04-20 09:35:35 -0700515 public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, CallOptions options)
Jan Tattermusch70f86522015-10-07 18:23:51 -0700516 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700517 return CallInvoker.AsyncUnaryCall(__Method_Start, null, options, request);
Jan Tattermusch70f86522015-10-07 18:23:51 -0700518 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700519 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 -0700520 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700521 return Stop(request, new CallOptions(headers, deadline, cancellationToken));
522 }
523 public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options)
524 {
525 return CallInvoker.BlockingUnaryCall(__Method_Stop, null, options, request);
526 }
527 public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
528 {
529 return StopAsync(request, new CallOptions(headers, deadline, cancellationToken));
530 }
531 public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options)
532 {
533 return CallInvoker.AsyncUnaryCall(__Method_Stop, null, options, request);
534 }
535 protected override ReconnectServiceClient NewInstance(ClientBaseConfiguration configuration)
536 {
537 return new ReconnectServiceClient(configuration);
Jan Tattermusch70f86522015-10-07 18:23:51 -0700538 }
539 }
540
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700541 /// <summary>Creates a new client for ReconnectService</summary>
Jan Tattermusch7c0e1ee2016-04-25 16:00:34 -0700542 public static ReconnectServiceClient NewClient(Channel channel)
543 {
544 return new ReconnectServiceClient(channel);
545 }
546
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700547 /// <summary>Creates service definition that can be registered with a server</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700548 public static ServerServiceDefinition BindService(ReconnectServiceBase serviceImpl)
549 {
Jan Tattermusch562cd052016-06-06 08:47:17 -0700550 return ServerServiceDefinition.CreateBuilder()
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700551 .AddMethod(__Method_Start, serviceImpl.Start)
552 .AddMethod(__Method_Stop, serviceImpl.Stop).Build();
553 }
554
Jan Tattermusch70f86522015-10-07 18:23:51 -0700555 }
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700556}
Jan Tattermuschcd7e3132015-05-07 15:10:23 -0700557#endregion