From f2460396c8afa25d69c4b223209a58b652b92879 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Wed, 25 Sep 2024 12:44:50 +0100 Subject: [PATCH] Update examples Motivation: In #2072 the code gen was changed to add an underscore to the generated names. This wasn't picked up in CI because the examples depend on "main" at the moment. Modifications: - Update examples Result: CI passes --- .../echo/Sources/Generated/echo.grpc.swift | 18 +++++++++--------- .../echo/Sources/Subcommands/Collect.swift | 2 +- Examples/echo/Sources/Subcommands/Expand.swift | 2 +- Examples/echo/Sources/Subcommands/Get.swift | 2 +- Examples/echo/Sources/Subcommands/Serve.swift | 2 +- Examples/echo/Sources/Subcommands/Update.swift | 2 +- .../Sources/Generated/helloworld.grpc.swift | 18 +++++++++--------- .../Sources/Subcommands/Greet.swift | 2 +- .../Sources/Subcommands/Serve.swift | 2 +- .../Sources/Generated/route_guide.grpc.swift | 18 +++++++++--------- .../Sources/Subcommands/GetFeature.swift | 2 +- .../Sources/Subcommands/ListFeatures.swift | 2 +- .../Sources/Subcommands/RecordRoute.swift | 2 +- .../Sources/Subcommands/RouteChat.swift | 2 +- 14 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Examples/echo/Sources/Generated/echo.grpc.swift b/Examples/echo/Sources/Generated/echo.grpc.swift index 63a264205..a782d7d4a 100644 --- a/Examples/echo/Sources/Generated/echo.grpc.swift +++ b/Examples/echo/Sources/Generated/echo.grpc.swift @@ -67,13 +67,13 @@ internal enum Echo_Echo { ] } @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias StreamingServiceProtocol = Echo_EchoStreamingServiceProtocol + internal typealias StreamingServiceProtocol = Echo_Echo_StreamingServiceProtocol @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias ServiceProtocol = Echo_EchoServiceProtocol + internal typealias ServiceProtocol = Echo_Echo_ServiceProtocol @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias ClientProtocol = Echo_EchoClientProtocol + internal typealias ClientProtocol = Echo_Echo_ClientProtocol @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias Client = Echo_EchoClient + internal typealias Client = Echo_Echo_Client } extension GRPCCore.ServiceDescriptor { @@ -84,7 +84,7 @@ extension GRPCCore.ServiceDescriptor { } @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal protocol Echo_EchoStreamingServiceProtocol: GRPCCore.RegistrableRPCService { +internal protocol Echo_Echo_StreamingServiceProtocol: GRPCCore.RegistrableRPCService { /// Immediately returns an echo of a request. func get( request: GRPCCore.ServerRequest.Stream, @@ -163,7 +163,7 @@ extension Echo_Echo.StreamingServiceProtocol { } @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal protocol Echo_EchoServiceProtocol: Echo_Echo.StreamingServiceProtocol { +internal protocol Echo_Echo_ServiceProtocol: Echo_Echo.StreamingServiceProtocol { /// Immediately returns an echo of a request. func get( request: GRPCCore.ServerRequest.Single, @@ -189,7 +189,7 @@ internal protocol Echo_EchoServiceProtocol: Echo_Echo.StreamingServiceProtocol { ) async throws -> GRPCCore.ServerResponse.Stream } -/// Partial conformance to `Echo_EchoStreamingServiceProtocol`. +/// Partial conformance to `Echo_Echo_StreamingServiceProtocol`. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) extension Echo_Echo.ServiceProtocol { internal func get( @@ -227,7 +227,7 @@ extension Echo_Echo.ServiceProtocol { } @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal protocol Echo_EchoClientProtocol: Sendable { +internal protocol Echo_Echo_ClientProtocol: Sendable { /// Immediately returns an echo of a request. func get( request: GRPCCore.ClientRequest.Single, @@ -408,7 +408,7 @@ extension Echo_Echo.ClientProtocol { } @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal struct Echo_EchoClient: Echo_Echo.ClientProtocol { +internal struct Echo_Echo_Client: Echo_Echo.ClientProtocol { private let client: GRPCCore.GRPCClient internal init(wrapping client: GRPCCore.GRPCClient) { diff --git a/Examples/echo/Sources/Subcommands/Collect.swift b/Examples/echo/Sources/Subcommands/Collect.swift index 6022d8a2d..d105237c3 100644 --- a/Examples/echo/Sources/Subcommands/Collect.swift +++ b/Examples/echo/Sources/Subcommands/Collect.swift @@ -39,7 +39,7 @@ struct Collect: AsyncParsableCommand { try await client.run() } - let echo = Echo_EchoClient(wrapping: client) + let echo = Echo_Echo_Client(wrapping: client) for _ in 0 ..< self.arguments.repetitions { let message = try await echo.collect { writer in diff --git a/Examples/echo/Sources/Subcommands/Expand.swift b/Examples/echo/Sources/Subcommands/Expand.swift index d2e48bbf3..72285dc08 100644 --- a/Examples/echo/Sources/Subcommands/Expand.swift +++ b/Examples/echo/Sources/Subcommands/Expand.swift @@ -39,7 +39,7 @@ struct Expand: AsyncParsableCommand { try await client.run() } - let echo = Echo_EchoClient(wrapping: client) + let echo = Echo_Echo_Client(wrapping: client) for _ in 0 ..< self.arguments.repetitions { let message = Echo_EchoRequest.with { $0.text = self.arguments.message } diff --git a/Examples/echo/Sources/Subcommands/Get.swift b/Examples/echo/Sources/Subcommands/Get.swift index ea69bc5f3..242e4b0a1 100644 --- a/Examples/echo/Sources/Subcommands/Get.swift +++ b/Examples/echo/Sources/Subcommands/Get.swift @@ -37,7 +37,7 @@ struct Get: AsyncParsableCommand { try await client.run() } - let echo = Echo_EchoClient(wrapping: client) + let echo = Echo_Echo_Client(wrapping: client) for _ in 0 ..< self.arguments.repetitions { let message = Echo_EchoRequest.with { $0.text = self.arguments.message } diff --git a/Examples/echo/Sources/Subcommands/Serve.swift b/Examples/echo/Sources/Subcommands/Serve.swift index 6ea8648cb..b5e126788 100644 --- a/Examples/echo/Sources/Subcommands/Serve.swift +++ b/Examples/echo/Sources/Subcommands/Serve.swift @@ -43,7 +43,7 @@ struct Serve: AsyncParsableCommand { } @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -struct EchoService: Echo_EchoServiceProtocol { +struct EchoService: Echo_Echo_ServiceProtocol { func get( request: ServerRequest.Single, context: ServerContext diff --git a/Examples/echo/Sources/Subcommands/Update.swift b/Examples/echo/Sources/Subcommands/Update.swift index 1b4c81d00..2166a6aa1 100644 --- a/Examples/echo/Sources/Subcommands/Update.swift +++ b/Examples/echo/Sources/Subcommands/Update.swift @@ -39,7 +39,7 @@ struct Update: AsyncParsableCommand { try await client.run() } - let echo = Echo_EchoClient(wrapping: client) + let echo = Echo_Echo_Client(wrapping: client) for _ in 0 ..< self.arguments.repetitions { try await echo.update { writer in diff --git a/Examples/hello-world/Sources/Generated/helloworld.grpc.swift b/Examples/hello-world/Sources/Generated/helloworld.grpc.swift index 8044411e5..7ae35011b 100644 --- a/Examples/hello-world/Sources/Generated/helloworld.grpc.swift +++ b/Examples/hello-world/Sources/Generated/helloworld.grpc.swift @@ -40,13 +40,13 @@ internal enum Helloworld_Greeter { ] } @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias StreamingServiceProtocol = Helloworld_GreeterStreamingServiceProtocol + internal typealias StreamingServiceProtocol = Helloworld_Greeter_StreamingServiceProtocol @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias ServiceProtocol = Helloworld_GreeterServiceProtocol + internal typealias ServiceProtocol = Helloworld_Greeter_ServiceProtocol @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias ClientProtocol = Helloworld_GreeterClientProtocol + internal typealias ClientProtocol = Helloworld_Greeter_ClientProtocol @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias Client = Helloworld_GreeterClient + internal typealias Client = Helloworld_Greeter_Client } extension GRPCCore.ServiceDescriptor { @@ -58,7 +58,7 @@ extension GRPCCore.ServiceDescriptor { /// The greeting service definition. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal protocol Helloworld_GreeterStreamingServiceProtocol: GRPCCore.RegistrableRPCService { +internal protocol Helloworld_Greeter_StreamingServiceProtocol: GRPCCore.RegistrableRPCService { /// Sends a greeting func sayHello( request: GRPCCore.ServerRequest.Stream, @@ -87,7 +87,7 @@ extension Helloworld_Greeter.StreamingServiceProtocol { /// The greeting service definition. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal protocol Helloworld_GreeterServiceProtocol: Helloworld_Greeter.StreamingServiceProtocol { +internal protocol Helloworld_Greeter_ServiceProtocol: Helloworld_Greeter.StreamingServiceProtocol { /// Sends a greeting func sayHello( request: GRPCCore.ServerRequest.Single, @@ -95,7 +95,7 @@ internal protocol Helloworld_GreeterServiceProtocol: Helloworld_Greeter.Streamin ) async throws -> GRPCCore.ServerResponse.Single } -/// Partial conformance to `Helloworld_GreeterStreamingServiceProtocol`. +/// Partial conformance to `Helloworld_Greeter_StreamingServiceProtocol`. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) extension Helloworld_Greeter.ServiceProtocol { internal func sayHello( @@ -112,7 +112,7 @@ extension Helloworld_Greeter.ServiceProtocol { /// The greeting service definition. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal protocol Helloworld_GreeterClientProtocol: Sendable { +internal protocol Helloworld_Greeter_ClientProtocol: Sendable { /// Sends a greeting func sayHello( request: GRPCCore.ClientRequest.Single, @@ -167,7 +167,7 @@ extension Helloworld_Greeter.ClientProtocol { /// The greeting service definition. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal struct Helloworld_GreeterClient: Helloworld_Greeter.ClientProtocol { +internal struct Helloworld_Greeter_Client: Helloworld_Greeter.ClientProtocol { private let client: GRPCCore.GRPCClient internal init(wrapping client: GRPCCore.GRPCClient) { diff --git a/Examples/hello-world/Sources/Subcommands/Greet.swift b/Examples/hello-world/Sources/Subcommands/Greet.swift index 940a1c9cb..64d405863 100644 --- a/Examples/hello-world/Sources/Subcommands/Greet.swift +++ b/Examples/hello-world/Sources/Subcommands/Greet.swift @@ -44,7 +44,7 @@ struct Greet: AsyncParsableCommand { client.beginGracefulShutdown() } - let greeter = Helloworld_GreeterClient(wrapping: client) + let greeter = Helloworld_Greeter_Client(wrapping: client) let reply = try await greeter.sayHello(.with { $0.name = self.name }) print(reply.message) } diff --git a/Examples/hello-world/Sources/Subcommands/Serve.swift b/Examples/hello-world/Sources/Subcommands/Serve.swift index 75f083ece..6ae06d013 100644 --- a/Examples/hello-world/Sources/Subcommands/Serve.swift +++ b/Examples/hello-world/Sources/Subcommands/Serve.swift @@ -42,7 +42,7 @@ struct Serve: AsyncParsableCommand { } } -struct Greeter: Helloworld_GreeterServiceProtocol { +struct Greeter: Helloworld_Greeter_ServiceProtocol { func sayHello( request: ServerRequest.Single, context: ServerContext diff --git a/Examples/route-guide/Sources/Generated/route_guide.grpc.swift b/Examples/route-guide/Sources/Generated/route_guide.grpc.swift index 6a89ed2a3..3e9f77ffc 100644 --- a/Examples/route-guide/Sources/Generated/route_guide.grpc.swift +++ b/Examples/route-guide/Sources/Generated/route_guide.grpc.swift @@ -67,13 +67,13 @@ internal enum Routeguide_RouteGuide { ] } @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias StreamingServiceProtocol = Routeguide_RouteGuideStreamingServiceProtocol + internal typealias StreamingServiceProtocol = Routeguide_RouteGuide_StreamingServiceProtocol @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias ServiceProtocol = Routeguide_RouteGuideServiceProtocol + internal typealias ServiceProtocol = Routeguide_RouteGuide_ServiceProtocol @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias ClientProtocol = Routeguide_RouteGuideClientProtocol + internal typealias ClientProtocol = Routeguide_RouteGuide_ClientProtocol @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) - internal typealias Client = Routeguide_RouteGuideClient + internal typealias Client = Routeguide_RouteGuide_Client } extension GRPCCore.ServiceDescriptor { @@ -85,7 +85,7 @@ extension GRPCCore.ServiceDescriptor { /// Interface exported by the server. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal protocol Routeguide_RouteGuideStreamingServiceProtocol: GRPCCore.RegistrableRPCService { +internal protocol Routeguide_RouteGuide_StreamingServiceProtocol: GRPCCore.RegistrableRPCService { /// A simple RPC. /// /// Obtains the feature at a given position. @@ -181,7 +181,7 @@ extension Routeguide_RouteGuide.StreamingServiceProtocol { /// Interface exported by the server. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal protocol Routeguide_RouteGuideServiceProtocol: Routeguide_RouteGuide.StreamingServiceProtocol { +internal protocol Routeguide_RouteGuide_ServiceProtocol: Routeguide_RouteGuide.StreamingServiceProtocol { /// A simple RPC. /// /// Obtains the feature at a given position. @@ -223,7 +223,7 @@ internal protocol Routeguide_RouteGuideServiceProtocol: Routeguide_RouteGuide.St ) async throws -> GRPCCore.ServerResponse.Stream } -/// Partial conformance to `Routeguide_RouteGuideStreamingServiceProtocol`. +/// Partial conformance to `Routeguide_RouteGuide_StreamingServiceProtocol`. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) extension Routeguide_RouteGuide.ServiceProtocol { internal func getFeature( @@ -262,7 +262,7 @@ extension Routeguide_RouteGuide.ServiceProtocol { /// Interface exported by the server. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal protocol Routeguide_RouteGuideClientProtocol: Sendable { +internal protocol Routeguide_RouteGuide_ClientProtocol: Sendable { /// A simple RPC. /// /// Obtains the feature at a given position. @@ -476,7 +476,7 @@ extension Routeguide_RouteGuide.ClientProtocol { /// Interface exported by the server. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -internal struct Routeguide_RouteGuideClient: Routeguide_RouteGuide.ClientProtocol { +internal struct Routeguide_RouteGuide_Client: Routeguide_RouteGuide.ClientProtocol { private let client: GRPCCore.GRPCClient internal init(wrapping client: GRPCCore.GRPCClient) { diff --git a/Examples/route-guide/Sources/Subcommands/GetFeature.swift b/Examples/route-guide/Sources/Subcommands/GetFeature.swift index b3110e0c9..72ba1d1a4 100644 --- a/Examples/route-guide/Sources/Subcommands/GetFeature.swift +++ b/Examples/route-guide/Sources/Subcommands/GetFeature.swift @@ -47,7 +47,7 @@ struct GetFeature: AsyncParsableCommand { try await client.run() } - let routeGuide = Routeguide_RouteGuideClient(wrapping: client) + let routeGuide = Routeguide_RouteGuide_Client(wrapping: client) let point = Routeguide_Point.with { $0.latitude = self.latitude diff --git a/Examples/route-guide/Sources/Subcommands/ListFeatures.swift b/Examples/route-guide/Sources/Subcommands/ListFeatures.swift index 383eda154..7e83add71 100644 --- a/Examples/route-guide/Sources/Subcommands/ListFeatures.swift +++ b/Examples/route-guide/Sources/Subcommands/ListFeatures.swift @@ -61,7 +61,7 @@ struct ListFeatures: AsyncParsableCommand { try await client.run() } - let routeGuide = Routeguide_RouteGuideClient(wrapping: client) + let routeGuide = Routeguide_RouteGuide_Client(wrapping: client) let boundingRectangle = Routeguide_Rectangle.with { $0.lo.latitude = self.minLatitude $0.hi.latitude = self.maxLatitude diff --git a/Examples/route-guide/Sources/Subcommands/RecordRoute.swift b/Examples/route-guide/Sources/Subcommands/RecordRoute.swift index c3fcce361..7cdf30cd2 100644 --- a/Examples/route-guide/Sources/Subcommands/RecordRoute.swift +++ b/Examples/route-guide/Sources/Subcommands/RecordRoute.swift @@ -40,7 +40,7 @@ struct RecordRoute: AsyncParsableCommand { try await client.run() } - let routeGuide = Routeguide_RouteGuideClient(wrapping: client) + let routeGuide = Routeguide_RouteGuide_Client(wrapping: client) // Get all features. let rectangle = Routeguide_Rectangle.with { diff --git a/Examples/route-guide/Sources/Subcommands/RouteChat.swift b/Examples/route-guide/Sources/Subcommands/RouteChat.swift index 23266e3bf..3461e1f75 100644 --- a/Examples/route-guide/Sources/Subcommands/RouteChat.swift +++ b/Examples/route-guide/Sources/Subcommands/RouteChat.swift @@ -40,7 +40,7 @@ struct RouteChat: AsyncParsableCommand { try await client.run() } - let routeGuide = Routeguide_RouteGuideClient(wrapping: client) + let routeGuide = Routeguide_RouteGuide_Client(wrapping: client) try await routeGuide.routeChat { writer in let notes: [(String, (Int32, Int32))] = [