OLD | NEW |
(Empty) | |
| 1 // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 // source: src/proto/grpc/testing/test.proto |
| 3 #region Designer generated code |
| 4 |
| 5 using System; |
| 6 using System.Threading; |
| 7 using System.Threading.Tasks; |
| 8 using Grpc.Core; |
| 9 |
| 10 namespace Grpc.Testing { |
| 11 public static class TestService |
| 12 { |
| 13 static readonly string __ServiceName = "grpc.testing.TestService"; |
| 14 |
| 15 static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty =
Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArra
y(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 16 static readonly Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_
SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExten
sions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); |
| 17 static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller
_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExt
ensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); |
| 18 static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallRequest>
__Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => global::Go
ogle.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Streaming
OutputCallRequest.Parser.ParseFrom); |
| 19 static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallResponse>
__Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => global::
Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Streami
ngOutputCallResponse.Parser.ParseFrom); |
| 20 static readonly Marshaller<global::Grpc.Testing.StreamingInputCallRequest> _
_Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => global::Goog
le.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingIn
putCallRequest.Parser.ParseFrom); |
| 21 static readonly Marshaller<global::Grpc.Testing.StreamingInputCallResponse>
__Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => global::Go
ogle.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Streaming
InputCallResponse.Parser.ParseFrom); |
| 22 |
| 23 static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empt
y> __Method_EmptyCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Test
ing.Empty>( |
| 24 MethodType.Unary, |
| 25 __ServiceName, |
| 26 "EmptyCall", |
| 27 __Marshaller_Empty, |
| 28 __Marshaller_Empty); |
| 29 |
| 30 static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Test
ing.SimpleResponse> __Method_UnaryCall = new Method<global::Grpc.Testing.SimpleR
equest, global::Grpc.Testing.SimpleResponse>( |
| 31 MethodType.Unary, |
| 32 __ServiceName, |
| 33 "UnaryCall", |
| 34 __Marshaller_SimpleRequest, |
| 35 __Marshaller_SimpleResponse); |
| 36 |
| 37 static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, glob
al::Grpc.Testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new
Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.St
reamingOutputCallResponse>( |
| 38 MethodType.ServerStreaming, |
| 39 __ServiceName, |
| 40 "StreamingOutputCall", |
| 41 __Marshaller_StreamingOutputCallRequest, |
| 42 __Marshaller_StreamingOutputCallResponse); |
| 43 |
| 44 static readonly Method<global::Grpc.Testing.StreamingInputCallRequest, globa
l::Grpc.Testing.StreamingInputCallResponse> __Method_StreamingInputCall = new Me
thod<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.Stream
ingInputCallResponse>( |
| 45 MethodType.ClientStreaming, |
| 46 __ServiceName, |
| 47 "StreamingInputCall", |
| 48 __Marshaller_StreamingInputCallRequest, |
| 49 __Marshaller_StreamingInputCallResponse); |
| 50 |
| 51 static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, glob
al::Grpc.Testing.StreamingOutputCallResponse> __Method_FullDuplexCall = new Meth
od<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.Streami
ngOutputCallResponse>( |
| 52 MethodType.DuplexStreaming, |
| 53 __ServiceName, |
| 54 "FullDuplexCall", |
| 55 __Marshaller_StreamingOutputCallRequest, |
| 56 __Marshaller_StreamingOutputCallResponse); |
| 57 |
| 58 static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, glob
al::Grpc.Testing.StreamingOutputCallResponse> __Method_HalfDuplexCall = new Meth
od<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.Streami
ngOutputCallResponse>( |
| 59 MethodType.DuplexStreaming, |
| 60 __ServiceName, |
| 61 "HalfDuplexCall", |
| 62 __Marshaller_StreamingOutputCallRequest, |
| 63 __Marshaller_StreamingOutputCallResponse); |
| 64 |
| 65 // service descriptor |
| 66 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descripto
r |
| 67 { |
| 68 get { return global::Grpc.Testing.TestReflection.Descriptor.Services[0]; } |
| 69 } |
| 70 |
| 71 // client interface |
| 72 public interface ITestServiceClient |
| 73 { |
| 74 global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, M
etadata headers = null, DateTime? deadline = null, CancellationToken cancellatio
nToken = default(CancellationToken)); |
| 75 global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, C
allOptions options); |
| 76 AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Tes
ting.Empty request, Metadata headers = null, DateTime? deadline = null, Cancella
tionToken cancellationToken = default(CancellationToken)); |
| 77 AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Tes
ting.Empty request, CallOptions options); |
| 78 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleR
equest request, Metadata headers = null, DateTime? deadline = null, Cancellation
Token cancellationToken = default(CancellationToken)); |
| 79 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleR
equest request, CallOptions options); |
| 80 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global:
:Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline
= null, CancellationToken cancellationToken = default(CancellationToken)); |
| 81 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global:
:Grpc.Testing.SimpleRequest request, CallOptions options); |
| 82 AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse>
StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Me
tadata headers = null, DateTime? deadline = null, CancellationToken cancellation
Token = default(CancellationToken)); |
| 83 AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse>
StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Ca
llOptions options); |
| 84 AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, g
lobal::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metadata head
ers = null, DateTime? deadline = null, CancellationToken cancellationToken = def
ault(CancellationToken)); |
| 85 AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, g
lobal::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions o
ptions); |
| 86 AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest,
global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata header
s = null, DateTime? deadline = null, CancellationToken cancellationToken = defau
lt(CancellationToken)); |
| 87 AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest,
global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions opt
ions); |
| 88 AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest,
global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata header
s = null, DateTime? deadline = null, CancellationToken cancellationToken = defau
lt(CancellationToken)); |
| 89 AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest,
global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions opt
ions); |
| 90 } |
| 91 |
| 92 // server-side interface |
| 93 public interface ITestService |
| 94 { |
| 95 Task<global::Grpc.Testing.Empty> EmptyCall(global::Grpc.Testing.Empty requ
est, ServerCallContext context); |
| 96 Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.S
impleRequest request, ServerCallContext context); |
| 97 Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest r
equest, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> re
sponseStream, ServerCallContext context); |
| 98 Task<global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(I
AsyncStreamReader<global::Grpc.Testing.StreamingInputCallRequest> requestStream,
ServerCallContext context); |
| 99 Task FullDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutpu
tCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingO
utputCallResponse> responseStream, ServerCallContext context); |
| 100 Task HalfDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutpu
tCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingO
utputCallResponse> responseStream, ServerCallContext context); |
| 101 } |
| 102 |
| 103 // client stub |
| 104 public class TestServiceClient : ClientBase, ITestServiceClient |
| 105 { |
| 106 public TestServiceClient(Channel channel) : base(channel) |
| 107 { |
| 108 } |
| 109 public global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty req
uest, Metadata headers = null, DateTime? deadline = null, CancellationToken canc
ellationToken = default(CancellationToken)) |
| 110 { |
| 111 var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 112 return Calls.BlockingUnaryCall(call, request); |
| 113 } |
| 114 public global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty req
uest, CallOptions options) |
| 115 { |
| 116 var call = CreateCall(__Method_EmptyCall, options); |
| 117 return Calls.BlockingUnaryCall(call, request); |
| 118 } |
| 119 public AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::G
rpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, C
ancellationToken cancellationToken = default(CancellationToken)) |
| 120 { |
| 121 var call = CreateCall(__Method_EmptyCall, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 122 return Calls.AsyncUnaryCall(call, request); |
| 123 } |
| 124 public AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::G
rpc.Testing.Empty request, CallOptions options) |
| 125 { |
| 126 var call = CreateCall(__Method_EmptyCall, options); |
| 127 return Calls.AsyncUnaryCall(call, request); |
| 128 } |
| 129 public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.
SimpleRequest request, Metadata headers = null, DateTime? deadline = null, Cance
llationToken cancellationToken = default(CancellationToken)) |
| 130 { |
| 131 var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 132 return Calls.BlockingUnaryCall(call, request); |
| 133 } |
| 134 public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.
SimpleRequest request, CallOptions options) |
| 135 { |
| 136 var call = CreateCall(__Method_UnaryCall, options); |
| 137 return Calls.BlockingUnaryCall(call, request); |
| 138 } |
| 139 public AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(
global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? d
eadline = null, CancellationToken cancellationToken = default(CancellationToken)
) |
| 140 { |
| 141 var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 142 return Calls.AsyncUnaryCall(call, request); |
| 143 } |
| 144 public AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(
global::Grpc.Testing.SimpleRequest request, CallOptions options) |
| 145 { |
| 146 var call = CreateCall(__Method_UnaryCall, options); |
| 147 return Calls.AsyncUnaryCall(call, request); |
| 148 } |
| 149 public AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallRe
sponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest requ
est, Metadata headers = null, DateTime? deadline = null, CancellationToken cance
llationToken = default(CancellationToken)) |
| 150 { |
| 151 var call = CreateCall(__Method_StreamingOutputCall, new CallOptions(head
ers, deadline, cancellationToken)); |
| 152 return Calls.AsyncServerStreamingCall(call, request); |
| 153 } |
| 154 public AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallRe
sponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest requ
est, CallOptions options) |
| 155 { |
| 156 var call = CreateCall(__Method_StreamingOutputCall, options); |
| 157 return Calls.AsyncServerStreamingCall(call, request); |
| 158 } |
| 159 public AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallReq
uest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metada
ta headers = null, DateTime? deadline = null, CancellationToken cancellationToke
n = default(CancellationToken)) |
| 160 { |
| 161 var call = CreateCall(__Method_StreamingInputCall, new CallOptions(heade
rs, deadline, cancellationToken)); |
| 162 return Calls.AsyncClientStreamingCall(call); |
| 163 } |
| 164 public AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallReq
uest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOp
tions options) |
| 165 { |
| 166 var call = CreateCall(__Method_StreamingInputCall, options); |
| 167 return Calls.AsyncClientStreamingCall(call); |
| 168 } |
| 169 public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRe
quest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata
headers = null, DateTime? deadline = null, CancellationToken cancellationToken
= default(CancellationToken)) |
| 170 { |
| 171 var call = CreateCall(__Method_FullDuplexCall, new CallOptions(headers,
deadline, cancellationToken)); |
| 172 return Calls.AsyncDuplexStreamingCall(call); |
| 173 } |
| 174 public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRe
quest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOpti
ons options) |
| 175 { |
| 176 var call = CreateCall(__Method_FullDuplexCall, options); |
| 177 return Calls.AsyncDuplexStreamingCall(call); |
| 178 } |
| 179 public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRe
quest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata
headers = null, DateTime? deadline = null, CancellationToken cancellationToken
= default(CancellationToken)) |
| 180 { |
| 181 var call = CreateCall(__Method_HalfDuplexCall, new CallOptions(headers,
deadline, cancellationToken)); |
| 182 return Calls.AsyncDuplexStreamingCall(call); |
| 183 } |
| 184 public AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRe
quest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOpti
ons options) |
| 185 { |
| 186 var call = CreateCall(__Method_HalfDuplexCall, options); |
| 187 return Calls.AsyncDuplexStreamingCall(call); |
| 188 } |
| 189 } |
| 190 |
| 191 // creates service definition that can be registered with a server |
| 192 public static ServerServiceDefinition BindService(ITestService serviceImpl) |
| 193 { |
| 194 return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 195 .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) |
| 196 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 197 .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCa
ll) |
| 198 .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall
) |
| 199 .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall) |
| 200 .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(
); |
| 201 } |
| 202 |
| 203 // creates a new client |
| 204 public static TestServiceClient NewClient(Channel channel) |
| 205 { |
| 206 return new TestServiceClient(channel); |
| 207 } |
| 208 |
| 209 } |
| 210 public static class UnimplementedService |
| 211 { |
| 212 static readonly string __ServiceName = "grpc.testing.UnimplementedService"; |
| 213 |
| 214 static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty =
Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArra
y(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 215 |
| 216 static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empt
y> __Method_UnimplementedCall = new Method<global::Grpc.Testing.Empty, global::G
rpc.Testing.Empty>( |
| 217 MethodType.Unary, |
| 218 __ServiceName, |
| 219 "UnimplementedCall", |
| 220 __Marshaller_Empty, |
| 221 __Marshaller_Empty); |
| 222 |
| 223 // service descriptor |
| 224 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descripto
r |
| 225 { |
| 226 get { return global::Grpc.Testing.TestReflection.Descriptor.Services[1]; } |
| 227 } |
| 228 |
| 229 // client interface |
| 230 public interface IUnimplementedServiceClient |
| 231 { |
| 232 global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty re
quest, Metadata headers = null, DateTime? deadline = null, CancellationToken can
cellationToken = default(CancellationToken)); |
| 233 global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty re
quest, CallOptions options); |
| 234 AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::
Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null,
CancellationToken cancellationToken = default(CancellationToken)); |
| 235 AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::
Grpc.Testing.Empty request, CallOptions options); |
| 236 } |
| 237 |
| 238 // server-side interface |
| 239 public interface IUnimplementedService |
| 240 { |
| 241 Task<global::Grpc.Testing.Empty> UnimplementedCall(global::Grpc.Testing.Em
pty request, ServerCallContext context); |
| 242 } |
| 243 |
| 244 // client stub |
| 245 public class UnimplementedServiceClient : ClientBase, IUnimplementedServiceC
lient |
| 246 { |
| 247 public UnimplementedServiceClient(Channel channel) : base(channel) |
| 248 { |
| 249 } |
| 250 public global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.E
mpty request, Metadata headers = null, DateTime? deadline = null, CancellationTo
ken cancellationToken = default(CancellationToken)) |
| 251 { |
| 252 var call = CreateCall(__Method_UnimplementedCall, new CallOptions(header
s, deadline, cancellationToken)); |
| 253 return Calls.BlockingUnaryCall(call, request); |
| 254 } |
| 255 public global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.E
mpty request, CallOptions options) |
| 256 { |
| 257 var call = CreateCall(__Method_UnimplementedCall, options); |
| 258 return Calls.BlockingUnaryCall(call, request); |
| 259 } |
| 260 public AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(g
lobal::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline =
null, CancellationToken cancellationToken = default(CancellationToken)) |
| 261 { |
| 262 var call = CreateCall(__Method_UnimplementedCall, new CallOptions(header
s, deadline, cancellationToken)); |
| 263 return Calls.AsyncUnaryCall(call, request); |
| 264 } |
| 265 public AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(g
lobal::Grpc.Testing.Empty request, CallOptions options) |
| 266 { |
| 267 var call = CreateCall(__Method_UnimplementedCall, options); |
| 268 return Calls.AsyncUnaryCall(call, request); |
| 269 } |
| 270 } |
| 271 |
| 272 // creates service definition that can be registered with a server |
| 273 public static ServerServiceDefinition BindService(IUnimplementedService serv
iceImpl) |
| 274 { |
| 275 return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 276 .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).
Build(); |
| 277 } |
| 278 |
| 279 // creates a new client |
| 280 public static UnimplementedServiceClient NewClient(Channel channel) |
| 281 { |
| 282 return new UnimplementedServiceClient(channel); |
| 283 } |
| 284 |
| 285 } |
| 286 public static class ReconnectService |
| 287 { |
| 288 static readonly string __ServiceName = "grpc.testing.ReconnectService"; |
| 289 |
| 290 static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty =
Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArra
y(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 291 static readonly Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_
ReconnectInfo = Marshallers.Create((arg) => global::Google.Protobuf.MessageExten
sions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom); |
| 292 |
| 293 static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empt
y> __Method_Start = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.
Empty>( |
| 294 MethodType.Unary, |
| 295 __ServiceName, |
| 296 "Start", |
| 297 __Marshaller_Empty, |
| 298 __Marshaller_Empty); |
| 299 |
| 300 static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Reco
nnectInfo> __Method_Stop = new Method<global::Grpc.Testing.Empty, global::Grpc.T
esting.ReconnectInfo>( |
| 301 MethodType.Unary, |
| 302 __ServiceName, |
| 303 "Stop", |
| 304 __Marshaller_Empty, |
| 305 __Marshaller_ReconnectInfo); |
| 306 |
| 307 // service descriptor |
| 308 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descripto
r |
| 309 { |
| 310 get { return global::Grpc.Testing.TestReflection.Descriptor.Services[2]; } |
| 311 } |
| 312 |
| 313 // client interface |
| 314 public interface IReconnectServiceClient |
| 315 { |
| 316 global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, Metad
ata headers = null, DateTime? deadline = null, CancellationToken cancellationTok
en = default(CancellationToken)); |
| 317 global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request, CallO
ptions options); |
| 318 AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing
.Empty request, Metadata headers = null, DateTime? deadline = null, Cancellation
Token cancellationToken = default(CancellationToken)); |
| 319 AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing
.Empty request, CallOptions options); |
| 320 global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request
, Metadata headers = null, DateTime? deadline = null, CancellationToken cancella
tionToken = default(CancellationToken)); |
| 321 global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request
, CallOptions options); |
| 322 AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.
Testing.Empty request, Metadata headers = null, DateTime? deadline = null, Cance
llationToken cancellationToken = default(CancellationToken)); |
| 323 AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.
Testing.Empty request, CallOptions options); |
| 324 } |
| 325 |
| 326 // server-side interface |
| 327 public interface IReconnectService |
| 328 { |
| 329 Task<global::Grpc.Testing.Empty> Start(global::Grpc.Testing.Empty request,
ServerCallContext context); |
| 330 Task<global::Grpc.Testing.ReconnectInfo> Stop(global::Grpc.Testing.Empty r
equest, ServerCallContext context); |
| 331 } |
| 332 |
| 333 // client stub |
| 334 public class ReconnectServiceClient : ClientBase, IReconnectServiceClient |
| 335 { |
| 336 public ReconnectServiceClient(Channel channel) : base(channel) |
| 337 { |
| 338 } |
| 339 public global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request
, Metadata headers = null, DateTime? deadline = null, CancellationToken cancella
tionToken = default(CancellationToken)) |
| 340 { |
| 341 var call = CreateCall(__Method_Start, new CallOptions(headers, deadline,
cancellationToken)); |
| 342 return Calls.BlockingUnaryCall(call, request); |
| 343 } |
| 344 public global::Grpc.Testing.Empty Start(global::Grpc.Testing.Empty request
, CallOptions options) |
| 345 { |
| 346 var call = CreateCall(__Method_Start, options); |
| 347 return Calls.BlockingUnaryCall(call, request); |
| 348 } |
| 349 public AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.
Testing.Empty request, Metadata headers = null, DateTime? deadline = null, Cance
llationToken cancellationToken = default(CancellationToken)) |
| 350 { |
| 351 var call = CreateCall(__Method_Start, new CallOptions(headers, deadline,
cancellationToken)); |
| 352 return Calls.AsyncUnaryCall(call, request); |
| 353 } |
| 354 public AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.
Testing.Empty request, CallOptions options) |
| 355 { |
| 356 var call = CreateCall(__Method_Start, options); |
| 357 return Calls.AsyncUnaryCall(call, request); |
| 358 } |
| 359 public global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty
request, Metadata headers = null, DateTime? deadline = null, CancellationToken c
ancellationToken = default(CancellationToken)) |
| 360 { |
| 361 var call = CreateCall(__Method_Stop, new CallOptions(headers, deadline,
cancellationToken)); |
| 362 return Calls.BlockingUnaryCall(call, request); |
| 363 } |
| 364 public global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty
request, CallOptions options) |
| 365 { |
| 366 var call = CreateCall(__Method_Stop, options); |
| 367 return Calls.BlockingUnaryCall(call, request); |
| 368 } |
| 369 public AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global
::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null
, CancellationToken cancellationToken = default(CancellationToken)) |
| 370 { |
| 371 var call = CreateCall(__Method_Stop, new CallOptions(headers, deadline,
cancellationToken)); |
| 372 return Calls.AsyncUnaryCall(call, request); |
| 373 } |
| 374 public AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global
::Grpc.Testing.Empty request, CallOptions options) |
| 375 { |
| 376 var call = CreateCall(__Method_Stop, options); |
| 377 return Calls.AsyncUnaryCall(call, request); |
| 378 } |
| 379 } |
| 380 |
| 381 // creates service definition that can be registered with a server |
| 382 public static ServerServiceDefinition BindService(IReconnectService serviceI
mpl) |
| 383 { |
| 384 return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 385 .AddMethod(__Method_Start, serviceImpl.Start) |
| 386 .AddMethod(__Method_Stop, serviceImpl.Stop).Build(); |
| 387 } |
| 388 |
| 389 // creates a new client |
| 390 public static ReconnectServiceClient NewClient(Channel channel) |
| 391 { |
| 392 return new ReconnectServiceClient(channel); |
| 393 } |
| 394 |
| 395 } |
| 396 } |
| 397 #endregion |
OLD | NEW |