blob: dd30afb427f8c6eeb9c7cc43f3d039c3dc1e76b4 [file] [log] [blame]
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -07001// Generated by the protocol buffer compiler. DO NOT EDIT!
Jan Tattermusch72ce4422016-01-20 13:54:38 -08002// source: src/proto/grpc/testing/services.proto
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -07003#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 BenchmarkService
12 {
13 static readonly string __ServiceName = "grpc.testing.BenchmarkService";
14
15 static readonly Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
16 static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
17
18 static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
19 MethodType.Unary,
20 __ServiceName,
21 "UnaryCall",
22 __Marshaller_SimpleRequest,
23 __Marshaller_SimpleResponse);
24
25 static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
26 MethodType.DuplexStreaming,
27 __ServiceName,
28 "StreamingCall",
29 __Marshaller_SimpleRequest,
30 __Marshaller_SimpleResponse);
31
32 // service descriptor
33 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
34 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -080035 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070036 }
37
38 // client interface
39 public interface IBenchmarkServiceClient
40 {
41 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
42 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options);
43 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
44 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options);
45 AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
46 AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options);
47 }
48
49 // server-side interface
50 public interface IBenchmarkService
51 {
52 Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context);
53 Task StreamingCall(IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, ServerCallContext context);
54 }
55
56 // client stub
57 public class BenchmarkServiceClient : ClientBase, IBenchmarkServiceClient
58 {
59 public BenchmarkServiceClient(Channel channel) : base(channel)
60 {
61 }
62 public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
63 {
64 var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken));
65 return Calls.BlockingUnaryCall(call, request);
66 }
67 public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options)
68 {
69 var call = CreateCall(__Method_UnaryCall, options);
70 return Calls.BlockingUnaryCall(call, request);
71 }
72 public AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
73 {
74 var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadline, cancellationToken));
75 return Calls.AsyncUnaryCall(call, request);
76 }
77 public AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options)
78 {
79 var call = CreateCall(__Method_UnaryCall, options);
80 return Calls.AsyncUnaryCall(call, request);
81 }
82 public AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
83 {
84 var call = CreateCall(__Method_StreamingCall, new CallOptions(headers, deadline, cancellationToken));
85 return Calls.AsyncDuplexStreamingCall(call);
86 }
87 public AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options)
88 {
89 var call = CreateCall(__Method_StreamingCall, options);
90 return Calls.AsyncDuplexStreamingCall(call);
91 }
92 }
93
94 // creates service definition that can be registered with a server
95 public static ServerServiceDefinition BindService(IBenchmarkService serviceImpl)
96 {
97 return ServerServiceDefinition.CreateBuilder(__ServiceName)
98 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
99 .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build();
100 }
101
102 // creates a new client
103 public static BenchmarkServiceClient NewClient(Channel channel)
104 {
105 return new BenchmarkServiceClient(channel);
106 }
107
108 }
109 public static class WorkerService
110 {
111 static readonly string __ServiceName = "grpc.testing.WorkerService";
112
113 static readonly Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_ServerArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom);
114 static readonly Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_ServerStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom);
115 static readonly Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_ClientArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom);
116 static readonly Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_ClientStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom);
117
118 static readonly Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> __Method_RunServer = new Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>(
119 MethodType.DuplexStreaming,
120 __ServiceName,
121 "RunServer",
122 __Marshaller_ServerArgs,
123 __Marshaller_ServerStatus);
124
125 static readonly Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> __Method_RunClient = new Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>(
126 MethodType.DuplexStreaming,
127 __ServiceName,
128 "RunClient",
129 __Marshaller_ClientArgs,
130 __Marshaller_ClientStatus);
131
132 // service descriptor
133 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
134 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -0800135 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700136 }
137
138 // client interface
139 public interface IWorkerServiceClient
140 {
141 AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
142 AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options);
143 AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
144 AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options);
145 }
146
147 // server-side interface
148 public interface IWorkerService
149 {
150 Task RunServer(IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, ServerCallContext context);
151 Task RunClient(IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, ServerCallContext context);
152 }
153
154 // client stub
155 public class WorkerServiceClient : ClientBase, IWorkerServiceClient
156 {
157 public WorkerServiceClient(Channel channel) : base(channel)
158 {
159 }
160 public AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
161 {
162 var call = CreateCall(__Method_RunServer, new CallOptions(headers, deadline, cancellationToken));
163 return Calls.AsyncDuplexStreamingCall(call);
164 }
165 public AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options)
166 {
167 var call = CreateCall(__Method_RunServer, options);
168 return Calls.AsyncDuplexStreamingCall(call);
169 }
170 public AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
171 {
172 var call = CreateCall(__Method_RunClient, new CallOptions(headers, deadline, cancellationToken));
173 return Calls.AsyncDuplexStreamingCall(call);
174 }
175 public AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options)
176 {
177 var call = CreateCall(__Method_RunClient, options);
178 return Calls.AsyncDuplexStreamingCall(call);
179 }
180 }
181
182 // creates service definition that can be registered with a server
183 public static ServerServiceDefinition BindService(IWorkerService serviceImpl)
184 {
185 return ServerServiceDefinition.CreateBuilder(__ServiceName)
186 .AddMethod(__Method_RunServer, serviceImpl.RunServer)
187 .AddMethod(__Method_RunClient, serviceImpl.RunClient).Build();
188 }
189
190 // creates a new client
191 public static WorkerServiceClient NewClient(Channel channel)
192 {
193 return new WorkerServiceClient(channel);
194 }
195
196 }
197}
198#endregion