1 // <auto-generated> 2 // Generated by the protocol buffer compiler. DO NOT EDIT! 3 // source: math/math.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 #pragma warning disable 0414, 1591 21 #region Designer generated code 22 23 using grpc = global::Grpc.Core; 24 25 namespace Math { 26 public static partial class Math 27 { 28 static readonly string __ServiceName = "math.Math"; 29 30 static readonly grpc::Marshaller<global::Math.DivArgs> __Marshaller_math_DivArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom); 31 static readonly grpc::Marshaller<global::Math.DivReply> __Marshaller_math_DivReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom); 32 static readonly grpc::Marshaller<global::Math.FibArgs> __Marshaller_math_FibArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom); 33 static readonly grpc::Marshaller<global::Math.Num> __Marshaller_math_Num = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom); 34 35 static readonly grpc::Method<global::Math.DivArgs, global::Math.DivReply> __Method_Div = new grpc::Method<global::Math.DivArgs, global::Math.DivReply>( 36 grpc::MethodType.Unary, 37 __ServiceName, 38 "Div", 39 __Marshaller_math_DivArgs, 40 __Marshaller_math_DivReply); 41 42 static readonly grpc::Method<global::Math.DivArgs, global::Math.DivReply> __Method_DivMany = new grpc::Method<global::Math.DivArgs, global::Math.DivReply>( 43 grpc::MethodType.DuplexStreaming, 44 __ServiceName, 45 "DivMany", 46 __Marshaller_math_DivArgs, 47 __Marshaller_math_DivReply); 48 49 static readonly grpc::Method<global::Math.FibArgs, global::Math.Num> __Method_Fib = new grpc::Method<global::Math.FibArgs, global::Math.Num>( 50 grpc::MethodType.ServerStreaming, 51 __ServiceName, 52 "Fib", 53 __Marshaller_math_FibArgs, 54 __Marshaller_math_Num); 55 56 static readonly grpc::Method<global::Math.Num, global::Math.Num> __Method_Sum = new grpc::Method<global::Math.Num, global::Math.Num>( 57 grpc::MethodType.ClientStreaming, 58 __ServiceName, 59 "Sum", 60 __Marshaller_math_Num, 61 __Marshaller_math_Num); 62 63 /// <summary>Service descriptor</summary> 64 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor 65 { 66 get { return global::Math.MathReflection.Descriptor.Services[0]; } 67 } 68 69 /// <summary>Base class for server-side implementations of Math</summary> 70 [grpc::BindServiceMethod(typeof(Math), "BindService")] 71 public abstract partial class MathBase 72 { 73 /// <summary> 74 /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient 75 /// and remainder. 76 /// </summary> 77 /// <param name="request">The request received from the client.</param> 78 /// <param name="context">The context of the server-side call handler being invoked.</param> 79 /// <returns>The response to send back to the client (wrapped by a task).</returns> Div(global::Math.DivArgs request, grpc::ServerCallContext context)80 public virtual global::System.Threading.Tasks.Task<global::Math.DivReply> Div(global::Math.DivArgs request, grpc::ServerCallContext context) 81 { 82 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 83 } 84 85 /// <summary> 86 /// DivMany accepts an arbitrary number of division args from the client stream 87 /// and sends back the results in the reply stream. The stream continues until 88 /// the client closes its end; the server does the same after sending all the 89 /// replies. The stream ends immediately if either end aborts. 90 /// </summary> 91 /// <param name="requestStream">Used for reading requests from the client.</param> 92 /// <param name="responseStream">Used for sending responses back to the client.</param> 93 /// <param name="context">The context of the server-side call handler being invoked.</param> 94 /// <returns>A task indicating completion of the handler.</returns> DivMany(grpc::IAsyncStreamReader<global::Math.DivArgs> requestStream, grpc::IServerStreamWriter<global::Math.DivReply> responseStream, grpc::ServerCallContext context)95 public virtual global::System.Threading.Tasks.Task DivMany(grpc::IAsyncStreamReader<global::Math.DivArgs> requestStream, grpc::IServerStreamWriter<global::Math.DivReply> responseStream, grpc::ServerCallContext context) 96 { 97 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 98 } 99 100 /// <summary> 101 /// Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib 102 /// generates up to limit numbers; otherwise it continues until the call is 103 /// canceled. Unlike Fib above, Fib has no final FibReply. 104 /// </summary> 105 /// <param name="request">The request received from the client.</param> 106 /// <param name="responseStream">Used for sending responses back to the client.</param> 107 /// <param name="context">The context of the server-side call handler being invoked.</param> 108 /// <returns>A task indicating completion of the handler.</returns> Fib(global::Math.FibArgs request, grpc::IServerStreamWriter<global::Math.Num> responseStream, grpc::ServerCallContext context)109 public virtual global::System.Threading.Tasks.Task Fib(global::Math.FibArgs request, grpc::IServerStreamWriter<global::Math.Num> responseStream, grpc::ServerCallContext context) 110 { 111 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 112 } 113 114 /// <summary> 115 /// Sum sums a stream of numbers, returning the final result once the stream 116 /// is closed. 117 /// </summary> 118 /// <param name="requestStream">Used for reading requests from the client.</param> 119 /// <param name="context">The context of the server-side call handler being invoked.</param> 120 /// <returns>The response to send back to the client (wrapped by a task).</returns> Sum(grpc::IAsyncStreamReader<global::Math.Num> requestStream, grpc::ServerCallContext context)121 public virtual global::System.Threading.Tasks.Task<global::Math.Num> Sum(grpc::IAsyncStreamReader<global::Math.Num> requestStream, grpc::ServerCallContext context) 122 { 123 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 124 } 125 126 } 127 128 /// <summary>Client for Math</summary> 129 public partial class MathClient : grpc::ClientBase<MathClient> 130 { 131 /// <summary>Creates a new client for Math</summary> 132 /// <param name="channel">The channel to use to make remote calls.</param> MathClient(grpc::Channel channel)133 public MathClient(grpc::Channel channel) : base(channel) 134 { 135 } 136 /// <summary>Creates a new client for Math that uses a custom <c>CallInvoker</c>.</summary> 137 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> MathClient(grpc::CallInvoker callInvoker)138 public MathClient(grpc::CallInvoker callInvoker) : base(callInvoker) 139 { 140 } 141 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> MathClient()142 protected MathClient() : base() 143 { 144 } 145 /// <summary>Protected constructor to allow creation of configured clients.</summary> 146 /// <param name="configuration">The client configuration.</param> MathClient(ClientBaseConfiguration configuration)147 protected MathClient(ClientBaseConfiguration configuration) : base(configuration) 148 { 149 } 150 151 /// <summary> 152 /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient 153 /// and remainder. 154 /// </summary> 155 /// <param name="request">The request to send to the server.</param> 156 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 157 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 158 /// <param name="cancellationToken">An optional token for canceling the call.</param> 159 /// <returns>The response received from the server.</returns> Div(global::Math.DivArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))160 public virtual global::Math.DivReply Div(global::Math.DivArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 161 { 162 return Div(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 163 } 164 /// <summary> 165 /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient 166 /// and remainder. 167 /// </summary> 168 /// <param name="request">The request to send to the server.</param> 169 /// <param name="options">The options for the call.</param> 170 /// <returns>The response received from the server.</returns> Div(global::Math.DivArgs request, grpc::CallOptions options)171 public virtual global::Math.DivReply Div(global::Math.DivArgs request, grpc::CallOptions options) 172 { 173 return CallInvoker.BlockingUnaryCall(__Method_Div, null, options, request); 174 } 175 /// <summary> 176 /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient 177 /// and remainder. 178 /// </summary> 179 /// <param name="request">The request to send to the server.</param> 180 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 181 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 182 /// <param name="cancellationToken">An optional token for canceling the call.</param> 183 /// <returns>The call object.</returns> DivAsync(global::Math.DivArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))184 public virtual grpc::AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 185 { 186 return DivAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 187 } 188 /// <summary> 189 /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient 190 /// and remainder. 191 /// </summary> 192 /// <param name="request">The request to send to the server.</param> 193 /// <param name="options">The options for the call.</param> 194 /// <returns>The call object.</returns> DivAsync(global::Math.DivArgs request, grpc::CallOptions options)195 public virtual grpc::AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, grpc::CallOptions options) 196 { 197 return CallInvoker.AsyncUnaryCall(__Method_Div, null, options, request); 198 } 199 /// <summary> 200 /// DivMany accepts an arbitrary number of division args from the client stream 201 /// and sends back the results in the reply stream. The stream continues until 202 /// the client closes its end; the server does the same after sending all the 203 /// replies. The stream ends immediately if either end aborts. 204 /// </summary> 205 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 206 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 207 /// <param name="cancellationToken">An optional token for canceling the call.</param> 208 /// <returns>The call object.</returns> DivMany(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))209 public virtual grpc::AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 210 { 211 return DivMany(new grpc::CallOptions(headers, deadline, cancellationToken)); 212 } 213 /// <summary> 214 /// DivMany accepts an arbitrary number of division args from the client stream 215 /// and sends back the results in the reply stream. The stream continues until 216 /// the client closes its end; the server does the same after sending all the 217 /// replies. The stream ends immediately if either end aborts. 218 /// </summary> 219 /// <param name="options">The options for the call.</param> 220 /// <returns>The call object.</returns> DivMany(grpc::CallOptions options)221 public virtual grpc::AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(grpc::CallOptions options) 222 { 223 return CallInvoker.AsyncDuplexStreamingCall(__Method_DivMany, null, options); 224 } 225 /// <summary> 226 /// Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib 227 /// generates up to limit numbers; otherwise it continues until the call is 228 /// canceled. Unlike Fib above, Fib has no final FibReply. 229 /// </summary> 230 /// <param name="request">The request to send to the server.</param> 231 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 232 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 233 /// <param name="cancellationToken">An optional token for canceling the call.</param> 234 /// <returns>The call object.</returns> Fib(global::Math.FibArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))235 public virtual grpc::AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 236 { 237 return Fib(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 238 } 239 /// <summary> 240 /// Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib 241 /// generates up to limit numbers; otherwise it continues until the call is 242 /// canceled. Unlike Fib above, Fib has no final FibReply. 243 /// </summary> 244 /// <param name="request">The request to send to the server.</param> 245 /// <param name="options">The options for the call.</param> 246 /// <returns>The call object.</returns> Fib(global::Math.FibArgs request, grpc::CallOptions options)247 public virtual grpc::AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, grpc::CallOptions options) 248 { 249 return CallInvoker.AsyncServerStreamingCall(__Method_Fib, null, options, request); 250 } 251 /// <summary> 252 /// Sum sums a stream of numbers, returning the final result once the stream 253 /// is closed. 254 /// </summary> 255 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 256 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 257 /// <param name="cancellationToken">An optional token for canceling the call.</param> 258 /// <returns>The call object.</returns> Sum(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))259 public virtual grpc::AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 260 { 261 return Sum(new grpc::CallOptions(headers, deadline, cancellationToken)); 262 } 263 /// <summary> 264 /// Sum sums a stream of numbers, returning the final result once the stream 265 /// is closed. 266 /// </summary> 267 /// <param name="options">The options for the call.</param> 268 /// <returns>The call object.</returns> Sum(grpc::CallOptions options)269 public virtual grpc::AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(grpc::CallOptions options) 270 { 271 return CallInvoker.AsyncClientStreamingCall(__Method_Sum, null, options); 272 } 273 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> NewInstance(ClientBaseConfiguration configuration)274 protected override MathClient NewInstance(ClientBaseConfiguration configuration) 275 { 276 return new MathClient(configuration); 277 } 278 } 279 280 /// <summary>Creates service definition that can be registered with a server</summary> 281 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(MathBase serviceImpl)282 public static grpc::ServerServiceDefinition BindService(MathBase serviceImpl) 283 { 284 return grpc::ServerServiceDefinition.CreateBuilder() 285 .AddMethod(__Method_Div, serviceImpl.Div) 286 .AddMethod(__Method_DivMany, serviceImpl.DivMany) 287 .AddMethod(__Method_Fib, serviceImpl.Fib) 288 .AddMethod(__Method_Sum, serviceImpl.Sum).Build(); 289 } 290 291 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. 292 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> 293 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> 294 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(grpc::ServiceBinderBase serviceBinder, MathBase serviceImpl)295 public static void BindService(grpc::ServiceBinderBase serviceBinder, MathBase serviceImpl) 296 { 297 serviceBinder.AddMethod(__Method_Div, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Math.DivArgs, global::Math.DivReply>(serviceImpl.Div)); 298 serviceBinder.AddMethod(__Method_DivMany, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Math.DivArgs, global::Math.DivReply>(serviceImpl.DivMany)); 299 serviceBinder.AddMethod(__Method_Fib, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Math.FibArgs, global::Math.Num>(serviceImpl.Fib)); 300 serviceBinder.AddMethod(__Method_Sum, serviceImpl == null ? null : new grpc::ClientStreamingServerMethod<global::Math.Num, global::Math.Num>(serviceImpl.Sum)); 301 } 302 303 } 304 } 305 #endregion 306