blob: 0f701a837f4380d5573eb38404203a3fe4903892 [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
3#region Designer generated code
4
5using System;
6using System.Threading;
7using System.Threading.Tasks;
8using Grpc.Core;
9
10namespace Grpc.Testing {
11 public static class MetricsService
12 {
13 static readonly string __ServiceName = "grpc.testing.MetricsService";
14
15 static readonly Marshaller<global::Grpc.Testing.EmptyMessage> __Marshaller_EmptyMessage = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.EmptyMessage.Parser.ParseFrom);
16 static readonly Marshaller<global::Grpc.Testing.GaugeResponse> __Marshaller_GaugeResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeResponse.Parser.ParseFrom);
17 static readonly Marshaller<global::Grpc.Testing.GaugeRequest> __Marshaller_GaugeRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.GaugeRequest.Parser.ParseFrom);
18
19 static readonly Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse> __Method_GetAllGauges = new Method<global::Grpc.Testing.EmptyMessage, global::Grpc.Testing.GaugeResponse>(
20 MethodType.ServerStreaming,
21 __ServiceName,
22 "GetAllGauges",
23 __Marshaller_EmptyMessage,
24 __Marshaller_GaugeResponse);
25
26 static readonly Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse> __Method_GetGauge = new Method<global::Grpc.Testing.GaugeRequest, global::Grpc.Testing.GaugeResponse>(
27 MethodType.Unary,
28 __ServiceName,
29 "GetGauge",
30 __Marshaller_GaugeRequest,
31 __Marshaller_GaugeResponse);
32
33 // service descriptor
34 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
35 {
36 get { return global::Grpc.Testing.MetricsReflection.Descriptor.Services[0]; }
37 }
38
39 // client interface
40 [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
41 public interface IMetricsServiceClient
42 {
43 AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
44 AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, CallOptions options);
45 global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
46 global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, CallOptions options);
47 AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
48 AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, CallOptions options);
49 }
50
51 // server-side interface
52 [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
53 public interface IMetricsService
54 {
55 Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter<global::Grpc.Testing.GaugeResponse> responseStream, ServerCallContext context);
56 Task<global::Grpc.Testing.GaugeResponse> GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context);
57 }
58
59 // server-side abstract class
60 public abstract class MetricsServiceBase
61 {
62 public virtual Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter<global::Grpc.Testing.GaugeResponse> responseStream, ServerCallContext context)
63 {
64 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
65 }
66
67 public virtual Task<global::Grpc.Testing.GaugeResponse> GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context)
68 {
69 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
70 }
71
72 }
73
74 // client stub
Jan Tattermusch55fad172016-04-25 13:42:28 -070075 #pragma warning disable 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -070076 public class MetricsServiceClient : ClientBase<MetricsServiceClient>, IMetricsServiceClient
Jan Tattermusch55fad172016-04-25 13:42:28 -070077 #pragma warning restore 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -070078 {
79 public MetricsServiceClient(Channel channel) : base(channel)
80 {
81 }
82 public MetricsServiceClient(CallInvoker callInvoker) : base(callInvoker)
83 {
84 }
85 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
86 protected MetricsServiceClient() : base()
87 {
88 }
89 ///<summary>Protected constructor to allow creation of configured clients.</summary>
90 protected MetricsServiceClient(ClientBaseConfiguration configuration) : base(configuration)
91 {
92 }
93
94 public virtual AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
95 {
96 return GetAllGauges(request, new CallOptions(headers, deadline, cancellationToken));
97 }
98 public virtual AsyncServerStreamingCall<global::Grpc.Testing.GaugeResponse> GetAllGauges(global::Grpc.Testing.EmptyMessage request, CallOptions options)
99 {
100 return CallInvoker.AsyncServerStreamingCall(__Method_GetAllGauges, null, options, request);
101 }
102 public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
103 {
104 return GetGauge(request, new CallOptions(headers, deadline, cancellationToken));
105 }
106 public virtual global::Grpc.Testing.GaugeResponse GetGauge(global::Grpc.Testing.GaugeRequest request, CallOptions options)
107 {
108 return CallInvoker.BlockingUnaryCall(__Method_GetGauge, null, options, request);
109 }
110 public virtual AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
111 {
112 return GetGaugeAsync(request, new CallOptions(headers, deadline, cancellationToken));
113 }
114 public virtual AsyncUnaryCall<global::Grpc.Testing.GaugeResponse> GetGaugeAsync(global::Grpc.Testing.GaugeRequest request, CallOptions options)
115 {
116 return CallInvoker.AsyncUnaryCall(__Method_GetGauge, null, options, request);
117 }
118 protected override MetricsServiceClient NewInstance(ClientBaseConfiguration configuration)
119 {
120 return new MetricsServiceClient(configuration);
121 }
122 }
123
Jan Tattermusch7c0e1ee2016-04-25 16:00:34 -0700124 // creates a new client
125 public static MetricsServiceClient NewClient(Channel channel)
126 {
127 return new MetricsServiceClient(channel);
128 }
129
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700130 // creates service definition that can be registered with a server
Jan Tattermusch55fad172016-04-25 13:42:28 -0700131 #pragma warning disable 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700132 public static ServerServiceDefinition BindService(IMetricsService serviceImpl)
Jan Tattermusch55fad172016-04-25 13:42:28 -0700133 #pragma warning restore 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700134 {
135 return ServerServiceDefinition.CreateBuilder(__ServiceName)
136 .AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges)
137 .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build();
138 }
139
140 // creates service definition that can be registered with a server
Jan Tattermusch55fad172016-04-25 13:42:28 -0700141 #pragma warning disable 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700142 public static ServerServiceDefinition BindService(MetricsServiceBase serviceImpl)
Jan Tattermusch55fad172016-04-25 13:42:28 -0700143 #pragma warning restore 0618
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700144 {
145 return ServerServiceDefinition.CreateBuilder(__ServiceName)
146 .AddMethod(__Method_GetAllGauges, serviceImpl.GetAllGauges)
147 .AddMethod(__Method_GetGauge, serviceImpl.GetGauge).Build();
148 }
149
Jan Tattermusch44aa8432016-04-21 13:54:44 -0700150 }
151}
152#endregion