blob: 9d31d1c5146c6e3bc71105bca12ec7d9044dffca [file] [log] [blame]
Jan Tattermusch44aa8432016-04-21 13:54:44 -07001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: src/proto/grpc/testing/metrics.proto
Jan Tattermuschbfee01d2016-04-28 10:52:41 -07003// 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 Tattermusch44aa8432016-04-21 13:54:44 -070039#region Designer generated code
40
41using System;
42using System.Threading;
43using System.Threading.Tasks;
44using Grpc.Core;
45
46namespace 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 Tattermuschbfee01d2016-04-28 10:52:41 -070069 /// <summary>Service descriptor</summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -070070 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
71 {
72 get { return global::Grpc.Testing.MetricsReflection.Descriptor.Services[0]; }
73 }
74
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070075 /// <summary>Client for MetricsService</summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -070076 [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
77 public interface IMetricsServiceClient
78 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070079 /// <summary>
80 /// Returns the values of all the gauges that are currently being maintained by
81 /// the service
82 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -070083 AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070084 /// <summary>
85 /// Returns the values of all the gauges that are currently being maintained by
86 /// the service
87 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -070088 AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, CallOptions options);
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070089 /// <summary>
90 /// Returns the value of one gauge
91 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -070092 global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070093 /// <summary>
94 /// Returns the value of one gauge
95 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -070096 global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, CallOptions options);
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070097 /// <summary>
98 /// Returns the value of one gauge
99 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700100 AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700101 /// <summary>
102 /// Returns the value of one gauge
103 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700104 AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, CallOptions options);
105 }
106
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700107 /// <summary>Interface of server-side implementations of MetricsService</summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700108 [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
109 public interface IMetricsService
110 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700111 /// <summary>
112 /// Returns the values of all the gauges that are currently being maintained by
113 /// the service
114 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700115 global::System.Threading.Tasks.Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter<global::Grpc.Testing.GaugeResponse> responseStream, ServerCallContext context);
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700116 /// <summary>
117 /// Returns the value of one gauge
118 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700119 global::System.Threading.Tasks.Task<global::Grpc.Testing.GaugeResponse> GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context);
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700120 }
121
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700122 /// <summary>Base class for server-side implementations of MetricsService</summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700123 public abstract class MetricsServiceBase
124 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700125 /// <summary>
126 /// Returns the values of all the gauges that are currently being maintained by
127 /// the service
128 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700129 public virtual global::System.Threading.Tasks.Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter<global::Grpc.Testing.GaugeResponse> responseStream, ServerCallContext context)
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700130 {
131 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
132 }
133
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700134 /// <summary>
135 /// Returns the value of one gauge
136 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700137 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.GaugeResponse> GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context)
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700138 {
139 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
140 }
141
142 }
143
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700144 /// <summary>Client for MetricsService</summary>
Jan Tattermusch55fad172016-04-25 13:42:28 -0700145 #pragma warning disable 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700146 public class MetricsServiceClient : ClientBase<MetricsServiceClient>, IMetricsServiceClient
Jan Tattermusch55fad172016-04-25 13:42:28 -0700147 #pragma warning restore 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700148 {
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 Tattermuschbfee01d2016-04-28 10:52:41 -0700164 /// <summary>
165 /// Returns the values of all the gauges that are currently being maintained by
166 /// the service
167 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700168 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 Tattermuschbfee01d2016-04-28 10:52:41 -0700172 /// <summary>
173 /// Returns the values of all the gauges that are currently being maintained by
174 /// the service
175 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700176 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 Tattermuschbfee01d2016-04-28 10:52:41 -0700180 /// <summary>
181 /// Returns the value of one gauge
182 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700183 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 Tattermuschbfee01d2016-04-28 10:52:41 -0700187 /// <summary>
188 /// Returns the value of one gauge
189 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700190 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 Tattermuschbfee01d2016-04-28 10:52:41 -0700194 /// <summary>
195 /// Returns the value of one gauge
196 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700197 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 Tattermuschbfee01d2016-04-28 10:52:41 -0700201 /// <summary>
202 /// Returns the value of one gauge
203 /// </summary>
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700204 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 Tattermuschbfee01d2016-04-28 10:52:41 -0700214 /// <summary>Creates a new client for MetricsService</summary>
Jan Tattermusch7c0e1ee2016-04-25 16:00:34 -0700215 public static MetricsServiceClient NewClient(Channel channel)
216 {
217 return new MetricsServiceClient(channel);
218 }
219
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700220 /// <summary>Creates service definition that can be registered with a server</summary>
Jan Tattermusch55fad172016-04-25 13:42:28 -0700221 #pragma warning disable 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700222 public static ServerServiceDefinition BindService(IMetricsService serviceImpl)
Jan Tattermusch55fad172016-04-25 13:42:28 -0700223 #pragma warning restore 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700224 {
225 return ServerServiceDefinition.CreateBuilder(__ServiceName)
226 .AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges)
227 .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build();
228 }
229
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700230 /// <summary>Creates service definition that can be registered with a server</summary>
Jan Tattermusch55fad172016-04-25 13:42:28 -0700231 #pragma warning disable 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700232 public static ServerServiceDefinition BindService(MetricsServiceBase serviceImpl)
Jan Tattermusch55fad172016-04-25 13:42:28 -0700233 #pragma warning restore 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700234 {
235 return ServerServiceDefinition.CreateBuilder(__ServiceName)
236 .AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges)
237 .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build();
238 }
239
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700240 }
241}
242#endregion