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 __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)33 static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) 34 { 35 #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION 36 if (message is global::Google.Protobuf.IBufferMessage) 37 { 38 context.SetPayloadLength(message.CalculateSize()); 39 global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); 40 context.Complete(); 41 return; 42 } 43 #endif 44 context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); 45 } 46 47 static class __Helper_MessageCache<T> 48 { 49 public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); 50 } 51 52 static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser<T> parser) where T : global::Google.Protobuf.IMessage<T> 53 { 54 #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION 55 if (__Helper_MessageCache<T>.IsBufferMessage) 56 { 57 return parser.ParseFrom(context.PayloadAsReadOnlySequence()); 58 } 59 #endif 60 return parser.ParseFrom(context.PayloadAsNewBuffer()); 61 } 62 63 static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckRequest> __Marshaller_grpc_health_v1_HealthCheckRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Grpc.Health.V1.HealthCheckRequest.Parser)); 64 static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckResponse> __Marshaller_grpc_health_v1_HealthCheckResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Grpc.Health.V1.HealthCheckResponse.Parser)); 65 66 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>( 67 grpc::MethodType.Unary, 68 __ServiceName, 69 "Check", 70 __Marshaller_grpc_health_v1_HealthCheckRequest, 71 __Marshaller_grpc_health_v1_HealthCheckResponse); 72 73 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>( 74 grpc::MethodType.ServerStreaming, 75 __ServiceName, 76 "Watch", 77 __Marshaller_grpc_health_v1_HealthCheckRequest, 78 __Marshaller_grpc_health_v1_HealthCheckResponse); 79 80 /// <summary>Service descriptor</summary> 81 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor 82 { 83 get { return global::Grpc.Health.V1.HealthReflection.Descriptor.Services[0]; } 84 } 85 86 /// <summary>Base class for server-side implementations of Health</summary> 87 [grpc::BindServiceMethod(typeof(Health), "BindService")] 88 public abstract partial class HealthBase 89 { 90 /// <summary> 91 /// If the requested service is unknown, the call will fail with status 92 /// NOT_FOUND. 93 /// </summary> 94 /// <param name="request">The request received from the client.</param> 95 /// <param name="context">The context of the server-side call handler being invoked.</param> 96 /// <returns>The response to send back to the client (wrapped by a task).</returns> Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::ServerCallContext context)97 public virtual global::System.Threading.Tasks.Task<global::Grpc.Health.V1.HealthCheckResponse> Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::ServerCallContext context) 98 { 99 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 100 } 101 102 /// <summary> 103 /// Performs a watch for the serving status of the requested service. 104 /// The server will immediately send back a message indicating the current 105 /// serving status. It will then subsequently send a new message whenever 106 /// the service's serving status changes. 107 /// 108 /// If the requested service is unknown when the call is received, the 109 /// server will send a message setting the serving status to 110 /// SERVICE_UNKNOWN but will *not* terminate the call. If at some 111 /// future point, the serving status of the service becomes known, the 112 /// server will send a new message with the service's serving status. 113 /// 114 /// If the call terminates with status UNIMPLEMENTED, then clients 115 /// should assume this method is not supported and should not retry the 116 /// call. If the call terminates with any other status (including OK), 117 /// clients should retry the call with appropriate exponential backoff. 118 /// </summary> 119 /// <param name="request">The request received from the client.</param> 120 /// <param name="responseStream">Used for sending responses back to the client.</param> 121 /// <param name="context">The context of the server-side call handler being invoked.</param> 122 /// <returns>A task indicating completion of the handler.</returns> Watch(global::Grpc.Health.V1.HealthCheckRequest request, grpc::IServerStreamWriter<global::Grpc.Health.V1.HealthCheckResponse> responseStream, grpc::ServerCallContext context)123 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) 124 { 125 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 126 } 127 128 } 129 130 /// <summary>Client for Health</summary> 131 public partial class HealthClient : grpc::ClientBase<HealthClient> 132 { 133 /// <summary>Creates a new client for Health</summary> 134 /// <param name="channel">The channel to use to make remote calls.</param> HealthClient(grpc::ChannelBase channel)135 public HealthClient(grpc::ChannelBase channel) : base(channel) 136 { 137 } 138 /// <summary>Creates a new client for Health that uses a custom <c>CallInvoker</c>.</summary> 139 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> HealthClient(grpc::CallInvoker callInvoker)140 public HealthClient(grpc::CallInvoker callInvoker) : base(callInvoker) 141 { 142 } 143 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> HealthClient()144 protected HealthClient() : base() 145 { 146 } 147 /// <summary>Protected constructor to allow creation of configured clients.</summary> 148 /// <param name="configuration">The client configuration.</param> HealthClient(ClientBaseConfiguration configuration)149 protected HealthClient(ClientBaseConfiguration configuration) : base(configuration) 150 { 151 } 152 153 /// <summary> 154 /// If the requested service is unknown, the call will fail with status 155 /// NOT_FOUND. 156 /// </summary> 157 /// <param name="request">The request to send to the server.</param> 158 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 159 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 160 /// <param name="cancellationToken">An optional token for canceling the call.</param> 161 /// <returns>The response received from the server.</returns> 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))162 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)) 163 { 164 return Check(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 165 } 166 /// <summary> 167 /// If the requested service is unknown, the call will fail with status 168 /// NOT_FOUND. 169 /// </summary> 170 /// <param name="request">The request to send to the server.</param> 171 /// <param name="options">The options for the call.</param> 172 /// <returns>The response received from the server.</returns> Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)173 public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options) 174 { 175 return CallInvoker.BlockingUnaryCall(__Method_Check, null, options, request); 176 } 177 /// <summary> 178 /// If the requested service is unknown, the call will fail with status 179 /// NOT_FOUND. 180 /// </summary> 181 /// <param name="request">The request to send to the server.</param> 182 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 183 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 184 /// <param name="cancellationToken">An optional token for canceling the call.</param> 185 /// <returns>The call object.</returns> 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))186 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)) 187 { 188 return CheckAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 189 } 190 /// <summary> 191 /// If the requested service is unknown, the call will fail with status 192 /// NOT_FOUND. 193 /// </summary> 194 /// <param name="request">The request to send to the server.</param> 195 /// <param name="options">The options for the call.</param> 196 /// <returns>The call object.</returns> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)197 public virtual grpc::AsyncUnaryCall<global::Grpc.Health.V1.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options) 198 { 199 return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request); 200 } 201 /// <summary> 202 /// Performs a watch for the serving status of the requested service. 203 /// The server will immediately send back a message indicating the current 204 /// serving status. It will then subsequently send a new message whenever 205 /// the service's serving status changes. 206 /// 207 /// If the requested service is unknown when the call is received, the 208 /// server will send a message setting the serving status to 209 /// SERVICE_UNKNOWN but will *not* terminate the call. If at some 210 /// future point, the serving status of the service becomes known, the 211 /// server will send a new message with the service's serving status. 212 /// 213 /// If the call terminates with status UNIMPLEMENTED, then clients 214 /// should assume this method is not supported and should not retry the 215 /// call. If the call terminates with any other status (including OK), 216 /// clients should retry the call with appropriate exponential backoff. 217 /// </summary> 218 /// <param name="request">The request to send to the server.</param> 219 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 220 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 221 /// <param name="cancellationToken">An optional token for canceling the call.</param> 222 /// <returns>The call object.</returns> 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))223 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)) 224 { 225 return Watch(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 226 } 227 /// <summary> 228 /// Performs a watch for the serving status of the requested service. 229 /// The server will immediately send back a message indicating the current 230 /// serving status. It will then subsequently send a new message whenever 231 /// the service's serving status changes. 232 /// 233 /// If the requested service is unknown when the call is received, the 234 /// server will send a message setting the serving status to 235 /// SERVICE_UNKNOWN but will *not* terminate the call. If at some 236 /// future point, the serving status of the service becomes known, the 237 /// server will send a new message with the service's serving status. 238 /// 239 /// If the call terminates with status UNIMPLEMENTED, then clients 240 /// should assume this method is not supported and should not retry the 241 /// call. If the call terminates with any other status (including OK), 242 /// clients should retry the call with appropriate exponential backoff. 243 /// </summary> 244 /// <param name="request">The request to send to the server.</param> 245 /// <param name="options">The options for the call.</param> 246 /// <returns>The call object.</returns> Watch(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)247 public virtual grpc::AsyncServerStreamingCall<global::Grpc.Health.V1.HealthCheckResponse> Watch(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options) 248 { 249 return CallInvoker.AsyncServerStreamingCall(__Method_Watch, null, options, request); 250 } 251 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> NewInstance(ClientBaseConfiguration configuration)252 protected override HealthClient NewInstance(ClientBaseConfiguration configuration) 253 { 254 return new HealthClient(configuration); 255 } 256 } 257 258 /// <summary>Creates service definition that can be registered with a server</summary> 259 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(HealthBase serviceImpl)260 public static grpc::ServerServiceDefinition BindService(HealthBase serviceImpl) 261 { 262 return grpc::ServerServiceDefinition.CreateBuilder() 263 .AddMethod(__Method_Check, serviceImpl.Check) 264 .AddMethod(__Method_Watch, serviceImpl.Watch).Build(); 265 } 266 267 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. 268 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> 269 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> 270 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(grpc::ServiceBinderBase serviceBinder, HealthBase serviceImpl)271 public static void BindService(grpc::ServiceBinderBase serviceBinder, HealthBase serviceImpl) 272 { 273 serviceBinder.AddMethod(__Method_Check, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(serviceImpl.Check)); 274 serviceBinder.AddMethod(__Method_Watch, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Grpc.Health.V1.HealthCheckRequest, global::Grpc.Health.V1.HealthCheckResponse>(serviceImpl.Watch)); 275 } 276 277 } 278 } 279 #endregion 280