• 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/worker_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 WorkerService
29   {
30     static readonly string __ServiceName = "grpc.testing.WorkerService";
31 
32     static readonly grpc::Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_grpc_testing_ServerArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom);
33     static readonly grpc::Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_grpc_testing_ServerStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom);
34     static readonly grpc::Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_grpc_testing_ClientArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom);
35     static readonly grpc::Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_grpc_testing_ClientStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom);
36     static readonly grpc::Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_grpc_testing_CoreRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom);
37     static readonly grpc::Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_grpc_testing_CoreResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom);
38     static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_grpc_testing_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
39 
40     static readonly grpc::Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> __Method_RunServer = new grpc::Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>(
41         grpc::MethodType.DuplexStreaming,
42         __ServiceName,
43         "RunServer",
44         __Marshaller_grpc_testing_ServerArgs,
45         __Marshaller_grpc_testing_ServerStatus);
46 
47     static readonly grpc::Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> __Method_RunClient = new grpc::Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>(
48         grpc::MethodType.DuplexStreaming,
49         __ServiceName,
50         "RunClient",
51         __Marshaller_grpc_testing_ClientArgs,
52         __Marshaller_grpc_testing_ClientStatus);
53 
54     static readonly grpc::Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse> __Method_CoreCount = new grpc::Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>(
55         grpc::MethodType.Unary,
56         __ServiceName,
57         "CoreCount",
58         __Marshaller_grpc_testing_CoreRequest,
59         __Marshaller_grpc_testing_CoreResponse);
60 
61     static readonly grpc::Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void> __Method_QuitWorker = new grpc::Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void>(
62         grpc::MethodType.Unary,
63         __ServiceName,
64         "QuitWorker",
65         __Marshaller_grpc_testing_Void,
66         __Marshaller_grpc_testing_Void);
67 
68     /// <summary>Service descriptor</summary>
69     public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
70     {
71       get { return global::Grpc.Testing.WorkerServiceReflection.Descriptor.Services[0]; }
72     }
73 
74     /// <summary>Base class for server-side implementations of WorkerService</summary>
75     [grpc::BindServiceMethod(typeof(WorkerService), "BindService")]
76     public abstract partial class WorkerServiceBase
77     {
78       /// <summary>
79       /// Start server with specified workload.
80       /// First request sent specifies the ServerConfig followed by ServerStatus
81       /// response. After that, a "Mark" can be sent anytime to request the latest
82       /// stats. Closing the stream will initiate shutdown of the test server
83       /// and once the shutdown has finished, the OK status is sent to terminate
84       /// this RPC.
85       /// </summary>
86       /// <param name="requestStream">Used for reading requests from the client.</param>
87       /// <param name="responseStream">Used for sending responses back to the client.</param>
88       /// <param name="context">The context of the server-side call handler being invoked.</param>
89       /// <returns>A task indicating completion of the handler.</returns>
RunServer(grpc::IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, grpc::ServerCallContext context)90       public virtual global::System.Threading.Tasks.Task RunServer(grpc::IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, grpc::ServerCallContext context)
91       {
92         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
93       }
94 
95       /// <summary>
96       /// Start client with specified workload.
97       /// First request sent specifies the ClientConfig followed by ClientStatus
98       /// response. After that, a "Mark" can be sent anytime to request the latest
99       /// stats. Closing the stream will initiate shutdown of the test client
100       /// and once the shutdown has finished, the OK status is sent to terminate
101       /// this RPC.
102       /// </summary>
103       /// <param name="requestStream">Used for reading requests from the client.</param>
104       /// <param name="responseStream">Used for sending responses back to the client.</param>
105       /// <param name="context">The context of the server-side call handler being invoked.</param>
106       /// <returns>A task indicating completion of the handler.</returns>
RunClient(grpc::IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, grpc::ServerCallContext context)107       public virtual global::System.Threading.Tasks.Task RunClient(grpc::IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, grpc::ServerCallContext context)
108       {
109         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
110       }
111 
112       /// <summary>
113       /// Just return the core count - unary call
114       /// </summary>
115       /// <param name="request">The request received from the client.</param>
116       /// <param name="context">The context of the server-side call handler being invoked.</param>
117       /// <returns>The response to send back to the client (wrapped by a task).</returns>
CoreCount(global::Grpc.Testing.CoreRequest request, grpc::ServerCallContext context)118       public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, grpc::ServerCallContext context)
119       {
120         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
121       }
122 
123       /// <summary>
124       /// Quit this worker
125       /// </summary>
126       /// <param name="request">The request received from the client.</param>
127       /// <param name="context">The context of the server-side call handler being invoked.</param>
128       /// <returns>The response to send back to the client (wrapped by a task).</returns>
QuitWorker(global::Grpc.Testing.Void request, grpc::ServerCallContext context)129       public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, grpc::ServerCallContext context)
130       {
131         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
132       }
133 
134     }
135 
136     /// <summary>Client for WorkerService</summary>
137     public partial class WorkerServiceClient : grpc::ClientBase<WorkerServiceClient>
138     {
139       /// <summary>Creates a new client for WorkerService</summary>
140       /// <param name="channel">The channel to use to make remote calls.</param>
WorkerServiceClient(grpc::ChannelBase channel)141       public WorkerServiceClient(grpc::ChannelBase channel) : base(channel)
142       {
143       }
144       /// <summary>Creates a new client for WorkerService that uses a custom <c>CallInvoker</c>.</summary>
145       /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
WorkerServiceClient(grpc::CallInvoker callInvoker)146       public WorkerServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
147       {
148       }
149       /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
WorkerServiceClient()150       protected WorkerServiceClient() : base()
151       {
152       }
153       /// <summary>Protected constructor to allow creation of configured clients.</summary>
154       /// <param name="configuration">The client configuration.</param>
WorkerServiceClient(ClientBaseConfiguration configuration)155       protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration)
156       {
157       }
158 
159       /// <summary>
160       /// Start server with specified workload.
161       /// First request sent specifies the ServerConfig followed by ServerStatus
162       /// response. After that, a "Mark" can be sent anytime to request the latest
163       /// stats. Closing the stream will initiate shutdown of the test server
164       /// and once the shutdown has finished, the OK status is sent to terminate
165       /// this RPC.
166       /// </summary>
167       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
168       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
169       /// <param name="cancellationToken">An optional token for canceling the call.</param>
170       /// <returns>The call object.</returns>
RunServer(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))171       public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
172       {
173         return RunServer(new grpc::CallOptions(headers, deadline, cancellationToken));
174       }
175       /// <summary>
176       /// Start server with specified workload.
177       /// First request sent specifies the ServerConfig followed by ServerStatus
178       /// response. After that, a "Mark" can be sent anytime to request the latest
179       /// stats. Closing the stream will initiate shutdown of the test server
180       /// and once the shutdown has finished, the OK status is sent to terminate
181       /// this RPC.
182       /// </summary>
183       /// <param name="options">The options for the call.</param>
184       /// <returns>The call object.</returns>
RunServer(grpc::CallOptions options)185       public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(grpc::CallOptions options)
186       {
187         return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options);
188       }
189       /// <summary>
190       /// Start client with specified workload.
191       /// First request sent specifies the ClientConfig followed by ClientStatus
192       /// response. After that, a "Mark" can be sent anytime to request the latest
193       /// stats. Closing the stream will initiate shutdown of the test client
194       /// and once the shutdown has finished, the OK status is sent to terminate
195       /// this RPC.
196       /// </summary>
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>
RunClient(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))201       public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
202       {
203         return RunClient(new grpc::CallOptions(headers, deadline, cancellationToken));
204       }
205       /// <summary>
206       /// Start client with specified workload.
207       /// First request sent specifies the ClientConfig followed by ClientStatus
208       /// response. After that, a "Mark" can be sent anytime to request the latest
209       /// stats. Closing the stream will initiate shutdown of the test client
210       /// and once the shutdown has finished, the OK status is sent to terminate
211       /// this RPC.
212       /// </summary>
213       /// <param name="options">The options for the call.</param>
214       /// <returns>The call object.</returns>
RunClient(grpc::CallOptions options)215       public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(grpc::CallOptions options)
216       {
217         return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options);
218       }
219       /// <summary>
220       /// Just return the core count - unary call
221       /// </summary>
222       /// <param name="request">The request to send to the server.</param>
223       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
224       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
225       /// <param name="cancellationToken">An optional token for canceling the call.</param>
226       /// <returns>The response received from the server.</returns>
CoreCount(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))227       public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
228       {
229         return CoreCount(request, new grpc::CallOptions(headers, deadline, cancellationToken));
230       }
231       /// <summary>
232       /// Just return the core count - unary call
233       /// </summary>
234       /// <param name="request">The request to send to the server.</param>
235       /// <param name="options">The options for the call.</param>
236       /// <returns>The response received from the server.</returns>
CoreCount(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options)237       public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options)
238       {
239         return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request);
240       }
241       /// <summary>
242       /// Just return the core count - unary call
243       /// </summary>
244       /// <param name="request">The request to send to the server.</param>
245       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
246       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
247       /// <param name="cancellationToken">An optional token for canceling the call.</param>
248       /// <returns>The call object.</returns>
CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))249       public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
250       {
251         return CoreCountAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
252       }
253       /// <summary>
254       /// Just return the core count - unary call
255       /// </summary>
256       /// <param name="request">The request to send to the server.</param>
257       /// <param name="options">The options for the call.</param>
258       /// <returns>The call object.</returns>
CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options)259       public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options)
260       {
261         return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request);
262       }
263       /// <summary>
264       /// Quit this worker
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 response received from the server.</returns>
QuitWorker(global::Grpc.Testing.Void request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))271       public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
272       {
273         return QuitWorker(request, new grpc::CallOptions(headers, deadline, cancellationToken));
274       }
275       /// <summary>
276       /// Quit this worker
277       /// </summary>
278       /// <param name="request">The request to send to the server.</param>
279       /// <param name="options">The options for the call.</param>
280       /// <returns>The response received from the server.</returns>
QuitWorker(global::Grpc.Testing.Void request, grpc::CallOptions options)281       public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::CallOptions options)
282       {
283         return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request);
284       }
285       /// <summary>
286       /// Quit this worker
287       /// </summary>
288       /// <param name="request">The request to send to the server.</param>
289       /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
290       /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
291       /// <param name="cancellationToken">An optional token for canceling the call.</param>
292       /// <returns>The call object.</returns>
QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))293       public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
294       {
295         return QuitWorkerAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
296       }
297       /// <summary>
298       /// Quit this worker
299       /// </summary>
300       /// <param name="request">The request to send to the server.</param>
301       /// <param name="options">The options for the call.</param>
302       /// <returns>The call object.</returns>
QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::CallOptions options)303       public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::CallOptions options)
304       {
305         return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request);
306       }
307       /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
NewInstance(ClientBaseConfiguration configuration)308       protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration)
309       {
310         return new WorkerServiceClient(configuration);
311       }
312     }
313 
314     /// <summary>Creates service definition that can be registered with a server</summary>
315     /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
BindService(WorkerServiceBase serviceImpl)316     public static grpc::ServerServiceDefinition BindService(WorkerServiceBase serviceImpl)
317     {
318       return grpc::ServerServiceDefinition.CreateBuilder()
319           .AddMethod(__Method_RunServer, serviceImpl.RunServer)
320           .AddMethod(__Method_RunClient, serviceImpl.RunClient)
321           .AddMethod(__Method_CoreCount, serviceImpl.CoreCount)
322           .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build();
323     }
324 
325     /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
326     /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
327     /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
328     /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
BindService(grpc::ServiceBinderBase serviceBinder, WorkerServiceBase serviceImpl)329     public static void BindService(grpc::ServiceBinderBase serviceBinder, WorkerServiceBase serviceImpl)
330     {
331       serviceBinder.AddMethod(__Method_RunServer, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>(serviceImpl.RunServer));
332       serviceBinder.AddMethod(__Method_RunClient, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>(serviceImpl.RunClient));
333       serviceBinder.AddMethod(__Method_CoreCount, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>(serviceImpl.CoreCount));
334       serviceBinder.AddMethod(__Method_QuitWorker, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.Void, global::Grpc.Testing.Void>(serviceImpl.QuitWorker));
335     }
336 
337   }
338 }
339 #endregion
340