MorusGrpc.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: morus.proto
  4. // </auto-generated>
  5. #pragma warning disable 0414, 1591, 8981, 0612
  6. #region Designer generated code
  7. using grpc = global::Grpc.Core;
  8. namespace Mint.Morus.V1 {
  9. /// <summary>
  10. /// ----------------------------------------------------------------------------
  11. /// </summary>
  12. public static partial class Markdown
  13. {
  14. static readonly string __ServiceName = "mint.morus.v1.Markdown";
  15. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  16. static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)
  17. {
  18. #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
  19. if (message is global::Google.Protobuf.IBufferMessage)
  20. {
  21. context.SetPayloadLength(message.CalculateSize());
  22. global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter());
  23. context.Complete();
  24. return;
  25. }
  26. #endif
  27. context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message));
  28. }
  29. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  30. static class __Helper_MessageCache<T>
  31. {
  32. public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));
  33. }
  34. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  35. static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser<T> parser) where T : global::Google.Protobuf.IMessage<T>
  36. {
  37. #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
  38. if (__Helper_MessageCache<T>.IsBufferMessage)
  39. {
  40. return parser.ParseFrom(context.PayloadAsReadOnlySequence());
  41. }
  42. #endif
  43. return parser.ParseFrom(context.PayloadAsNewBuffer());
  44. }
  45. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  46. static readonly grpc::Marshaller<global::Mint.Morus.V1.MarkdownToHtmlRequest> __Marshaller_mint_morus_v1_MarkdownToHtmlRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Mint.Morus.V1.MarkdownToHtmlRequest.Parser));
  47. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  48. static readonly grpc::Marshaller<global::Mint.Morus.V1.MarkdownToHtmlResponse> __Marshaller_mint_morus_v1_MarkdownToHtmlResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Mint.Morus.V1.MarkdownToHtmlResponse.Parser));
  49. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  50. static readonly grpc::Method<global::Mint.Morus.V1.MarkdownToHtmlRequest, global::Mint.Morus.V1.MarkdownToHtmlResponse> __Method_ToHtml = new grpc::Method<global::Mint.Morus.V1.MarkdownToHtmlRequest, global::Mint.Morus.V1.MarkdownToHtmlResponse>(
  51. grpc::MethodType.Unary,
  52. __ServiceName,
  53. "ToHtml",
  54. __Marshaller_mint_morus_v1_MarkdownToHtmlRequest,
  55. __Marshaller_mint_morus_v1_MarkdownToHtmlResponse);
  56. /// <summary>Service descriptor</summary>
  57. public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
  58. {
  59. get { return global::Mint.Morus.V1.MorusReflection.Descriptor.Services[0]; }
  60. }
  61. /// <summary>Base class for server-side implementations of Markdown</summary>
  62. [grpc::BindServiceMethod(typeof(Markdown), "BindService")]
  63. public abstract partial class MarkdownBase
  64. {
  65. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  66. public virtual global::System.Threading.Tasks.Task<global::Mint.Morus.V1.MarkdownToHtmlResponse> ToHtml(global::Mint.Morus.V1.MarkdownToHtmlRequest request, grpc::ServerCallContext context)
  67. {
  68. throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
  69. }
  70. }
  71. /// <summary>Client for Markdown</summary>
  72. public partial class MarkdownClient : grpc::ClientBase<MarkdownClient>
  73. {
  74. /// <summary>Creates a new client for Markdown</summary>
  75. /// <param name="channel">The channel to use to make remote calls.</param>
  76. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  77. public MarkdownClient(grpc::ChannelBase channel) : base(channel)
  78. {
  79. }
  80. /// <summary>Creates a new client for Markdown that uses a custom <c>CallInvoker</c>.</summary>
  81. /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
  82. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  83. public MarkdownClient(grpc::CallInvoker callInvoker) : base(callInvoker)
  84. {
  85. }
  86. /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
  87. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  88. protected MarkdownClient() : base()
  89. {
  90. }
  91. /// <summary>Protected constructor to allow creation of configured clients.</summary>
  92. /// <param name="configuration">The client configuration.</param>
  93. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  94. protected MarkdownClient(ClientBaseConfiguration configuration) : base(configuration)
  95. {
  96. }
  97. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  98. public virtual global::Mint.Morus.V1.MarkdownToHtmlResponse ToHtml(global::Mint.Morus.V1.MarkdownToHtmlRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
  99. {
  100. return ToHtml(request, new grpc::CallOptions(headers, deadline, cancellationToken));
  101. }
  102. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  103. public virtual global::Mint.Morus.V1.MarkdownToHtmlResponse ToHtml(global::Mint.Morus.V1.MarkdownToHtmlRequest request, grpc::CallOptions options)
  104. {
  105. return CallInvoker.BlockingUnaryCall(__Method_ToHtml, null, options, request);
  106. }
  107. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  108. public virtual grpc::AsyncUnaryCall<global::Mint.Morus.V1.MarkdownToHtmlResponse> ToHtmlAsync(global::Mint.Morus.V1.MarkdownToHtmlRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
  109. {
  110. return ToHtmlAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
  111. }
  112. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  113. public virtual grpc::AsyncUnaryCall<global::Mint.Morus.V1.MarkdownToHtmlResponse> ToHtmlAsync(global::Mint.Morus.V1.MarkdownToHtmlRequest request, grpc::CallOptions options)
  114. {
  115. return CallInvoker.AsyncUnaryCall(__Method_ToHtml, null, options, request);
  116. }
  117. /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
  118. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  119. protected override MarkdownClient NewInstance(ClientBaseConfiguration configuration)
  120. {
  121. return new MarkdownClient(configuration);
  122. }
  123. }
  124. /// <summary>Creates service definition that can be registered with a server</summary>
  125. /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
  126. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  127. public static grpc::ServerServiceDefinition BindService(MarkdownBase serviceImpl)
  128. {
  129. return grpc::ServerServiceDefinition.CreateBuilder()
  130. .AddMethod(__Method_ToHtml, serviceImpl.ToHtml).Build();
  131. }
  132. /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
  133. /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
  134. /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
  135. /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
  136. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
  137. public static void BindService(grpc::ServiceBinderBase serviceBinder, MarkdownBase serviceImpl)
  138. {
  139. serviceBinder.AddMethod(__Method_ToHtml, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Mint.Morus.V1.MarkdownToHtmlRequest, global::Mint.Morus.V1.MarkdownToHtmlResponse>(serviceImpl.ToHtml));
  140. }
  141. }
  142. }
  143. #endregion