Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 2 | // source: src/proto/grpc/testing/test.proto |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 3 | // 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 | // An integration test service that covers all the method signature permutations |
| 34 | // of unary/streaming requests/responses. |
| 35 | // |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 36 | #region Designer generated code |
| 37 | |
| 38 | using System; |
| 39 | using System.Threading; |
| 40 | using System.Threading.Tasks; |
| 41 | using Grpc.Core; |
| 42 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 43 | namespace Grpc.Testing { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 44 | /// <summary> |
| 45 | /// A simple service to test the various types of RPCs and experiment with |
| 46 | /// performance with various types of payload. |
| 47 | /// </summary> |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 48 | public static class TestService |
| 49 | { |
| 50 | static readonly string __ServiceName = "grpc.testing.TestService"; |
| 51 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 52 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 53 | static readonly Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); |
| 54 | static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); |
| 55 | static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallRequest> __Marshaller_StreamingOutputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallRequest.Parser.ParseFrom); |
| 56 | static readonly Marshaller<global::Grpc.Testing.StreamingOutputCallResponse> __Marshaller_StreamingOutputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingOutputCallResponse.Parser.ParseFrom); |
| 57 | static readonly Marshaller<global::Grpc.Testing.StreamingInputCallRequest> __Marshaller_StreamingInputCallRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallRequest.Parser.ParseFrom); |
| 58 | static readonly Marshaller<global::Grpc.Testing.StreamingInputCallResponse> __Marshaller_StreamingInputCallResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.StreamingInputCallResponse.Parser.ParseFrom); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 59 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 60 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_EmptyCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 61 | MethodType.Unary, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 62 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 63 | "EmptyCall", |
| 64 | __Marshaller_Empty, |
| 65 | __Marshaller_Empty); |
| 66 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 67 | static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 68 | MethodType.Unary, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 69 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 70 | "UnaryCall", |
| 71 | __Marshaller_SimpleRequest, |
| 72 | __Marshaller_SimpleResponse); |
| 73 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 74 | static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 75 | MethodType.ServerStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 76 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 77 | "StreamingOutputCall", |
| 78 | __Marshaller_StreamingOutputCallRequest, |
| 79 | __Marshaller_StreamingOutputCallResponse); |
| 80 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 81 | static readonly Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> __Method_StreamingInputCall = new Method<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 82 | MethodType.ClientStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 83 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 84 | "StreamingInputCall", |
| 85 | __Marshaller_StreamingInputCallRequest, |
| 86 | __Marshaller_StreamingInputCallResponse); |
| 87 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 88 | static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_FullDuplexCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 89 | MethodType.DuplexStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 90 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 91 | "FullDuplexCall", |
| 92 | __Marshaller_StreamingOutputCallRequest, |
| 93 | __Marshaller_StreamingOutputCallResponse); |
| 94 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 95 | static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_HalfDuplexCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>( |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 96 | MethodType.DuplexStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 97 | __ServiceName, |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 98 | "HalfDuplexCall", |
| 99 | __Marshaller_StreamingOutputCallRequest, |
| 100 | __Marshaller_StreamingOutputCallResponse); |
| 101 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 102 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | e6af5d1 | 2015-08-03 10:57:43 -0700 | [diff] [blame] | 103 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 104 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 105 | get { return global::Grpc.Testing.TestReflection.Descriptor.Services[0]; } |
Jan Tattermusch | e6af5d1 | 2015-08-03 10:57:43 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 108 | /// <summary>Client for TestService</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 109 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 110 | public interface ITestServiceClient |
| 111 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 112 | /// <summary> |
| 113 | /// One empty request followed by one empty response. |
| 114 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 115 | global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 116 | /// <summary> |
| 117 | /// One empty request followed by one empty response. |
| 118 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 119 | global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 120 | /// <summary> |
| 121 | /// One empty request followed by one empty response. |
| 122 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 123 | AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 124 | /// <summary> |
| 125 | /// One empty request followed by one empty response. |
| 126 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 127 | AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 128 | /// <summary> |
| 129 | /// One request followed by one response. |
| 130 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 131 | global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 132 | /// <summary> |
| 133 | /// One request followed by one response. |
| 134 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 135 | global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 136 | /// <summary> |
| 137 | /// One request followed by one response. |
| 138 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 139 | AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 140 | /// <summary> |
| 141 | /// One request followed by one response. |
| 142 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 143 | AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 144 | /// <summary> |
| 145 | /// One request followed by a sequence of responses (streamed download). |
| 146 | /// The server returns the payload with client desired type and sizes. |
| 147 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 148 | AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 149 | /// <summary> |
| 150 | /// One request followed by a sequence of responses (streamed download). |
| 151 | /// The server returns the payload with client desired type and sizes. |
| 152 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 153 | AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 154 | /// <summary> |
| 155 | /// A sequence of requests followed by one response (streamed upload). |
| 156 | /// The server returns the aggregated size of client payload as the result. |
| 157 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 158 | AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 159 | /// <summary> |
| 160 | /// A sequence of requests followed by one response (streamed upload). |
| 161 | /// The server returns the aggregated size of client payload as the result. |
| 162 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 163 | AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 164 | /// <summary> |
| 165 | /// A sequence of requests with each request served by the server immediately. |
| 166 | /// As one request could lead to multiple responses, this interface |
| 167 | /// demonstrates the idea of full duplexing. |
| 168 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 169 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 170 | /// <summary> |
| 171 | /// A sequence of requests with each request served by the server immediately. |
| 172 | /// As one request could lead to multiple responses, this interface |
| 173 | /// demonstrates the idea of full duplexing. |
| 174 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 175 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 176 | /// <summary> |
| 177 | /// A sequence of requests followed by a sequence of responses. |
| 178 | /// The server buffers all the client requests and then serves them in order. A |
| 179 | /// stream of responses are returned to the client when the server starts with |
| 180 | /// first request. |
| 181 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 182 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 183 | /// <summary> |
| 184 | /// A sequence of requests followed by a sequence of responses. |
| 185 | /// The server buffers all the client requests and then serves them in order. A |
| 186 | /// stream of responses are returned to the client when the server starts with |
| 187 | /// first request. |
| 188 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 189 | AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 190 | } |
| 191 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 192 | /// <summary>Interface of server-side implementations of TestService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 193 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 194 | public interface ITestService |
| 195 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 196 | /// <summary> |
| 197 | /// One empty request followed by one empty response. |
| 198 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 199 | global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 200 | /// <summary> |
| 201 | /// One request followed by one response. |
| 202 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 203 | global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 204 | /// <summary> |
| 205 | /// One request followed by a sequence of responses (streamed download). |
| 206 | /// The server returns the payload with client desired type and sizes. |
| 207 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 208 | global::System.Threading.Tasks.Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 209 | /// <summary> |
| 210 | /// A sequence of requests followed by one response (streamed upload). |
| 211 | /// The server returns the aggregated size of client payload as the result. |
| 212 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 213 | global::System.Threading.Tasks.Task<global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<global::Grpc.Testing.StreamingInputCallRequest> requestStream, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 214 | /// <summary> |
| 215 | /// A sequence of requests with each request served by the server immediately. |
| 216 | /// As one request could lead to multiple responses, this interface |
| 217 | /// demonstrates the idea of full duplexing. |
| 218 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 219 | global::System.Threading.Tasks.Task FullDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 220 | /// <summary> |
| 221 | /// A sequence of requests followed by a sequence of responses. |
| 222 | /// The server buffers all the client requests and then serves them in order. A |
| 223 | /// stream of responses are returned to the client when the server starts with |
| 224 | /// first request. |
| 225 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 226 | global::System.Threading.Tasks.Task HalfDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 227 | } |
| 228 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 229 | /// <summary>Base class for server-side implementations of TestService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 230 | public abstract class TestServiceBase |
| 231 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 232 | /// <summary> |
| 233 | /// One empty request followed by one empty response. |
| 234 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 235 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 236 | { |
| 237 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 238 | } |
| 239 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 240 | /// <summary> |
| 241 | /// One request followed by one response. |
| 242 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 243 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 244 | { |
| 245 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 246 | } |
| 247 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 248 | /// <summary> |
| 249 | /// One request followed by a sequence of responses (streamed download). |
| 250 | /// The server returns the payload with client desired type and sizes. |
| 251 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 252 | public virtual global::System.Threading.Tasks.Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 253 | { |
| 254 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 255 | } |
| 256 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 257 | /// <summary> |
| 258 | /// A sequence of requests followed by one response (streamed upload). |
| 259 | /// The server returns the aggregated size of client payload as the result. |
| 260 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 261 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<global::Grpc.Testing.StreamingInputCallRequest> requestStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 262 | { |
| 263 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 264 | } |
| 265 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 266 | /// <summary> |
| 267 | /// A sequence of requests with each request served by the server immediately. |
| 268 | /// As one request could lead to multiple responses, this interface |
| 269 | /// demonstrates the idea of full duplexing. |
| 270 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 271 | public virtual global::System.Threading.Tasks.Task FullDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 272 | { |
| 273 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 274 | } |
| 275 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 276 | /// <summary> |
| 277 | /// A sequence of requests followed by a sequence of responses. |
| 278 | /// The server buffers all the client requests and then serves them in order. A |
| 279 | /// stream of responses are returned to the client when the server starts with |
| 280 | /// first request. |
| 281 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 282 | public virtual global::System.Threading.Tasks.Task HalfDuplexCall(IAsyncStreamReader<global::Grpc.Testing.StreamingOutputCallRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.StreamingOutputCallResponse> responseStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 283 | { |
| 284 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 285 | } |
| 286 | |
| 287 | } |
| 288 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 289 | /// <summary>Client for TestService</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 290 | #pragma warning disable 0618 |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 291 | public class TestServiceClient : ClientBase<TestServiceClient>, ITestServiceClient |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 292 | #pragma warning restore 0618 |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 293 | { |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 294 | public TestServiceClient(Channel channel) : base(channel) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 295 | { |
| 296 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 297 | public TestServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 298 | { |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 299 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 300 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 301 | protected TestServiceClient() : base() |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 302 | { |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 303 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 304 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 305 | protected TestServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 306 | { |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 307 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 308 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 309 | /// <summary> |
| 310 | /// One empty request followed by one empty response. |
| 311 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 312 | public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 313 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 314 | return EmptyCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 315 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 316 | /// <summary> |
| 317 | /// One empty request followed by one empty response. |
| 318 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 319 | public virtual global::Grpc.Testing.Empty EmptyCall(global::Grpc.Testing.Empty request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 320 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 321 | return CallInvoker.BlockingUnaryCall(__Method_EmptyCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 322 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 323 | /// <summary> |
| 324 | /// One empty request followed by one empty response. |
| 325 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 326 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 327 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 328 | return EmptyCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 329 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 330 | /// <summary> |
| 331 | /// One empty request followed by one empty response. |
| 332 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 333 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> EmptyCallAsync(global::Grpc.Testing.Empty request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 334 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 335 | return CallInvoker.AsyncUnaryCall(__Method_EmptyCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 336 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 337 | /// <summary> |
| 338 | /// One request followed by one response. |
| 339 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 340 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 341 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 342 | return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 343 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 344 | /// <summary> |
| 345 | /// One request followed by one response. |
| 346 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 347 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 348 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 349 | return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 350 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 351 | /// <summary> |
| 352 | /// One request followed by one response. |
| 353 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 354 | public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 355 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 356 | return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 357 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 358 | /// <summary> |
| 359 | /// One request followed by one response. |
| 360 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 361 | public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 362 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 363 | return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 364 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 365 | /// <summary> |
| 366 | /// One request followed by a sequence of responses (streamed download). |
| 367 | /// The server returns the payload with client desired type and sizes. |
| 368 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 369 | public virtual AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 370 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 371 | return StreamingOutputCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 372 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 373 | /// <summary> |
| 374 | /// One request followed by a sequence of responses (streamed download). |
| 375 | /// The server returns the payload with client desired type and sizes. |
| 376 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 377 | public virtual AsyncServerStreamingCall<global::Grpc.Testing.StreamingOutputCallResponse> StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 378 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 379 | return CallInvoker.AsyncServerStreamingCall(__Method_StreamingOutputCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 380 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 381 | /// <summary> |
| 382 | /// A sequence of requests followed by one response (streamed upload). |
| 383 | /// The server returns the aggregated size of client payload as the result. |
| 384 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 385 | public virtual AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 386 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 387 | return StreamingInputCall(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 388 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 389 | /// <summary> |
| 390 | /// A sequence of requests followed by one response (streamed upload). |
| 391 | /// The server returns the aggregated size of client payload as the result. |
| 392 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 393 | public virtual AsyncClientStreamingCall<global::Grpc.Testing.StreamingInputCallRequest, global::Grpc.Testing.StreamingInputCallResponse> StreamingInputCall(CallOptions options) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 394 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 395 | return CallInvoker.AsyncClientStreamingCall(__Method_StreamingInputCall, null, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 396 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 397 | /// <summary> |
| 398 | /// A sequence of requests with each request served by the server immediately. |
| 399 | /// As one request could lead to multiple responses, this interface |
| 400 | /// demonstrates the idea of full duplexing. |
| 401 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 402 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 403 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 404 | return FullDuplexCall(new CallOptions(headers, deadline, cancellationToken)); |
| 405 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 406 | /// <summary> |
| 407 | /// A sequence of requests with each request served by the server immediately. |
| 408 | /// As one request could lead to multiple responses, this interface |
| 409 | /// demonstrates the idea of full duplexing. |
| 410 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 411 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options) |
| 412 | { |
| 413 | return CallInvoker.AsyncDuplexStreamingCall(__Method_FullDuplexCall, null, options); |
| 414 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 415 | /// <summary> |
| 416 | /// A sequence of requests followed by a sequence of responses. |
| 417 | /// The server buffers all the client requests and then serves them in order. A |
| 418 | /// stream of responses are returned to the client when the server starts with |
| 419 | /// first request. |
| 420 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 421 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 422 | { |
| 423 | return HalfDuplexCall(new CallOptions(headers, deadline, cancellationToken)); |
| 424 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 425 | /// <summary> |
| 426 | /// A sequence of requests followed by a sequence of responses. |
| 427 | /// The server buffers all the client requests and then serves them in order. A |
| 428 | /// stream of responses are returned to the client when the server starts with |
| 429 | /// first request. |
| 430 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 431 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options) |
| 432 | { |
| 433 | return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options); |
| 434 | } |
| 435 | protected override TestServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 436 | { |
| 437 | return new TestServiceClient(configuration); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 438 | } |
| 439 | } |
| 440 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 441 | /// <summary>Creates a new client for TestService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 442 | public static TestServiceClient NewClient(Channel channel) |
| 443 | { |
| 444 | return new TestServiceClient(channel); |
| 445 | } |
| 446 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 447 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 448 | #pragma warning disable 0618 |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 449 | public static ServerServiceDefinition BindService(ITestService serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 450 | #pragma warning restore 0618 |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 451 | { |
| 452 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 453 | .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) |
| 454 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 455 | .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall) |
| 456 | .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall) |
| 457 | .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall) |
| 458 | .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(); |
| 459 | } |
| 460 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 461 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 462 | #pragma warning disable 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 463 | public static ServerServiceDefinition BindService(TestServiceBase serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 464 | #pragma warning restore 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 465 | { |
| 466 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 467 | .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) |
| 468 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 469 | .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall) |
| 470 | .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall) |
| 471 | .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall) |
| 472 | .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(); |
| 473 | } |
| 474 | |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 475 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 476 | /// <summary> |
| 477 | /// A simple service NOT implemented at servers so clients can test for |
| 478 | /// that case. |
| 479 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 480 | public static class UnimplementedService |
| 481 | { |
| 482 | static readonly string __ServiceName = "grpc.testing.UnimplementedService"; |
| 483 | |
| 484 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 485 | |
| 486 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>( |
| 487 | MethodType.Unary, |
| 488 | __ServiceName, |
| 489 | "UnimplementedCall", |
| 490 | __Marshaller_Empty, |
| 491 | __Marshaller_Empty); |
| 492 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 493 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 494 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 495 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 496 | get { return global::Grpc.Testing.TestReflection.Descriptor.Services[1]; } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 497 | } |
| 498 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 499 | /// <summary>Client for UnimplementedService</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 500 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 501 | public interface IUnimplementedServiceClient |
| 502 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 503 | /// <summary> |
| 504 | /// A call that no server should implement |
| 505 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 506 | global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 507 | /// <summary> |
| 508 | /// A call that no server should implement |
| 509 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 510 | global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 511 | /// <summary> |
| 512 | /// A call that no server should implement |
| 513 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 514 | AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 515 | /// <summary> |
| 516 | /// A call that no server should implement |
| 517 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 518 | AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options); |
| 519 | } |
| 520 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 521 | /// <summary>Interface of server-side implementations of UnimplementedService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 522 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 523 | public interface IUnimplementedService |
| 524 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 525 | /// <summary> |
| 526 | /// A call that no server should implement |
| 527 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 528 | global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 529 | } |
| 530 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 531 | /// <summary>Base class for server-side implementations of UnimplementedService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 532 | public abstract class UnimplementedServiceBase |
| 533 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 534 | /// <summary> |
| 535 | /// A call that no server should implement |
| 536 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 537 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 538 | { |
| 539 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 540 | } |
| 541 | |
| 542 | } |
| 543 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 544 | /// <summary>Client for UnimplementedService</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 545 | #pragma warning disable 0618 |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 546 | public class UnimplementedServiceClient : ClientBase<UnimplementedServiceClient>, IUnimplementedServiceClient |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 547 | #pragma warning restore 0618 |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 548 | { |
| 549 | public UnimplementedServiceClient(Channel channel) : base(channel) |
| 550 | { |
| 551 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 552 | public UnimplementedServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 553 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 554 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 555 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 556 | protected UnimplementedServiceClient() : base() |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 557 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 558 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 559 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 560 | protected UnimplementedServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 561 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 562 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 563 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 564 | /// <summary> |
| 565 | /// A call that no server should implement |
| 566 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 567 | public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 568 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 569 | return UnimplementedCall(request, new CallOptions(headers, deadline, cancellationToken)); |
| 570 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 571 | /// <summary> |
| 572 | /// A call that no server should implement |
| 573 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 574 | public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options) |
| 575 | { |
| 576 | return CallInvoker.BlockingUnaryCall(__Method_UnimplementedCall, null, options, request); |
| 577 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 578 | /// <summary> |
| 579 | /// A call that no server should implement |
| 580 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 581 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 582 | { |
| 583 | return UnimplementedCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 584 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 585 | /// <summary> |
| 586 | /// A call that no server should implement |
| 587 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 588 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options) |
| 589 | { |
| 590 | return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request); |
| 591 | } |
| 592 | protected override UnimplementedServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 593 | { |
| 594 | return new UnimplementedServiceClient(configuration); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 595 | } |
| 596 | } |
| 597 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 598 | /// <summary>Creates a new client for UnimplementedService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 599 | public static UnimplementedServiceClient NewClient(Channel channel) |
| 600 | { |
| 601 | return new UnimplementedServiceClient(channel); |
| 602 | } |
| 603 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 604 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 605 | #pragma warning disable 0618 |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 606 | public static ServerServiceDefinition BindService(IUnimplementedService serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 607 | #pragma warning restore 0618 |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 608 | { |
| 609 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 610 | .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build(); |
| 611 | } |
| 612 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 613 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 614 | #pragma warning disable 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 615 | public static ServerServiceDefinition BindService(UnimplementedServiceBase serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 616 | #pragma warning restore 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 617 | { |
| 618 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 619 | .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build(); |
| 620 | } |
| 621 | |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 622 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 623 | /// <summary> |
| 624 | /// A service used to control reconnect server. |
| 625 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 626 | public static class ReconnectService |
| 627 | { |
| 628 | static readonly string __ServiceName = "grpc.testing.ReconnectService"; |
| 629 | |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 630 | static readonly Marshaller<global::Grpc.Testing.ReconnectParams> __Marshaller_ReconnectParams = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectParams.Parser.ParseFrom); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 631 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 632 | static readonly Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_ReconnectInfo = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom); |
| 633 | |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 634 | static readonly Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty> __Method_Start = new Method<global::Grpc.Testing.ReconnectParams, global::Grpc.Testing.Empty>( |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 635 | MethodType.Unary, |
| 636 | __ServiceName, |
| 637 | "Start", |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 638 | __Marshaller_ReconnectParams, |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 639 | __Marshaller_Empty); |
| 640 | |
| 641 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo> __Method_Stop = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo>( |
| 642 | MethodType.Unary, |
| 643 | __ServiceName, |
| 644 | "Stop", |
| 645 | __Marshaller_Empty, |
| 646 | __Marshaller_ReconnectInfo); |
| 647 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 648 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 649 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 650 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 651 | get { return global::Grpc.Testing.TestReflection.Descriptor.Services[2]; } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 652 | } |
| 653 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 654 | /// <summary>Client for ReconnectService</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 655 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 656 | public interface IReconnectServiceClient |
| 657 | { |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 658 | global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 659 | global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, CallOptions options); |
| 660 | AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 661 | AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, CallOptions options); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 662 | global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 663 | global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options); |
| 664 | AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 665 | AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options); |
| 666 | } |
| 667 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 668 | /// <summary>Interface of server-side implementations of ReconnectService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 669 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 670 | public interface IReconnectService |
| 671 | { |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 672 | global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context); |
| 673 | global::System.Threading.Tasks.Task<global::Grpc.Testing.ReconnectInfo> Stop(global::Grpc.Testing.Empty request, ServerCallContext context); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 674 | } |
| 675 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 676 | /// <summary>Base class for server-side implementations of ReconnectService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 677 | public abstract class ReconnectServiceBase |
| 678 | { |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 679 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 680 | { |
| 681 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 682 | } |
| 683 | |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 684 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.ReconnectInfo> Stop(global::Grpc.Testing.Empty request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 685 | { |
| 686 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 687 | } |
| 688 | |
| 689 | } |
| 690 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 691 | /// <summary>Client for ReconnectService</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 692 | #pragma warning disable 0618 |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 693 | public class ReconnectServiceClient : ClientBase<ReconnectServiceClient>, IReconnectServiceClient |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 694 | #pragma warning restore 0618 |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 695 | { |
| 696 | public ReconnectServiceClient(Channel channel) : base(channel) |
| 697 | { |
| 698 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 699 | public ReconnectServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 700 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 701 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 702 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 703 | protected ReconnectServiceClient() : base() |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 704 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 705 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 706 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 707 | protected ReconnectServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 708 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 709 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 710 | |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 711 | public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 712 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 713 | return Start(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 714 | } |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 715 | public virtual global::Grpc.Testing.Empty Start(global::Grpc.Testing.ReconnectParams request, CallOptions options) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 716 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 717 | return CallInvoker.BlockingUnaryCall(__Method_Start, null, options, request); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 718 | } |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 719 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 720 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 721 | return StartAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 722 | } |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 723 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> StartAsync(global::Grpc.Testing.ReconnectParams request, CallOptions options) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 724 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 725 | return CallInvoker.AsyncUnaryCall(__Method_Start, null, options, request); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 726 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 727 | public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 728 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 729 | return Stop(request, new CallOptions(headers, deadline, cancellationToken)); |
| 730 | } |
| 731 | public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options) |
| 732 | { |
| 733 | return CallInvoker.BlockingUnaryCall(__Method_Stop, null, options, request); |
| 734 | } |
| 735 | public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 736 | { |
| 737 | return StopAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 738 | } |
| 739 | public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options) |
| 740 | { |
| 741 | return CallInvoker.AsyncUnaryCall(__Method_Stop, null, options, request); |
| 742 | } |
| 743 | protected override ReconnectServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 744 | { |
| 745 | return new ReconnectServiceClient(configuration); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 746 | } |
| 747 | } |
| 748 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 749 | /// <summary>Creates a new client for ReconnectService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 750 | public static ReconnectServiceClient NewClient(Channel channel) |
| 751 | { |
| 752 | return new ReconnectServiceClient(channel); |
| 753 | } |
| 754 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 755 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 756 | #pragma warning disable 0618 |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 757 | public static ServerServiceDefinition BindService(IReconnectService serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 758 | #pragma warning restore 0618 |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 759 | { |
| 760 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 761 | .AddMethod(__Method_Start, serviceImpl.Start) |
| 762 | .AddMethod(__Method_Stop, serviceImpl.Stop).Build(); |
| 763 | } |
| 764 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 765 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 766 | #pragma warning disable 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 767 | public static ServerServiceDefinition BindService(ReconnectServiceBase serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 768 | #pragma warning restore 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 769 | { |
| 770 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 771 | .AddMethod(__Method_Start, serviceImpl.Start) |
| 772 | .AddMethod(__Method_Stop, serviceImpl.Stop).Build(); |
| 773 | } |
| 774 | |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 775 | } |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 776 | } |
Jan Tattermusch | cd7e313 | 2015-05-07 15:10:23 -0700 | [diff] [blame] | 777 | #endregion |