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 public abstract partial class HealthBase
60 /// If the requested service is unknown, the call will fail with status
63 /// <param name="request">The request received from the client.</param>
64 /// <param name="context">The context of the server-side call handler being invoked.</param>
65 /// <returns>The response to send back to the client (wrapped by a task).</returns>
66 public virtual global::System.Threading.Tasks.Task<global::Grpc.Health.V1.HealthCheckResponse> Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::ServerCallContext context)
68 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
72 /// Performs a watch for the serving status of the requested service.
73 /// The server will immediately send back a message indicating the current
74 /// serving status. It will then subsequently send a new message whenever
75 /// the service's serving status changes.
77 /// If the requested service is unknown when the call is received, the
78 /// server will send a message setting the serving status to
79 /// SERVICE_UNKNOWN but will *not* terminate the call. If at some
80 /// future point, the serving status of the service becomes known, the
81 /// server will send a new message with the service's serving status.
83 /// If the call terminates with status UNIMPLEMENTED, then clients
84 /// should assume this method is not supported and should not retry the
85 /// call. If the call terminates with any other status (including OK),
86 /// clients should retry the call with appropriate exponential backoff.
88 /// <param name="request">The request received from the client.</param>
89 /// <param name="responseStream">Used for sending responses back to the client.</param>
90 /// <param name="context">The context of the server-side call handler being invoked.</param>
91 /// <returns>A task indicating completion of the handler.</returns>
92 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)
94 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
99 /// <summary>Client for Health</summary>
100 public partial class HealthClient : grpc::ClientBase<HealthClient>
102 /// <summary>Creates a new client for Health</summary>
103 /// <param name="channel">The channel to use to make remote calls.</param>
104 public HealthClient(grpc::Channel channel) : base(channel)
107 /// <summary>Creates a new client for Health that uses a custom <c>CallInvoker</c>.</summary>
108 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
109 public HealthClient(grpc::CallInvoker callInvoker) : base(callInvoker)
112 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
113 protected HealthClient() : base()
116 /// <summary>Protected constructor to allow creation of configured clients.</summary>
117 /// <param name="configuration">The client configuration.</param>
118 protected HealthClient(ClientBaseConfiguration configuration) : base(configuration)
123 /// If the requested service is unknown, the call will fail with status
126 /// <param name="request">The request to send to the server.</param>
127 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
128 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
129 /// <param name="cancellationToken">An optional token for canceling the call.</param>
130 /// <returns>The response received from the server.</returns>
131 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))
133 return Check(request, new grpc::CallOptions(headers, deadline, cancellationToken));
136 /// If the requested service is unknown, the call will fail with status
139 /// <param name="request">The request to send to the server.</param>
140 /// <param name="options">The options for the call.</param>
141 /// <returns>The response received from the server.</returns>
142 public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)
144 return CallInvoker.BlockingUnaryCall(__Method_Check, null, options, request);
147 /// If the requested service is unknown, the call will fail with status
150 /// <param name="request">The request to send to the server.</param>
151 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
152 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
153 /// <param name="cancellationToken">An optional token for canceling the call.</param>
154 /// <returns>The call object.</returns>
155 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))
157 return CheckAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
160 /// If the requested service is unknown, the call will fail with status
163 /// <param name="request">The request to send to the server.</param>
164 /// <param name="options">The options for the call.</param>
165 /// <returns>The call object.</returns>
166 public virtual grpc::AsyncUnaryCall<global::Grpc.Health.V1.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)
168 return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request);
171 /// Performs a watch for the serving status of the requested service.
172 /// The server will immediately send back a message indicating the current
173 /// serving status. It will then subsequently send a new message whenever
174 /// the service's serving status changes.
176 /// If the requested service is unknown when the call is received, the
177 /// server will send a message setting the serving status to
178 /// SERVICE_UNKNOWN but will *not* terminate the call. If at some
179 /// future point, the serving status of the service becomes known, the
180 /// server will send a new message with the service's serving status.
182 /// If the call terminates with status UNIMPLEMENTED, then clients
183 /// should assume this method is not supported and should not retry the
184 /// call. If the call terminates with any other status (including OK),
185 /// clients should retry the call with appropriate exponential backoff.
187 /// <param name="request">The request to send to the server.</param>
188 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
189 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
190 /// <param name="cancellationToken">An optional token for canceling the call.</param>
191 /// <returns>The call object.</returns>
192 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))
194 return Watch(request, new grpc::CallOptions(headers, deadline, cancellationToken));
197 /// Performs a watch for the serving status of the requested service.
198 /// The server will immediately send back a message indicating the current
199 /// serving status. It will then subsequently send a new message whenever
200 /// the service's serving status changes.
202 /// If the requested service is unknown when the call is received, the
203 /// server will send a message setting the serving status to
204 /// SERVICE_UNKNOWN but will *not* terminate the call. If at some
205 /// future point, the serving status of the service becomes known, the
206 /// server will send a new message with the service's serving status.
208 /// If the call terminates with status UNIMPLEMENTED, then clients
209 /// should assume this method is not supported and should not retry the
210 /// call. If the call terminates with any other status (including OK),
211 /// clients should retry the call with appropriate exponential backoff.
213 /// <param name="request">The request to send to the server.</param>
214 /// <param name="options">The options for the call.</param>
215 /// <returns>The call object.</returns>
216 public virtual grpc::AsyncServerStreamingCall<global::Grpc.Health.V1.HealthCheckResponse> Watch(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)
218 return CallInvoker.AsyncServerStreamingCall(__Method_Watch, null, options, request);
220 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
221 protected override HealthClient NewInstance(ClientBaseConfiguration configuration)
223 return new HealthClient(configuration);
227 /// <summary>Creates service definition that can be registered with a server</summary>
228 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
229 public static grpc::ServerServiceDefinition BindService(HealthBase serviceImpl)
231 return grpc::ServerServiceDefinition.CreateBuilder()
232 .AddMethod(__Method_Check, serviceImpl.Check)
233 .AddMethod(__Method_Watch, serviceImpl.Watch).Build();
236 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
237 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
238 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
239 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
240 public static void BindService(grpc::ServiceBinderBase serviceBinder, HealthBase serviceImpl)
242 serviceBinder.AddMethod(__Method_Check, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(serviceImpl.Check));
243 serviceBinder.AddMethod(__Method_Watch, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(serviceImpl.Watch));