Skip to content

Commit 51be432

Browse files
authored
Update generated code (#13)
Motivation: The generated code changed a little. Modifications: Update generated code Result: Generated code is up-to-date.
1 parent 7c9a904 commit 51be432

File tree

6 files changed

+2924
-1140
lines changed

6 files changed

+2924
-1140
lines changed

Sources/GRPCHealthService/Generated/health.grpc.swift

Lines changed: 575 additions & 244 deletions
Large diffs are not rendered by default.

Sources/GRPCHealthService/HealthService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
internal import GRPCCore
1818
private import Synchronization
1919

20-
internal struct HealthService: Grpc_Health_V1_Health_ServiceProtocol {
20+
internal struct HealthService: Grpc_Health_V1_Health.ServiceProtocol {
2121
private let state = HealthService.State()
2222

2323
func check(

Sources/GRPCInteropTests/Generated/empty_service.grpc.swift

Lines changed: 99 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -23,71 +23,127 @@
2323

2424
public import GRPCCore
2525
internal import GRPCProtobuf
26+
public import SwiftProtobuf
2627

28+
// MARK: - grpc.testing.EmptyService
29+
30+
/// Namespace containing generated types for the "grpc.testing.EmptyService" service.
2731
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.
2935
public enum Method {
36+
/// Descriptors for all methods in the "grpc.testing.EmptyService" service.
3037
public static let descriptors: [GRPCCore.MethodDescriptor] = []
3138
}
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
4039
}
4140

4241
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")
4744
}
4845

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 {}
5365

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:)'.
5694
extension Grpc_Testing_EmptyService.StreamingServiceProtocol {
57-
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
5895
public func registerMethods(with router: inout GRPCCore.RPCRouter) {}
5996
}
6097

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'.
6899
extension Grpc_Testing_EmptyService.ServiceProtocol {
69100
}
70101

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)
75107

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+
}
78141
}
79142

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.
81144
extension Grpc_Testing_EmptyService.ClientProtocol {
82145
}
83146

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 {
93149
}

0 commit comments

Comments
 (0)