Skip to content

Commit 7f44016

Browse files
authored
Fix naming (#4)
Motivation: Some names were changed in grpc/grpc-swift#2076 which we need to update here. Modifications: - Update names of request/response types - Regenerate code Result: Compiles
1 parent 143ea6c commit 7f44016

File tree

11 files changed

+318
-318
lines changed

11 files changed

+318
-318
lines changed

Sources/GRPCHealthService/Generated/health.grpc.swift

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ package enum Grpc_Health_V1_Health {
5252
]
5353
}
5454
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
55-
package typealias StreamingServiceProtocol = Grpc_Health_V1_HealthStreamingServiceProtocol
55+
package typealias StreamingServiceProtocol = Grpc_Health_V1_Health_StreamingServiceProtocol
5656
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
57-
package typealias ServiceProtocol = Grpc_Health_V1_HealthServiceProtocol
57+
package typealias ServiceProtocol = Grpc_Health_V1_Health_ServiceProtocol
5858
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
59-
package typealias ClientProtocol = Grpc_Health_V1_HealthClientProtocol
59+
package typealias ClientProtocol = Grpc_Health_V1_Health_ClientProtocol
6060
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
61-
package typealias Client = Grpc_Health_V1_HealthClient
61+
package typealias Client = Grpc_Health_V1_Health_Client
6262
}
6363

6464
extension GRPCCore.ServiceDescriptor {
@@ -72,7 +72,7 @@ extension GRPCCore.ServiceDescriptor {
7272
/// RPCs. Its semantics are documented in
7373
/// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
7474
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
75-
package protocol Grpc_Health_V1_HealthStreamingServiceProtocol: GRPCCore.RegistrableRPCService {
75+
package protocol Grpc_Health_V1_Health_StreamingServiceProtocol: GRPCCore.RegistrableRPCService {
7676
/// Check gets the health of the specified service. If the requested service
7777
/// is unknown, the call will fail with status NOT_FOUND. If the caller does
7878
/// not specify a service name, the server should respond with its overall
@@ -83,9 +83,9 @@ package protocol Grpc_Health_V1_HealthStreamingServiceProtocol: GRPCCore.Registr
8383
///
8484
/// Check implementations should be idempotent and side effect free.
8585
func check(
86-
request: GRPCCore.ServerRequest.Stream<Grpc_Health_V1_HealthCheckRequest>,
86+
request: GRPCCore.StreamingServerRequest<Grpc_Health_V1_HealthCheckRequest>,
8787
context: GRPCCore.ServerContext
88-
) async throws -> GRPCCore.ServerResponse.Stream<Grpc_Health_V1_HealthCheckResponse>
88+
) async throws -> GRPCCore.StreamingServerResponse<Grpc_Health_V1_HealthCheckResponse>
8989

9090
/// Performs a watch for the serving status of the requested service.
9191
/// The server will immediately send back a message indicating the current
@@ -103,9 +103,9 @@ package protocol Grpc_Health_V1_HealthStreamingServiceProtocol: GRPCCore.Registr
103103
/// call. If the call terminates with any other status (including OK),
104104
/// clients should retry the call with appropriate exponential backoff.
105105
func watch(
106-
request: GRPCCore.ServerRequest.Stream<Grpc_Health_V1_HealthCheckRequest>,
106+
request: GRPCCore.StreamingServerRequest<Grpc_Health_V1_HealthCheckRequest>,
107107
context: GRPCCore.ServerContext
108-
) async throws -> GRPCCore.ServerResponse.Stream<Grpc_Health_V1_HealthCheckResponse>
108+
) async throws -> GRPCCore.StreamingServerResponse<Grpc_Health_V1_HealthCheckResponse>
109109
}
110110

111111
/// Conformance to `GRPCCore.RegistrableRPCService`.
@@ -142,7 +142,7 @@ extension Grpc_Health_V1_Health.StreamingServiceProtocol {
142142
/// RPCs. Its semantics are documented in
143143
/// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
144144
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
145-
package protocol Grpc_Health_V1_HealthServiceProtocol: Grpc_Health_V1_Health.StreamingServiceProtocol {
145+
package protocol Grpc_Health_V1_Health_ServiceProtocol: Grpc_Health_V1_Health.StreamingServiceProtocol {
146146
/// Check gets the health of the specified service. If the requested service
147147
/// is unknown, the call will fail with status NOT_FOUND. If the caller does
148148
/// not specify a service name, the server should respond with its overall
@@ -153,9 +153,9 @@ package protocol Grpc_Health_V1_HealthServiceProtocol: Grpc_Health_V1_Health.Str
153153
///
154154
/// Check implementations should be idempotent and side effect free.
155155
func check(
156-
request: GRPCCore.ServerRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
156+
request: GRPCCore.ServerRequest<Grpc_Health_V1_HealthCheckRequest>,
157157
context: GRPCCore.ServerContext
158-
) async throws -> GRPCCore.ServerResponse.Single<Grpc_Health_V1_HealthCheckResponse>
158+
) async throws -> GRPCCore.ServerResponse<Grpc_Health_V1_HealthCheckResponse>
159159

160160
/// Performs a watch for the serving status of the requested service.
161161
/// The server will immediately send back a message indicating the current
@@ -173,31 +173,31 @@ package protocol Grpc_Health_V1_HealthServiceProtocol: Grpc_Health_V1_Health.Str
173173
/// call. If the call terminates with any other status (including OK),
174174
/// clients should retry the call with appropriate exponential backoff.
175175
func watch(
176-
request: GRPCCore.ServerRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
176+
request: GRPCCore.ServerRequest<Grpc_Health_V1_HealthCheckRequest>,
177177
context: GRPCCore.ServerContext
178-
) async throws -> GRPCCore.ServerResponse.Stream<Grpc_Health_V1_HealthCheckResponse>
178+
) async throws -> GRPCCore.StreamingServerResponse<Grpc_Health_V1_HealthCheckResponse>
179179
}
180180

181-
/// Partial conformance to `Grpc_Health_V1_HealthStreamingServiceProtocol`.
181+
/// Partial conformance to `Grpc_Health_V1_Health_StreamingServiceProtocol`.
182182
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
183183
extension Grpc_Health_V1_Health.ServiceProtocol {
184184
package func check(
185-
request: GRPCCore.ServerRequest.Stream<Grpc_Health_V1_HealthCheckRequest>,
185+
request: GRPCCore.StreamingServerRequest<Grpc_Health_V1_HealthCheckRequest>,
186186
context: GRPCCore.ServerContext
187-
) async throws -> GRPCCore.ServerResponse.Stream<Grpc_Health_V1_HealthCheckResponse> {
187+
) async throws -> GRPCCore.StreamingServerResponse<Grpc_Health_V1_HealthCheckResponse> {
188188
let response = try await self.check(
189-
request: GRPCCore.ServerRequest.Single(stream: request),
189+
request: GRPCCore.ServerRequest(stream: request),
190190
context: context
191191
)
192-
return GRPCCore.ServerResponse.Stream(single: response)
192+
return GRPCCore.StreamingServerResponse(single: response)
193193
}
194194

195195
package func watch(
196-
request: GRPCCore.ServerRequest.Stream<Grpc_Health_V1_HealthCheckRequest>,
196+
request: GRPCCore.StreamingServerRequest<Grpc_Health_V1_HealthCheckRequest>,
197197
context: GRPCCore.ServerContext
198-
) async throws -> GRPCCore.ServerResponse.Stream<Grpc_Health_V1_HealthCheckResponse> {
198+
) async throws -> GRPCCore.StreamingServerResponse<Grpc_Health_V1_HealthCheckResponse> {
199199
let response = try await self.watch(
200-
request: GRPCCore.ServerRequest.Single(stream: request),
200+
request: GRPCCore.ServerRequest(stream: request),
201201
context: context
202202
)
203203
return response
@@ -208,7 +208,7 @@ extension Grpc_Health_V1_Health.ServiceProtocol {
208208
/// RPCs. Its semantics are documented in
209209
/// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
210210
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
211-
package protocol Grpc_Health_V1_HealthClientProtocol: Sendable {
211+
package protocol Grpc_Health_V1_Health_ClientProtocol: Sendable {
212212
/// Check gets the health of the specified service. If the requested service
213213
/// is unknown, the call will fail with status NOT_FOUND. If the caller does
214214
/// not specify a service name, the server should respond with its overall
@@ -219,11 +219,11 @@ package protocol Grpc_Health_V1_HealthClientProtocol: Sendable {
219219
///
220220
/// Check implementations should be idempotent and side effect free.
221221
func check<R>(
222-
request: GRPCCore.ClientRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
222+
request: GRPCCore.ClientRequest<Grpc_Health_V1_HealthCheckRequest>,
223223
serializer: some GRPCCore.MessageSerializer<Grpc_Health_V1_HealthCheckRequest>,
224224
deserializer: some GRPCCore.MessageDeserializer<Grpc_Health_V1_HealthCheckResponse>,
225225
options: GRPCCore.CallOptions,
226-
_ body: @Sendable @escaping (GRPCCore.ClientResponse.Single<Grpc_Health_V1_HealthCheckResponse>) async throws -> R
226+
_ body: @Sendable @escaping (GRPCCore.ClientResponse<Grpc_Health_V1_HealthCheckResponse>) async throws -> R
227227
) async throws -> R where R: Sendable
228228

229229
/// Performs a watch for the serving status of the requested service.
@@ -242,20 +242,20 @@ package protocol Grpc_Health_V1_HealthClientProtocol: Sendable {
242242
/// call. If the call terminates with any other status (including OK),
243243
/// clients should retry the call with appropriate exponential backoff.
244244
func watch<R>(
245-
request: GRPCCore.ClientRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
245+
request: GRPCCore.ClientRequest<Grpc_Health_V1_HealthCheckRequest>,
246246
serializer: some GRPCCore.MessageSerializer<Grpc_Health_V1_HealthCheckRequest>,
247247
deserializer: some GRPCCore.MessageDeserializer<Grpc_Health_V1_HealthCheckResponse>,
248248
options: GRPCCore.CallOptions,
249-
_ body: @Sendable @escaping (GRPCCore.ClientResponse.Stream<Grpc_Health_V1_HealthCheckResponse>) async throws -> R
249+
_ body: @Sendable @escaping (GRPCCore.StreamingClientResponse<Grpc_Health_V1_HealthCheckResponse>) async throws -> R
250250
) async throws -> R where R: Sendable
251251
}
252252

253253
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
254254
extension Grpc_Health_V1_Health.ClientProtocol {
255255
package func check<R>(
256-
request: GRPCCore.ClientRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
256+
request: GRPCCore.ClientRequest<Grpc_Health_V1_HealthCheckRequest>,
257257
options: GRPCCore.CallOptions = .defaults,
258-
_ body: @Sendable @escaping (GRPCCore.ClientResponse.Single<Grpc_Health_V1_HealthCheckResponse>) async throws -> R = {
258+
_ body: @Sendable @escaping (GRPCCore.ClientResponse<Grpc_Health_V1_HealthCheckResponse>) async throws -> R = {
259259
try $0.message
260260
}
261261
) async throws -> R where R: Sendable {
@@ -269,9 +269,9 @@ extension Grpc_Health_V1_Health.ClientProtocol {
269269
}
270270

271271
package func watch<R>(
272-
request: GRPCCore.ClientRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
272+
request: GRPCCore.ClientRequest<Grpc_Health_V1_HealthCheckRequest>,
273273
options: GRPCCore.CallOptions = .defaults,
274-
_ body: @Sendable @escaping (GRPCCore.ClientResponse.Stream<Grpc_Health_V1_HealthCheckResponse>) async throws -> R
274+
_ body: @Sendable @escaping (GRPCCore.StreamingClientResponse<Grpc_Health_V1_HealthCheckResponse>) async throws -> R
275275
) async throws -> R where R: Sendable {
276276
try await self.watch(
277277
request: request,
@@ -298,11 +298,11 @@ extension Grpc_Health_V1_Health.ClientProtocol {
298298
_ message: Grpc_Health_V1_HealthCheckRequest,
299299
metadata: GRPCCore.Metadata = [:],
300300
options: GRPCCore.CallOptions = .defaults,
301-
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse.Single<Grpc_Health_V1_HealthCheckResponse>) async throws -> Result = {
301+
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Grpc_Health_V1_HealthCheckResponse>) async throws -> Result = {
302302
try $0.message
303303
}
304304
) async throws -> Result where Result: Sendable {
305-
let request = GRPCCore.ClientRequest.Single<Grpc_Health_V1_HealthCheckRequest>(
305+
let request = GRPCCore.ClientRequest<Grpc_Health_V1_HealthCheckRequest>(
306306
message: message,
307307
metadata: metadata
308308
)
@@ -332,9 +332,9 @@ extension Grpc_Health_V1_Health.ClientProtocol {
332332
_ message: Grpc_Health_V1_HealthCheckRequest,
333333
metadata: GRPCCore.Metadata = [:],
334334
options: GRPCCore.CallOptions = .defaults,
335-
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse.Stream<Grpc_Health_V1_HealthCheckResponse>) async throws -> Result
335+
onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse<Grpc_Health_V1_HealthCheckResponse>) async throws -> Result
336336
) async throws -> Result where Result: Sendable {
337-
let request = GRPCCore.ClientRequest.Single<Grpc_Health_V1_HealthCheckRequest>(
337+
let request = GRPCCore.ClientRequest<Grpc_Health_V1_HealthCheckRequest>(
338338
message: message,
339339
metadata: metadata
340340
)
@@ -350,7 +350,7 @@ extension Grpc_Health_V1_Health.ClientProtocol {
350350
/// RPCs. Its semantics are documented in
351351
/// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
352352
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
353-
package struct Grpc_Health_V1_HealthClient: Grpc_Health_V1_Health.ClientProtocol {
353+
package struct Grpc_Health_V1_Health_Client: Grpc_Health_V1_Health.ClientProtocol {
354354
private let client: GRPCCore.GRPCClient
355355

356356
package init(wrapping client: GRPCCore.GRPCClient) {
@@ -367,11 +367,11 @@ package struct Grpc_Health_V1_HealthClient: Grpc_Health_V1_Health.ClientProtocol
367367
///
368368
/// Check implementations should be idempotent and side effect free.
369369
package func check<R>(
370-
request: GRPCCore.ClientRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
370+
request: GRPCCore.ClientRequest<Grpc_Health_V1_HealthCheckRequest>,
371371
serializer: some GRPCCore.MessageSerializer<Grpc_Health_V1_HealthCheckRequest>,
372372
deserializer: some GRPCCore.MessageDeserializer<Grpc_Health_V1_HealthCheckResponse>,
373373
options: GRPCCore.CallOptions = .defaults,
374-
_ body: @Sendable @escaping (GRPCCore.ClientResponse.Single<Grpc_Health_V1_HealthCheckResponse>) async throws -> R = {
374+
_ body: @Sendable @escaping (GRPCCore.ClientResponse<Grpc_Health_V1_HealthCheckResponse>) async throws -> R = {
375375
try $0.message
376376
}
377377
) async throws -> R where R: Sendable {
@@ -401,11 +401,11 @@ package struct Grpc_Health_V1_HealthClient: Grpc_Health_V1_Health.ClientProtocol
401401
/// call. If the call terminates with any other status (including OK),
402402
/// clients should retry the call with appropriate exponential backoff.
403403
package func watch<R>(
404-
request: GRPCCore.ClientRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
404+
request: GRPCCore.ClientRequest<Grpc_Health_V1_HealthCheckRequest>,
405405
serializer: some GRPCCore.MessageSerializer<Grpc_Health_V1_HealthCheckRequest>,
406406
deserializer: some GRPCCore.MessageDeserializer<Grpc_Health_V1_HealthCheckResponse>,
407407
options: GRPCCore.CallOptions = .defaults,
408-
_ body: @Sendable @escaping (GRPCCore.ClientResponse.Stream<Grpc_Health_V1_HealthCheckResponse>) async throws -> R
408+
_ body: @Sendable @escaping (GRPCCore.StreamingClientResponse<Grpc_Health_V1_HealthCheckResponse>) async throws -> R
409409
) async throws -> R where R: Sendable {
410410
try await self.client.serverStreaming(
411411
request: request,

Sources/GRPCHealthService/HealthService.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ internal import GRPCCore
1818
private import Synchronization
1919

2020
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
21-
internal struct HealthService: Grpc_Health_V1_HealthServiceProtocol {
21+
internal struct HealthService: Grpc_Health_V1_Health_ServiceProtocol {
2222
private let state = HealthService.State()
2323

2424
func check(
25-
request: ServerRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
25+
request: ServerRequest<Grpc_Health_V1_HealthCheckRequest>,
2626
context: ServerContext
27-
) async throws -> ServerResponse.Single<Grpc_Health_V1_HealthCheckResponse> {
27+
) async throws -> ServerResponse<Grpc_Health_V1_HealthCheckResponse> {
2828
let service = request.message.service
2929

3030
guard let status = self.state.currentStatus(ofService: service) else {
@@ -34,19 +34,19 @@ internal struct HealthService: Grpc_Health_V1_HealthServiceProtocol {
3434
var response = Grpc_Health_V1_HealthCheckResponse()
3535
response.status = status
3636

37-
return ServerResponse.Single(message: response)
37+
return ServerResponse(message: response)
3838
}
3939

4040
func watch(
41-
request: ServerRequest.Single<Grpc_Health_V1_HealthCheckRequest>,
41+
request: ServerRequest<Grpc_Health_V1_HealthCheckRequest>,
4242
context: ServerContext
43-
) async -> ServerResponse.Stream<Grpc_Health_V1_HealthCheckResponse> {
43+
) async -> StreamingServerResponse<Grpc_Health_V1_HealthCheckResponse> {
4444
let service = request.message.service
4545
let statuses = AsyncStream.makeStream(of: Grpc_Health_V1_HealthCheckResponse.ServingStatus.self)
4646

4747
self.state.addContinuation(statuses.continuation, forService: service)
4848

49-
return ServerResponse.Stream(of: Grpc_Health_V1_HealthCheckResponse.self) { writer in
49+
return StreamingServerResponse(of: Grpc_Health_V1_HealthCheckResponse.self) { writer in
5050
var response = Grpc_Health_V1_HealthCheckResponse()
5151

5252
for await status in statuses.stream {

Sources/GRPCInterceptors/ClientTracingInterceptor.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ public struct ClientTracingInterceptor: ClientInterceptor {
4444
/// Which key-value pairs are injected will depend on the specific tracing implementation
4545
/// that has been configured when bootstrapping `swift-distributed-tracing` in your application.
4646
public func intercept<Input, Output>(
47-
request: ClientRequest.Stream<Input>,
47+
request: StreamingClientRequest<Input>,
4848
context: ClientContext,
4949
next: (
50-
ClientRequest.Stream<Input>,
50+
StreamingClientRequest<Input>,
5151
ClientContext
52-
) async throws -> ClientResponse.Stream<Output>
53-
) async throws -> ClientResponse.Stream<Output> where Input: Sendable, Output: Sendable {
52+
) async throws -> StreamingClientResponse<Output>
53+
) async throws -> StreamingClientResponse<Output> where Input: Sendable, Output: Sendable {
5454
var request = request
5555
let tracer = InstrumentationSystem.tracer
5656
let serviceContext = ServiceContext.current ?? .topLevel
@@ -92,7 +92,7 @@ public struct ClientTracingInterceptor: ClientInterceptor {
9292
}
9393
}
9494

95-
var response: ClientResponse.Stream<Output>
95+
var response: StreamingClientResponse<Output>
9696
do {
9797
response = try await next(request, context)
9898
} catch {

Sources/GRPCInterceptors/ServerTracingInterceptor.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public struct ServerTracingInterceptor: ServerInterceptor {
4343
/// Which key-value pairs are extracted and made available will depend on the specific tracing implementation
4444
/// that has been configured when bootstrapping `swift-distributed-tracing` in your application.
4545
public func intercept<Input, Output>(
46-
request: ServerRequest.Stream<Input>,
46+
request: StreamingServerRequest<Input>,
4747
context: ServerContext,
48-
next: @Sendable (ServerRequest.Stream<Input>, ServerContext) async throws ->
49-
ServerResponse.Stream<Output>
50-
) async throws -> ServerResponse.Stream<Output> where Input: Sendable, Output: Sendable {
48+
next: @Sendable (StreamingServerRequest<Input>, ServerContext) async throws ->
49+
StreamingServerResponse<Output>
50+
) async throws -> StreamingServerResponse<Output> where Input: Sendable, Output: Sendable {
5151
var serviceContext = ServiceContext.topLevel
5252
let tracer = InstrumentationSystem.tracer
5353

0 commit comments

Comments
 (0)