1 // <auto-generated> 2 // Generated by the protocol buffer compiler. DO NOT EDIT! 3 // source: grpc/reflection/v1alpha/reflection.proto 4 // </auto-generated> 5 // Original file comments: 6 // Copyright 2016 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 // Service exported by server reflection 21 // 22 #pragma warning disable 0414, 1591 23 #region Designer generated code 24 25 using grpc = global::Grpc.Core; 26 27 namespace Grpc.Reflection.V1Alpha { 28 public static partial class ServerReflection 29 { 30 static readonly string __ServiceName = "grpc.reflection.v1alpha.ServerReflection"; 31 __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)32 static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) 33 { 34 #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION 35 if (message is global::Google.Protobuf.IBufferMessage) 36 { 37 context.SetPayloadLength(message.CalculateSize()); 38 global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); 39 context.Complete(); 40 return; 41 } 42 #endif 43 context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); 44 } 45 46 static class __Helper_MessageCache<T> 47 { 48 public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); 49 } 50 51 static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser<T> parser) where T : global::Google.Protobuf.IMessage<T> 52 { 53 #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION 54 if (__Helper_MessageCache<T>.IsBufferMessage) 55 { 56 return parser.ParseFrom(context.PayloadAsReadOnlySequence()); 57 } 58 #endif 59 return parser.ParseFrom(context.PayloadAsNewBuffer()); 60 } 61 62 static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest> __Marshaller_grpc_reflection_v1alpha_ServerReflectionRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Grpc.Reflection.V1Alpha.ServerReflectionRequest.Parser)); 63 static readonly grpc::Marshaller<global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Marshaller_grpc_reflection_v1alpha_ServerReflectionResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse.Parser)); 64 65 static readonly grpc::Method<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> __Method_ServerReflectionInfo = new grpc::Method<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse>( 66 grpc::MethodType.DuplexStreaming, 67 __ServiceName, 68 "ServerReflectionInfo", 69 __Marshaller_grpc_reflection_v1alpha_ServerReflectionRequest, 70 __Marshaller_grpc_reflection_v1alpha_ServerReflectionResponse); 71 72 /// <summary>Service descriptor</summary> 73 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor 74 { 75 get { return global::Grpc.Reflection.V1Alpha.ReflectionReflection.Descriptor.Services[0]; } 76 } 77 78 /// <summary>Base class for server-side implementations of ServerReflection</summary> 79 [grpc::BindServiceMethod(typeof(ServerReflection), "BindService")] 80 public abstract partial class ServerReflectionBase 81 { 82 /// <summary> 83 /// The reflection service is structured as a bidirectional stream, ensuring 84 /// all related requests go to a single server. 85 /// </summary> 86 /// <param name="requestStream">Used for reading requests from the client.</param> 87 /// <param name="responseStream">Used for sending responses back to the client.</param> 88 /// <param name="context">The context of the server-side call handler being invoked.</param> 89 /// <returns>A task indicating completion of the handler.</returns> ServerReflectionInfo(grpc::IAsyncStreamReader<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> responseStream, grpc::ServerCallContext context)90 public virtual global::System.Threading.Tasks.Task ServerReflectionInfo(grpc::IAsyncStreamReader<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> responseStream, grpc::ServerCallContext context) 91 { 92 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 93 } 94 95 } 96 97 /// <summary>Client for ServerReflection</summary> 98 public partial class ServerReflectionClient : grpc::ClientBase<ServerReflectionClient> 99 { 100 /// <summary>Creates a new client for ServerReflection</summary> 101 /// <param name="channel">The channel to use to make remote calls.</param> ServerReflectionClient(grpc::ChannelBase channel)102 public ServerReflectionClient(grpc::ChannelBase channel) : base(channel) 103 { 104 } 105 /// <summary>Creates a new client for ServerReflection that uses a custom <c>CallInvoker</c>.</summary> 106 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> ServerReflectionClient(grpc::CallInvoker callInvoker)107 public ServerReflectionClient(grpc::CallInvoker callInvoker) : base(callInvoker) 108 { 109 } 110 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> ServerReflectionClient()111 protected ServerReflectionClient() : base() 112 { 113 } 114 /// <summary>Protected constructor to allow creation of configured clients.</summary> 115 /// <param name="configuration">The client configuration.</param> ServerReflectionClient(ClientBaseConfiguration configuration)116 protected ServerReflectionClient(ClientBaseConfiguration configuration) : base(configuration) 117 { 118 } 119 120 /// <summary> 121 /// The reflection service is structured as a bidirectional stream, ensuring 122 /// all related requests go to a single server. 123 /// </summary> 124 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 125 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 126 /// <param name="cancellationToken">An optional token for canceling the call.</param> 127 /// <returns>The call object.</returns> ServerReflectionInfo(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))128 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> ServerReflectionInfo(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 129 { 130 return ServerReflectionInfo(new grpc::CallOptions(headers, deadline, cancellationToken)); 131 } 132 /// <summary> 133 /// The reflection service is structured as a bidirectional stream, ensuring 134 /// all related requests go to a single server. 135 /// </summary> 136 /// <param name="options">The options for the call.</param> 137 /// <returns>The call object.</returns> ServerReflectionInfo(grpc::CallOptions options)138 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse> ServerReflectionInfo(grpc::CallOptions options) 139 { 140 return CallInvoker.AsyncDuplexStreamingCall(__Method_ServerReflectionInfo, null, options); 141 } 142 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> NewInstance(ClientBaseConfiguration configuration)143 protected override ServerReflectionClient NewInstance(ClientBaseConfiguration configuration) 144 { 145 return new ServerReflectionClient(configuration); 146 } 147 } 148 149 /// <summary>Creates service definition that can be registered with a server</summary> 150 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(ServerReflectionBase serviceImpl)151 public static grpc::ServerServiceDefinition BindService(ServerReflectionBase serviceImpl) 152 { 153 return grpc::ServerServiceDefinition.CreateBuilder() 154 .AddMethod(__Method_ServerReflectionInfo, serviceImpl.ServerReflectionInfo).Build(); 155 } 156 157 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. 158 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> 159 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> 160 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(grpc::ServiceBinderBase serviceBinder, ServerReflectionBase serviceImpl)161 public static void BindService(grpc::ServiceBinderBase serviceBinder, ServerReflectionBase serviceImpl) 162 { 163 serviceBinder.AddMethod(__Method_ServerReflectionInfo, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Grpc.Reflection.V1Alpha.ServerReflectionRequest, global::Grpc.Reflection.V1Alpha.ServerReflectionResponse>(serviceImpl.ServerReflectionInfo)); 164 } 165 166 } 167 } 168 #endregion 169