Imported Upstream version 1.21.0
[platform/upstream/grpc.git] / src / csharp / Grpc.HealthCheck / HealthGrpc.cs
1 // <auto-generated>
2 //     Generated by the protocol buffer compiler.  DO NOT EDIT!
3 //     source: grpc/health/v1/health.proto
4 // </auto-generated>
5 // Original file comments:
6 // Copyright 2015 The 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 // The canonical version of this proto can be found at
21 // https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto
22 //
23 #pragma warning disable 0414, 1591
24 #region Designer generated code
25
26 using grpc = global::Grpc.Core;
27
28 namespace Grpc.Health.V1 {
29   public static partial class Health
30   {
31     static readonly string __ServiceName = "grpc.health.v1.Health";
32
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);
35
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,
38         __ServiceName,
39         "Check",
40         __Marshaller_grpc_health_v1_HealthCheckRequest,
41         __Marshaller_grpc_health_v1_HealthCheckResponse);
42
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,
45         __ServiceName,
46         "Watch",
47         __Marshaller_grpc_health_v1_HealthCheckRequest,
48         __Marshaller_grpc_health_v1_HealthCheckResponse);
49
50     /// <summary>Service descriptor</summary>
51     public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
52     {
53       get { return global::Grpc.Health.V1.HealthReflection.Descriptor.Services[0]; }
54     }
55
56     /// <summary>Base class for server-side implementations of Health</summary>
57     [grpc::BindServiceMethod(typeof(Health), "BindService")]
58     public abstract partial class HealthBase
59     {
60       /// <summary>
61       /// If the requested service is unknown, the call will fail with status
62       /// NOT_FOUND.
63       /// </summary>
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)
68       {
69         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
70       }
71
72       /// <summary>
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.
77       ///
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.
83       ///
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.
88       /// </summary>
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)
94       {
95         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
96       }
97
98     }
99
100     /// <summary>Client for Health</summary>
101     public partial class HealthClient : grpc::ClientBase<HealthClient>
102     {
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)
106       {
107       }
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)
111       {
112       }
113       /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
114       protected HealthClient() : base()
115       {
116       }
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)
120       {
121       }
122
123       /// <summary>
124       /// If the requested service is unknown, the call will fail with status
125       /// NOT_FOUND.
126       /// </summary>
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))
133       {
134         return Check(request, new grpc::CallOptions(headers, deadline, cancellationToken));
135       }
136       /// <summary>
137       /// If the requested service is unknown, the call will fail with status
138       /// NOT_FOUND.
139       /// </summary>
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)
144       {
145         return CallInvoker.BlockingUnaryCall(__Method_Check, null, options, request);
146       }
147       /// <summary>
148       /// If the requested service is unknown, the call will fail with status
149       /// NOT_FOUND.
150       /// </summary>
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))
157       {
158         return CheckAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
159       }
160       /// <summary>
161       /// If the requested service is unknown, the call will fail with status
162       /// NOT_FOUND.
163       /// </summary>
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)
168       {
169         return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request);
170       }
171       /// <summary>
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.
176       ///
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.
182       ///
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.
187       /// </summary>
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))
194       {
195         return Watch(request, new grpc::CallOptions(headers, deadline, cancellationToken));
196       }
197       /// <summary>
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.
202       ///
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.
208       ///
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.
213       /// </summary>
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)
218       {
219         return CallInvoker.AsyncServerStreamingCall(__Method_Watch, null, options, request);
220       }
221       /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
222       protected override HealthClient NewInstance(ClientBaseConfiguration configuration)
223       {
224         return new HealthClient(configuration);
225       }
226     }
227
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)
231     {
232       return grpc::ServerServiceDefinition.CreateBuilder()
233           .AddMethod(__Method_Check, serviceImpl.Check)
234           .AddMethod(__Method_Watch, serviceImpl.Watch).Build();
235     }
236
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)
242     {
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));
245     }
246
247   }
248 }
249 #endregion