Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: src/proto/grpc/testing/metrics.proto |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 3 | // Original file comments: |
| 4 | // Copyright 2015-2016, Google Inc. |
| 5 | // All rights reserved. |
| 6 | // |
| 7 | // Redistribution and use in source and binary forms, with or without |
| 8 | // modification, are permitted provided that the following conditions are |
| 9 | // met: |
| 10 | // |
| 11 | // * Redistributions of source code must retain the above copyright |
| 12 | // notice, this list of conditions and the following disclaimer. |
| 13 | // * Redistributions in binary form must reproduce the above |
| 14 | // copyright notice, this list of conditions and the following disclaimer |
| 15 | // in the documentation and/or other materials provided with the |
| 16 | // distribution. |
| 17 | // * Neither the name of Google Inc. nor the names of its |
| 18 | // contributors may be used to endorse or promote products derived from |
| 19 | // this software without specific prior written permission. |
| 20 | // |
| 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | // |
| 33 | // Contains the definitions for a metrics service and the type of metrics |
| 34 | // exposed by the service. |
| 35 | // |
| 36 | // Currently, 'Gauge' (i.e a metric that represents the measured value of |
| 37 | // something at an instant of time) is the only metric type supported by the |
| 38 | // service. |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 39 | #region Designer generated code |
| 40 | |
| 41 | using System; |
| 42 | using System.Threading; |
| 43 | using System.Threading.Tasks; |
| 44 | using Grpc.Core; |
| 45 | |
| 46 | namespace Grpc.Testing { |
| 47 | public static class MetricsService |
| 48 | { |
| 49 | static readonly string __ServiceName = "grpc.testing.MetricsService"; |
| 50 | |
| 51 | static readonly Marshaller<global::Grpc.Testing.EmptyMessage> __Marshaller_EmptyMessage = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.EmptyMessage.Parser.ParseFrom); |
| 52 | static readonly Marshaller<global::Grpc.Testing.GaugeResponse> __Marshaller_GaugeResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeResponse.Parser.ParseFrom); |
| 53 | static readonly Marshaller<global::Grpc.Testing.GaugeRequest> __Marshaller_GaugeRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeRequest.Parser.ParseFrom); |
| 54 | |
| 55 | static readonly Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse> __Method_GetAllGauges = new Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse>( |
| 56 | MethodType.ServerStreaming, |
| 57 | __ServiceName, |
| 58 | "GetAllGauges", |
| 59 | __Marshaller_EmptyMessage, |
| 60 | __Marshaller_GaugeResponse); |
| 61 | |
| 62 | static readonly Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse> __Method_GetGauge = new Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse>( |
| 63 | MethodType.Unary, |
| 64 | __ServiceName, |
| 65 | "GetGauge", |
| 66 | __Marshaller_GaugeRequest, |
| 67 | __Marshaller_GaugeResponse); |
| 68 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 69 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 70 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 71 | { |
| 72 | get { return global::Grpc.Testing.MetricsReflection.Descriptor.Services[0]; } |
| 73 | } |
| 74 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 75 | /// <summary>Client for MetricsService</summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 76 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
| 77 | public interface IMetricsServiceClient |
| 78 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 79 | /// <summary> |
| 80 | /// Returns the values of all the gauges that are currently being maintained by |
| 81 | /// the service |
| 82 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 83 | AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 84 | /// <summary> |
| 85 | /// Returns the values of all the gauges that are currently being maintained by |
| 86 | /// the service |
| 87 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 88 | AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 89 | /// <summary> |
| 90 | /// Returns the value of one gauge |
| 91 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 92 | global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 93 | /// <summary> |
| 94 | /// Returns the value of one gauge |
| 95 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 96 | global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 97 | /// <summary> |
| 98 | /// Returns the value of one gauge |
| 99 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 100 | AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 101 | /// <summary> |
| 102 | /// Returns the value of one gauge |
| 103 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 104 | AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, CallOptions options); |
| 105 | } |
| 106 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 107 | /// <summary>Interface of server-side implementations of MetricsService</summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 108 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
| 109 | public interface IMetricsService |
| 110 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 111 | /// <summary> |
| 112 | /// Returns the values of all the gauges that are currently being maintained by |
| 113 | /// the service |
| 114 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 115 | global::System.Threading.Tasks.Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter<global::Grpc.Testing.GaugeResponse> responseStream, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 116 | /// <summary> |
| 117 | /// Returns the value of one gauge |
| 118 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 119 | global::System.Threading.Tasks.Task<global::Grpc.Testing.GaugeResponse> GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context); |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 120 | } |
| 121 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 122 | /// <summary>Base class for server-side implementations of MetricsService</summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 123 | public abstract class MetricsServiceBase |
| 124 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 125 | /// <summary> |
| 126 | /// Returns the values of all the gauges that are currently being maintained by |
| 127 | /// the service |
| 128 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 129 | public virtual global::System.Threading.Tasks.Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter<global::Grpc.Testing.GaugeResponse> responseStream, ServerCallContext context) |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 130 | { |
| 131 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 132 | } |
| 133 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 134 | /// <summary> |
| 135 | /// Returns the value of one gauge |
| 136 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 137 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.GaugeResponse> GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context) |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 138 | { |
| 139 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 140 | } |
| 141 | |
| 142 | } |
| 143 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 144 | /// <summary>Client for MetricsService</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 145 | #pragma warning disable 0618 |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 146 | public class MetricsServiceClient : ClientBase<MetricsServiceClient>, IMetricsServiceClient |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 147 | #pragma warning restore 0618 |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 148 | { |
| 149 | public MetricsServiceClient(Channel channel) : base(channel) |
| 150 | { |
| 151 | } |
| 152 | public MetricsServiceClient(CallInvoker callInvoker) : base(callInvoker) |
| 153 | { |
| 154 | } |
| 155 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 156 | protected MetricsServiceClient() : base() |
| 157 | { |
| 158 | } |
| 159 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 160 | protected MetricsServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
| 161 | { |
| 162 | } |
| 163 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 164 | /// <summary> |
| 165 | /// Returns the values of all the gauges that are currently being maintained by |
| 166 | /// the service |
| 167 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 168 | public virtual AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 169 | { |
| 170 | return GetAllGauges(request, new CallOptions(headers, deadline, cancellationToken)); |
| 171 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 172 | /// <summary> |
| 173 | /// Returns the values of all the gauges that are currently being maintained by |
| 174 | /// the service |
| 175 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 176 | public virtual AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, CallOptions options) |
| 177 | { |
| 178 | return CallInvoker.AsyncServerStreamingCall(__Method_GetAllGauges, null, options, request); |
| 179 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 180 | /// <summary> |
| 181 | /// Returns the value of one gauge |
| 182 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 183 | public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 184 | { |
| 185 | return GetGauge(request, new CallOptions(headers, deadline, cancellationToken)); |
| 186 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 187 | /// <summary> |
| 188 | /// Returns the value of one gauge |
| 189 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 190 | public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, CallOptions options) |
| 191 | { |
| 192 | return CallInvoker.BlockingUnaryCall(__Method_GetGauge, null, options, request); |
| 193 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 194 | /// <summary> |
| 195 | /// Returns the value of one gauge |
| 196 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 197 | public virtual AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 198 | { |
| 199 | return GetGaugeAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 200 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 201 | /// <summary> |
| 202 | /// Returns the value of one gauge |
| 203 | /// </summary> |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 204 | public virtual AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, CallOptions options) |
| 205 | { |
| 206 | return CallInvoker.AsyncUnaryCall(__Method_GetGauge, null, options, request); |
| 207 | } |
| 208 | protected override MetricsServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 209 | { |
| 210 | return new MetricsServiceClient(configuration); |
| 211 | } |
| 212 | } |
| 213 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 214 | /// <summary>Creates a new client for MetricsService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 215 | public static MetricsServiceClient NewClient(Channel channel) |
| 216 | { |
| 217 | return new MetricsServiceClient(channel); |
| 218 | } |
| 219 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 220 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 221 | #pragma warning disable 0618 |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 222 | public static ServerServiceDefinition BindService(IMetricsService serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 223 | #pragma warning restore 0618 |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 224 | { |
| 225 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 226 | .AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges) |
| 227 | .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build(); |
| 228 | } |
| 229 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 230 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 231 | #pragma warning disable 0618 |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 232 | public static ServerServiceDefinition BindService(MetricsServiceBase serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 233 | #pragma warning restore 0618 |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 234 | { |
| 235 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 236 | .AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges) |
| 237 | .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build(); |
| 238 | } |
| 239 | |
Jan Tattermusch | 44aa843 | 2016-04-21 13:54:44 -0700 | [diff] [blame] | 240 | } |
| 241 | } |
| 242 | #endregion |