23
23
24
24
public import GRPCCore
25
25
internal import GRPCProtobuf
26
+ public import SwiftProtobuf
26
27
28
+ // MARK: - grpc.testing.EmptyService
29
+
30
+ /// Namespace containing generated types for the "grpc.testing.EmptyService" service.
27
31
public enum Grpc_Testing_EmptyService {
28
- public static let descriptor = GRPCCore . ServiceDescriptor. grpc_testing_EmptyService
32
+ /// Service descriptor for the "grpc.testing.EmptyService" service.
33
+ public static let descriptor = GRPCCore . ServiceDescriptor ( fullyQualifiedService: " grpc.testing.EmptyService " )
34
+ /// Namespace for method metadata.
29
35
public enum Method {
36
+ /// Descriptors for all methods in the "grpc.testing.EmptyService" service.
30
37
public static let descriptors : [ GRPCCore . MethodDescriptor ] = [ ]
31
38
}
32
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
33
- public typealias StreamingServiceProtocol = Grpc_Testing_EmptyService_StreamingServiceProtocol
34
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
35
- public typealias ServiceProtocol = Grpc_Testing_EmptyService_ServiceProtocol
36
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
37
- public typealias ClientProtocol = Grpc_Testing_EmptyService_ClientProtocol
38
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
39
- public typealias Client = Grpc_Testing_EmptyService_Client
40
39
}
41
40
42
41
extension GRPCCore . ServiceDescriptor {
43
- public static let grpc_testing_EmptyService = Self (
44
- package : " grpc.testing " ,
45
- service: " EmptyService "
46
- )
42
+ /// Service descriptor for the "grpc.testing.EmptyService" service.
43
+ public static let grpc_testing_EmptyService = GRPCCore . ServiceDescriptor ( fullyQualifiedService: " grpc.testing.EmptyService " )
47
44
}
48
45
49
- /// A service that has zero methods.
50
- /// See https://github.com/grpc/grpc/issues/15574
51
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
52
- public protocol Grpc_Testing_EmptyService_StreamingServiceProtocol : GRPCCore . RegistrableRPCService { }
46
+ // MARK: grpc.testing.EmptyService (server)
47
+
48
+ extension Grpc_Testing_EmptyService {
49
+ /// Streaming variant of the service protocol for the "grpc.testing.EmptyService" service.
50
+ ///
51
+ /// This protocol is the lowest-level of the service protocols generated for this service
52
+ /// giving you the most flexibility over the implementation of your service. This comes at
53
+ /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in
54
+ /// terms of a request stream and response stream. Where only a single request or response
55
+ /// message is expected, you are responsible for enforcing this invariant is maintained.
56
+ ///
57
+ /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol``
58
+ /// or ``SimpleServiceProtocol`` instead.
59
+ ///
60
+ /// > Source IDL Documentation:
61
+ /// >
62
+ /// > A service that has zero methods.
63
+ /// > See https://github.com/grpc/grpc/issues/15574
64
+ public protocol StreamingServiceProtocol : GRPCCore . RegistrableRPCService { }
53
65
54
- /// Conformance to `GRPCCore.RegistrableRPCService`.
55
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
66
+ /// Service protocol for the "grpc.testing.EmptyService" service.
67
+ ///
68
+ /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than
69
+ /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and
70
+ /// trailing response metadata. If you don't need these then consider using
71
+ /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then
72
+ /// use ``StreamingServiceProtocol``.
73
+ ///
74
+ /// > Source IDL Documentation:
75
+ /// >
76
+ /// > A service that has zero methods.
77
+ /// > See https://github.com/grpc/grpc/issues/15574
78
+ public protocol ServiceProtocol : Grpc_Testing_EmptyService . StreamingServiceProtocol { }
79
+
80
+ /// Simple service protocol for the "grpc.testing.EmptyService" service.
81
+ ///
82
+ /// This is the highest level protocol for the service. The API is the easiest to use but
83
+ /// doesn't provide access to request or response metadata. If you need access to these
84
+ /// then use ``ServiceProtocol`` instead.
85
+ ///
86
+ /// > Source IDL Documentation:
87
+ /// >
88
+ /// > A service that has zero methods.
89
+ /// > See https://github.com/grpc/grpc/issues/15574
90
+ public protocol SimpleServiceProtocol : Grpc_Testing_EmptyService . ServiceProtocol { }
91
+ }
92
+
93
+ // Default implementation of 'registerMethods(with:)'.
56
94
extension Grpc_Testing_EmptyService . StreamingServiceProtocol {
57
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
58
95
public func registerMethods( with router: inout GRPCCore . RPCRouter ) { }
59
96
}
60
97
61
- /// A service that has zero methods.
62
- /// See https://github.com/grpc/grpc/issues/15574
63
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
64
- public protocol Grpc_Testing_EmptyService_ServiceProtocol : Grpc_Testing_EmptyService . StreamingServiceProtocol { }
65
-
66
- /// Partial conformance to `Grpc_Testing_EmptyService_StreamingServiceProtocol`.
67
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
98
+ // Default implementation of streaming methods from 'StreamingServiceProtocol'.
68
99
extension Grpc_Testing_EmptyService . ServiceProtocol {
69
100
}
70
101
71
- /// A service that has zero methods.
72
- /// See https://github.com/grpc/grpc/issues/15574
73
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
74
- public protocol Grpc_Testing_EmptyService_ClientProtocol : Sendable { }
102
+ // Default implementation of methods from 'ServiceProtocol'.
103
+ extension Grpc_Testing_EmptyService . SimpleServiceProtocol {
104
+ }
105
+
106
+ // MARK: grpc.testing.EmptyService (client)
75
107
76
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
77
- extension Grpc_Testing_EmptyService . ClientProtocol {
108
+ extension Grpc_Testing_EmptyService {
109
+ /// Generated client protocol for the "grpc.testing.EmptyService" service.
110
+ ///
111
+ /// You don't need to implement this protocol directly, use the generated
112
+ /// implementation, ``Client``.
113
+ ///
114
+ /// > Source IDL Documentation:
115
+ /// >
116
+ /// > A service that has zero methods.
117
+ /// > See https://github.com/grpc/grpc/issues/15574
118
+ public protocol ClientProtocol : Sendable { }
119
+
120
+ /// Generated client for the "grpc.testing.EmptyService" service.
121
+ ///
122
+ /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps
123
+ /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived
124
+ /// means of communication with the remote peer.
125
+ ///
126
+ /// > Source IDL Documentation:
127
+ /// >
128
+ /// > A service that has zero methods.
129
+ /// > See https://github.com/grpc/grpc/issues/15574
130
+ public struct Client : ClientProtocol {
131
+ private let client : GRPCCore . GRPCClient
132
+
133
+ /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`.
134
+ ///
135
+ /// - Parameters:
136
+ /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service.
137
+ public init ( wrapping client: GRPCCore . GRPCClient ) {
138
+ self . client = client
139
+ }
140
+ }
78
141
}
79
142
80
- @ available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
143
+ // Helpers providing default arguments to 'ClientProtocol' methods.
81
144
extension Grpc_Testing_EmptyService . ClientProtocol {
82
145
}
83
146
84
- /// A service that has zero methods.
85
- /// See https://github.com/grpc/grpc/issues/15574
86
- @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
87
- public struct Grpc_Testing_EmptyService_Client : Grpc_Testing_EmptyService . ClientProtocol {
88
- private let client : GRPCCore . GRPCClient
89
-
90
- public init ( wrapping client: GRPCCore . GRPCClient ) {
91
- self . client = client
92
- }
147
+ // Helpers providing sugared APIs for 'ClientProtocol' methods.
148
+ extension Grpc_Testing_EmptyService . ClientProtocol {
93
149
}
0 commit comments