1 // <auto-generated> 2 // Generated by the protocol buffer compiler. DO NOT EDIT! 3 // source: src/proto/grpc/testing/metrics.proto 4 // </auto-generated> 5 // Original file comments: 6 // Copyright 2015-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 // Contains the definitions for a metrics service and the type of metrics 21 // exposed by the service. 22 // 23 // Currently, 'Gauge' (i.e a metric that represents the measured value of 24 // something at an instant of time) is the only metric type supported by the 25 // service. 26 #pragma warning disable 0414, 1591 27 #region Designer generated code 28 29 using grpc = global::Grpc.Core; 30 31 namespace Grpc.Testing { 32 public static partial class MetricsService 33 { 34 static readonly string __ServiceName = "grpc.testing.MetricsService"; 35 36 static readonly grpc::Marshaller<global::Grpc.Testing.EmptyMessage> __Marshaller_grpc_testing_EmptyMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.EmptyMessage.Parser.ParseFrom); 37 static readonly grpc::Marshaller<global::Grpc.Testing.GaugeResponse> __Marshaller_grpc_testing_GaugeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeResponse.Parser.ParseFrom); 38 static readonly grpc::Marshaller<global::Grpc.Testing.GaugeRequest> __Marshaller_grpc_testing_GaugeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeRequest.Parser.ParseFrom); 39 40 static readonly grpc::Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse> __Method_GetAllGauges = new grpc::Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse>( 41 grpc::MethodType.ServerStreaming, 42 __ServiceName, 43 "GetAllGauges", 44 __Marshaller_grpc_testing_EmptyMessage, 45 __Marshaller_grpc_testing_GaugeResponse); 46 47 static readonly grpc::Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse> __Method_GetGauge = new grpc::Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse>( 48 grpc::MethodType.Unary, 49 __ServiceName, 50 "GetGauge", 51 __Marshaller_grpc_testing_GaugeRequest, 52 __Marshaller_grpc_testing_GaugeResponse); 53 54 /// <summary>Service descriptor</summary> 55 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor 56 { 57 get { return global::Grpc.Testing.MetricsReflection.Descriptor.Services[0]; } 58 } 59 60 /// <summary>Base class for server-side implementations of MetricsService</summary> 61 public abstract partial class MetricsServiceBase 62 { 63 /// <summary> 64 /// Returns the values of all the gauges that are currently being maintained by 65 /// the service 66 /// </summary> 67 /// <param name="request">The request received from the client.</param> 68 /// <param name="responseStream">Used for sending responses back to the client.</param> 69 /// <param name="context">The context of the server-side call handler being invoked.</param> 70 /// <returns>A task indicating completion of the handler.</returns> GetAllGauges(global::Grpc.Testing.EmptyMessage request, grpc::IServerStreamWriter<global::Grpc.Testing.GaugeResponse> responseStream, grpc::ServerCallContext context)71 public virtual global::System.Threading.Tasks.Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, grpc::IServerStreamWriter<global::Grpc.Testing.GaugeResponse> responseStream, grpc::ServerCallContext context) 72 { 73 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 74 } 75 76 /// <summary> 77 /// Returns the value of one gauge 78 /// </summary> 79 /// <param name="request">The request received from the client.</param> 80 /// <param name="context">The context of the server-side call handler being invoked.</param> 81 /// <returns>The response to send back to the client (wrapped by a task).</returns> GetGauge(global::Grpc.Testing.GaugeRequest request, grpc::ServerCallContext context)82 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.GaugeResponse> GetGauge(global::Grpc.Testing.GaugeRequest request, grpc::ServerCallContext context) 83 { 84 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); 85 } 86 87 } 88 89 /// <summary>Client for MetricsService</summary> 90 public partial class MetricsServiceClient : grpc::ClientBase<MetricsServiceClient> 91 { 92 /// <summary>Creates a new client for MetricsService</summary> 93 /// <param name="channel">The channel to use to make remote calls.</param> MetricsServiceClient(grpc::Channel channel)94 public MetricsServiceClient(grpc::Channel channel) : base(channel) 95 { 96 } 97 /// <summary>Creates a new client for MetricsService that uses a custom <c>CallInvoker</c>.</summary> 98 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> MetricsServiceClient(grpc::CallInvoker callInvoker)99 public MetricsServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) 100 { 101 } 102 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> MetricsServiceClient()103 protected MetricsServiceClient() : base() 104 { 105 } 106 /// <summary>Protected constructor to allow creation of configured clients.</summary> 107 /// <param name="configuration">The client configuration.</param> MetricsServiceClient(ClientBaseConfiguration configuration)108 protected MetricsServiceClient(ClientBaseConfiguration configuration) : base(configuration) 109 { 110 } 111 112 /// <summary> 113 /// Returns the values of all the gauges that are currently being maintained by 114 /// the service 115 /// </summary> 116 /// <param name="request">The request to send to the server.</param> 117 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 118 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 119 /// <param name="cancellationToken">An optional token for canceling the call.</param> 120 /// <returns>The call object.</returns> GetAllGauges(global::Grpc.Testing.EmptyMessage request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))121 public virtual grpc::AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 122 { 123 return GetAllGauges(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 124 } 125 /// <summary> 126 /// Returns the values of all the gauges that are currently being maintained by 127 /// the service 128 /// </summary> 129 /// <param name="request">The request to send to the server.</param> 130 /// <param name="options">The options for the call.</param> 131 /// <returns>The call object.</returns> GetAllGauges(global::Grpc.Testing.EmptyMessage request, grpc::CallOptions options)132 public virtual grpc::AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, grpc::CallOptions options) 133 { 134 return CallInvoker.AsyncServerStreamingCall(__Method_GetAllGauges, null, options, request); 135 } 136 /// <summary> 137 /// Returns the value of one gauge 138 /// </summary> 139 /// <param name="request">The request to send to the server.</param> 140 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 141 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 142 /// <param name="cancellationToken">An optional token for canceling the call.</param> 143 /// <returns>The response received from the server.</returns> GetGauge(global::Grpc.Testing.GaugeRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))144 public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 145 { 146 return GetGauge(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 147 } 148 /// <summary> 149 /// Returns the value of one gauge 150 /// </summary> 151 /// <param name="request">The request to send to the server.</param> 152 /// <param name="options">The options for the call.</param> 153 /// <returns>The response received from the server.</returns> GetGauge(global::Grpc.Testing.GaugeRequest request, grpc::CallOptions options)154 public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, grpc::CallOptions options) 155 { 156 return CallInvoker.BlockingUnaryCall(__Method_GetGauge, null, options, request); 157 } 158 /// <summary> 159 /// Returns the value of one gauge 160 /// </summary> 161 /// <param name="request">The request to send to the server.</param> 162 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> 163 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> 164 /// <param name="cancellationToken">An optional token for canceling the call.</param> 165 /// <returns>The call object.</returns> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))166 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) 167 { 168 return GetGaugeAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); 169 } 170 /// <summary> 171 /// Returns the value of one gauge 172 /// </summary> 173 /// <param name="request">The request to send to the server.</param> 174 /// <param name="options">The options for the call.</param> 175 /// <returns>The call object.</returns> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, grpc::CallOptions options)176 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, grpc::CallOptions options) 177 { 178 return CallInvoker.AsyncUnaryCall(__Method_GetGauge, null, options, request); 179 } 180 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> NewInstance(ClientBaseConfiguration configuration)181 protected override MetricsServiceClient NewInstance(ClientBaseConfiguration configuration) 182 { 183 return new MetricsServiceClient(configuration); 184 } 185 } 186 187 /// <summary>Creates service definition that can be registered with a server</summary> 188 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> BindService(MetricsServiceBase serviceImpl)189 public static grpc::ServerServiceDefinition BindService(MetricsServiceBase serviceImpl) 190 { 191 return grpc::ServerServiceDefinition.CreateBuilder() 192 .AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges) 193 .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build(); 194 } 195 196 } 197 } 198 #endregion 199