3edec5a37f8f6fb6872d234a6677c67167a52a72
[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     public abstract partial class HealthBase
58     {
59       /// <summary>
60       /// If the requested service is unknown, the call will fail with status
61       /// NOT_FOUND.
62       /// </summary>
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)
67       {
68         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
69       }
70
71       /// <summary>
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.
76       ///
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.
82       ///
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.
87       /// </summary>
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)
93       {
94         throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
95       }
96
97     }
98
99     /// <summary>Client for Health</summary>
100     public partial class HealthClient : grpc::ClientBase<HealthClient>
101     {
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)
105       {
106       }
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)
110       {
111       }
112       /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
113       protected HealthClient() : base()
114       {
115       }
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)
119       {
120       }
121
122       /// <summary>
123       /// If the requested service is unknown, the call will fail with status
124       /// NOT_FOUND.
125       /// </summary>
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))
132       {
133         return Check(request, new grpc::CallOptions(headers, deadline, cancellationToken));
134       }
135       /// <summary>
136       /// If the requested service is unknown, the call will fail with status
137       /// NOT_FOUND.
138       /// </summary>
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)
143       {
144         return CallInvoker.BlockingUnaryCall(__Method_Check, null, options, request);
145       }
146       /// <summary>
147       /// If the requested service is unknown, the call will fail with status
148       /// NOT_FOUND.
149       /// </summary>
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))
156       {
157         return CheckAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
158       }
159       /// <summary>
160       /// If the requested service is unknown, the call will fail with status
161       /// NOT_FOUND.
162       /// </summary>
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)
167       {
168         return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request);
169       }
170       /// <summary>
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.
175       ///
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.
181       ///
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.
186       /// </summary>
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))
193       {
194         return Watch(request, new grpc::CallOptions(headers, deadline, cancellationToken));
195       }
196       /// <summary>
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.
201       ///
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.
207       ///
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.
212       /// </summary>
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)
217       {
218         return CallInvoker.AsyncServerStreamingCall(__Method_Watch, null, options, request);
219       }
220       /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
221       protected override HealthClient NewInstance(ClientBaseConfiguration configuration)
222       {
223         return new HealthClient(configuration);
224       }
225     }
226
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)
230     {
231       return grpc::ServerServiceDefinition.CreateBuilder()
232           .AddMethod(__Method_Check, serviceImpl.Check)
233           .AddMethod(__Method_Watch, serviceImpl.Watch).Build();
234     }
235
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)
241     {
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));
244     }
245
246   }
247 }
248 #endregion