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 [grpc::BindServiceMethod(typeof(BenchmarkService), "BindService")] 78 public abstract partial class BenchmarkServiceBase 79 { 80 /// <summary> 81 /// One request followed by one response. 82 /// The server returns the client payload as-is. 83 /// </summary> 84 /// <param name="request">The request received from the client.</param> 85 /// <param name="context">The context of the server-side call handler being invoked.</param> 86 /// <returns>The response to send back to the client (wrapped by a task).</returns> UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context)87 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context) 88 { 89 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 90 } 91 92 /// <summary> 93 /// Repeated sequence of one request followed by one response. 94 /// Should be called streaming ping-pong 95 /// The server returns the client payload as-is on each response 96 /// </summary> 97 /// <param name="requestStream">Used for reading requests from the client.</param> 98 /// <param name="responseStream">Used for sending responses back to the client.</param> 99 /// <param name="context">The context of the server-side call handler being invoked.</param> 100 /// <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)101 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) 102 { 103 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 104 } 105 106 /// <summary> 107 /// Single-sided unbounded streaming from client to server 108 /// The server returns the client payload as-is once the client does WritesDone 109 /// </summary> 110 /// <param name="requestStream">Used for reading requests from the client.</param> 111 /// <param name="context">The context of the server-side call handler being invoked.</param> 112 /// <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)113 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::ServerCallContext context) 114 { 115 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 116 } 117 118 /// <summary> 119 /// Single-sided unbounded streaming from server to client 120 /// The server repeatedly returns the client payload as-is 121 /// </summary> 122 /// <param name="request">The request received from the client.</param> 123 /// <param name="responseStream">Used for sending responses back to the client.</param> 124 /// <param name="context">The context of the server-side call handler being invoked.</param> 125 /// <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)126 public virtual global::System.Threading.Tasks.Task StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context) 127 { 128 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 129 } 130 131 /// <summary> 132 /// Two-sided unbounded streaming between server to client 133 /// Both sides send the content of their own choice to the other 134 /// </summary> 135 /// <param name="requestStream">Used for reading requests from the client.</param> 136 /// <param name="responseStream">Used for sending responses back to the client.</param> 137 /// <param name="context">The context of the server-side call handler being invoked.</param> 138 /// <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)139 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) 140 { 141 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 142 } 143 144 } 145 146 /// <summary>Client for BenchmarkService</summary> 147 public partial class BenchmarkServiceClient : grpc::ClientBase<BenchmarkServiceClient> 148 { 149 /// <summary>Creates a new client for BenchmarkService</summary> 150 /// <param name="channel">The channel to use to make remote calls.</param> BenchmarkServiceClient(grpc::ChannelBase channel)151 public BenchmarkServiceClient(grpc::ChannelBase channel) : base(channel) 152 { 153 } 154 /// <summary>Creates a new client for BenchmarkService that uses a custom <c>CallInvoker</c>.</summary> 155 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> BenchmarkServiceClient(grpc::CallInvoker callInvoker)156 public BenchmarkServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) 157 { 158 } 159 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> BenchmarkServiceClient()160 protected BenchmarkServiceClient() : base() 161 { 162 } 163 /// <summary>Protected constructor to allow creation of configured clients.</summary> 164 /// <param name="configuration">The client configuration.</param> BenchmarkServiceClient(ClientBaseConfiguration configuration)165 protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration) 166 { 167 } 168 169 /// <summary> 170 /// One request followed by one response. 171 /// The server returns the client payload as-is. 172 /// </summary> 173 /// <param name="request">The request to send to the server.</param> 174 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 175 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 176 /// <param name="cancellationToken">An optional token for canceling the call.</param> 177 /// <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))178 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)) 179 { 180 return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 181 } 182 /// <summary> 183 /// One request followed by one response. 184 /// The server returns the client payload as-is. 185 /// </summary> 186 /// <param name="request">The request to send to the server.</param> 187 /// <param name="options">The options for the call.</param> 188 /// <returns>The response received from the server.</returns> UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)189 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) 190 { 191 return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); 192 } 193 /// <summary> 194 /// One request followed by one response. 195 /// The server returns the client payload as-is. 196 /// </summary> 197 /// <param name="request">The request to send to the server.</param> 198 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 199 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 200 /// <param name="cancellationToken">An optional token for canceling the call.</param> 201 /// <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))202 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)) 203 { 204 return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 205 } 206 /// <summary> 207 /// One request followed by one response. 208 /// The server returns the client payload as-is. 209 /// </summary> 210 /// <param name="request">The request to send to the server.</param> 211 /// <param name="options">The options for the call.</param> 212 /// <returns>The call object.</returns> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)213 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) 214 { 215 return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); 216 } 217 /// <summary> 218 /// Repeated sequence of one request followed by one response. 219 /// Should be called streaming ping-pong 220 /// The server returns the client payload as-is on each response 221 /// </summary> 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 call object.</returns> StreamingCall(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))226 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)) 227 { 228 return StreamingCall(new grpc::CallOptions(headers, deadline, cancellationToken)); 229 } 230 /// <summary> 231 /// Repeated sequence of one request followed by one response. 232 /// Should be called streaming ping-pong 233 /// The server returns the client payload as-is on each response 234 /// </summary> 235 /// <param name="options">The options for the call.</param> 236 /// <returns>The call object.</returns> StreamingCall(grpc::CallOptions options)237 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(grpc::CallOptions options) 238 { 239 return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); 240 } 241 /// <summary> 242 /// Single-sided unbounded streaming from client to server 243 /// The server returns the client payload as-is once the client does WritesDone 244 /// </summary> 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> StreamingFromClient(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))249 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)) 250 { 251 return StreamingFromClient(new grpc::CallOptions(headers, deadline, cancellationToken)); 252 } 253 /// <summary> 254 /// Single-sided unbounded streaming from client to server 255 /// The server returns the client payload as-is once the client does WritesDone 256 /// </summary> 257 /// <param name="options">The options for the call.</param> 258 /// <returns>The call object.</returns> StreamingFromClient(grpc::CallOptions options)259 public virtual grpc::AsyncClientStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::CallOptions options) 260 { 261 return CallInvoker.AsyncClientStreamingCall(__Method_StreamingFromClient, null, options); 262 } 263 /// <summary> 264 /// Single-sided unbounded streaming from server to client 265 /// The server repeatedly returns the client payload as-is 266 /// </summary> 267 /// <param name="request">The request to send to the server.</param> 268 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 269 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 270 /// <param name="cancellationToken">An optional token for canceling the call.</param> 271 /// <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))272 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)) 273 { 274 return StreamingFromServer(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 275 } 276 /// <summary> 277 /// Single-sided unbounded streaming from server to client 278 /// The server repeatedly returns the client payload as-is 279 /// </summary> 280 /// <param name="request">The request to send to the server.</param> 281 /// <param name="options">The options for the call.</param> 282 /// <returns>The call object.</returns> StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)283 public virtual grpc::AsyncServerStreamingCall<global::Grpc.Testing.SimpleResponse> StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) 284 { 285 return CallInvoker.AsyncServerStreamingCall(__Method_StreamingFromServer, null, options, request); 286 } 287 /// <summary> 288 /// Two-sided unbounded streaming between server to client 289 /// Both sides send the content of their own choice to the other 290 /// </summary> 291 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 292 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 293 /// <param name="cancellationToken">An optional token for canceling the call.</param> 294 /// <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))295 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)) 296 { 297 return StreamingBothWays(new grpc::CallOptions(headers, deadline, cancellationToken)); 298 } 299 /// <summary> 300 /// Two-sided unbounded streaming between server to client 301 /// Both sides send the content of their own choice to the other 302 /// </summary> 303 /// <param name="options">The options for the call.</param> 304 /// <returns>The call object.</returns> StreamingBothWays(grpc::CallOptions options)305 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingBothWays(grpc::CallOptions options) 306 { 307 return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingBothWays, null, options); 308 } 309 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> NewInstance(ClientBaseConfiguration configuration)310 protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration) 311 { 312 return new BenchmarkServiceClient(configuration); 313 } 314 } 315 316 /// <summary>Creates service definition that can be registered with a server</summary> 317 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(BenchmarkServiceBase serviceImpl)318 public static grpc::ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) 319 { 320 return grpc::ServerServiceDefinition.CreateBuilder() 321 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) 322 .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall) 323 .AddMethod(__Method_StreamingFromClient, serviceImpl.StreamingFromClient) 324 .AddMethod(__Method_StreamingFromServer, serviceImpl.StreamingFromServer) 325 .AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays).Build(); 326 } 327 328 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. 329 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> 330 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> 331 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(grpc::ServiceBinderBase serviceBinder, BenchmarkServiceBase serviceImpl)332 public static void BindService(grpc::ServiceBinderBase serviceBinder, BenchmarkServiceBase serviceImpl) 333 { 334 serviceBinder.AddMethod(__Method_UnaryCall, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.UnaryCall)); 335 serviceBinder.AddMethod(__Method_StreamingCall, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.StreamingCall)); 336 serviceBinder.AddMethod(__Method_StreamingFromClient, serviceImpl == null ? null : new grpc::ClientStreamingServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.StreamingFromClient)); 337 serviceBinder.AddMethod(__Method_StreamingFromServer, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.StreamingFromServer)); 338 serviceBinder.AddMethod(__Method_StreamingBothWays, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(serviceImpl.StreamingBothWays)); 339 } 340 341 } 342 } 343 #endregion 344