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>Base class for server-side implementations of TestService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 109 | public abstract class TestServiceBase |
| 110 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 111 | /// <summary> |
| 112 | /// One empty request followed by one empty response. |
| 113 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 114 | 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] | 115 | { |
| 116 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 117 | } |
| 118 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 119 | /// <summary> |
| 120 | /// One request followed by one response. |
| 121 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 122 | 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] | 123 | { |
| 124 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 125 | } |
| 126 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 127 | /// <summary> |
| 128 | /// One request followed by a sequence of responses (streamed download). |
| 129 | /// The server returns the payload with client desired type and sizes. |
| 130 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 131 | 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] | 132 | { |
| 133 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 134 | } |
| 135 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 136 | /// <summary> |
| 137 | /// A sequence of requests followed by one response (streamed upload). |
| 138 | /// The server returns the aggregated size of client payload as the result. |
| 139 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 140 | 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] | 141 | { |
| 142 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 143 | } |
| 144 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 145 | /// <summary> |
| 146 | /// A sequence of requests with each request served by the server immediately. |
| 147 | /// As one request could lead to multiple responses, this interface |
| 148 | /// demonstrates the idea of full duplexing. |
| 149 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 150 | 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] | 151 | { |
| 152 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 153 | } |
| 154 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 155 | /// <summary> |
| 156 | /// A sequence of requests followed by a sequence of responses. |
| 157 | /// The server buffers all the client requests and then serves them in order. A |
| 158 | /// stream of responses are returned to the client when the server starts with |
| 159 | /// first request. |
| 160 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 161 | 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] | 162 | { |
| 163 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 164 | } |
| 165 | |
| 166 | } |
| 167 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 168 | /// <summary>Client for TestService</summary> |
Jan Tattermusch | fcc8d97 | 2016-06-06 09:44:02 -0700 | [diff] [blame^] | 169 | public class TestServiceClient : ClientBase<TestServiceClient> |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 170 | { |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 171 | public TestServiceClient(Channel channel) : base(channel) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 172 | { |
| 173 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 174 | public TestServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 175 | { |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 176 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 177 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 178 | protected TestServiceClient() : base() |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 179 | { |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 180 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 181 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 182 | protected TestServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 183 | { |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 184 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 185 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 186 | /// <summary> |
| 187 | /// One empty request followed by one empty response. |
| 188 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 189 | 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] | 190 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 191 | return EmptyCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 192 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 193 | /// <summary> |
| 194 | /// One empty request followed by one empty response. |
| 195 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 196 | 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] | 197 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 198 | return CallInvoker.BlockingUnaryCall(__Method_EmptyCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 199 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 200 | /// <summary> |
| 201 | /// One empty request followed by one empty response. |
| 202 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 203 | 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] | 204 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 205 | return EmptyCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 206 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 207 | /// <summary> |
| 208 | /// One empty request followed by one empty response. |
| 209 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 210 | 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] | 211 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 212 | return CallInvoker.AsyncUnaryCall(__Method_EmptyCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 213 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 214 | /// <summary> |
| 215 | /// One request followed by one response. |
| 216 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 217 | 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] | 218 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 219 | return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 220 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 221 | /// <summary> |
| 222 | /// One request followed by one response. |
| 223 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 224 | 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] | 225 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 226 | return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 227 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 228 | /// <summary> |
| 229 | /// One request followed by one response. |
| 230 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 231 | 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] | 232 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 233 | return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 234 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 235 | /// <summary> |
| 236 | /// One request followed by one response. |
| 237 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 238 | 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] | 239 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 240 | return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 241 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 242 | /// <summary> |
| 243 | /// One request followed by a sequence of responses (streamed download). |
| 244 | /// The server returns the payload with client desired type and sizes. |
| 245 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 246 | 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] | 247 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 248 | return StreamingOutputCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 249 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 250 | /// <summary> |
| 251 | /// One request followed by a sequence of responses (streamed download). |
| 252 | /// The server returns the payload with client desired type and sizes. |
| 253 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 254 | 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] | 255 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 256 | return CallInvoker.AsyncServerStreamingCall(__Method_StreamingOutputCall, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 257 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 258 | /// <summary> |
| 259 | /// A sequence of requests followed by one response (streamed upload). |
| 260 | /// The server returns the aggregated size of client payload as the result. |
| 261 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 262 | 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] | 263 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 264 | return StreamingInputCall(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 265 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 266 | /// <summary> |
| 267 | /// A sequence of requests followed by one response (streamed upload). |
| 268 | /// The server returns the aggregated size of client payload as the result. |
| 269 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 270 | 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] | 271 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 272 | return CallInvoker.AsyncClientStreamingCall(__Method_StreamingInputCall, null, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 273 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 274 | /// <summary> |
| 275 | /// A sequence of requests with each request served by the server immediately. |
| 276 | /// As one request could lead to multiple responses, this interface |
| 277 | /// demonstrates the idea of full duplexing. |
| 278 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 279 | 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] | 280 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 281 | return FullDuplexCall(new CallOptions(headers, deadline, cancellationToken)); |
| 282 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 283 | /// <summary> |
| 284 | /// A sequence of requests with each request served by the server immediately. |
| 285 | /// As one request could lead to multiple responses, this interface |
| 286 | /// demonstrates the idea of full duplexing. |
| 287 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 288 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> FullDuplexCall(CallOptions options) |
| 289 | { |
| 290 | return CallInvoker.AsyncDuplexStreamingCall(__Method_FullDuplexCall, null, options); |
| 291 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 292 | /// <summary> |
| 293 | /// A sequence of requests followed by a sequence of responses. |
| 294 | /// The server buffers all the client requests and then serves them in order. A |
| 295 | /// stream of responses are returned to the client when the server starts with |
| 296 | /// first request. |
| 297 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 298 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 299 | { |
| 300 | return HalfDuplexCall(new CallOptions(headers, deadline, cancellationToken)); |
| 301 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 302 | /// <summary> |
| 303 | /// A sequence of requests followed by a sequence of responses. |
| 304 | /// The server buffers all the client requests and then serves them in order. A |
| 305 | /// stream of responses are returned to the client when the server starts with |
| 306 | /// first request. |
| 307 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 308 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> HalfDuplexCall(CallOptions options) |
| 309 | { |
| 310 | return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options); |
| 311 | } |
| 312 | protected override TestServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 313 | { |
| 314 | return new TestServiceClient(configuration); |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 315 | } |
| 316 | } |
| 317 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 318 | /// <summary>Creates a new client for TestService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 319 | public static TestServiceClient NewClient(Channel channel) |
| 320 | { |
| 321 | return new TestServiceClient(channel); |
| 322 | } |
| 323 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 324 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 325 | public static ServerServiceDefinition BindService(TestServiceBase serviceImpl) |
| 326 | { |
Jan Tattermusch | 562cd05 | 2016-06-06 08:47:17 -0700 | [diff] [blame] | 327 | return ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 328 | .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) |
| 329 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 330 | .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall) |
| 331 | .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall) |
| 332 | .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall) |
| 333 | .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(); |
| 334 | } |
| 335 | |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 336 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 337 | /// <summary> |
| 338 | /// A simple service NOT implemented at servers so clients can test for |
| 339 | /// that case. |
| 340 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 341 | public static class UnimplementedService |
| 342 | { |
| 343 | static readonly string __ServiceName = "grpc.testing.UnimplementedService"; |
| 344 | |
| 345 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 346 | |
| 347 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>( |
| 348 | MethodType.Unary, |
| 349 | __ServiceName, |
| 350 | "UnimplementedCall", |
| 351 | __Marshaller_Empty, |
| 352 | __Marshaller_Empty); |
| 353 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 354 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 355 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 356 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 357 | get { return global::Grpc.Testing.TestReflection.Descriptor.Services[1]; } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 358 | } |
| 359 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 360 | /// <summary>Base class for server-side implementations of UnimplementedService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 361 | public abstract class UnimplementedServiceBase |
| 362 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 363 | /// <summary> |
| 364 | /// A call that no server should implement |
| 365 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 366 | 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] | 367 | { |
| 368 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 369 | } |
| 370 | |
| 371 | } |
| 372 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 373 | /// <summary>Client for UnimplementedService</summary> |
Jan Tattermusch | fcc8d97 | 2016-06-06 09:44:02 -0700 | [diff] [blame^] | 374 | public class UnimplementedServiceClient : ClientBase<UnimplementedServiceClient> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 375 | { |
| 376 | public UnimplementedServiceClient(Channel channel) : base(channel) |
| 377 | { |
| 378 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 379 | public UnimplementedServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 380 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 381 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 382 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 383 | protected UnimplementedServiceClient() : base() |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 384 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 385 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 386 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 387 | protected UnimplementedServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 388 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 389 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 390 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 391 | /// <summary> |
| 392 | /// A call that no server should implement |
| 393 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 394 | 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] | 395 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 396 | return UnimplementedCall(request, new CallOptions(headers, deadline, cancellationToken)); |
| 397 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 398 | /// <summary> |
| 399 | /// A call that no server should implement |
| 400 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 401 | public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options) |
| 402 | { |
| 403 | return CallInvoker.BlockingUnaryCall(__Method_UnimplementedCall, null, options, request); |
| 404 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 405 | /// <summary> |
| 406 | /// A call that no server should implement |
| 407 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 408 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 409 | { |
| 410 | return UnimplementedCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 411 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 412 | /// <summary> |
| 413 | /// A call that no server should implement |
| 414 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 415 | public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options) |
| 416 | { |
| 417 | return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request); |
| 418 | } |
| 419 | protected override UnimplementedServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 420 | { |
| 421 | return new UnimplementedServiceClient(configuration); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 422 | } |
| 423 | } |
| 424 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 425 | /// <summary>Creates a new client for UnimplementedService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 426 | public static UnimplementedServiceClient NewClient(Channel channel) |
| 427 | { |
| 428 | return new UnimplementedServiceClient(channel); |
| 429 | } |
| 430 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 431 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 432 | public static ServerServiceDefinition BindService(UnimplementedServiceBase serviceImpl) |
| 433 | { |
Jan Tattermusch | 562cd05 | 2016-06-06 08:47:17 -0700 | [diff] [blame] | 434 | return ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 435 | .AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build(); |
| 436 | } |
| 437 | |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 438 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 439 | /// <summary> |
| 440 | /// A service used to control reconnect server. |
| 441 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 442 | public static class ReconnectService |
| 443 | { |
| 444 | static readonly string __ServiceName = "grpc.testing.ReconnectService"; |
| 445 | |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 446 | 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] | 447 | static readonly Marshaller<global::Grpc.Testing.Empty> __Marshaller_Empty = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Empty.Parser.ParseFrom); |
| 448 | static readonly Marshaller<global::Grpc.Testing.ReconnectInfo> __Marshaller_ReconnectInfo = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ReconnectInfo.Parser.ParseFrom); |
| 449 | |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 450 | 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] | 451 | MethodType.Unary, |
| 452 | __ServiceName, |
| 453 | "Start", |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 454 | __Marshaller_ReconnectParams, |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 455 | __Marshaller_Empty); |
| 456 | |
| 457 | static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo> __Method_Stop = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.ReconnectInfo>( |
| 458 | MethodType.Unary, |
| 459 | __ServiceName, |
| 460 | "Stop", |
| 461 | __Marshaller_Empty, |
| 462 | __Marshaller_ReconnectInfo); |
| 463 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 464 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 465 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 466 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 467 | get { return global::Grpc.Testing.TestReflection.Descriptor.Services[2]; } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 468 | } |
| 469 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 470 | /// <summary>Base class for server-side implementations of ReconnectService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 471 | public abstract class ReconnectServiceBase |
| 472 | { |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 473 | 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] | 474 | { |
| 475 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 476 | } |
| 477 | |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 478 | 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] | 479 | { |
| 480 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 481 | } |
| 482 | |
| 483 | } |
| 484 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 485 | /// <summary>Client for ReconnectService</summary> |
Jan Tattermusch | fcc8d97 | 2016-06-06 09:44:02 -0700 | [diff] [blame^] | 486 | public class ReconnectServiceClient : ClientBase<ReconnectServiceClient> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 487 | { |
| 488 | public ReconnectServiceClient(Channel channel) : base(channel) |
| 489 | { |
| 490 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 491 | public ReconnectServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 492 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 493 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 494 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 495 | protected ReconnectServiceClient() : base() |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 496 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 497 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 498 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 499 | protected ReconnectServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 500 | { |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 501 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 502 | |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 503 | 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] | 504 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 505 | return Start(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 506 | } |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 507 | 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] | 508 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 509 | return CallInvoker.BlockingUnaryCall(__Method_Start, null, options, request); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 510 | } |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 511 | 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] | 512 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 513 | return StartAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 514 | } |
vjpai | 87bac95 | 2016-04-20 09:35:35 -0700 | [diff] [blame] | 515 | 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] | 516 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 517 | return CallInvoker.AsyncUnaryCall(__Method_Start, null, options, request); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 518 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 519 | 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] | 520 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 521 | return Stop(request, new CallOptions(headers, deadline, cancellationToken)); |
| 522 | } |
| 523 | public virtual global::Grpc.Testing.ReconnectInfo Stop(global::Grpc.Testing.Empty request, CallOptions options) |
| 524 | { |
| 525 | return CallInvoker.BlockingUnaryCall(__Method_Stop, null, options, request); |
| 526 | } |
| 527 | public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 528 | { |
| 529 | return StopAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 530 | } |
| 531 | public virtual AsyncUnaryCall<global::Grpc.Testing.ReconnectInfo> StopAsync(global::Grpc.Testing.Empty request, CallOptions options) |
| 532 | { |
| 533 | return CallInvoker.AsyncUnaryCall(__Method_Stop, null, options, request); |
| 534 | } |
| 535 | protected override ReconnectServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 536 | { |
| 537 | return new ReconnectServiceClient(configuration); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 538 | } |
| 539 | } |
| 540 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 541 | /// <summary>Creates a new client for ReconnectService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 542 | public static ReconnectServiceClient NewClient(Channel channel) |
| 543 | { |
| 544 | return new ReconnectServiceClient(channel); |
| 545 | } |
| 546 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 547 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 548 | public static ServerServiceDefinition BindService(ReconnectServiceBase serviceImpl) |
| 549 | { |
Jan Tattermusch | 562cd05 | 2016-06-06 08:47:17 -0700 | [diff] [blame] | 550 | return ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 551 | .AddMethod(__Method_Start, serviceImpl.Start) |
| 552 | .AddMethod(__Method_Stop, serviceImpl.Stop).Build(); |
| 553 | } |
| 554 | |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 555 | } |
Jan Tattermusch | 7eb3a76 | 2015-05-07 14:26:13 -0700 | [diff] [blame] | 556 | } |
Jan Tattermusch | cd7e313 | 2015-05-07 15:10:23 -0700 | [diff] [blame] | 557 | #endregion |