HealthGrpc.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 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. #pragma warning disable 1591
  21. #region Designer generated code
  22. using grpc = global::Grpc.Core;
  23. namespace Grpc.Health.V1 {
  24. public static partial class Health
  25. {
  26. static readonly string __ServiceName = "grpc.health.v1.Health";
  27. static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckRequest> __Marshaller_HealthCheckRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckRequest.Parser.ParseFrom);
  28. static readonly grpc::Marshaller<global::Grpc.Health.V1.HealthCheckResponse> __Marshaller_HealthCheckResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Health.V1.HealthCheckResponse.Parser.ParseFrom);
  29. 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>(
  30. grpc::MethodType.Unary,
  31. __ServiceName,
  32. "Check",
  33. __Marshaller_HealthCheckRequest,
  34. __Marshaller_HealthCheckResponse);
  35. /// <summary>Service descriptor</summary>
  36. public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
  37. {
  38. get { return global::Grpc.Health.V1.HealthReflection.Descriptor.Services[0]; }
  39. }
  40. /// <summary>Base class for server-side implementations of Health</summary>
  41. public abstract partial class HealthBase
  42. {
  43. public virtual global::System.Threading.Tasks.Task<global::Grpc.Health.V1.HealthCheckResponse> Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::ServerCallContext context)
  44. {
  45. throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
  46. }
  47. }
  48. /// <summary>Client for Health</summary>
  49. public partial class HealthClient : grpc::ClientBase<HealthClient>
  50. {
  51. /// <summary>Creates a new client for Health</summary>
  52. /// <param name="channel">The channel to use to make remote calls.</param>
  53. public HealthClient(grpc::Channel channel) : base(channel)
  54. {
  55. }
  56. /// <summary>Creates a new client for Health that uses a custom <c>CallInvoker</c>.</summary>
  57. /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
  58. public HealthClient(grpc::CallInvoker callInvoker) : base(callInvoker)
  59. {
  60. }
  61. /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
  62. protected HealthClient() : base()
  63. {
  64. }
  65. /// <summary>Protected constructor to allow creation of configured clients.</summary>
  66. /// <param name="configuration">The client configuration.</param>
  67. protected HealthClient(ClientBaseConfiguration configuration) : base(configuration)
  68. {
  69. }
  70. 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))
  71. {
  72. return Check(request, new grpc::CallOptions(headers, deadline, cancellationToken));
  73. }
  74. public virtual global::Grpc.Health.V1.HealthCheckResponse Check(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)
  75. {
  76. return CallInvoker.BlockingUnaryCall(__Method_Check, null, options, request);
  77. }
  78. 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))
  79. {
  80. return CheckAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
  81. }
  82. public virtual grpc::AsyncUnaryCall<global::Grpc.Health.V1.HealthCheckResponse> CheckAsync(global::Grpc.Health.V1.HealthCheckRequest request, grpc::CallOptions options)
  83. {
  84. return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request);
  85. }
  86. /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
  87. protected override HealthClient NewInstance(ClientBaseConfiguration configuration)
  88. {
  89. return new HealthClient(configuration);
  90. }
  91. }
  92. /// <summary>Creates service definition that can be registered with a server</summary>
  93. /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
  94. public static grpc::ServerServiceDefinition BindService(HealthBase serviceImpl)
  95. {
  96. return grpc::ServerServiceDefinition.CreateBuilder()
  97. .AddMethod(__Method_Check, serviceImpl.Check).Build();
  98. }
  99. }
  100. }
  101. #endregion