ReportQpsScenarioServiceGrpc.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: src/proto/grpc/testing/report_qps_scenario_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. using grpc = global::Grpc.Core;
  25. namespace Grpc.Testing {
  26. public static partial class ReportQpsScenarioService
  27. {
  28. static readonly string __ServiceName = "grpc.testing.ReportQpsScenarioService";
  29. static readonly grpc::Marshaller<global::Grpc.Testing.ScenarioResult> __Marshaller_grpc_testing_ScenarioResult = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ScenarioResult.Parser.ParseFrom);
  30. 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);
  31. static readonly grpc::Method<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void> __Method_ReportScenario = new grpc::Method<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void>(
  32. grpc::MethodType.Unary,
  33. __ServiceName,
  34. "ReportScenario",
  35. __Marshaller_grpc_testing_ScenarioResult,
  36. __Marshaller_grpc_testing_Void);
  37. /// <summary>Service descriptor</summary>
  38. public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
  39. {
  40. get { return global::Grpc.Testing.ReportQpsScenarioServiceReflection.Descriptor.Services[0]; }
  41. }
  42. /// <summary>Base class for server-side implementations of ReportQpsScenarioService</summary>
  43. public abstract partial class ReportQpsScenarioServiceBase
  44. {
  45. /// <summary>
  46. /// Report results of a QPS test benchmark scenario.
  47. /// </summary>
  48. /// <param name="request">The request received from the client.</param>
  49. /// <param name="context">The context of the server-side call handler being invoked.</param>
  50. /// <returns>The response to send back to the client (wrapped by a task).</returns>
  51. public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::ServerCallContext context)
  52. {
  53. throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
  54. }
  55. }
  56. /// <summary>Client for ReportQpsScenarioService</summary>
  57. public partial class ReportQpsScenarioServiceClient : grpc::ClientBase<ReportQpsScenarioServiceClient>
  58. {
  59. /// <summary>Creates a new client for ReportQpsScenarioService</summary>
  60. /// <param name="channel">The channel to use to make remote calls.</param>
  61. public ReportQpsScenarioServiceClient(grpc::Channel channel) : base(channel)
  62. {
  63. }
  64. /// <summary>Creates a new client for ReportQpsScenarioService that uses a custom <c>CallInvoker</c>.</summary>
  65. /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
  66. public ReportQpsScenarioServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
  67. {
  68. }
  69. /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
  70. protected ReportQpsScenarioServiceClient() : base()
  71. {
  72. }
  73. /// <summary>Protected constructor to allow creation of configured clients.</summary>
  74. /// <param name="configuration">The client configuration.</param>
  75. protected ReportQpsScenarioServiceClient(ClientBaseConfiguration configuration) : base(configuration)
  76. {
  77. }
  78. /// <summary>
  79. /// Report results of a QPS test benchmark scenario.
  80. /// </summary>
  81. /// <param name="request">The request to send to the server.</param>
  82. /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
  83. /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
  84. /// <param name="cancellationToken">An optional token for canceling the call.</param>
  85. /// <returns>The response received from the server.</returns>
  86. public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
  87. {
  88. return ReportScenario(request, new grpc::CallOptions(headers, deadline, cancellationToken));
  89. }
  90. /// <summary>
  91. /// Report results of a QPS test benchmark scenario.
  92. /// </summary>
  93. /// <param name="request">The request to send to the server.</param>
  94. /// <param name="options">The options for the call.</param>
  95. /// <returns>The response received from the server.</returns>
  96. public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options)
  97. {
  98. return CallInvoker.BlockingUnaryCall(__Method_ReportScenario, null, options, request);
  99. }
  100. /// <summary>
  101. /// Report results of a QPS test benchmark scenario.
  102. /// </summary>
  103. /// <param name="request">The request to send to the server.</param>
  104. /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
  105. /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
  106. /// <param name="cancellationToken">An optional token for canceling the call.</param>
  107. /// <returns>The call object.</returns>
  108. public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
  109. {
  110. return ReportScenarioAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
  111. }
  112. /// <summary>
  113. /// Report results of a QPS test benchmark scenario.
  114. /// </summary>
  115. /// <param name="request">The request to send to the server.</param>
  116. /// <param name="options">The options for the call.</param>
  117. /// <returns>The call object.</returns>
  118. public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options)
  119. {
  120. return CallInvoker.AsyncUnaryCall(__Method_ReportScenario, null, options, request);
  121. }
  122. /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
  123. protected override ReportQpsScenarioServiceClient NewInstance(ClientBaseConfiguration configuration)
  124. {
  125. return new ReportQpsScenarioServiceClient(configuration);
  126. }
  127. }
  128. /// <summary>Creates service definition that can be registered with a server</summary>
  129. /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
  130. public static grpc::ServerServiceDefinition BindService(ReportQpsScenarioServiceBase serviceImpl)
  131. {
  132. return grpc::ServerServiceDefinition.CreateBuilder()
  133. .AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario).Build();
  134. }
  135. /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
  136. /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
  137. /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
  138. /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
  139. public static void BindService(grpc::ServiceBinderBase serviceBinder, ReportQpsScenarioServiceBase serviceImpl)
  140. {
  141. serviceBinder.AddMethod(__Method_ReportScenario, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void>(serviceImpl.ReportScenario));
  142. }
  143. }
  144. }
  145. #endregion