Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: health.proto |
| 3 | #region Designer generated code |
| 4 | |
| 5 | using System; |
| 6 | using System.Threading; |
| 7 | using System.Threading.Tasks; |
| 8 | using Grpc.Core; |
| 9 | |
| 10 | namespace Grpc.Health.V1Alpha { |
| 11 | public static class Health |
| 12 | { |
| 13 | static readonly string __ServiceName = "grpc.health.v1alpha.Health"; |
| 14 | |
| 15 | static readonly Marshaller<global::Grpc.Health.V1Alpha.HealthCheckRequest> __Marshaller_HealthCheckRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Health.V1Alpha.HealthCheckRequest.ParseFrom); |
| 16 | static readonly Marshaller<global::Grpc.Health.V1Alpha.HealthCheckResponse> __Marshaller_HealthCheckResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::Grpc.Health.V1Alpha.HealthCheckResponse.ParseFrom); |
| 17 | |
| 18 | static readonly Method<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckResponse> __Method_Check = new Method<global::Grpc.Health.V1Alpha.HealthCheckRequest, global::Grpc.Health.V1Alpha.HealthCheckResponse>( |
| 19 | MethodType.Unary, |
| 20 | "Check", |
| 21 | __Marshaller_HealthCheckRequest, |
| 22 | __Marshaller_HealthCheckResponse); |
| 23 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 24 | // client interface |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 25 | public interface IHealthClient |
| 26 | { |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 27 | global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 28 | Task<global::Grpc.Health.V1Alpha.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | // server-side interface |
| 32 | public interface IHealth |
| 33 | { |
| 34 | Task<global::Grpc.Health.V1Alpha.HealthCheckResponse> Check(ServerCallContext context, global::Grpc.Health.V1Alpha.HealthCheckRequest request); |
| 35 | } |
| 36 | |
| 37 | // client stub |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 38 | public class HealthClient : ClientBase, IHealthClient |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 39 | { |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 40 | public HealthClient(Channel channel) : base(channel) |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 41 | { |
| 42 | } |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 43 | public global::Grpc.Health.V1Alpha.HealthCheckResponse Check(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 44 | { |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 45 | var call = CreateCall(__ServiceName, __Method_Check, headers); |
| 46 | return Calls.BlockingUnaryCall(call, request, cancellationToken); |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 47 | } |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 48 | public Task<global::Grpc.Health.V1Alpha.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1Alpha.HealthCheckRequest request, Metadata headers = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 49 | { |
Jan Tattermusch | fd953a5 | 2015-07-14 21:41:29 -0700 | [diff] [blame] | 50 | var call = CreateCall(__ServiceName, __Method_Check, headers); |
| 51 | return Calls.AsyncUnaryCall(call, request, cancellationToken); |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 52 | } |
| 53 | } |
| 54 | |
| 55 | // creates service definition that can be registered with a server |
| 56 | public static ServerServiceDefinition BindService(IHealth serviceImpl) |
| 57 | { |
| 58 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 59 | .AddMethod(__Method_Check, serviceImpl.Check).Build(); |
| 60 | } |
| 61 | |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 62 | // creates a new client |
| 63 | public static HealthClient NewClient(Channel channel) |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 64 | { |
| 65 | return new HealthClient(channel); |
| 66 | } |
| 67 | |
Jan Tattermusch | 5253467 | 2015-07-14 20:29:21 -0700 | [diff] [blame] | 68 | } |
| 69 | } |
| 70 | #endregion |