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 25 using grpc = global::Grpc.Core; 26 27 namespace Grpc.Testing { 28 public static partial class ReportQpsScenarioService 29 { 30 static readonly string __ServiceName = "grpc.testing.ReportQpsScenarioService"; 31 __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)32 static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) 33 { 34 #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION 35 if (message is global::Google.Protobuf.IBufferMessage) 36 { 37 context.SetPayloadLength(message.CalculateSize()); 38 global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); 39 context.Complete(); 40 return; 41 } 42 #endif 43 context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); 44 } 45 46 static class __Helper_MessageCache<T> 47 { 48 public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); 49 } 50 51 static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser<T> parser) where T : global::Google.Protobuf.IMessage<T> 52 { 53 #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION 54 if (__Helper_MessageCache<T>.IsBufferMessage) 55 { 56 return parser.ParseFrom(context.PayloadAsReadOnlySequence()); 57 } 58 #endif 59 return parser.ParseFrom(context.PayloadAsNewBuffer()); 60 } 61 62 static readonly grpc::Marshaller<global::Grpc.Testing.ScenarioResult> __Marshaller_grpc_testing_ScenarioResult = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Grpc.Testing.ScenarioResult.Parser)); 63 static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_grpc_testing_Void = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Grpc.Testing.Void.Parser)); 64 65 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>( 66 grpc::MethodType.Unary, 67 __ServiceName, 68 "ReportScenario", 69 __Marshaller_grpc_testing_ScenarioResult, 70 __Marshaller_grpc_testing_Void); 71 72 /// <summary>Service descriptor</summary> 73 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor 74 { 75 get { return global::Grpc.Testing.ReportQpsScenarioServiceReflection.Descriptor.Services[0]; } 76 } 77 78 /// <summary>Base class for server-side implementations of ReportQpsScenarioService</summary> 79 [grpc::BindServiceMethod(typeof(ReportQpsScenarioService), "BindService")] 80 public abstract partial class ReportQpsScenarioServiceBase 81 { 82 /// <summary> 83 /// Report results of a QPS test benchmark scenario. 84 /// </summary> 85 /// <param name="request">The request received from the client.</param> 86 /// <param name="context">The context of the server-side call handler being invoked.</param> 87 /// <returns>The response to send back to the client (wrapped by a task).</returns> ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::ServerCallContext context)88 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::ServerCallContext context) 89 { 90 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 91 } 92 93 } 94 95 /// <summary>Client for ReportQpsScenarioService</summary> 96 public partial class ReportQpsScenarioServiceClient : grpc::ClientBase<ReportQpsScenarioServiceClient> 97 { 98 /// <summary>Creates a new client for ReportQpsScenarioService</summary> 99 /// <param name="channel">The channel to use to make remote calls.</param> ReportQpsScenarioServiceClient(grpc::ChannelBase channel)100 public ReportQpsScenarioServiceClient(grpc::ChannelBase channel) : base(channel) 101 { 102 } 103 /// <summary>Creates a new client for ReportQpsScenarioService that uses a custom <c>CallInvoker</c>.</summary> 104 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> ReportQpsScenarioServiceClient(grpc::CallInvoker callInvoker)105 public ReportQpsScenarioServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) 106 { 107 } 108 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> ReportQpsScenarioServiceClient()109 protected ReportQpsScenarioServiceClient() : base() 110 { 111 } 112 /// <summary>Protected constructor to allow creation of configured clients.</summary> 113 /// <param name="configuration">The client configuration.</param> ReportQpsScenarioServiceClient(ClientBaseConfiguration configuration)114 protected ReportQpsScenarioServiceClient(ClientBaseConfiguration configuration) : base(configuration) 115 { 116 } 117 118 /// <summary> 119 /// Report results of a QPS test benchmark scenario. 120 /// </summary> 121 /// <param name="request">The request to send to the server.</param> 122 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 123 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 124 /// <param name="cancellationToken">An optional token for canceling the call.</param> 125 /// <returns>The response received from the server.</returns> 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))126 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)) 127 { 128 return ReportScenario(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 129 } 130 /// <summary> 131 /// Report results of a QPS test benchmark scenario. 132 /// </summary> 133 /// <param name="request">The request to send to the server.</param> 134 /// <param name="options">The options for the call.</param> 135 /// <returns>The response received from the server.</returns> ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options)136 public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options) 137 { 138 return CallInvoker.BlockingUnaryCall(__Method_ReportScenario, null, options, request); 139 } 140 /// <summary> 141 /// Report results of a QPS test benchmark scenario. 142 /// </summary> 143 /// <param name="request">The request to send to the server.</param> 144 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 145 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 146 /// <param name="cancellationToken">An optional token for canceling the call.</param> 147 /// <returns>The call object.</returns> 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))148 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)) 149 { 150 return ReportScenarioAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 151 } 152 /// <summary> 153 /// Report results of a QPS test benchmark scenario. 154 /// </summary> 155 /// <param name="request">The request to send to the server.</param> 156 /// <param name="options">The options for the call.</param> 157 /// <returns>The call object.</returns> ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options)158 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options) 159 { 160 return CallInvoker.AsyncUnaryCall(__Method_ReportScenario, null, options, request); 161 } 162 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> NewInstance(ClientBaseConfiguration configuration)163 protected override ReportQpsScenarioServiceClient NewInstance(ClientBaseConfiguration configuration) 164 { 165 return new ReportQpsScenarioServiceClient(configuration); 166 } 167 } 168 169 /// <summary>Creates service definition that can be registered with a server</summary> 170 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(ReportQpsScenarioServiceBase serviceImpl)171 public static grpc::ServerServiceDefinition BindService(ReportQpsScenarioServiceBase serviceImpl) 172 { 173 return grpc::ServerServiceDefinition.CreateBuilder() 174 .AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario).Build(); 175 } 176 177 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. 178 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> 179 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> 180 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(grpc::ServiceBinderBase serviceBinder, ReportQpsScenarioServiceBase serviceImpl)181 public static void BindService(grpc::ServiceBinderBase serviceBinder, ReportQpsScenarioServiceBase serviceImpl) 182 { 183 serviceBinder.AddMethod(__Method_ReportScenario, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void>(serviceImpl.ReportScenario)); 184 } 185 186 } 187 } 188 #endregion 189