kpayson64 | 7a20c96 | 2018-04-18 15:19:55 -0700 | [diff] [blame] | 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. |
Jan Tattermusch | 57139d1 | 2018-05-31 08:44:58 +0200 | [diff] [blame] | 22 | #pragma warning disable 0414, 1591 |
kpayson64 | 7a20c96 | 2018-04-18 15:19:55 -0700 | [diff] [blame] | 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 | |
Jan Tattermusch | b8fb538 | 2018-06-08 17:24:40 +0200 | [diff] [blame] | 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); |
kpayson64 | 7a20c96 | 2018-04-18 15:19:55 -0700 | [diff] [blame] | 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", |
Jan Tattermusch | b8fb538 | 2018-06-08 17:24:40 +0200 | [diff] [blame] | 44 | __Marshaller_grpc_testing_ServerArgs, |
| 45 | __Marshaller_grpc_testing_ServerStatus); |
kpayson64 | 7a20c96 | 2018-04-18 15:19:55 -0700 | [diff] [blame] | 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", |
Jan Tattermusch | b8fb538 | 2018-06-08 17:24:40 +0200 | [diff] [blame] | 51 | __Marshaller_grpc_testing_ClientArgs, |
| 52 | __Marshaller_grpc_testing_ClientStatus); |
kpayson64 | 7a20c96 | 2018-04-18 15:19:55 -0700 | [diff] [blame] | 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", |
Jan Tattermusch | b8fb538 | 2018-06-08 17:24:40 +0200 | [diff] [blame] | 58 | __Marshaller_grpc_testing_CoreRequest, |
| 59 | __Marshaller_grpc_testing_CoreResponse); |
kpayson64 | 7a20c96 | 2018-04-18 15:19:55 -0700 | [diff] [blame] | 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", |
Jan Tattermusch | b8fb538 | 2018-06-08 17:24:40 +0200 | [diff] [blame] | 65 | __Marshaller_grpc_testing_Void, |
| 66 | __Marshaller_grpc_testing_Void); |
kpayson64 | 7a20c96 | 2018-04-18 15:19:55 -0700 | [diff] [blame] | 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 | public abstract partial class WorkerServiceBase |
| 76 | { |
| 77 | /// <summary> |
| 78 | /// Start server with specified workload. |
| 79 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 80 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 81 | /// stats. Closing the stream will initiate shutdown of the test server |
| 82 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 83 | /// this RPC. |
| 84 | /// </summary> |
| 85 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 86 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 87 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 88 | /// <returns>A task indicating completion of the handler.</returns> |
| 89 | 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) |
| 90 | { |
| 91 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
| 92 | } |
| 93 | |
| 94 | /// <summary> |
| 95 | /// Start client with specified workload. |
| 96 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 97 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 98 | /// stats. Closing the stream will initiate shutdown of the test client |
| 99 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 100 | /// this RPC. |
| 101 | /// </summary> |
| 102 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 103 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 104 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 105 | /// <returns>A task indicating completion of the handler.</returns> |
| 106 | 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) |
| 107 | { |
| 108 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
| 109 | } |
| 110 | |
| 111 | /// <summary> |
| 112 | /// Just return the core count - unary call |
| 113 | /// </summary> |
| 114 | /// <param name="request">The request received from the client.</param> |
| 115 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 116 | /// <returns>The response to send back to the client (wrapped by a task).</returns> |
| 117 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, grpc::ServerCallContext context) |
| 118 | { |
| 119 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
| 120 | } |
| 121 | |
| 122 | /// <summary> |
| 123 | /// Quit this worker |
| 124 | /// </summary> |
| 125 | /// <param name="request">The request received from the client.</param> |
| 126 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 127 | /// <returns>The response to send back to the client (wrapped by a task).</returns> |
| 128 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, grpc::ServerCallContext context) |
| 129 | { |
| 130 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
| 131 | } |
| 132 | |
| 133 | } |
| 134 | |
| 135 | /// <summary>Client for WorkerService</summary> |
| 136 | public partial class WorkerServiceClient : grpc::ClientBase<WorkerServiceClient> |
| 137 | { |
| 138 | /// <summary>Creates a new client for WorkerService</summary> |
| 139 | /// <param name="channel">The channel to use to make remote calls.</param> |
| 140 | public WorkerServiceClient(grpc::Channel channel) : base(channel) |
| 141 | { |
| 142 | } |
| 143 | /// <summary>Creates a new client for WorkerService that uses a custom <c>CallInvoker</c>.</summary> |
| 144 | /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> |
| 145 | public WorkerServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) |
| 146 | { |
| 147 | } |
| 148 | /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 149 | protected WorkerServiceClient() : base() |
| 150 | { |
| 151 | } |
| 152 | /// <summary>Protected constructor to allow creation of configured clients.</summary> |
| 153 | /// <param name="configuration">The client configuration.</param> |
| 154 | protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
| 155 | { |
| 156 | } |
| 157 | |
| 158 | /// <summary> |
| 159 | /// Start server with specified workload. |
| 160 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 161 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 162 | /// stats. Closing the stream will initiate shutdown of the test server |
| 163 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 164 | /// this RPC. |
| 165 | /// </summary> |
| 166 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 167 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 168 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 169 | /// <returns>The call object.</returns> |
| 170 | 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)) |
| 171 | { |
| 172 | return RunServer(new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 173 | } |
| 174 | /// <summary> |
| 175 | /// Start server with specified workload. |
| 176 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 177 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 178 | /// stats. Closing the stream will initiate shutdown of the test server |
| 179 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 180 | /// this RPC. |
| 181 | /// </summary> |
| 182 | /// <param name="options">The options for the call.</param> |
| 183 | /// <returns>The call object.</returns> |
| 184 | public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(grpc::CallOptions options) |
| 185 | { |
| 186 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); |
| 187 | } |
| 188 | /// <summary> |
| 189 | /// Start client with specified workload. |
| 190 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 191 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 192 | /// stats. Closing the stream will initiate shutdown of the test client |
| 193 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 194 | /// this RPC. |
| 195 | /// </summary> |
| 196 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 197 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 198 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 199 | /// <returns>The call object.</returns> |
| 200 | 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)) |
| 201 | { |
| 202 | return RunClient(new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 203 | } |
| 204 | /// <summary> |
| 205 | /// Start client with specified workload. |
| 206 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 207 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 208 | /// stats. Closing the stream will initiate shutdown of the test client |
| 209 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 210 | /// this RPC. |
| 211 | /// </summary> |
| 212 | /// <param name="options">The options for the call.</param> |
| 213 | /// <returns>The call object.</returns> |
| 214 | public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(grpc::CallOptions options) |
| 215 | { |
| 216 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); |
| 217 | } |
| 218 | /// <summary> |
| 219 | /// Just return the core count - unary call |
| 220 | /// </summary> |
| 221 | /// <param name="request">The request to send to the server.</param> |
| 222 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 223 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 224 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 225 | /// <returns>The response received from the server.</returns> |
| 226 | 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)) |
| 227 | { |
| 228 | return CoreCount(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 229 | } |
| 230 | /// <summary> |
| 231 | /// Just return the core count - unary call |
| 232 | /// </summary> |
| 233 | /// <param name="request">The request to send to the server.</param> |
| 234 | /// <param name="options">The options for the call.</param> |
| 235 | /// <returns>The response received from the server.</returns> |
| 236 | public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) |
| 237 | { |
| 238 | return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); |
| 239 | } |
| 240 | /// <summary> |
| 241 | /// Just return the core count - unary call |
| 242 | /// </summary> |
| 243 | /// <param name="request">The request to send to the server.</param> |
| 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> |
| 248 | 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)) |
| 249 | { |
| 250 | return CoreCountAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 251 | } |
| 252 | /// <summary> |
| 253 | /// Just return the core count - unary call |
| 254 | /// </summary> |
| 255 | /// <param name="request">The request to send to the server.</param> |
| 256 | /// <param name="options">The options for the call.</param> |
| 257 | /// <returns>The call object.</returns> |
| 258 | public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) |
| 259 | { |
| 260 | return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); |
| 261 | } |
| 262 | /// <summary> |
| 263 | /// Quit this worker |
| 264 | /// </summary> |
| 265 | /// <param name="request">The request to send to the server.</param> |
| 266 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 267 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 268 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 269 | /// <returns>The response received from the server.</returns> |
| 270 | 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)) |
| 271 | { |
| 272 | return QuitWorker(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 273 | } |
| 274 | /// <summary> |
| 275 | /// Quit this worker |
| 276 | /// </summary> |
| 277 | /// <param name="request">The request to send to the server.</param> |
| 278 | /// <param name="options">The options for the call.</param> |
| 279 | /// <returns>The response received from the server.</returns> |
| 280 | public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::CallOptions options) |
| 281 | { |
| 282 | return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); |
| 283 | } |
| 284 | /// <summary> |
| 285 | /// Quit this worker |
| 286 | /// </summary> |
| 287 | /// <param name="request">The request to send to the server.</param> |
| 288 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 289 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 290 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 291 | /// <returns>The call object.</returns> |
| 292 | 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)) |
| 293 | { |
| 294 | return QuitWorkerAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 295 | } |
| 296 | /// <summary> |
| 297 | /// Quit this worker |
| 298 | /// </summary> |
| 299 | /// <param name="request">The request to send to the server.</param> |
| 300 | /// <param name="options">The options for the call.</param> |
| 301 | /// <returns>The call object.</returns> |
| 302 | public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::CallOptions options) |
| 303 | { |
| 304 | return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); |
| 305 | } |
| 306 | /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> |
| 307 | protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 308 | { |
| 309 | return new WorkerServiceClient(configuration); |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | /// <summary>Creates service definition that can be registered with a server</summary> |
| 314 | /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> |
| 315 | public static grpc::ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) |
| 316 | { |
| 317 | return grpc::ServerServiceDefinition.CreateBuilder() |
| 318 | .AddMethod(__Method_RunServer, serviceImpl.RunServer) |
| 319 | .AddMethod(__Method_RunClient, serviceImpl.RunClient) |
| 320 | .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) |
| 321 | .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); |
| 322 | } |
| 323 | |
| 324 | } |
| 325 | } |
| 326 | #endregion |