• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // <auto-generated>
2 //     Generated by the protocol buffer compiler.  DO NOT EDIT!
3 //     source: src/proto/grpc/testing/benchmark_service.proto
4 // </auto-generated>
5 // Original file comments:
6 // Copyright 2015 gRPC authors.
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 //     http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 //
20 // An integration test service that covers all the method signature permutations
21 // of unary/streaming requests/responses.
22 #pragma warning disable 0414, 1591
23 #region Designer generated code
24 
25 using grpc = global::Grpc.Core;
26 
27 namespace Grpc.Testing {
28   public static partial class BenchmarkService
29   {
30     static readonly string __ServiceName = "grpc.testing.BenchmarkService";
31 
32     static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_grpc_testing_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
33     static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_grpc_testing_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
34 
35     static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
36         grpc::MethodType.Unary,
37         __ServiceName,
38         "UnaryCall",
39         __Marshaller_grpc_testing_SimpleRequest,
40         __Marshaller_grpc_testing_SimpleResponse);
41 
42     static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
43         grpc::MethodType.DuplexStreaming,
44         __ServiceName,
45         "StreamingCall",
46         __Marshaller_grpc_testing_SimpleRequest,
47         __Marshaller_grpc_testing_SimpleResponse);
48 
49     static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingFromClient = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
50         grpc::MethodType.ClientStreaming,
51         __ServiceName,
52         "StreamingFromClient",
53         __Marshaller_grpc_testing_SimpleRequest,
54         __Marshaller_grpc_testing_SimpleResponse);
55 
56     static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingFromServer = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
57         grpc::MethodType.ServerStreaming,
58         __ServiceName,
59         "StreamingFromServer",
60         __Marshaller_grpc_testing_SimpleRequest,
61         __Marshaller_grpc_testing_SimpleResponse);
62 
63     static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingBothWays = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
64         grpc::MethodType.DuplexStreaming,
65         __ServiceName,
66         "StreamingBothWays",
67         __Marshaller_grpc_testing_SimpleRequest,
68         __Marshaller_grpc_testing_SimpleResponse);
69 
70     /// <summary>Service descriptor</summary>
71     public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
72     {
73       get { return global::Grpc.Testing.BenchmarkServiceReflection.Descriptor.Services[0]; }
74     }
75 
76     /// <summary>Base class for server-side implementations of BenchmarkService</summary>
77     public abstract partial class BenchmarkServiceBase
78     {
79       /// <summary>
80       /// One request followed by one response.
81       /// The server returns the client payload as-is.
82       /// </summary>
83       /// <param name="request">The request received from the client.</param>
84       /// <param name="context">The context of the server-side call handler being invoked.</param>
85       /// <returns>The response to send back to the client (wrapped by a task).</returns>
UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context)86       public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context)
87       {
88         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
89       }
90 
91       /// <summary>
92       /// Repeated sequence of one request followed by one response.
93       /// Should be called streaming ping-pong
94       /// The server returns the client payload as-is on each response
95       /// </summary>
96       /// <param name="requestStream">Used for reading requests from the client.</param>
97       /// <param name="responseStream">Used for sending responses back to the client.</param>
98       /// <param name="context">The context of the server-side call handler being invoked.</param>
99       /// <returns>A task indicating completion of the handler.</returns>
StreamingCall(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context)100       public virtual global::System.Threading.Tasks.Task StreamingCall(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context)
101       {
102         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
103       }
104 
105       /// <summary>
106       /// Single-sided unbounded streaming from client to server
107       /// The server returns the client payload as-is once the client does WritesDone
108       /// </summary>
109       /// <param name="requestStream">Used for reading requests from the client.</param>
110       /// <param name="context">The context of the server-side call handler being invoked.</param>
111       /// <returns>The response to send back to the client (wrapped by a task).</returns>
StreamingFromClient(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::ServerCallContext context)112       public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::ServerCallContext context)
113       {
114         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
115       }
116 
117       /// <summary>
118       /// Single-sided unbounded streaming from server to client
119       /// The server repeatedly returns the client payload as-is
120       /// </summary>
121       /// <param name="request">The request received from the client.</param>
122       /// <param name="responseStream">Used for sending responses back to the client.</param>
123       /// <param name="context">The context of the server-side call handler being invoked.</param>
124       /// <returns>A task indicating completion of the handler.</returns>
StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context)125       public virtual global::System.Threading.Tasks.Task StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context)
126       {
127         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
128       }
129 
130       /// <summary>
131       /// Two-sided unbounded streaming between server to client
132       /// Both sides send the content of their own choice to the other
133       /// </summary>
134       /// <param name="requestStream">Used for reading requests from the client.</param>
135       /// <param name="responseStream">Used for sending responses back to the client.</param>
136       /// <param name="context">The context of the server-side call handler being invoked.</param>
137       /// <returns>A task indicating completion of the handler.</returns>
StreamingBothWays(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context)138       public virtual global::System.Threading.Tasks.Task StreamingBothWays(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context)
139       {
140         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
141       }
142 
143     }
144 
145     /// <summary>Client for BenchmarkService</summary>
146     public partial class BenchmarkServiceClient : grpc::ClientBase<BenchmarkServiceClient>
147     {
148       /// <summary>Creates a new client for BenchmarkService</summary>
149       /// <param name="channel">The channel to use to make remote calls.</param>
BenchmarkServiceClient(grpc::Channel channel)150       public BenchmarkServiceClient(grpc::Channel channel) : base(channel)
151       {
152       }
153       /// <summary>Creates a new client for BenchmarkService that uses a custom <c>CallInvoker</c>.</summary>
154       /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
BenchmarkServiceClient(grpc::CallInvoker callInvoker)155       public BenchmarkServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
156       {
157       }
158       /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
BenchmarkServiceClient()159       protected BenchmarkServiceClient() : base()
160       {
161       }
162       /// <summary>Protected constructor to allow creation of configured clients.</summary>
163       /// <param name="configuration">The client configuration.</param>
BenchmarkServiceClient(ClientBaseConfiguration configuration)164       protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration)
165       {
166       }
167 
168       /// <summary>
169       /// One request followed by one response.
170       /// The server returns the client payload as-is.
171       /// </summary>
172       /// <param name="request">The request to send to the server.</param>
173       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
174       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
175       /// <param name="cancellationToken">An optional token for canceling the call.</param>
176       /// <returns>The response received from the server.</returns>
UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))177       public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
178       {
179         return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken));
180       }
181       /// <summary>
182       /// One request followed by one response.
183       /// The server returns the client payload as-is.
184       /// </summary>
185       /// <param name="request">The request to send to the server.</param>
186       /// <param name="options">The options for the call.</param>
187       /// <returns>The response received from the server.</returns>
UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)188       public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)
189       {
190         return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request);
191       }
192       /// <summary>
193       /// One request followed by one response.
194       /// The server returns the client payload as-is.
195       /// </summary>
196       /// <param name="request">The request to send to the server.</param>
197       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
198       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
199       /// <param name="cancellationToken">An optional token for canceling the call.</param>
200       /// <returns>The call object.</returns>
UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))201       public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
202       {
203         return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
204       }
205       /// <summary>
206       /// One request followed by one response.
207       /// The server returns the client payload as-is.
208       /// </summary>
209       /// <param name="request">The request to send to the server.</param>
210       /// <param name="options">The options for the call.</param>
211       /// <returns>The call object.</returns>
UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)212       public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)
213       {
214         return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request);
215       }
216       /// <summary>
217       /// Repeated sequence of one request followed by one response.
218       /// Should be called streaming ping-pong
219       /// The server returns the client payload as-is on each response
220       /// </summary>
221       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
222       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
223       /// <param name="cancellationToken">An optional token for canceling the call.</param>
224       /// <returns>The call object.</returns>
StreamingCall(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))225       public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
226       {
227         return StreamingCall(new grpc::CallOptions(headers, deadline, cancellationToken));
228       }
229       /// <summary>
230       /// Repeated sequence of one request followed by one response.
231       /// Should be called streaming ping-pong
232       /// The server returns the client payload as-is on each response
233       /// </summary>
234       /// <param name="options">The options for the call.</param>
235       /// <returns>The call object.</returns>
StreamingCall(grpc::CallOptions options)236       public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(grpc::CallOptions options)
237       {
238         return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options);
239       }
240       /// <summary>
241       /// Single-sided unbounded streaming from client to server
242       /// The server returns the client payload as-is once the client does WritesDone
243       /// </summary>
244       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
245       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
246       /// <param name="cancellationToken">An optional token for canceling the call.</param>
247       /// <returns>The call object.</returns>
StreamingFromClient(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))248       public virtual grpc::AsyncClientStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
249       {
250         return StreamingFromClient(new grpc::CallOptions(headers, deadline, cancellationToken));
251       }
252       /// <summary>
253       /// Single-sided unbounded streaming from client to server
254       /// The server returns the client payload as-is once the client does WritesDone
255       /// </summary>
256       /// <param name="options">The options for the call.</param>
257       /// <returns>The call object.</returns>
StreamingFromClient(grpc::CallOptions options)258       public virtual grpc::AsyncClientStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::CallOptions options)
259       {
260         return CallInvoker.AsyncClientStreamingCall(__Method_StreamingFromClient, null, options);
261       }
262       /// <summary>
263       /// Single-sided unbounded streaming from server to client
264       /// The server repeatedly returns the client payload as-is
265       /// </summary>
266       /// <param name="request">The request to send to the server.</param>
267       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
268       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
269       /// <param name="cancellationToken">An optional token for canceling the call.</param>
270       /// <returns>The call object.</returns>
StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))271       public virtual grpc::AsyncServerStreamingCall<global::Grpc.Testing.SimpleResponse> StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
272       {
273         return StreamingFromServer(request, new grpc::CallOptions(headers, deadline, cancellationToken));
274       }
275       /// <summary>
276       /// Single-sided unbounded streaming from server to client
277       /// The server repeatedly returns the client payload as-is
278       /// </summary>
279       /// <param name="request">The request to send to the server.</param>
280       /// <param name="options">The options for the call.</param>
281       /// <returns>The call object.</returns>
StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)282       public virtual grpc::AsyncServerStreamingCall<global::Grpc.Testing.SimpleResponse> StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)
283       {
284         return CallInvoker.AsyncServerStreamingCall(__Method_StreamingFromServer, null, options, request);
285       }
286       /// <summary>
287       /// Two-sided unbounded streaming between server to client
288       /// Both sides send the content of their own choice to the other
289       /// </summary>
290       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
291       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
292       /// <param name="cancellationToken">An optional token for canceling the call.</param>
293       /// <returns>The call object.</returns>
StreamingBothWays(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))294       public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingBothWays(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
295       {
296         return StreamingBothWays(new grpc::CallOptions(headers, deadline, cancellationToken));
297       }
298       /// <summary>
299       /// Two-sided unbounded streaming between server to client
300       /// Both sides send the content of their own choice to the other
301       /// </summary>
302       /// <param name="options">The options for the call.</param>
303       /// <returns>The call object.</returns>
StreamingBothWays(grpc::CallOptions options)304       public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingBothWays(grpc::CallOptions options)
305       {
306         return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingBothWays, null, options);
307       }
308       /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
NewInstance(ClientBaseConfiguration configuration)309       protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration)
310       {
311         return new BenchmarkServiceClient(configuration);
312       }
313     }
314 
315     /// <summary>Creates service definition that can be registered with a server</summary>
316     /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
BindService(BenchmarkServiceBase serviceImpl)317     public static grpc::ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl)
318     {
319       return grpc::ServerServiceDefinition.CreateBuilder()
320           .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
321           .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall)
322           .AddMethod(__Method_StreamingFromClient, serviceImpl.StreamingFromClient)
323           .AddMethod(__Method_StreamingFromServer, serviceImpl.StreamingFromServer)
324           .AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays).Build();
325     }
326 
327   }
328 }
329 #endregion
330