2 // Generated by the protocol buffer compiler. DO NOT EDIT!
3 // source: grpc/health/v1/health.proto
5 // Original file comments:
6 // Copyright 2015 The gRPC Authors
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
12 // http://www.apache.org/licenses/LICENSE-2.0
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.
20 // The canonical version of this proto can be found at
21 // https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto
23 #pragma warning disable 0414, 1591
24 #region Designer generated code
26 using grpc = global::Grpc.Core;
28 namespace Grpc.Health.V1 {
29 public static partial class Health
31 static readonly string __ServiceName = "grpc.health.v1.Health";
33 static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckRequest> __Marshaller_grpc_health_v1_HealthCheckRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom);
34 static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckResponse> __Marshaller_grpc_health_v1_HealthCheckResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom);
36 static readonly grpc::Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse> __Method_Check = new grpc::Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(
37 grpc::MethodType.Unary,
40 __Marshaller_grpc_health_v1_HealthCheckRequest,
41 __Marshaller_grpc_health_v1_HealthCheckResponse);
43 static readonly grpc::Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse> __Method_Watch = new grpc::Method<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(
44 grpc::MethodType.ServerStreaming,
47 __Marshaller_grpc_health_v1_HealthCheckRequest,
48 __Marshaller_grpc_health_v1_HealthCheckResponse);
50 /// <summary>Service descriptor</summary>
51 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
53 get { return global::Grpc.Health.V1.HealthReflection.Descriptor.Services[0]; }
56 /// <summary>Base class for server-side implementations of Health</summary>
57 [grpc::BindServiceMethod(typeof(Health), "BindService")]
58 public abstract partial class HealthBase
61 /// If the requested service is unknown, the call will fail with status
64 /// <param name="request">The request received from the client.</param>
65 /// <param name="context">The context of the server-side call handler being invoked.</param>
66 /// <returns>The response to send back to the client (wrapped by a task).</returns>
67 public virtual global::System.Threading.Tasks.Task<global::Grpc.Health.V1.HealthCheckResponse> Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::ServerCallContext context)
69 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
73 /// Performs a watch for the serving status of the requested service.
74 /// The server will immediately send back a message indicating the current
75 /// serving status. It will then subsequently send a new message whenever
76 /// the service's serving status changes.
78 /// If the requested service is unknown when the call is received, the
79 /// server will send a message setting the serving status to
80 /// SERVICE_UNKNOWN but will *not* terminate the call. If at some
81 /// future point, the serving status of the service becomes known, the
82 /// server will send a new message with the service's serving status.
84 /// If the call terminates with status UNIMPLEMENTED, then clients
85 /// should assume this method is not supported and should not retry the
86 /// call. If the call terminates with any other status (including OK),
87 /// clients should retry the call with appropriate exponential backoff.
89 /// <param name="request">The request received from the client.</param>
90 /// <param name="responseStream">Used for sending responses back to the client.</param>
91 /// <param name="context">The context of the server-side call handler being invoked.</param>
92 /// <returns>A task indicating completion of the handler.</returns>
93 public virtual global::System.Threading.Tasks.Task Watch(global::Grpc.Health.V1.HealthCheckRequest request, grpc::IServerStreamWriter<global::Grpc.Health.V1.HealthCheckResponse> responseStream, grpc::ServerCallContext context)
95 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
100 /// <summary>Client for Health</summary>
101 public partial class HealthClient : grpc::ClientBase<HealthClient>
103 /// <summary>Creates a new client for Health</summary>
104 /// <param name="channel">The channel to use to make remote calls.</param>
105 public HealthClient(grpc::Channel channel) : base(channel)
108 /// <summary>Creates a new client for Health that uses a custom <c>CallInvoker</c>.</summary>
109 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
110 public HealthClient(grpc::CallInvoker callInvoker) : base(callInvoker)
113 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
114 protected HealthClient() : base()
117 /// <summary>Protected constructor to allow creation of configured clients.</summary>
118 /// <param name="configuration">The client configuration.</param>
119 protected HealthClient(ClientBaseConfiguration configuration) : base(configuration)
124 /// If the requested service is unknown, the call will fail with status
127 /// <param name="request">The request to send to the server.</param>
128 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
129 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
130 /// <param name="cancellationToken">An optional token for canceling the call.</param>
131 /// <returns>The response received from the server.</returns>
132 public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
134 return Check(request, new grpc::CallOptions(headers, deadline, cancellationToken));
137 /// If the requested service is unknown, the call will fail with status
140 /// <param name="request">The request to send to the server.</param>
141 /// <param name="options">The options for the call.</param>
142 /// <returns>The response received from the server.</returns>
143 public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)
145 return CallInvoker.BlockingUnaryCall(__Method_Check, null, options, request);
148 /// If the requested service is unknown, the call will fail with status
151 /// <param name="request">The request to send to the server.</param>
152 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
153 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
154 /// <param name="cancellationToken">An optional token for canceling the call.</param>
155 /// <returns>The call object.</returns>
156 public virtual grpc::AsyncUnaryCall<global::Grpc.Health.V1.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
158 return CheckAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
161 /// If the requested service is unknown, the call will fail with status
164 /// <param name="request">The request to send to the server.</param>
165 /// <param name="options">The options for the call.</param>
166 /// <returns>The call object.</returns>
167 public virtual grpc::AsyncUnaryCall<global::Grpc.Health.V1.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)
169 return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request);
172 /// Performs a watch for the serving status of the requested service.
173 /// The server will immediately send back a message indicating the current
174 /// serving status. It will then subsequently send a new message whenever
175 /// the service's serving status changes.
177 /// If the requested service is unknown when the call is received, the
178 /// server will send a message setting the serving status to
179 /// SERVICE_UNKNOWN but will *not* terminate the call. If at some
180 /// future point, the serving status of the service becomes known, the
181 /// server will send a new message with the service's serving status.
183 /// If the call terminates with status UNIMPLEMENTED, then clients
184 /// should assume this method is not supported and should not retry the
185 /// call. If the call terminates with any other status (including OK),
186 /// clients should retry the call with appropriate exponential backoff.
188 /// <param name="request">The request to send to the server.</param>
189 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
190 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
191 /// <param name="cancellationToken">An optional token for canceling the call.</param>
192 /// <returns>The call object.</returns>
193 public virtual grpc::AsyncServerStreamingCall<global::Grpc.Health.V1.HealthCheckResponse> Watch(global::Grpc.Health.V1.HealthCheckRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
195 return Watch(request, new grpc::CallOptions(headers, deadline, cancellationToken));
198 /// Performs a watch for the serving status of the requested service.
199 /// The server will immediately send back a message indicating the current
200 /// serving status. It will then subsequently send a new message whenever
201 /// the service's serving status changes.
203 /// If the requested service is unknown when the call is received, the
204 /// server will send a message setting the serving status to
205 /// SERVICE_UNKNOWN but will *not* terminate the call. If at some
206 /// future point, the serving status of the service becomes known, the
207 /// server will send a new message with the service's serving status.
209 /// If the call terminates with status UNIMPLEMENTED, then clients
210 /// should assume this method is not supported and should not retry the
211 /// call. If the call terminates with any other status (including OK),
212 /// clients should retry the call with appropriate exponential backoff.
214 /// <param name="request">The request to send to the server.</param>
215 /// <param name="options">The options for the call.</param>
216 /// <returns>The call object.</returns>
217 public virtual grpc::AsyncServerStreamingCall<global::Grpc.Health.V1.HealthCheckResponse> Watch(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)
219 return CallInvoker.AsyncServerStreamingCall(__Method_Watch, null, options, request);
221 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
222 protected override HealthClient NewInstance(ClientBaseConfiguration configuration)
224 return new HealthClient(configuration);
228 /// <summary>Creates service definition that can be registered with a server</summary>
229 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
230 public static grpc::ServerServiceDefinition BindService(HealthBase serviceImpl)
232 return grpc::ServerServiceDefinition.CreateBuilder()
233 .AddMethod(__Method_Check, serviceImpl.Check)
234 .AddMethod(__Method_Watch, serviceImpl.Watch).Build();
237 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
238 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
239 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
240 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
241 public static void BindService(grpc::ServiceBinderBase serviceBinder, HealthBase serviceImpl)
243 serviceBinder.AddMethod(__Method_Check, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(serviceImpl.Check));
244 serviceBinder.AddMethod(__Method_Watch, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(serviceImpl.Watch));