blob: 8502bb56da498cebdf4e8257be37e710b34ab760 [file] [log] [blame]
Jan Tattermusch7eb3a762015-05-07 14:26:13 -07001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: test.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 TestService
12 {
13 static readonly string __ServiceName = "grpc.testing.TestService";
14
Jan Tattermusch3fffe602015-05-20 08:56:24 -070015 static readonly Marshaller<global::grpc.testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.Empty.ParseFrom);
16 static readonly Marshaller<global::grpc.testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleRequest.ParseFrom);
17 static readonly Marshaller<global::grpc.testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.SimpleResponse.ParseFrom);
18 static readonly Marshaller<global::grpc.testing.StreamingOutputCallRequest> __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallRequest.ParseFrom);
19 static readonly Marshaller<global::grpc.testing.StreamingOutputCallResponse> __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingOutputCallResponse.ParseFrom);
20 static readonly Marshaller<global::grpc.testing.StreamingInputCallRequest> __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallRequest.ParseFrom);
21 static readonly Marshaller<global::grpc.testing.StreamingInputCallResponse> __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => arg.ToByteArray(), global::grpc.testing.StreamingInputCallResponse.ParseFrom);
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070022
Jan Tattermusch3fffe602015-05-20 08:56:24 -070023 static readonly Method<global::grpc.testing.Empty, global::grpc.testing.Empty> __Method_EmptyCall = new Method<global::grpc.testing.Empty, global::grpc.testing.Empty>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070024 MethodType.Unary,
25 "EmptyCall",
26 __Marshaller_Empty,
27 __Marshaller_Empty);
28
Jan Tattermusch3fffe602015-05-20 08:56:24 -070029 static readonly Method<global::grpc.testing.SimpleRequest, global::grpc.testing.SimpleResponse> __Method_UnaryCall = new Method<global::grpc.testing.SimpleRequest, global::grpc.testing.SimpleResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070030 MethodType.Unary,
31 "UnaryCall",
32 __Marshaller_SimpleRequest,
33 __Marshaller_SimpleResponse);
34
Jan Tattermusch3fffe602015-05-20 08:56:24 -070035 static readonly Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070036 MethodType.ServerStreaming,
37 "StreamingOutputCall",
38 __Marshaller_StreamingOutputCallRequest,
39 __Marshaller_StreamingOutputCallResponse);
40
Jan Tattermusch3fffe602015-05-20 08:56:24 -070041 static readonly Method<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> __Method_StreamingInputCall = new Method<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070042 MethodType.ClientStreaming,
43 "StreamingInputCall",
44 __Marshaller_StreamingInputCallRequest,
45 __Marshaller_StreamingInputCallResponse);
46
Jan Tattermusch3fffe602015-05-20 08:56:24 -070047 static readonly Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> __Method_FullDuplexCall = new Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070048 MethodType.DuplexStreaming,
49 "FullDuplexCall",
50 __Marshaller_StreamingOutputCallRequest,
51 __Marshaller_StreamingOutputCallResponse);
52
Jan Tattermusch3fffe602015-05-20 08:56:24 -070053 static readonly Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> __Method_HalfDuplexCall = new Method<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse>(
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070054 MethodType.DuplexStreaming,
55 "HalfDuplexCall",
56 __Marshaller_StreamingOutputCallRequest,
57 __Marshaller_StreamingOutputCallResponse);
58
Jan Tattermuschb5332812015-07-14 19:29:35 -070059 // client interface
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070060 public interface ITestServiceClient
61 {
Jan Tattermusch3fffe602015-05-20 08:56:24 -070062 global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CancellationToken token = default(CancellationToken));
63 Task<global::grpc.testing.Empty> EmptyCallAsync(global::grpc.testing.Empty request, CancellationToken token = default(CancellationToken));
64 global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CancellationToken token = default(CancellationToken));
65 Task<global::grpc.testing.SimpleResponse> UnaryCallAsync(global::grpc.testing.SimpleRequest request, CancellationToken token = default(CancellationToken));
66 AsyncServerStreamingCall<global::grpc.testing.StreamingOutputCallResponse> StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CancellationToken token = default(CancellationToken));
67 AsyncClientStreamingCall<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(CancellationToken token = default(CancellationToken));
68 AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> FullDuplexCall(CancellationToken token = default(CancellationToken));
69 AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> HalfDuplexCall(CancellationToken token = default(CancellationToken));
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070070 }
71
72 // server-side interface
73 public interface ITestService
74 {
Jan Tattermusch3fffe602015-05-20 08:56:24 -070075 Task<global::grpc.testing.Empty> EmptyCall(ServerCallContext context, global::grpc.testing.Empty request);
76 Task<global::grpc.testing.SimpleResponse> UnaryCall(ServerCallContext context, global::grpc.testing.SimpleRequest request);
77 Task StreamingOutputCall(ServerCallContext context, global::grpc.testing.StreamingOutputCallRequest request, IServerStreamWriter<global::grpc.testing.StreamingOutputCallResponse> responseStream);
78 Task<global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(ServerCallContext context, IAsyncStreamReader<global::grpc.testing.StreamingInputCallRequest> requestStream);
79 Task FullDuplexCall(ServerCallContext context, IAsyncStreamReader<global::grpc.testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::grpc.testing.StreamingOutputCallResponse> responseStream);
80 Task HalfDuplexCall(ServerCallContext context, IAsyncStreamReader<global::grpc.testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::grpc.testing.StreamingOutputCallResponse> responseStream);
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070081 }
82
83 // client stub
Jan Tattermuschb5332812015-07-14 19:29:35 -070084 public class TestServiceClient : ClientBase, ITestServiceClient
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070085 {
Jan Tattermuschb5332812015-07-14 19:29:35 -070086 public TestServiceClient(Channel channel) : base(channel)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070087 {
88 }
Jan Tattermusch3fffe602015-05-20 08:56:24 -070089 public global::grpc.testing.Empty EmptyCall(global::grpc.testing.Empty request, CancellationToken token = default(CancellationToken))
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070090 {
91 var call = CreateCall(__ServiceName, __Method_EmptyCall);
92 return Calls.BlockingUnaryCall(call, request, token);
93 }
Jan Tattermusch3fffe602015-05-20 08:56:24 -070094 public Task<global::grpc.testing.Empty> EmptyCallAsync(global::grpc.testing.Empty request, CancellationToken token = default(CancellationToken))
Jan Tattermusch7eb3a762015-05-07 14:26:13 -070095 {
96 var call = CreateCall(__ServiceName, __Method_EmptyCall);
97 return Calls.AsyncUnaryCall(call, request, token);
98 }
Jan Tattermusch3fffe602015-05-20 08:56:24 -070099 public global::grpc.testing.SimpleResponse UnaryCall(global::grpc.testing.SimpleRequest request, CancellationToken token = default(CancellationToken))
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700100 {
101 var call = CreateCall(__ServiceName, __Method_UnaryCall);
102 return Calls.BlockingUnaryCall(call, request, token);
103 }
Jan Tattermusch3fffe602015-05-20 08:56:24 -0700104 public Task<global::grpc.testing.SimpleResponse> UnaryCallAsync(global::grpc.testing.SimpleRequest request, CancellationToken token = default(CancellationToken))
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700105 {
106 var call = CreateCall(__ServiceName, __Method_UnaryCall);
107 return Calls.AsyncUnaryCall(call, request, token);
108 }
Jan Tattermusch3fffe602015-05-20 08:56:24 -0700109 public AsyncServerStreamingCall<global::grpc.testing.StreamingOutputCallResponse> StreamingOutputCall(global::grpc.testing.StreamingOutputCallRequest request, CancellationToken token = default(CancellationToken))
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700110 {
111 var call = CreateCall(__ServiceName, __Method_StreamingOutputCall);
112 return Calls.AsyncServerStreamingCall(call, request, token);
113 }
Jan Tattermusch3fffe602015-05-20 08:56:24 -0700114 public AsyncClientStreamingCall<global::grpc.testing.StreamingInputCallRequest, global::grpc.testing.StreamingInputCallResponse> StreamingInputCall(CancellationToken token = default(CancellationToken))
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700115 {
116 var call = CreateCall(__ServiceName, __Method_StreamingInputCall);
117 return Calls.AsyncClientStreamingCall(call, token);
118 }
Jan Tattermusch3fffe602015-05-20 08:56:24 -0700119 public AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> FullDuplexCall(CancellationToken token = default(CancellationToken))
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700120 {
121 var call = CreateCall(__ServiceName, __Method_FullDuplexCall);
122 return Calls.AsyncDuplexStreamingCall(call, token);
123 }
Jan Tattermusch3fffe602015-05-20 08:56:24 -0700124 public AsyncDuplexStreamingCall<global::grpc.testing.StreamingOutputCallRequest, global::grpc.testing.StreamingOutputCallResponse> HalfDuplexCall(CancellationToken token = default(CancellationToken))
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700125 {
126 var call = CreateCall(__ServiceName, __Method_HalfDuplexCall);
127 return Calls.AsyncDuplexStreamingCall(call, token);
128 }
129 }
130
131 // creates service definition that can be registered with a server
132 public static ServerServiceDefinition BindService(ITestService serviceImpl)
133 {
134 return ServerServiceDefinition.CreateBuilder(__ServiceName)
135 .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall)
136 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
137 .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall)
138 .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall)
139 .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall)
140 .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build();
141 }
142
Jan Tattermuschb5332812015-07-14 19:29:35 -0700143 // creates a new client
144 public static TestServiceClient NewClient(Channel channel)
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700145 {
146 return new TestServiceClient(channel);
147 }
148
Jan Tattermusch7eb3a762015-05-07 14:26:13 -0700149 }
150}
Jan Tattermuschcd7e3132015-05-07 15:10:23 -0700151#endregion