@@ -44,14 +44,14 @@ import Dispatch
4444import gRPC
4545
4646/// Type for errors thrown from generated client code.
47- public enum Echo_EchoClientError : Error {
47+ internal enum Echo_EchoClientError : Error {
4848 case endOfStream
4949 case invalidMessageReceived
5050 case error( c: CallResult )
5151}
5252
5353/// Get (Unary)
54- public class Echo_EchoGetCall {
54+ internal class Echo_EchoGetCall {
5555 private var call : Call
5656
5757 /// Create a call.
@@ -101,7 +101,7 @@ public class Echo_EchoGetCall {
101101}
102102
103103/// Expand (Server Streaming)
104- public class Echo_EchoExpandCall {
104+ internal class Echo_EchoExpandCall {
105105 private var call : Call
106106
107107 /// Create a call.
@@ -123,7 +123,7 @@ public class Echo_EchoExpandCall {
123123 }
124124
125125 /// Call this to wait for a result. Blocking.
126- public func receive( ) throws -> Echo_EchoResponse {
126+ internal func receive( ) throws -> Echo_EchoResponse {
127127 var returnError : Echo_EchoClientError ?
128128 var returnResponse : Echo_EchoResponse !
129129 let sem = DispatchSemaphore ( value: 0 )
@@ -142,7 +142,7 @@ public class Echo_EchoExpandCall {
142142 }
143143
144144 /// Call this to wait for a result. Nonblocking.
145- public func receive( completion: @escaping ( Echo_EchoResponse ? , Echo_EchoClientError ? ) -> ( ) ) throws {
145+ internal func receive( completion: @escaping ( Echo_EchoResponse ? , Echo_EchoClientError ? ) -> ( ) ) throws {
146146 do {
147147 try call. receiveMessage ( ) { ( responseData) in
148148 if let responseData = responseData {
@@ -160,7 +160,7 @@ public class Echo_EchoExpandCall {
160160}
161161
162162/// Collect (Client Streaming)
163- public class Echo_EchoCollectCall {
163+ internal class Echo_EchoCollectCall {
164164 private var call : Call
165165
166166 /// Create a call.
@@ -176,13 +176,13 @@ public class Echo_EchoCollectCall {
176176 }
177177
178178 /// Call this to send each message in the request stream. Nonblocking.
179- public func send( _ message: Echo_EchoRequest , errorHandler: @escaping ( Error ) -> ( ) ) throws {
179+ internal func send( _ message: Echo_EchoRequest , errorHandler: @escaping ( Error ) -> ( ) ) throws {
180180 let messageData = try message. serializedData ( )
181181 try call. sendMessage ( data: messageData, errorHandler: errorHandler)
182182 }
183183
184184 /// Call this to close the connection and wait for a response. Blocking.
185- public func closeAndReceive( ) throws -> Echo_EchoResponse {
185+ internal func closeAndReceive( ) throws -> Echo_EchoResponse {
186186 var returnError : Echo_EchoClientError ?
187187 var returnResponse : Echo_EchoResponse !
188188 let sem = DispatchSemaphore ( value: 0 )
@@ -203,7 +203,7 @@ public class Echo_EchoCollectCall {
203203 }
204204
205205 /// Call this to close the connection and wait for a response. Nonblocking.
206- public func closeAndReceive( completion: @escaping ( Echo_EchoResponse ? , Echo_EchoClientError ? ) -> ( ) )
206+ internal func closeAndReceive( completion: @escaping ( Echo_EchoResponse ? , Echo_EchoClientError ? ) -> ( ) )
207207 throws {
208208 do {
209209 try call. receiveMessage ( ) { ( responseData) in
@@ -222,7 +222,7 @@ public class Echo_EchoCollectCall {
222222}
223223
224224/// Update (Bidirectional Streaming)
225- public class Echo_EchoUpdateCall {
225+ internal class Echo_EchoUpdateCall {
226226 private var call : Call
227227
228228 /// Create a call.
@@ -238,7 +238,7 @@ public class Echo_EchoUpdateCall {
238238 }
239239
240240 /// Call this to wait for a result. Blocking.
241- public func receive( ) throws -> Echo_EchoResponse {
241+ internal func receive( ) throws -> Echo_EchoResponse {
242242 var returnError : Echo_EchoClientError ?
243243 var returnMessage : Echo_EchoResponse !
244244 let sem = DispatchSemaphore ( value: 0 )
@@ -257,7 +257,7 @@ public class Echo_EchoUpdateCall {
257257 }
258258
259259 /// Call this to wait for a result. Nonblocking.
260- public func receive( completion: @escaping ( Echo_EchoResponse ? , Echo_EchoClientError ? ) -> ( ) ) throws {
260+ internal func receive( completion: @escaping ( Echo_EchoResponse ? , Echo_EchoClientError ? ) -> ( ) ) throws {
261261 do {
262262 try call. receiveMessage ( ) { ( data) in
263263 if let data = data {
@@ -274,13 +274,13 @@ public class Echo_EchoUpdateCall {
274274 }
275275
276276 /// Call this to send each message in the request stream.
277- public func send( _ message: Echo_EchoRequest , errorHandler: @escaping ( Error ) -> ( ) ) throws {
277+ internal func send( _ message: Echo_EchoRequest , errorHandler: @escaping ( Error ) -> ( ) ) throws {
278278 let messageData = try message. serializedData ( )
279279 try call. sendMessage ( data: messageData, errorHandler: errorHandler)
280280 }
281281
282282 /// Call this to close the sending connection. Blocking.
283- public func closeSend( ) throws {
283+ internal func closeSend( ) throws {
284284 let sem = DispatchSemaphore ( value: 0 )
285285 try closeSend ( ) {
286286 sem. signal ( )
@@ -289,24 +289,24 @@ public class Echo_EchoUpdateCall {
289289 }
290290
291291 /// Call this to close the sending connection. Nonblocking.
292- public func closeSend( completion: @escaping ( ) -> ( ) ) throws {
292+ internal func closeSend( completion: @escaping ( ) -> ( ) ) throws {
293293 try call. close ( ) {
294294 completion ( )
295295 }
296296 }
297297}
298298
299299/// Call methods of this class to make API calls.
300- public class Echo_EchoService {
300+ internal class Echo_EchoService {
301301 private var channel : Channel
302302
303303 /// This metadata will be sent with all requests.
304- public var metadata : Metadata
304+ internal var metadata : Metadata
305305
306306 /// This property allows the service host name to be overridden.
307307 /// For example, it can be used to make calls to "localhost:8080"
308308 /// appear to be to "example.com".
309- public var host : String {
309+ internal var host : String {
310310 get {
311311 return self . channel. host
312312 }
@@ -316,27 +316,27 @@ public class Echo_EchoService {
316316 }
317317
318318 /// Create a client that makes insecure connections.
319- public init ( address: String ) {
319+ internal init ( address: String ) {
320320 gRPC. initialize ( )
321321 channel = Channel ( address: address)
322322 metadata = Metadata ( )
323323 }
324324
325325 /// Create a client that makes secure connections.
326- public init ( address: String , certificates: String ? , host: String ? ) {
326+ internal init ( address: String , certificates: String ? , host: String ? ) {
327327 gRPC. initialize ( )
328328 channel = Channel ( address: address, certificates: certificates, host: host)
329329 metadata = Metadata ( )
330330 }
331331
332332 /// Synchronous. Unary.
333- public func get( _ request: Echo_EchoRequest )
333+ internal func get( _ request: Echo_EchoRequest )
334334 throws
335335 -> Echo_EchoResponse {
336336 return try Echo_EchoGetCall ( channel) . run ( request: request, metadata: metadata)
337337 }
338338 /// Asynchronous. Unary.
339- public func get( _ request: Echo_EchoRequest ,
339+ internal func get( _ request: Echo_EchoRequest ,
340340 completion: @escaping ( Echo_EchoResponse ? , CallResult ) -> ( ) )
341341 throws
342342 -> Echo_EchoGetCall {
@@ -347,23 +347,23 @@ public class Echo_EchoService {
347347 /// Asynchronous. Server-streaming.
348348 /// Send the initial message.
349349 /// Use methods on the returned object to get streamed responses.
350- public func expand( _ request: Echo_EchoRequest , completion: @escaping ( CallResult ) -> ( ) )
350+ internal func expand( _ request: Echo_EchoRequest , completion: @escaping ( CallResult ) -> ( ) )
351351 throws
352352 -> Echo_EchoExpandCall {
353353 return try Echo_EchoExpandCall ( channel) . start ( request: request, metadata: metadata, completion: completion)
354354 }
355355 /// Asynchronous. Client-streaming.
356356 /// Use methods on the returned object to stream messages and
357357 /// to close the connection and wait for a final response.
358- public func collect( completion: @escaping ( CallResult ) -> ( ) )
358+ internal func collect( completion: @escaping ( CallResult ) -> ( ) )
359359 throws
360360 -> Echo_EchoCollectCall {
361361 return try Echo_EchoCollectCall ( channel) . start ( metadata: metadata, completion: completion)
362362 }
363363 /// Asynchronous. Bidirectional-streaming.
364364 /// Use methods on the returned object to stream messages,
365365 /// to wait for replies, and to close the connection.
366- public func update( completion: @escaping ( CallResult ) -> ( ) )
366+ internal func update( completion: @escaping ( CallResult ) -> ( ) )
367367 throws
368368 -> Echo_EchoUpdateCall {
369369 return try Echo_EchoUpdateCall ( channel) . start ( metadata: metadata, completion: completion)
0 commit comments