diff --git a/Libraries/Connect/Interfaces/ConnectError.swift b/Libraries/Connect/Interfaces/ConnectError.swift index e1a3ac1e..92c1ed79 100644 --- a/Libraries/Connect/Interfaces/ConnectError.swift +++ b/Libraries/Connect/Interfaces/ConnectError.swift @@ -73,6 +73,27 @@ public struct ConnectError: Swift.Error, Sendable { case payload = "value" } + public init(from decoder: Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + // Read the base64-encoded payload and then pad it if needed: + // Base64-encoded strings should be a length that is a multiple of four. If the + // original string is not, it should be padded with "=" to guard against a + // corrupted string. + let encodedPayload = try container.decodeIfPresent(String.self, forKey: .payload) ?? "" + let paddedPayload = encodedPayload.padding( + // Calculate the nearest multiple of 4 that is >= the length of encodedPayload, + // then pad the string to that length. + toLength: ((encodedPayload.count + 3) / 4) * 4, + withPad: "=", + startingAt: 0 + ) + self.init( + type: try container.decodeIfPresent(String.self, forKey: .type) ?? "", + payload: Data(base64Encoded: paddedPayload) + ) + } + public init(type: String, payload: Data?) { self.type = type self.payload = payload diff --git a/Makefile b/Makefile index 60380a88..24c53bab 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ MAKEFLAGS += --no-builtin-rules MAKEFLAGS += --no-print-directory BIN := .tmp/bin LICENSE_HEADER_YEAR_RANGE := 2022-2023 -CONFORMANCE_VERSION := 36ce5b0ce50bc8cb3314eee08a72eeda4c96721e +CONFORMANCE_VERSION := 8e6893a4b801c282eb6cf9ad03d38b993b66ca66 LICENSE_HEADER_VERSION := v1.12.0 LICENSE_IGNORE := -e Package.swift \ -e $(BIN)\/ \ @@ -47,10 +47,10 @@ conformanceserverstop: ## Stop the conformance server .PHONY: conformanceserverrun conformanceserverrun: conformanceserverstop ## Start the conformance server docker run --rm --name serverconnect -p 8080:8080 -p 8081:8081 -d \ - bufbuild/connect-crosstest:$(CONFORMANCE_VERSION) \ + connectrpc/conformance:$(CONFORMANCE_VERSION) \ /usr/local/bin/serverconnect --h1port "8080" --h2port "8081" --cert "cert/localhost.crt" --key "cert/localhost.key" docker run --rm --name servergrpc -p 8083:8083 -d \ - bufbuild/connect-crosstest:$(CONFORMANCE_VERSION) \ + connectrpc/conformance:$(CONFORMANCE_VERSION) \ /usr/local/bin/servergrpc --port "8083" --cert "cert/localhost.crt" --key "cert/localhost.key" .PHONY: generate diff --git a/README.md b/README.md index eb725549..dd001863 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ for details. - [connect-go][connect-go]: Go service stubs for servers - [connect-es][connect-es]: Type-safe APIs with Protobuf and TypeScript - [Buf Studio][buf-studio]: Web UI for ad-hoc RPCs -- [connect-conformance][connect-conformance]: Connect, gRPC, and gRPC-Web +- [conformance][connect-conformance]: Connect, gRPC, and gRPC-Web interoperability tests ## Status diff --git a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index 763ec921..56d26f6d 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -21,8 +21,8 @@ import XCTest private let kTimeout = TimeInterval(10.0) -private typealias TestServiceClient = Grpc_Testing_TestServiceClient -private typealias UnimplementedServiceClient = Grpc_Testing_UnimplementedServiceClient +private typealias TestServiceClient = Connectrpc_Conformance_V1_TestServiceClient +private typealias UnimplementedServiceClient = Connectrpc_Conformance_V1_UnimplementedServiceClient /// This test suite runs against multiple protocols and serialization formats. /// Tests are based on https://github.com/connectrpc/conformance @@ -67,7 +67,7 @@ final class AsyncAwaitConformance: XCTestCase { func testLargeUnary() async { await self.executeTestWithClients { client in let size = 314_159 - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_V1_SimpleRequest.with { proto in proto.responseSize = Int32(size) proto.payload = .with { $0.body = Data(repeating: 0, count: size) } } @@ -81,7 +81,7 @@ final class AsyncAwaitConformance: XCTestCase { try await self.executeTestWithClients { client in let sizes = [31_415, 9, 2_653, 58_979] let stream = client.streamingOutputCall() - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = sizes.enumerated().map { index, size in return .with { parameters in parameters.size = Int32(size) @@ -117,7 +117,7 @@ final class AsyncAwaitConformance: XCTestCase { try await self.executeTestWithClients { client in let closeExpectation = self.expectation(description: "Stream completes") let stream = client.streamingOutputCall() - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = [] }) for await result in stream.results() { @@ -150,7 +150,7 @@ final class AsyncAwaitConformance: XCTestCase { leadingKey: [leadingValue], trailingKey: [trailingValue.base64EncodedString()], ] - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_V1_SimpleRequest.with { proto in proto.responseSize = Int32(size) proto.payload = .with { $0.body = Data(repeating: 0, count: size) } } @@ -182,7 +182,7 @@ final class AsyncAwaitConformance: XCTestCase { let messageExpectation = self.expectation(description: "Receives message") let trailersExpectation = self.expectation(description: "Receives trailers") let stream = client.streamingOutputCall(headers: headers) - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = [.with { $0.size = Int32(size) }] }) for await result in stream.results() { @@ -210,7 +210,7 @@ final class AsyncAwaitConformance: XCTestCase { } func testStatusCodeAndMessage() async { - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_V1_SimpleRequest.with { proto in proto.responseStatus = .with { status in status.code = Int32(Code.unknown.rawValue) status.message = "test status message" @@ -227,7 +227,7 @@ final class AsyncAwaitConformance: XCTestCase { func testSpecialStatus() async { let statusMessage = "\\t\\ntest with whitespace\\r\\nand Unicode BMP ☺ and non-BMP \\uD83D\\uDE08\\t\\n" - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_V1_SimpleRequest.with { proto in proto.responseStatus = .with { status in status.code = 2 status.message = statusMessage @@ -244,7 +244,7 @@ final class AsyncAwaitConformance: XCTestCase { func testTimeoutOnSleepingServer() async throws { try await self.executeTestWithClients(timeout: 0.01) { client in let expectation = self.expectation(description: "Stream times out") - let message = Grpc_Testing_StreamingOutputCallRequest.with { proto in + let message = Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.payload = .with { $0.body = Data(count: 271_828) } proto.responseParameters = [ .with { parameters in @@ -282,7 +282,7 @@ final class AsyncAwaitConformance: XCTestCase { XCTAssertEqual(response.code, .unimplemented) XCTAssertEqual( response.error?.message, - "grpc.testing.TestService.UnimplementedCall is not implemented" + "connectrpc.conformance.v1.TestService.UnimplementedCall is not implemented" ) } } @@ -302,7 +302,8 @@ final class AsyncAwaitConformance: XCTestCase { XCTAssertEqual( (error as? ConnectError)?.message, """ - grpc.testing.TestService.UnimplementedStreamingOutputCall is not implemented + connectrpc.conformance.v1.TestService.UnimplementedStreamingOutputCall is \ + not implemented """ ) expectation.fulfill() @@ -348,11 +349,13 @@ final class AsyncAwaitConformance: XCTestCase { func testFailUnary() async { await self.executeTestWithClients { client in - let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" - proto.domain = "connect-crosstest" + proto.domain = "connect-conformance" } - let response = await client.failUnaryCall(request: Grpc_Testing_SimpleRequest()) + let response = await client.failUnaryCall( + request: Connectrpc_Conformance_V1_SimpleRequest() + ) XCTAssertEqual(response.error?.code, .resourceExhausted) XCTAssertEqual(response.error?.message, "soirée 🎉") XCTAssertEqual(response.error?.unpackedDetails(), [expectedErrorDetail]) @@ -361,13 +364,14 @@ final class AsyncAwaitConformance: XCTestCase { func testFailServerStreaming() async throws { try await self.executeTestWithClients { client in - let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" - proto.domain = "connect-crosstest" + proto.domain = "connect-conformance" } let expectation = self.expectation(description: "Stream completes") let stream = client.failStreamingOutputCall() - try stream.send(Grpc_Testing_StreamingOutputCallRequest()) + + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest()) for await result in stream.results() { switch result { case .headers: @@ -394,13 +398,13 @@ final class AsyncAwaitConformance: XCTestCase { func testFailServerStreamingAfterResponse() async throws { try await self.executeTestWithClients { client in - let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" - proto.domain = "connect-crosstest" + proto.domain = "connect-conformance" } let sizes = [31_415, 9, 2_653, 58_979] let stream = client.failStreamingOutputCall() - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = sizes.enumerated().map { index, size in return .with { parameters in parameters.size = Int32(size) diff --git a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift index c407b579..70a48878 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift @@ -21,8 +21,8 @@ import XCTest private let kTimeout = TimeInterval(10.0) -private typealias TestServiceClient = Grpc_Testing_TestServiceClient -private typealias UnimplementedServiceClient = Grpc_Testing_UnimplementedServiceClient +private typealias TestServiceClient = Connectrpc_Conformance_V1_TestServiceClient +private typealias UnimplementedServiceClient = Connectrpc_Conformance_V1_UnimplementedServiceClient /// This test suite runs against multiple protocols and serialization formats. /// Tests are based on https://github.com/connectrpc/conformance @@ -69,7 +69,7 @@ final class CallbackConformance: XCTestCase { func testLargeUnary() { self.executeTestWithClients { client in let size = 314_159 - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_V1_SimpleRequest.with { proto in proto.responseSize = Int32(size) proto.payload = .with { $0.body = Data(repeating: 0, count: size) } } @@ -103,7 +103,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = sizes.enumerated().map { index, size in return .with { parameters in parameters.size = Int32(size) @@ -134,7 +134,7 @@ final class CallbackConformance: XCTestCase { closeExpectation.fulfill() } } - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = [] }) @@ -153,7 +153,7 @@ final class CallbackConformance: XCTestCase { leadingKey: [leadingValue], trailingKey: [trailingValue.base64EncodedString()], ] - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_V1_SimpleRequest.with { proto in proto.responseSize = Int32(size) proto.payload = .with { $0.body = Data(repeating: 0, count: size) } } @@ -206,7 +206,7 @@ final class CallbackConformance: XCTestCase { trailersExpectation.fulfill() } } - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = [.with { $0.size = Int32(size) }] }) @@ -217,7 +217,7 @@ final class CallbackConformance: XCTestCase { } func testStatusCodeAndMessage() { - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_V1_SimpleRequest.with { proto in proto.responseStatus = .with { status in status.code = Int32(Code.unknown.rawValue) status.message = "test status message" @@ -243,7 +243,7 @@ final class CallbackConformance: XCTestCase { func testSpecialStatus() { let statusMessage = "\\t\\ntest with whitespace\\r\\nand Unicode BMP ☺ and non-BMP \\uD83D\\uDE08\\t\\n" - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_V1_SimpleRequest.with { proto in proto.responseStatus = .with { status in status.code = 2 status.message = statusMessage @@ -269,7 +269,7 @@ final class CallbackConformance: XCTestCase { func testTimeoutOnSleepingServer() throws { try self.executeTestWithClients(timeout: 0.01) { client in let expectation = self.expectation(description: "Stream times out") - let message = Grpc_Testing_StreamingOutputCallRequest.with { proto in + let message = Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.payload = .with { $0.body = Data(count: 271_828) } proto.responseParameters = [ .with { parameters in @@ -305,7 +305,7 @@ final class CallbackConformance: XCTestCase { XCTAssertEqual(response.code, .unimplemented) XCTAssertEqual( response.error?.message, - "grpc.testing.TestService.UnimplementedCall is not implemented" + "connectrpc.conformance.v1.TestService.UnimplementedCall is not implemented" ) expectation.fulfill() } @@ -327,7 +327,7 @@ final class CallbackConformance: XCTestCase { XCTAssertEqual( (error as? ConnectError)?.message, """ - grpc.testing.TestService.UnimplementedStreamingOutputCall is \ + connectrpc.conformance.v1.TestService.UnimplementedStreamingOutputCall is \ not implemented """ ) @@ -377,12 +377,12 @@ final class CallbackConformance: XCTestCase { func testFailUnary() { self.executeTestWithClients { client in - let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" - proto.domain = "connect-crosstest" + proto.domain = "connect-conformance" } let expectation = self.expectation(description: "Request completes") - client.failUnaryCall(request: Grpc_Testing_SimpleRequest()) { response in + client.failUnaryCall(request: Connectrpc_Conformance_V1_SimpleRequest()) { response in XCTAssertEqual(response.error?.code, .resourceExhausted) XCTAssertEqual(response.error?.message, "soirée 🎉") XCTAssertEqual(response.error?.unpackedDetails(), [expectedErrorDetail]) @@ -395,9 +395,9 @@ final class CallbackConformance: XCTestCase { func testFailServerStreaming() throws { try self.executeTestWithClients { client in - let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" - proto.domain = "connect-crosstest" + proto.domain = "connect-conformance" } let expectation = self.expectation(description: "Stream completes") let stream = client.failStreamingOutputCall { result in @@ -420,7 +420,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Grpc_Testing_StreamingOutputCallRequest()) + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest()) XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) } @@ -428,9 +428,9 @@ final class CallbackConformance: XCTestCase { func testFailServerStreamingAfterResponse() throws { try self.executeTestWithClients { client in - let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" - proto.domain = "connect-crosstest" + proto.domain = "connect-conformance" } let expectation = self.expectation(description: "Stream completes") var responseCount = 0 @@ -456,7 +456,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = sizes.enumerated().map { index, size in return .with { parameters in parameters.size = Int32(size) diff --git a/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift b/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift index 905d4862..b2605045 100644 --- a/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift +++ b/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift @@ -23,13 +23,13 @@ final class ConnectMocksTests: XCTestCase { // MARK: - Unary func testMockUnaryCallbacks() { - let client = Grpc_Testing_TestServiceClientMock() + let client = Connectrpc_Conformance_V1_TestServiceClientMock() client.mockUnaryCall = { request in XCTAssertTrue(request.fillUsername) return ResponseMessage(result: .success(.with { $0.hostname = "pong" })) } - var receivedMessage: Grpc_Testing_SimpleResponse? + var receivedMessage: Connectrpc_Conformance_V1_SimpleResponse? client.unaryCall(request: .with { $0.fillUsername = true }) { response in receivedMessage = response.message } @@ -37,7 +37,7 @@ final class ConnectMocksTests: XCTestCase { } func testMockUnaryAsyncAwait() async { - let client = Grpc_Testing_TestServiceClientMock() + let client = Connectrpc_Conformance_V1_TestServiceClientMock() client.mockAsyncUnaryCall = { request in XCTAssertTrue(request.fillUsername) return ResponseMessage(result: .success(.with { $0.hostname = "pong" })) @@ -50,12 +50,13 @@ final class ConnectMocksTests: XCTestCase { // MARK: - Bidirectional stream func testMockBidirectionalStreamCallbacks() throws { - let client = Grpc_Testing_TestServiceClientMock() - let expectedInputs: [Grpc_Testing_StreamingOutputCallRequest] = [ + let client = Connectrpc_Conformance_V1_TestServiceClientMock() + let expectedInputs: [Connectrpc_Conformance_V1_StreamingOutputCallRequest] = [ .with { $0.responseParameters = [.with { $0.size = 123 }] }, .with { $0.responseParameters = [.with { $0.size = 456 }] }, ] - let expectedResults: [StreamResult] = [ + let expectedResults: [StreamResult] = + [ .headers(["x-header": ["123"]]), .message(.with { $0.payload.body = Data(repeating: 0, count: 123) }), .message(.with { $0.payload.body = Data(repeating: 0, count: 456) }), @@ -63,13 +64,15 @@ final class ConnectMocksTests: XCTestCase { ] XCTAssertFalse(client.mockFullDuplexCall.isClosed) - var sentInputs = [Grpc_Testing_StreamingOutputCallRequest]() + var sentInputs = [Connectrpc_Conformance_V1_StreamingOutputCallRequest]() var closeCalled = false client.mockFullDuplexCall.onSend = { sentInputs.append($0) } client.mockFullDuplexCall.onClose = { closeCalled = true } client.mockFullDuplexCall.outputs = Array(expectedResults) - var receivedResults = [StreamResult]() + var receivedResults = [ + StreamResult + ]() let stream = client.fullDuplexCall { receivedResults.append($0) } try stream.send(expectedInputs[0]) try stream.send(expectedInputs[1]) @@ -83,12 +86,13 @@ final class ConnectMocksTests: XCTestCase { } func testMockBidirectionalStreamAsyncAwait() async throws { - let client = Grpc_Testing_TestServiceClientMock() - let expectedInputs: [Grpc_Testing_StreamingOutputCallRequest] = [ + let client = Connectrpc_Conformance_V1_TestServiceClientMock() + let expectedInputs: [Connectrpc_Conformance_V1_StreamingOutputCallRequest] = [ .with { $0.responseParameters = [.with { $0.size = 123 }] }, .with { $0.responseParameters = [.with { $0.size = 456 }] }, ] - var expectedResults: [StreamResult] = [ + var expectedResults: [StreamResult] = + [ .headers(["x-header": ["123"]]), .message(.with { $0.payload.body = Data(repeating: 0, count: 123) }), .message(.with { $0.payload.body = Data(repeating: 0, count: 456) }), @@ -96,7 +100,7 @@ final class ConnectMocksTests: XCTestCase { ] XCTAssertFalse(client.mockAsyncFullDuplexCall.isClosed) - var sentInputs = [Grpc_Testing_StreamingOutputCallRequest]() + var sentInputs = [Connectrpc_Conformance_V1_StreamingOutputCallRequest]() var closeCalled = false client.mockAsyncFullDuplexCall.onSend = { sentInputs.append($0) } client.mockAsyncFullDuplexCall.onClose = { closeCalled = true } @@ -121,7 +125,7 @@ final class ConnectMocksTests: XCTestCase { // MARK: - Server-only stream func testMockServerOnlyStreamCallbacks() throws { - let client = Grpc_Testing_TestServiceClientMock() + let client = Connectrpc_Conformance_V1_TestServiceClientMock() let expectedInput = SwiftProtobuf.Google_Protobuf_Empty() let expectedResults: [StreamResult] = [ .headers(["x-header": ["123"]]), @@ -144,18 +148,19 @@ final class ConnectMocksTests: XCTestCase { } func testMockServerOnlyStreamAsyncAwait() async throws { - let client = Grpc_Testing_TestServiceClientMock() - let expectedInput = Grpc_Testing_StreamingOutputCallRequest.with { request in + let client = Connectrpc_Conformance_V1_TestServiceClientMock() + let expectedInput = Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { request in request.responseParameters = [.with { $0.size = 123 }] } - var expectedResults: [StreamResult] = [ + var expectedResults: [StreamResult] = + [ .headers(["x-header": ["123"]]), .message(.with { $0.payload.body = Data(repeating: 0, count: 123) }), .message(.with { $0.payload.body = Data(repeating: 0, count: 456) }), .complete(code: .ok, error: nil, trailers: nil), ] - var sentInputs = [Grpc_Testing_StreamingOutputCallRequest]() + var sentInputs = [Connectrpc_Conformance_V1_StreamingOutputCallRequest]() client.mockAsyncStreamingOutputCall.onSend = { sentInputs.append($0) } client.mockAsyncStreamingOutputCall.outputs = Array(expectedResults) diff --git a/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift b/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift index b9ac6f87..d6dc7a47 100644 --- a/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift +++ b/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift @@ -19,7 +19,9 @@ import XCTest final class ConnectErrorTests: XCTestCase { func testDeserializingFullErrorAndUnpackingDetails() throws { - let expectedDetails = Grpc_Testing_SimpleResponse.with { $0.hostname = "foobar" } + let expectedDetails = Connectrpc_Conformance_V1_SimpleResponse.with { + $0.hostname = "foobar" + } let errorData = try self.errorData(expectedDetails: [expectedDetails]) let error = try JSONDecoder().decode(ConnectError.self, from: errorData) XCTAssertEqual(error.code, .unavailable) @@ -31,8 +33,8 @@ final class ConnectErrorTests: XCTestCase { } func testDeserializingFullErrorAndUnpackingMultipleDetails() throws { - let expectedDetails1 = Grpc_Testing_SimpleResponse.with { $0.hostname = "foo" } - let expectedDetails2 = Grpc_Testing_SimpleResponse.with { $0.hostname = "bar" } + let expectedDetails1 = Connectrpc_Conformance_V1_SimpleResponse.with { $0.hostname = "foo" } + let expectedDetails2 = Connectrpc_Conformance_V1_SimpleResponse.with { $0.hostname = "bar" } let errorData = try self.errorData(expectedDetails: [expectedDetails1, expectedDetails2]) let error = try JSONDecoder().decode(ConnectError.self, from: errorData) XCTAssertEqual(error.code, .unavailable) @@ -44,7 +46,9 @@ final class ConnectErrorTests: XCTestCase { } func testDeserializingErrorUsingHelperFunctionLowercasesHeaderKeys() throws { - let expectedDetails = Grpc_Testing_SimpleResponse.with { $0.hostname = "foobar" } + let expectedDetails = Connectrpc_Conformance_V1_SimpleResponse.with { + $0.hostname = "foobar" + } let errorData = try self.errorData(expectedDetails: [expectedDetails]) let error = ConnectError.from( code: .aborted, @@ -72,7 +76,7 @@ final class ConnectErrorTests: XCTestCase { XCTAssertNil(error.message) XCTAssertNil(error.exception) XCTAssertTrue(error.details.isEmpty) - XCTAssertEqual(error.unpackedDetails(), [Grpc_Testing_SimpleResponse]()) + XCTAssertEqual(error.unpackedDetails(), [Connectrpc_Conformance_V1_SimpleResponse]()) XCTAssertTrue(error.metadata.isEmpty) } diff --git a/Tests/ConnectLibraryTests/ConnectTests/JSONCodecTests.swift b/Tests/ConnectLibraryTests/ConnectTests/JSONCodecTests.swift index 27beb928..e3874b69 100644 --- a/Tests/ConnectLibraryTests/ConnectTests/JSONCodecTests.swift +++ b/Tests/ConnectLibraryTests/ConnectTests/JSONCodecTests.swift @@ -18,7 +18,7 @@ import SwiftProtobuf import XCTest final class JSONCodecTests: XCTestCase { - private let message: Grpc_Testing_SimpleResponse = .with { proto in + private let message: Connectrpc_Conformance_V1_SimpleResponse = .with { proto in proto.grpclbRouteType = .backend proto.payload = .with { payload in payload.body = Data([0x0, 0x1, 0x2, 0x3]) } proto.serverID = "12345" diff --git a/Tests/ConnectLibraryTests/ConnectTests/ProtoCodecTests.swift b/Tests/ConnectLibraryTests/ConnectTests/ProtoCodecTests.swift index 0c13f234..02374a1a 100644 --- a/Tests/ConnectLibraryTests/ConnectTests/ProtoCodecTests.swift +++ b/Tests/ConnectLibraryTests/ConnectTests/ProtoCodecTests.swift @@ -17,7 +17,7 @@ import SwiftProtobuf import XCTest final class ProtoCodecTests: XCTestCase { - private let message: Grpc_Testing_SimpleResponse = .with { proto in + private let message: Connectrpc_Conformance_V1_SimpleResponse = .with { proto in proto.grpclbRouteType = .backend proto.payload = .with { payload in payload.body = Data([0x0, 0x1, 0x2, 0x3]) } proto.serverID = "12345" diff --git a/Tests/ConnectLibraryTests/ConnectTests/ServiceMetadataTests.swift b/Tests/ConnectLibraryTests/ConnectTests/ServiceMetadataTests.swift index 44c8d755..c6955d8e 100644 --- a/Tests/ConnectLibraryTests/ConnectTests/ServiceMetadataTests.swift +++ b/Tests/ConnectLibraryTests/ConnectTests/ServiceMetadataTests.swift @@ -18,52 +18,52 @@ import XCTest final class ServiceMetadataTests: XCTestCase { func testMethodSpecsAreGeneratedCorrectlyForService() { XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.unaryCall, + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.unaryCall, MethodSpec( name: "UnaryCall", - service: "grpc.testing.TestService", + service: "connectrpc.conformance.v1.TestService", type: .unary ) ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.unaryCall.path, - "grpc.testing.TestService/UnaryCall" + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.unaryCall.path, + "connectrpc.conformance.v1.TestService/UnaryCall" ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.streamingOutputCall, + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.streamingOutputCall, MethodSpec( name: "StreamingOutputCall", - service: "grpc.testing.TestService", + service: "connectrpc.conformance.v1.TestService", type: .serverStream ) ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.streamingOutputCall.path, - "grpc.testing.TestService/StreamingOutputCall" + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.streamingOutputCall.path, + "connectrpc.conformance.v1.TestService/StreamingOutputCall" ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.streamingInputCall, + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.streamingInputCall, MethodSpec( name: "StreamingInputCall", - service: "grpc.testing.TestService", + service: "connectrpc.conformance.v1.TestService", type: .clientStream ) ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.streamingInputCall.path, - "grpc.testing.TestService/StreamingInputCall" + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.streamingInputCall.path, + "connectrpc.conformance.v1.TestService/StreamingInputCall" ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.fullDuplexCall, + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.fullDuplexCall, MethodSpec( name: "FullDuplexCall", - service: "grpc.testing.TestService", + service: "connectrpc.conformance.v1.TestService", type: .bidirectionalStream ) ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.fullDuplexCall.path, - "grpc.testing.TestService/FullDuplexCall" + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.fullDuplexCall.path, + "connectrpc.conformance.v1.TestService/FullDuplexCall" ) } } diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/messages.pb.swift similarity index 81% rename from Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/messages.pb.swift index 7c4427b4..e46a3b68 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/messages.pb.swift @@ -2,11 +2,25 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: grpc/testing/messages.proto +// Source: connectrpc/conformance/v1/messages.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ +// Copyright 2022 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/messages.proto // Copyright 2015-2016 gRPC authors. @@ -39,7 +53,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP } /// The type of payload that should be returned. -enum Grpc_Testing_PayloadType: SwiftProtobuf.Enum { +enum Connectrpc_Conformance_V1_PayloadType: SwiftProtobuf.Enum { typealias RawValue = Int /// Compressable text format. @@ -68,9 +82,9 @@ enum Grpc_Testing_PayloadType: SwiftProtobuf.Enum { #if swift(>=4.2) -extension Grpc_Testing_PayloadType: CaseIterable { +extension Connectrpc_Conformance_V1_PayloadType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Grpc_Testing_PayloadType] = [ + static let allCases: [Connectrpc_Conformance_V1_PayloadType] = [ .compressable, ] } @@ -83,7 +97,7 @@ extension Grpc_Testing_PayloadType: CaseIterable { /// that the RPC reached the server via "gRPCLB backend" path (i.e. if it got /// the address of this server from the gRPCLB server BalanceLoad RPC). Exactly /// how this detection is done is context and server dependent. -enum Grpc_Testing_GrpclbRouteType: SwiftProtobuf.Enum { +enum Connectrpc_Conformance_V1_GrpclbRouteType: SwiftProtobuf.Enum { typealias RawValue = Int /// Server didn't detect the route that a client took to reach it. @@ -122,9 +136,9 @@ enum Grpc_Testing_GrpclbRouteType: SwiftProtobuf.Enum { #if swift(>=4.2) -extension Grpc_Testing_GrpclbRouteType: CaseIterable { +extension Connectrpc_Conformance_V1_GrpclbRouteType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Grpc_Testing_GrpclbRouteType] = [ + static let allCases: [Connectrpc_Conformance_V1_GrpclbRouteType] = [ .unknown, .fallback, .backend, @@ -134,13 +148,13 @@ extension Grpc_Testing_GrpclbRouteType: CaseIterable { #endif // swift(>=4.2) /// A block of data, to simply increase gRPC message size. -struct Grpc_Testing_Payload { +struct Connectrpc_Conformance_V1_Payload { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// The type of data in body. - var type: Grpc_Testing_PayloadType = .compressable + var type: Connectrpc_Conformance_V1_PayloadType = .compressable /// Primary contents of payload. var body: Data = Data() @@ -152,7 +166,7 @@ struct Grpc_Testing_Payload { /// A protobuf representation for grpc status. This is used by test /// clients to specify a status that the server should attempt to return. -struct Grpc_Testing_EchoStatus { +struct Connectrpc_Conformance_V1_EchoStatus { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -167,21 +181,21 @@ struct Grpc_Testing_EchoStatus { } /// Unary request. -struct Grpc_Testing_SimpleRequest { +struct Connectrpc_Conformance_V1_SimpleRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// Desired payload type in the response from the server. /// If response_type is RANDOM, server randomly chooses one from other formats. - var responseType: Grpc_Testing_PayloadType = .compressable + var responseType: Connectrpc_Conformance_V1_PayloadType = .compressable /// Desired payload size in the response from the server. var responseSize: Int32 = 0 /// Optional input payload sent along with the request. - var payload: Grpc_Testing_Payload { - get {return _payload ?? Grpc_Testing_Payload()} + var payload: Connectrpc_Conformance_V1_Payload { + get {return _payload ?? Connectrpc_Conformance_V1_Payload()} set {_payload = newValue} } /// Returns true if `payload` has been explicitly set. @@ -209,8 +223,8 @@ struct Grpc_Testing_SimpleRequest { mutating func clearResponseCompressed() {self._responseCompressed = nil} /// Whether server should return a given status - var responseStatus: Grpc_Testing_EchoStatus { - get {return _responseStatus ?? Grpc_Testing_EchoStatus()} + var responseStatus: Connectrpc_Conformance_V1_EchoStatus { + get {return _responseStatus ?? Connectrpc_Conformance_V1_EchoStatus()} set {_responseStatus = newValue} } /// Returns true if `responseStatus` has been explicitly set. @@ -238,21 +252,21 @@ struct Grpc_Testing_SimpleRequest { init() {} - fileprivate var _payload: Grpc_Testing_Payload? = nil + fileprivate var _payload: Connectrpc_Conformance_V1_Payload? = nil fileprivate var _responseCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil - fileprivate var _responseStatus: Grpc_Testing_EchoStatus? = nil + fileprivate var _responseStatus: Connectrpc_Conformance_V1_EchoStatus? = nil fileprivate var _expectCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil } /// Unary response, as configured by the request. -struct Grpc_Testing_SimpleResponse { +struct Connectrpc_Conformance_V1_SimpleResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// Payload to increase message size. - var payload: Grpc_Testing_Payload { - get {return _payload ?? Grpc_Testing_Payload()} + var payload: Connectrpc_Conformance_V1_Payload { + get {return _payload ?? Connectrpc_Conformance_V1_Payload()} set {_payload = newValue} } /// Returns true if `payload` has been explicitly set. @@ -272,7 +286,7 @@ struct Grpc_Testing_SimpleResponse { var serverID: String = String() /// gRPCLB Path. - var grpclbRouteType: Grpc_Testing_GrpclbRouteType = .unknown + var grpclbRouteType: Connectrpc_Conformance_V1_GrpclbRouteType = .unknown /// Server hostname. var hostname: String = String() @@ -281,18 +295,18 @@ struct Grpc_Testing_SimpleResponse { init() {} - fileprivate var _payload: Grpc_Testing_Payload? = nil + fileprivate var _payload: Connectrpc_Conformance_V1_Payload? = nil } /// Client-streaming request. -struct Grpc_Testing_StreamingInputCallRequest { +struct Connectrpc_Conformance_V1_StreamingInputCallRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// Optional input payload sent along with the request. - var payload: Grpc_Testing_Payload { - get {return _payload ?? Grpc_Testing_Payload()} + var payload: Connectrpc_Conformance_V1_Payload { + get {return _payload ?? Connectrpc_Conformance_V1_Payload()} set {_payload = newValue} } /// Returns true if `payload` has been explicitly set. @@ -317,12 +331,12 @@ struct Grpc_Testing_StreamingInputCallRequest { init() {} - fileprivate var _payload: Grpc_Testing_Payload? = nil + fileprivate var _payload: Connectrpc_Conformance_V1_Payload? = nil fileprivate var _expectCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil } /// Client-streaming response. -struct Grpc_Testing_StreamingInputCallResponse { +struct Connectrpc_Conformance_V1_StreamingInputCallResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -336,7 +350,7 @@ struct Grpc_Testing_StreamingInputCallResponse { } /// Configuration for a particular response. -struct Grpc_Testing_ResponseParameters { +struct Connectrpc_Conformance_V1_ResponseParameters { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -369,7 +383,7 @@ struct Grpc_Testing_ResponseParameters { } /// Server-streaming request. -struct Grpc_Testing_StreamingOutputCallRequest { +struct Connectrpc_Conformance_V1_StreamingOutputCallRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -378,14 +392,14 @@ struct Grpc_Testing_StreamingOutputCallRequest { /// If response_type is RANDOM, the payload from each response in the stream /// might be of different types. This is to simulate a mixed type of payload /// stream. - var responseType: Grpc_Testing_PayloadType = .compressable + var responseType: Connectrpc_Conformance_V1_PayloadType = .compressable /// Configuration for each expected response message. - var responseParameters: [Grpc_Testing_ResponseParameters] = [] + var responseParameters: [Connectrpc_Conformance_V1_ResponseParameters] = [] /// Optional input payload sent along with the request. - var payload: Grpc_Testing_Payload { - get {return _payload ?? Grpc_Testing_Payload()} + var payload: Connectrpc_Conformance_V1_Payload { + get {return _payload ?? Connectrpc_Conformance_V1_Payload()} set {_payload = newValue} } /// Returns true if `payload` has been explicitly set. @@ -394,8 +408,8 @@ struct Grpc_Testing_StreamingOutputCallRequest { mutating func clearPayload() {self._payload = nil} /// Whether server should return a given status - var responseStatus: Grpc_Testing_EchoStatus { - get {return _responseStatus ?? Grpc_Testing_EchoStatus()} + var responseStatus: Connectrpc_Conformance_V1_EchoStatus { + get {return _responseStatus ?? Connectrpc_Conformance_V1_EchoStatus()} set {_responseStatus = newValue} } /// Returns true if `responseStatus` has been explicitly set. @@ -407,19 +421,19 @@ struct Grpc_Testing_StreamingOutputCallRequest { init() {} - fileprivate var _payload: Grpc_Testing_Payload? = nil - fileprivate var _responseStatus: Grpc_Testing_EchoStatus? = nil + fileprivate var _payload: Connectrpc_Conformance_V1_Payload? = nil + fileprivate var _responseStatus: Connectrpc_Conformance_V1_EchoStatus? = nil } /// Server-streaming response, as configured by the request and parameters. -struct Grpc_Testing_StreamingOutputCallResponse { +struct Connectrpc_Conformance_V1_StreamingOutputCallResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// Payload to increase response size. - var payload: Grpc_Testing_Payload { - get {return _payload ?? Grpc_Testing_Payload()} + var payload: Connectrpc_Conformance_V1_Payload { + get {return _payload ?? Connectrpc_Conformance_V1_Payload()} set {_payload = newValue} } /// Returns true if `payload` has been explicitly set. @@ -431,12 +445,12 @@ struct Grpc_Testing_StreamingOutputCallResponse { init() {} - fileprivate var _payload: Grpc_Testing_Payload? = nil + fileprivate var _payload: Connectrpc_Conformance_V1_Payload? = nil } /// For reconnect interop test only. /// Client tells server what reconnection parameters it used. -struct Grpc_Testing_ReconnectParams { +struct Connectrpc_Conformance_V1_ReconnectParams { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -451,7 +465,7 @@ struct Grpc_Testing_ReconnectParams { /// For reconnect interop test only. /// Server tells client whether its reconnects are following the spec and the /// reconnect backoffs it saw. -struct Grpc_Testing_ReconnectInfo { +struct Connectrpc_Conformance_V1_ReconnectInfo { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -465,7 +479,7 @@ struct Grpc_Testing_ReconnectInfo { init() {} } -struct Grpc_Testing_LoadBalancerStatsRequest { +struct Connectrpc_Conformance_V1_LoadBalancerStatsRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -481,7 +495,7 @@ struct Grpc_Testing_LoadBalancerStatsRequest { init() {} } -struct Grpc_Testing_LoadBalancerStatsResponse { +struct Connectrpc_Conformance_V1_LoadBalancerStatsResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -492,7 +506,7 @@ struct Grpc_Testing_LoadBalancerStatsResponse { /// The number of RPCs that failed to record a remote peer. var numFailures: Int32 = 0 - var rpcsByMethod: Dictionary = [:] + var rpcsByMethod: Dictionary = [:] var unknownFields = SwiftProtobuf.UnknownStorage() @@ -513,7 +527,7 @@ struct Grpc_Testing_LoadBalancerStatsResponse { } /// Request for retrieving a test client's accumulated stats. -struct Grpc_Testing_LoadBalancerAccumulatedStatsRequest { +struct Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -524,7 +538,7 @@ struct Grpc_Testing_LoadBalancerAccumulatedStatsRequest { } /// Accumulated stats for RPCs sent by a test client. -struct Grpc_Testing_LoadBalancerAccumulatedStatsResponse { +struct Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -543,7 +557,7 @@ struct Grpc_Testing_LoadBalancerAccumulatedStatsResponse { /// Per-method RPC statistics. The key is the RpcType in string form; e.g. /// 'EMPTY_CALL' or 'UNARY_CALL' - var statsPerMethod: Dictionary = [:] + var statsPerMethod: Dictionary = [:] var unknownFields = SwiftProtobuf.UnknownStorage() @@ -568,16 +582,16 @@ struct Grpc_Testing_LoadBalancerAccumulatedStatsResponse { } /// Configurations for a test client. -struct Grpc_Testing_ClientConfigureRequest { +struct Connectrpc_Conformance_V1_ClientConfigureRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// The types of RPCs the client sends. - var types: [Grpc_Testing_ClientConfigureRequest.RpcType] = [] + var types: [Connectrpc_Conformance_V1_ClientConfigureRequest.RpcType] = [] /// The collection of custom metadata to be attached to RPCs sent by the client. - var metadata: [Grpc_Testing_ClientConfigureRequest.Metadata] = [] + var metadata: [Connectrpc_Conformance_V1_ClientConfigureRequest.Metadata] = [] /// The deadline to use, in seconds, for all RPCs. If unset or zero, the /// client will use the default from the command-line. @@ -620,7 +634,7 @@ struct Grpc_Testing_ClientConfigureRequest { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var type: Grpc_Testing_ClientConfigureRequest.RpcType = .emptyCall + var type: Connectrpc_Conformance_V1_ClientConfigureRequest.RpcType = .emptyCall var key: String = String() @@ -636,9 +650,9 @@ struct Grpc_Testing_ClientConfigureRequest { #if swift(>=4.2) -extension Grpc_Testing_ClientConfigureRequest.RpcType: CaseIterable { +extension Connectrpc_Conformance_V1_ClientConfigureRequest.RpcType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Grpc_Testing_ClientConfigureRequest.RpcType] = [ + static let allCases: [Connectrpc_Conformance_V1_ClientConfigureRequest.RpcType] = [ .emptyCall, .unaryCall, ] @@ -647,7 +661,7 @@ extension Grpc_Testing_ClientConfigureRequest.RpcType: CaseIterable { #endif // swift(>=4.2) /// Response for updating a test client's configuration. -struct Grpc_Testing_ClientConfigureResponse { +struct Connectrpc_Conformance_V1_ClientConfigureResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -657,7 +671,7 @@ struct Grpc_Testing_ClientConfigureResponse { init() {} } -struct Grpc_Testing_ErrorDetail { +struct Connectrpc_Conformance_V1_ErrorDetail { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -671,7 +685,7 @@ struct Grpc_Testing_ErrorDetail { init() {} } -struct Grpc_Testing_ErrorStatus { +struct Connectrpc_Conformance_V1_ErrorStatus { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -688,44 +702,44 @@ struct Grpc_Testing_ErrorStatus { } #if swift(>=5.5) && canImport(_Concurrency) -extension Grpc_Testing_PayloadType: @unchecked Sendable {} -extension Grpc_Testing_GrpclbRouteType: @unchecked Sendable {} -extension Grpc_Testing_Payload: @unchecked Sendable {} -extension Grpc_Testing_EchoStatus: @unchecked Sendable {} -extension Grpc_Testing_SimpleRequest: @unchecked Sendable {} -extension Grpc_Testing_SimpleResponse: @unchecked Sendable {} -extension Grpc_Testing_StreamingInputCallRequest: @unchecked Sendable {} -extension Grpc_Testing_StreamingInputCallResponse: @unchecked Sendable {} -extension Grpc_Testing_ResponseParameters: @unchecked Sendable {} -extension Grpc_Testing_StreamingOutputCallRequest: @unchecked Sendable {} -extension Grpc_Testing_StreamingOutputCallResponse: @unchecked Sendable {} -extension Grpc_Testing_ReconnectParams: @unchecked Sendable {} -extension Grpc_Testing_ReconnectInfo: @unchecked Sendable {} -extension Grpc_Testing_LoadBalancerStatsRequest: @unchecked Sendable {} -extension Grpc_Testing_LoadBalancerStatsResponse: @unchecked Sendable {} -extension Grpc_Testing_LoadBalancerStatsResponse.RpcsByPeer: @unchecked Sendable {} -extension Grpc_Testing_LoadBalancerAccumulatedStatsRequest: @unchecked Sendable {} -extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse: @unchecked Sendable {} -extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse.MethodStats: @unchecked Sendable {} -extension Grpc_Testing_ClientConfigureRequest: @unchecked Sendable {} -extension Grpc_Testing_ClientConfigureRequest.RpcType: @unchecked Sendable {} -extension Grpc_Testing_ClientConfigureRequest.Metadata: @unchecked Sendable {} -extension Grpc_Testing_ClientConfigureResponse: @unchecked Sendable {} -extension Grpc_Testing_ErrorDetail: @unchecked Sendable {} -extension Grpc_Testing_ErrorStatus: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_PayloadType: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_GrpclbRouteType: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_Payload: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_EchoStatus: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_SimpleRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_SimpleResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_StreamingInputCallRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_StreamingInputCallResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_ResponseParameters: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_StreamingOutputCallRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_StreamingOutputCallResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_ReconnectParams: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_ReconnectInfo: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_LoadBalancerStatsRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_LoadBalancerStatsResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_LoadBalancerStatsResponse.RpcsByPeer: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse.MethodStats: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_ClientConfigureRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_ClientConfigureRequest.RpcType: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_ClientConfigureRequest.Metadata: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_ClientConfigureResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_ErrorDetail: @unchecked Sendable {} +extension Connectrpc_Conformance_V1_ErrorStatus: @unchecked Sendable {} #endif // swift(>=5.5) && canImport(_Concurrency) // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "grpc.testing" +fileprivate let _protobuf_package = "connectrpc.conformance.v1" -extension Grpc_Testing_PayloadType: SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_PayloadType: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "COMPRESSABLE"), ] } -extension Grpc_Testing_GrpclbRouteType: SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_GrpclbRouteType: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "GRPCLB_ROUTE_TYPE_UNKNOWN"), 1: .same(proto: "GRPCLB_ROUTE_TYPE_FALLBACK"), @@ -733,7 +747,7 @@ extension Grpc_Testing_GrpclbRouteType: SwiftProtobuf._ProtoNameProviding { ] } -extension Grpc_Testing_Payload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_Payload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Payload" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "type"), @@ -763,7 +777,7 @@ extension Grpc_Testing_Payload: SwiftProtobuf.Message, SwiftProtobuf._MessageImp try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_Payload, rhs: Grpc_Testing_Payload) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_Payload, rhs: Connectrpc_Conformance_V1_Payload) -> Bool { if lhs.type != rhs.type {return false} if lhs.body != rhs.body {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -771,7 +785,7 @@ extension Grpc_Testing_Payload: SwiftProtobuf.Message, SwiftProtobuf._MessageImp } } -extension Grpc_Testing_EchoStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_EchoStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".EchoStatus" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), @@ -801,7 +815,7 @@ extension Grpc_Testing_EchoStatus: SwiftProtobuf.Message, SwiftProtobuf._Message try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_EchoStatus, rhs: Grpc_Testing_EchoStatus) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_EchoStatus, rhs: Connectrpc_Conformance_V1_EchoStatus) -> Bool { if lhs.code != rhs.code {return false} if lhs.message != rhs.message {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -809,7 +823,7 @@ extension Grpc_Testing_EchoStatus: SwiftProtobuf.Message, SwiftProtobuf._Message } } -extension Grpc_Testing_SimpleRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_SimpleRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".SimpleRequest" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "response_type"), @@ -883,7 +897,7 @@ extension Grpc_Testing_SimpleRequest: SwiftProtobuf.Message, SwiftProtobuf._Mess try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_SimpleRequest, rhs: Grpc_Testing_SimpleRequest) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_SimpleRequest, rhs: Connectrpc_Conformance_V1_SimpleRequest) -> Bool { if lhs.responseType != rhs.responseType {return false} if lhs.responseSize != rhs.responseSize {return false} if lhs._payload != rhs._payload {return false} @@ -899,7 +913,7 @@ extension Grpc_Testing_SimpleRequest: SwiftProtobuf.Message, SwiftProtobuf._Mess } } -extension Grpc_Testing_SimpleResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_SimpleResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".SimpleResponse" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "payload"), @@ -953,7 +967,7 @@ extension Grpc_Testing_SimpleResponse: SwiftProtobuf.Message, SwiftProtobuf._Mes try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_SimpleResponse, rhs: Grpc_Testing_SimpleResponse) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_SimpleResponse, rhs: Connectrpc_Conformance_V1_SimpleResponse) -> Bool { if lhs._payload != rhs._payload {return false} if lhs.username != rhs.username {return false} if lhs.oauthScope != rhs.oauthScope {return false} @@ -965,7 +979,7 @@ extension Grpc_Testing_SimpleResponse: SwiftProtobuf.Message, SwiftProtobuf._Mes } } -extension Grpc_Testing_StreamingInputCallRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_StreamingInputCallRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".StreamingInputCallRequest" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "payload"), @@ -999,7 +1013,7 @@ extension Grpc_Testing_StreamingInputCallRequest: SwiftProtobuf.Message, SwiftPr try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_StreamingInputCallRequest, rhs: Grpc_Testing_StreamingInputCallRequest) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_StreamingInputCallRequest, rhs: Connectrpc_Conformance_V1_StreamingInputCallRequest) -> Bool { if lhs._payload != rhs._payload {return false} if lhs._expectCompressed != rhs._expectCompressed {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -1007,7 +1021,7 @@ extension Grpc_Testing_StreamingInputCallRequest: SwiftProtobuf.Message, SwiftPr } } -extension Grpc_Testing_StreamingInputCallResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_StreamingInputCallResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".StreamingInputCallResponse" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "aggregated_payload_size"), @@ -1032,14 +1046,14 @@ extension Grpc_Testing_StreamingInputCallResponse: SwiftProtobuf.Message, SwiftP try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_StreamingInputCallResponse, rhs: Grpc_Testing_StreamingInputCallResponse) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_StreamingInputCallResponse, rhs: Connectrpc_Conformance_V1_StreamingInputCallResponse) -> Bool { if lhs.aggregatedPayloadSize != rhs.aggregatedPayloadSize {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Grpc_Testing_ResponseParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_ResponseParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ResponseParameters" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "size"), @@ -1078,7 +1092,7 @@ extension Grpc_Testing_ResponseParameters: SwiftProtobuf.Message, SwiftProtobuf. try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_ResponseParameters, rhs: Grpc_Testing_ResponseParameters) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_ResponseParameters, rhs: Connectrpc_Conformance_V1_ResponseParameters) -> Bool { if lhs.size != rhs.size {return false} if lhs.intervalUs != rhs.intervalUs {return false} if lhs._compressed != rhs._compressed {return false} @@ -1087,7 +1101,7 @@ extension Grpc_Testing_ResponseParameters: SwiftProtobuf.Message, SwiftProtobuf. } } -extension Grpc_Testing_StreamingOutputCallRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_StreamingOutputCallRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".StreamingOutputCallRequest" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "response_type"), @@ -1131,7 +1145,7 @@ extension Grpc_Testing_StreamingOutputCallRequest: SwiftProtobuf.Message, SwiftP try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_StreamingOutputCallRequest, rhs: Grpc_Testing_StreamingOutputCallRequest) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_StreamingOutputCallRequest, rhs: Connectrpc_Conformance_V1_StreamingOutputCallRequest) -> Bool { if lhs.responseType != rhs.responseType {return false} if lhs.responseParameters != rhs.responseParameters {return false} if lhs._payload != rhs._payload {return false} @@ -1141,7 +1155,7 @@ extension Grpc_Testing_StreamingOutputCallRequest: SwiftProtobuf.Message, SwiftP } } -extension Grpc_Testing_StreamingOutputCallResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_StreamingOutputCallResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".StreamingOutputCallResponse" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "payload"), @@ -1170,14 +1184,14 @@ extension Grpc_Testing_StreamingOutputCallResponse: SwiftProtobuf.Message, Swift try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_StreamingOutputCallResponse, rhs: Grpc_Testing_StreamingOutputCallResponse) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_StreamingOutputCallResponse, rhs: Connectrpc_Conformance_V1_StreamingOutputCallResponse) -> Bool { if lhs._payload != rhs._payload {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Grpc_Testing_ReconnectParams: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_ReconnectParams: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ReconnectParams" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "max_reconnect_backoff_ms"), @@ -1202,14 +1216,14 @@ extension Grpc_Testing_ReconnectParams: SwiftProtobuf.Message, SwiftProtobuf._Me try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_ReconnectParams, rhs: Grpc_Testing_ReconnectParams) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_ReconnectParams, rhs: Connectrpc_Conformance_V1_ReconnectParams) -> Bool { if lhs.maxReconnectBackoffMs != rhs.maxReconnectBackoffMs {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Grpc_Testing_ReconnectInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_ReconnectInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ReconnectInfo" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "passed"), @@ -1239,7 +1253,7 @@ extension Grpc_Testing_ReconnectInfo: SwiftProtobuf.Message, SwiftProtobuf._Mess try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_ReconnectInfo, rhs: Grpc_Testing_ReconnectInfo) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_ReconnectInfo, rhs: Connectrpc_Conformance_V1_ReconnectInfo) -> Bool { if lhs.passed != rhs.passed {return false} if lhs.backoffMs != rhs.backoffMs {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -1247,7 +1261,7 @@ extension Grpc_Testing_ReconnectInfo: SwiftProtobuf.Message, SwiftProtobuf._Mess } } -extension Grpc_Testing_LoadBalancerStatsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_LoadBalancerStatsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".LoadBalancerStatsRequest" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "num_rpcs"), @@ -1277,7 +1291,7 @@ extension Grpc_Testing_LoadBalancerStatsRequest: SwiftProtobuf.Message, SwiftPro try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_LoadBalancerStatsRequest, rhs: Grpc_Testing_LoadBalancerStatsRequest) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_LoadBalancerStatsRequest, rhs: Connectrpc_Conformance_V1_LoadBalancerStatsRequest) -> Bool { if lhs.numRpcs != rhs.numRpcs {return false} if lhs.timeoutSec != rhs.timeoutSec {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -1285,7 +1299,7 @@ extension Grpc_Testing_LoadBalancerStatsRequest: SwiftProtobuf.Message, SwiftPro } } -extension Grpc_Testing_LoadBalancerStatsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_LoadBalancerStatsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".LoadBalancerStatsResponse" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "rpcs_by_peer"), @@ -1301,7 +1315,7 @@ extension Grpc_Testing_LoadBalancerStatsResponse: SwiftProtobuf.Message, SwiftPr switch fieldNumber { case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.rpcsByPeer) }() case 2: try { try decoder.decodeSingularInt32Field(value: &self.numFailures) }() - case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.rpcsByMethod) }() + case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.rpcsByMethod) }() default: break } } @@ -1315,12 +1329,12 @@ extension Grpc_Testing_LoadBalancerStatsResponse: SwiftProtobuf.Message, SwiftPr try visitor.visitSingularInt32Field(value: self.numFailures, fieldNumber: 2) } if !self.rpcsByMethod.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.rpcsByMethod, fieldNumber: 3) + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.rpcsByMethod, fieldNumber: 3) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_LoadBalancerStatsResponse, rhs: Grpc_Testing_LoadBalancerStatsResponse) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_LoadBalancerStatsResponse, rhs: Connectrpc_Conformance_V1_LoadBalancerStatsResponse) -> Bool { if lhs.rpcsByPeer != rhs.rpcsByPeer {return false} if lhs.numFailures != rhs.numFailures {return false} if lhs.rpcsByMethod != rhs.rpcsByMethod {return false} @@ -1329,8 +1343,8 @@ extension Grpc_Testing_LoadBalancerStatsResponse: SwiftProtobuf.Message, SwiftPr } } -extension Grpc_Testing_LoadBalancerStatsResponse.RpcsByPeer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Grpc_Testing_LoadBalancerStatsResponse.protoMessageName + ".RpcsByPeer" +extension Connectrpc_Conformance_V1_LoadBalancerStatsResponse.RpcsByPeer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Connectrpc_Conformance_V1_LoadBalancerStatsResponse.protoMessageName + ".RpcsByPeer" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "rpcs_by_peer"), ] @@ -1354,14 +1368,14 @@ extension Grpc_Testing_LoadBalancerStatsResponse.RpcsByPeer: SwiftProtobuf.Messa try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_LoadBalancerStatsResponse.RpcsByPeer, rhs: Grpc_Testing_LoadBalancerStatsResponse.RpcsByPeer) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_LoadBalancerStatsResponse.RpcsByPeer, rhs: Connectrpc_Conformance_V1_LoadBalancerStatsResponse.RpcsByPeer) -> Bool { if lhs.rpcsByPeer != rhs.rpcsByPeer {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Grpc_Testing_LoadBalancerAccumulatedStatsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".LoadBalancerAccumulatedStatsRequest" static let _protobuf_nameMap = SwiftProtobuf._NameMap() @@ -1374,13 +1388,13 @@ extension Grpc_Testing_LoadBalancerAccumulatedStatsRequest: SwiftProtobuf.Messag try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_LoadBalancerAccumulatedStatsRequest, rhs: Grpc_Testing_LoadBalancerAccumulatedStatsRequest) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest, rhs: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".LoadBalancerAccumulatedStatsResponse" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "num_rpcs_started_by_method"), @@ -1398,7 +1412,7 @@ extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse: SwiftProtobuf.Messa case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.numRpcsStartedByMethod) }() case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.numRpcsSucceededByMethod) }() case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.numRpcsFailedByMethod) }() - case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.statsPerMethod) }() + case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.statsPerMethod) }() default: break } } @@ -1415,12 +1429,12 @@ extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse: SwiftProtobuf.Messa try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.numRpcsFailedByMethod, fieldNumber: 3) } if !self.statsPerMethod.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.statsPerMethod, fieldNumber: 4) + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.statsPerMethod, fieldNumber: 4) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_LoadBalancerAccumulatedStatsResponse, rhs: Grpc_Testing_LoadBalancerAccumulatedStatsResponse) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse, rhs: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse) -> Bool { if lhs.numRpcsStartedByMethod != rhs.numRpcsStartedByMethod {return false} if lhs.numRpcsSucceededByMethod != rhs.numRpcsSucceededByMethod {return false} if lhs.numRpcsFailedByMethod != rhs.numRpcsFailedByMethod {return false} @@ -1430,8 +1444,8 @@ extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse: SwiftProtobuf.Messa } } -extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse.MethodStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Grpc_Testing_LoadBalancerAccumulatedStatsResponse.protoMessageName + ".MethodStats" +extension Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse.MethodStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse.protoMessageName + ".MethodStats" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "rpcs_started"), 2: .same(proto: "result"), @@ -1460,7 +1474,7 @@ extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse.MethodStats: SwiftPr try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_LoadBalancerAccumulatedStatsResponse.MethodStats, rhs: Grpc_Testing_LoadBalancerAccumulatedStatsResponse.MethodStats) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse.MethodStats, rhs: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsResponse.MethodStats) -> Bool { if lhs.rpcsStarted != rhs.rpcsStarted {return false} if lhs.result != rhs.result {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -1468,7 +1482,7 @@ extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse.MethodStats: SwiftPr } } -extension Grpc_Testing_ClientConfigureRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_ClientConfigureRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ClientConfigureRequest" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "types"), @@ -1503,7 +1517,7 @@ extension Grpc_Testing_ClientConfigureRequest: SwiftProtobuf.Message, SwiftProto try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_ClientConfigureRequest, rhs: Grpc_Testing_ClientConfigureRequest) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_ClientConfigureRequest, rhs: Connectrpc_Conformance_V1_ClientConfigureRequest) -> Bool { if lhs.types != rhs.types {return false} if lhs.metadata != rhs.metadata {return false} if lhs.timeoutSec != rhs.timeoutSec {return false} @@ -1512,15 +1526,15 @@ extension Grpc_Testing_ClientConfigureRequest: SwiftProtobuf.Message, SwiftProto } } -extension Grpc_Testing_ClientConfigureRequest.RpcType: SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_ClientConfigureRequest.RpcType: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "EMPTY_CALL"), 1: .same(proto: "UNARY_CALL"), ] } -extension Grpc_Testing_ClientConfigureRequest.Metadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Grpc_Testing_ClientConfigureRequest.protoMessageName + ".Metadata" +extension Connectrpc_Conformance_V1_ClientConfigureRequest.Metadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Connectrpc_Conformance_V1_ClientConfigureRequest.protoMessageName + ".Metadata" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "type"), 2: .same(proto: "key"), @@ -1554,7 +1568,7 @@ extension Grpc_Testing_ClientConfigureRequest.Metadata: SwiftProtobuf.Message, S try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_ClientConfigureRequest.Metadata, rhs: Grpc_Testing_ClientConfigureRequest.Metadata) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_ClientConfigureRequest.Metadata, rhs: Connectrpc_Conformance_V1_ClientConfigureRequest.Metadata) -> Bool { if lhs.type != rhs.type {return false} if lhs.key != rhs.key {return false} if lhs.value != rhs.value {return false} @@ -1563,7 +1577,7 @@ extension Grpc_Testing_ClientConfigureRequest.Metadata: SwiftProtobuf.Message, S } } -extension Grpc_Testing_ClientConfigureResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_ClientConfigureResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ClientConfigureResponse" static let _protobuf_nameMap = SwiftProtobuf._NameMap() @@ -1576,13 +1590,13 @@ extension Grpc_Testing_ClientConfigureResponse: SwiftProtobuf.Message, SwiftProt try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_ClientConfigureResponse, rhs: Grpc_Testing_ClientConfigureResponse) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_ClientConfigureResponse, rhs: Connectrpc_Conformance_V1_ClientConfigureResponse) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Grpc_Testing_ErrorDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_ErrorDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ErrorDetail" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "reason"), @@ -1612,7 +1626,7 @@ extension Grpc_Testing_ErrorDetail: SwiftProtobuf.Message, SwiftProtobuf._Messag try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_ErrorDetail, rhs: Grpc_Testing_ErrorDetail) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_ErrorDetail, rhs: Connectrpc_Conformance_V1_ErrorDetail) -> Bool { if lhs.reason != rhs.reason {return false} if lhs.domain != rhs.domain {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -1620,7 +1634,7 @@ extension Grpc_Testing_ErrorDetail: SwiftProtobuf.Message, SwiftProtobuf._Messag } } -extension Grpc_Testing_ErrorStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_ErrorStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ErrorStatus" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), @@ -1655,7 +1669,7 @@ extension Grpc_Testing_ErrorStatus: SwiftProtobuf.Message, SwiftProtobuf._Messag try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Grpc_Testing_ErrorStatus, rhs: Grpc_Testing_ErrorStatus) -> Bool { + static func ==(lhs: Connectrpc_Conformance_V1_ErrorStatus, rhs: Connectrpc_Conformance_V1_ErrorStatus) -> Bool { if lhs.code != rhs.code {return false} if lhs.message != rhs.message {return false} if lhs.details != rhs.details {return false} diff --git a/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.connect.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.connect.swift new file mode 100644 index 00000000..841b9765 --- /dev/null +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.connect.swift @@ -0,0 +1,502 @@ +// Code generated by protoc-gen-connect-swift. DO NOT EDIT. +// +// Source: connectrpc/conformance/v1/test.proto +// + +import Connect +import Foundation +import SwiftProtobuf + +/// A simple service to test the various types of RPCs and experiment with +/// performance with various types of payload. +internal protocol Connectrpc_Conformance_V1_TestServiceClientInterface { + + /// One empty request followed by one empty response. + @discardableResult + func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// One empty request followed by one empty response. + @available(iOS 13, *) + func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage + + /// One request followed by one response. + @discardableResult + func `unaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// One request followed by one response. + @available(iOS 13, *) + func `unaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage + + /// One request followed by one response. This RPC always fails. + @discardableResult + func `failUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// One request followed by one response. This RPC always fails. + @available(iOS 13, *) + func `failUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage + + /// One request followed by one response. Response has cache control + /// headers set such that a caching HTTP proxy (such as GFE) can + /// satisfy subsequent requests. + @discardableResult + func `cacheableUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// One request followed by one response. Response has cache control + /// headers set such that a caching HTTP proxy (such as GFE) can + /// satisfy subsequent requests. + @available(iOS 13, *) + func `cacheableUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage + + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + func `streamingOutputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface + + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + @available(iOS 13, *) + func `streamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface + + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + /// This RPC always responds with an error status. + func `failStreamingOutputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface + + /// One request followed by a sequence of responses (streamed download). + /// The server returns the payload with client desired type and sizes. + /// This RPC always responds with an error status. + @available(iOS 13, *) + func `failStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface + + /// A sequence of requests followed by one response (streamed upload). + /// The server returns the aggregated size of client payload as the result. + func `streamingInputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ClientOnlyStreamInterface + + /// A sequence of requests followed by one response (streamed upload). + /// The server returns the aggregated size of client payload as the result. + @available(iOS 13, *) + func `streamingInputCall`(headers: Connect.Headers) -> any Connect.ClientOnlyAsyncStreamInterface + + /// A sequence of requests with each request served by the server immediately. + /// As one request could lead to multiple responses, this interface + /// demonstrates the idea of full duplexing. + func `fullDuplexCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface + + /// A sequence of requests with each request served by the server immediately. + /// As one request could lead to multiple responses, this interface + /// demonstrates the idea of full duplexing. + @available(iOS 13, *) + func `fullDuplexCall`(headers: Connect.Headers) -> any Connect.BidirectionalAsyncStreamInterface + + /// A sequence of requests followed by a sequence of responses. + /// The server buffers all the client requests and then serves them in order. A + /// stream of responses are returned to the client when the server starts with + /// first request. + func `halfDuplexCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface + + /// A sequence of requests followed by a sequence of responses. + /// The server buffers all the client requests and then serves them in order. A + /// stream of responses are returned to the client when the server starts with + /// first request. + @available(iOS 13, *) + func `halfDuplexCall`(headers: Connect.Headers) -> any Connect.BidirectionalAsyncStreamInterface + + /// The test server will not implement this method. It will be used + /// to test the behavior when clients call unimplemented methods. + @discardableResult + func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// The test server will not implement this method. It will be used + /// to test the behavior when clients call unimplemented methods. + @available(iOS 13, *) + func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage + + /// The test server will not implement this method. It will be used + /// to test the behavior when clients call unimplemented streaming output methods. + func `unimplementedStreamingOutputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface + + /// The test server will not implement this method. It will be used + /// to test the behavior when clients call unimplemented streaming output methods. + @available(iOS 13, *) + func `unimplementedStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface +} + +/// Concrete implementation of `Connectrpc_Conformance_V1_TestServiceClientInterface`. +internal final class Connectrpc_Conformance_V1_TestServiceClient: Connectrpc_Conformance_V1_TestServiceClientInterface { + private let client: Connect.ProtocolClientInterface + + internal init(client: Connect.ProtocolClientInterface) { + self.client = client + } + + @discardableResult + internal func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.TestService/EmptyCall", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.TestService/EmptyCall", request: request, headers: headers) + } + + @discardableResult + internal func `unaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.TestService/UnaryCall", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `unaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.TestService/UnaryCall", request: request, headers: headers) + } + + @discardableResult + internal func `failUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.TestService/FailUnaryCall", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `failUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.TestService/FailUnaryCall", request: request, headers: headers) + } + + @discardableResult + internal func `cacheableUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.TestService/CacheableUnaryCall", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `cacheableUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.TestService/CacheableUnaryCall", request: request, headers: headers) + } + + internal func `streamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { + return self.client.serverOnlyStream(path: "/connectrpc.conformance.v1.TestService/StreamingOutputCall", headers: headers, onResult: onResult) + } + + @available(iOS 13, *) + internal func `streamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + return self.client.serverOnlyStream(path: "/connectrpc.conformance.v1.TestService/StreamingOutputCall", headers: headers) + } + + internal func `failStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { + return self.client.serverOnlyStream(path: "/connectrpc.conformance.v1.TestService/FailStreamingOutputCall", headers: headers, onResult: onResult) + } + + @available(iOS 13, *) + internal func `failStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + return self.client.serverOnlyStream(path: "/connectrpc.conformance.v1.TestService/FailStreamingOutputCall", headers: headers) + } + + internal func `streamingInputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ClientOnlyStreamInterface { + return self.client.clientOnlyStream(path: "/connectrpc.conformance.v1.TestService/StreamingInputCall", headers: headers, onResult: onResult) + } + + @available(iOS 13, *) + internal func `streamingInputCall`(headers: Connect.Headers = [:]) -> any Connect.ClientOnlyAsyncStreamInterface { + return self.client.clientOnlyStream(path: "/connectrpc.conformance.v1.TestService/StreamingInputCall", headers: headers) + } + + internal func `fullDuplexCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface { + return self.client.bidirectionalStream(path: "/connectrpc.conformance.v1.TestService/FullDuplexCall", headers: headers, onResult: onResult) + } + + @available(iOS 13, *) + internal func `fullDuplexCall`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { + return self.client.bidirectionalStream(path: "/connectrpc.conformance.v1.TestService/FullDuplexCall", headers: headers) + } + + internal func `halfDuplexCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface { + return self.client.bidirectionalStream(path: "/connectrpc.conformance.v1.TestService/HalfDuplexCall", headers: headers, onResult: onResult) + } + + @available(iOS 13, *) + internal func `halfDuplexCall`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { + return self.client.bidirectionalStream(path: "/connectrpc.conformance.v1.TestService/HalfDuplexCall", headers: headers) + } + + @discardableResult + internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.TestService/UnimplementedCall", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.TestService/UnimplementedCall", request: request, headers: headers) + } + + internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { + return self.client.serverOnlyStream(path: "/connectrpc.conformance.v1.TestService/UnimplementedStreamingOutputCall", headers: headers, onResult: onResult) + } + + @available(iOS 13, *) + internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + return self.client.serverOnlyStream(path: "/connectrpc.conformance.v1.TestService/UnimplementedStreamingOutputCall", headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let emptyCall = Connect.MethodSpec(name: "EmptyCall", service: "connectrpc.conformance.v1.TestService", type: .unary) + internal static let unaryCall = Connect.MethodSpec(name: "UnaryCall", service: "connectrpc.conformance.v1.TestService", type: .unary) + internal static let failUnaryCall = Connect.MethodSpec(name: "FailUnaryCall", service: "connectrpc.conformance.v1.TestService", type: .unary) + internal static let cacheableUnaryCall = Connect.MethodSpec(name: "CacheableUnaryCall", service: "connectrpc.conformance.v1.TestService", type: .unary) + internal static let streamingOutputCall = Connect.MethodSpec(name: "StreamingOutputCall", service: "connectrpc.conformance.v1.TestService", type: .serverStream) + internal static let failStreamingOutputCall = Connect.MethodSpec(name: "FailStreamingOutputCall", service: "connectrpc.conformance.v1.TestService", type: .serverStream) + internal static let streamingInputCall = Connect.MethodSpec(name: "StreamingInputCall", service: "connectrpc.conformance.v1.TestService", type: .clientStream) + internal static let fullDuplexCall = Connect.MethodSpec(name: "FullDuplexCall", service: "connectrpc.conformance.v1.TestService", type: .bidirectionalStream) + internal static let halfDuplexCall = Connect.MethodSpec(name: "HalfDuplexCall", service: "connectrpc.conformance.v1.TestService", type: .bidirectionalStream) + internal static let unimplementedCall = Connect.MethodSpec(name: "UnimplementedCall", service: "connectrpc.conformance.v1.TestService", type: .unary) + internal static let unimplementedStreamingOutputCall = Connect.MethodSpec(name: "UnimplementedStreamingOutputCall", service: "connectrpc.conformance.v1.TestService", type: .serverStream) + } + } +} + +/// A simple service NOT implemented at servers so clients can test for +/// that case. +internal protocol Connectrpc_Conformance_V1_UnimplementedServiceClientInterface { + + /// A call that no server should implement + @discardableResult + func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// A call that no server should implement + @available(iOS 13, *) + func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage + + /// A call that no server should implement + func `unimplementedStreamingOutputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface + + /// A call that no server should implement + @available(iOS 13, *) + func `unimplementedStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface +} + +/// Concrete implementation of `Connectrpc_Conformance_V1_UnimplementedServiceClientInterface`. +internal final class Connectrpc_Conformance_V1_UnimplementedServiceClient: Connectrpc_Conformance_V1_UnimplementedServiceClientInterface { + private let client: Connect.ProtocolClientInterface + + internal init(client: Connect.ProtocolClientInterface) { + self.client = client + } + + @discardableResult + internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.UnimplementedService/UnimplementedCall", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.UnimplementedService/UnimplementedCall", request: request, headers: headers) + } + + internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { + return self.client.serverOnlyStream(path: "/connectrpc.conformance.v1.UnimplementedService/UnimplementedStreamingOutputCall", headers: headers, onResult: onResult) + } + + @available(iOS 13, *) + internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + return self.client.serverOnlyStream(path: "/connectrpc.conformance.v1.UnimplementedService/UnimplementedStreamingOutputCall", headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let unimplementedCall = Connect.MethodSpec(name: "UnimplementedCall", service: "connectrpc.conformance.v1.UnimplementedService", type: .unary) + internal static let unimplementedStreamingOutputCall = Connect.MethodSpec(name: "UnimplementedStreamingOutputCall", service: "connectrpc.conformance.v1.UnimplementedService", type: .serverStream) + } + } +} + +/// A service used to control reconnect server. +internal protocol Connectrpc_Conformance_V1_ReconnectServiceClientInterface { + + @discardableResult + func `start`(request: Connectrpc_Conformance_V1_ReconnectParams, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + @available(iOS 13, *) + func `start`(request: Connectrpc_Conformance_V1_ReconnectParams, headers: Connect.Headers) async -> ResponseMessage + + @discardableResult + func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + @available(iOS 13, *) + func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage +} + +/// Concrete implementation of `Connectrpc_Conformance_V1_ReconnectServiceClientInterface`. +internal final class Connectrpc_Conformance_V1_ReconnectServiceClient: Connectrpc_Conformance_V1_ReconnectServiceClientInterface { + private let client: Connect.ProtocolClientInterface + + internal init(client: Connect.ProtocolClientInterface) { + self.client = client + } + + @discardableResult + internal func `start`(request: Connectrpc_Conformance_V1_ReconnectParams, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.ReconnectService/Start", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `start`(request: Connectrpc_Conformance_V1_ReconnectParams, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.ReconnectService/Start", request: request, headers: headers) + } + + @discardableResult + internal func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.ReconnectService/Stop", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.ReconnectService/Stop", request: request, headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let start = Connect.MethodSpec(name: "Start", service: "connectrpc.conformance.v1.ReconnectService", type: .unary) + internal static let stop = Connect.MethodSpec(name: "Stop", service: "connectrpc.conformance.v1.ReconnectService", type: .unary) + } + } +} + +/// A service used to obtain stats for verifying LB behavior. +internal protocol Connectrpc_Conformance_V1_LoadBalancerStatsServiceClientInterface { + + /// Gets the backend distribution for RPCs sent by a test client. + @discardableResult + func `getClientStats`(request: Connectrpc_Conformance_V1_LoadBalancerStatsRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// Gets the backend distribution for RPCs sent by a test client. + @available(iOS 13, *) + func `getClientStats`(request: Connectrpc_Conformance_V1_LoadBalancerStatsRequest, headers: Connect.Headers) async -> ResponseMessage + + /// Gets the accumulated stats for RPCs sent by a test client. + @discardableResult + func `getClientAccumulatedStats`(request: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// Gets the accumulated stats for RPCs sent by a test client. + @available(iOS 13, *) + func `getClientAccumulatedStats`(request: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers) async -> ResponseMessage +} + +/// Concrete implementation of `Connectrpc_Conformance_V1_LoadBalancerStatsServiceClientInterface`. +internal final class Connectrpc_Conformance_V1_LoadBalancerStatsServiceClient: Connectrpc_Conformance_V1_LoadBalancerStatsServiceClientInterface { + private let client: Connect.ProtocolClientInterface + + internal init(client: Connect.ProtocolClientInterface) { + self.client = client + } + + @discardableResult + internal func `getClientStats`(request: Connectrpc_Conformance_V1_LoadBalancerStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.LoadBalancerStatsService/GetClientStats", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `getClientStats`(request: Connectrpc_Conformance_V1_LoadBalancerStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.LoadBalancerStatsService/GetClientStats", request: request, headers: headers) + } + + @discardableResult + internal func `getClientAccumulatedStats`(request: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `getClientAccumulatedStats`(request: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let getClientStats = Connect.MethodSpec(name: "GetClientStats", service: "connectrpc.conformance.v1.LoadBalancerStatsService", type: .unary) + internal static let getClientAccumulatedStats = Connect.MethodSpec(name: "GetClientAccumulatedStats", service: "connectrpc.conformance.v1.LoadBalancerStatsService", type: .unary) + } + } +} + +/// A service to remotely control health status of an xDS test server. +internal protocol Connectrpc_Conformance_V1_XdsUpdateHealthServiceClientInterface { + + @discardableResult + func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + @available(iOS 13, *) + func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage + + @discardableResult + func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + @available(iOS 13, *) + func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage +} + +/// Concrete implementation of `Connectrpc_Conformance_V1_XdsUpdateHealthServiceClientInterface`. +internal final class Connectrpc_Conformance_V1_XdsUpdateHealthServiceClient: Connectrpc_Conformance_V1_XdsUpdateHealthServiceClientInterface { + private let client: Connect.ProtocolClientInterface + + internal init(client: Connect.ProtocolClientInterface) { + self.client = client + } + + @discardableResult + internal func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.XdsUpdateHealthService/SetServing", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.XdsUpdateHealthService/SetServing", request: request, headers: headers) + } + + @discardableResult + internal func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.XdsUpdateHealthService/SetNotServing", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.XdsUpdateHealthService/SetNotServing", request: request, headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let setServing = Connect.MethodSpec(name: "SetServing", service: "connectrpc.conformance.v1.XdsUpdateHealthService", type: .unary) + internal static let setNotServing = Connect.MethodSpec(name: "SetNotServing", service: "connectrpc.conformance.v1.XdsUpdateHealthService", type: .unary) + } + } +} + +/// A service to dynamically update the configuration of an xDS test client. +internal protocol Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClientInterface { + + /// Update the tes client's configuration. + @discardableResult + func `configure`(request: Connectrpc_Conformance_V1_ClientConfigureRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// Update the tes client's configuration. + @available(iOS 13, *) + func `configure`(request: Connectrpc_Conformance_V1_ClientConfigureRequest, headers: Connect.Headers) async -> ResponseMessage +} + +/// Concrete implementation of `Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClientInterface`. +internal final class Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClient: Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClientInterface { + private let client: Connect.ProtocolClientInterface + + internal init(client: Connect.ProtocolClientInterface) { + self.client = client + } + + @discardableResult + internal func `configure`(request: Connectrpc_Conformance_V1_ClientConfigureRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.v1.XdsUpdateClientConfigureService/Configure", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `configure`(request: Connectrpc_Conformance_V1_ClientConfigureRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.v1.XdsUpdateClientConfigureService/Configure", request: request, headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let configure = Connect.MethodSpec(name: "Configure", service: "connectrpc.conformance.v1.XdsUpdateClientConfigureService", type: .unary) + } + } +} diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.mock.swift similarity index 59% rename from Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.mock.swift index aa671261..bf22c7dd 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.mock.swift @@ -1,6 +1,6 @@ // Code generated by protoc-gen-connect-swift. DO NOT EDIT. // -// Source: grpc/testing/test.proto +// Source: connectrpc/conformance/v1/test.proto // import Combine @@ -9,14 +9,14 @@ import ConnectMocks import Foundation import SwiftProtobuf -/// Mock implementation of `Grpc_Testing_TestServiceClientInterface`. +/// Mock implementation of `Connectrpc_Conformance_V1_TestServiceClientInterface`. /// /// Production implementations can be substituted with instances of this /// class, allowing for mocking RPC calls. Behavior can be customized /// either through the properties on this class or by /// subclassing the class and overriding its methods. @available(iOS 13, *) -internal class Grpc_Testing_TestServiceClientMock: Grpc_Testing_TestServiceClientInterface { +internal class Connectrpc_Conformance_V1_TestServiceClientMock: Connectrpc_Conformance_V1_TestServiceClientInterface { private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `emptyCall()`. @@ -24,37 +24,37 @@ internal class Grpc_Testing_TestServiceClientMock: Grpc_Testing_TestServiceClien /// Mocked for async calls to `emptyCall()`. internal var mockAsyncEmptyCall = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `unaryCall()`. - internal var mockUnaryCall = { (_: Grpc_Testing_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockUnaryCall = { (_: Connectrpc_Conformance_V1_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `unaryCall()`. - internal var mockAsyncUnaryCall = { (_: Grpc_Testing_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncUnaryCall = { (_: Connectrpc_Conformance_V1_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `failUnaryCall()`. - internal var mockFailUnaryCall = { (_: Grpc_Testing_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockFailUnaryCall = { (_: Connectrpc_Conformance_V1_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `failUnaryCall()`. - internal var mockAsyncFailUnaryCall = { (_: Grpc_Testing_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncFailUnaryCall = { (_: Connectrpc_Conformance_V1_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `cacheableUnaryCall()`. - internal var mockCacheableUnaryCall = { (_: Grpc_Testing_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockCacheableUnaryCall = { (_: Connectrpc_Conformance_V1_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `cacheableUnaryCall()`. - internal var mockAsyncCacheableUnaryCall = { (_: Grpc_Testing_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncCacheableUnaryCall = { (_: Connectrpc_Conformance_V1_SimpleRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `streamingOutputCall()`. - internal var mockStreamingOutputCall = MockServerOnlyStream() + internal var mockStreamingOutputCall = MockServerOnlyStream() /// Mocked for async calls to `streamingOutputCall()`. - internal var mockAsyncStreamingOutputCall = MockServerOnlyAsyncStream() + internal var mockAsyncStreamingOutputCall = MockServerOnlyAsyncStream() /// Mocked for calls to `failStreamingOutputCall()`. - internal var mockFailStreamingOutputCall = MockServerOnlyStream() + internal var mockFailStreamingOutputCall = MockServerOnlyStream() /// Mocked for async calls to `failStreamingOutputCall()`. - internal var mockAsyncFailStreamingOutputCall = MockServerOnlyAsyncStream() + internal var mockAsyncFailStreamingOutputCall = MockServerOnlyAsyncStream() /// Mocked for calls to `streamingInputCall()`. - internal var mockStreamingInputCall = MockClientOnlyStream() + internal var mockStreamingInputCall = MockClientOnlyStream() /// Mocked for async calls to `streamingInputCall()`. - internal var mockAsyncStreamingInputCall = MockClientOnlyAsyncStream() + internal var mockAsyncStreamingInputCall = MockClientOnlyAsyncStream() /// Mocked for calls to `fullDuplexCall()`. - internal var mockFullDuplexCall = MockBidirectionalStream() + internal var mockFullDuplexCall = MockBidirectionalStream() /// Mocked for async calls to `fullDuplexCall()`. - internal var mockAsyncFullDuplexCall = MockBidirectionalAsyncStream() + internal var mockAsyncFullDuplexCall = MockBidirectionalAsyncStream() /// Mocked for calls to `halfDuplexCall()`. - internal var mockHalfDuplexCall = MockBidirectionalStream() + internal var mockHalfDuplexCall = MockBidirectionalStream() /// Mocked for async calls to `halfDuplexCall()`. - internal var mockAsyncHalfDuplexCall = MockBidirectionalAsyncStream() + internal var mockAsyncHalfDuplexCall = MockBidirectionalAsyncStream() /// Mocked for calls to `unimplementedCall()`. internal var mockUnimplementedCall = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `unimplementedCall()`. @@ -77,77 +77,77 @@ internal class Grpc_Testing_TestServiceClientMock: Grpc_Testing_TestServiceClien } @discardableResult - internal func `unaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `unaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockUnaryCall(request)) return Connect.Cancelable {} } - internal func `unaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `unaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncUnaryCall(request) } @discardableResult - internal func `failUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `failUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockFailUnaryCall(request)) return Connect.Cancelable {} } - internal func `failUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `failUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncFailUnaryCall(request) } @discardableResult - internal func `cacheableUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `cacheableUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockCacheableUnaryCall(request)) return Connect.Cancelable {} } - internal func `cacheableUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `cacheableUnaryCall`(request: Connectrpc_Conformance_V1_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncCacheableUnaryCall(request) } - internal func `streamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { + internal func `streamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { self.mockStreamingOutputCall.$inputs.first { !$0.isEmpty }.sink { _ in self.mockStreamingOutputCall.outputs.forEach(onResult) }.store(in: &self.cancellables) return self.mockStreamingOutputCall } - internal func `streamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + internal func `streamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { return self.mockAsyncStreamingOutputCall } - internal func `failStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { + internal func `failStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { self.mockFailStreamingOutputCall.$inputs.first { !$0.isEmpty }.sink { _ in self.mockFailStreamingOutputCall.outputs.forEach(onResult) }.store(in: &self.cancellables) return self.mockFailStreamingOutputCall } - internal func `failStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + internal func `failStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { return self.mockAsyncFailStreamingOutputCall } - internal func `streamingInputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ClientOnlyStreamInterface { + internal func `streamingInputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ClientOnlyStreamInterface { self.mockStreamingInputCall.$inputs.first { !$0.isEmpty }.sink { _ in self.mockStreamingInputCall.outputs.forEach(onResult) }.store(in: &self.cancellables) return self.mockStreamingInputCall } - internal func `streamingInputCall`(headers: Connect.Headers = [:]) -> any Connect.ClientOnlyAsyncStreamInterface { + internal func `streamingInputCall`(headers: Connect.Headers = [:]) -> any Connect.ClientOnlyAsyncStreamInterface { return self.mockAsyncStreamingInputCall } - internal func `fullDuplexCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface { + internal func `fullDuplexCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface { self.mockFullDuplexCall.$inputs.first { !$0.isEmpty }.sink { _ in self.mockFullDuplexCall.outputs.forEach(onResult) }.store(in: &self.cancellables) return self.mockFullDuplexCall } - internal func `fullDuplexCall`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { + internal func `fullDuplexCall`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { return self.mockAsyncFullDuplexCall } - internal func `halfDuplexCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface { + internal func `halfDuplexCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface { self.mockHalfDuplexCall.$inputs.first { !$0.isEmpty }.sink { _ in self.mockHalfDuplexCall.outputs.forEach(onResult) }.store(in: &self.cancellables) return self.mockHalfDuplexCall } - internal func `halfDuplexCall`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { + internal func `halfDuplexCall`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { return self.mockAsyncHalfDuplexCall } @@ -171,14 +171,14 @@ internal class Grpc_Testing_TestServiceClientMock: Grpc_Testing_TestServiceClien } } -/// Mock implementation of `Grpc_Testing_UnimplementedServiceClientInterface`. +/// Mock implementation of `Connectrpc_Conformance_V1_UnimplementedServiceClientInterface`. /// /// Production implementations can be substituted with instances of this /// class, allowing for mocking RPC calls. Behavior can be customized /// either through the properties on this class or by /// subclassing the class and overriding its methods. @available(iOS 13, *) -internal class Grpc_Testing_UnimplementedServiceClientMock: Grpc_Testing_UnimplementedServiceClientInterface { +internal class Connectrpc_Conformance_V1_UnimplementedServiceClientMock: Connectrpc_Conformance_V1_UnimplementedServiceClientInterface { private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `unimplementedCall()`. @@ -212,98 +212,98 @@ internal class Grpc_Testing_UnimplementedServiceClientMock: Grpc_Testing_Unimple } } -/// Mock implementation of `Grpc_Testing_ReconnectServiceClientInterface`. +/// Mock implementation of `Connectrpc_Conformance_V1_ReconnectServiceClientInterface`. /// /// Production implementations can be substituted with instances of this /// class, allowing for mocking RPC calls. Behavior can be customized /// either through the properties on this class or by /// subclassing the class and overriding its methods. @available(iOS 13, *) -internal class Grpc_Testing_ReconnectServiceClientMock: Grpc_Testing_ReconnectServiceClientInterface { +internal class Connectrpc_Conformance_V1_ReconnectServiceClientMock: Connectrpc_Conformance_V1_ReconnectServiceClientInterface { private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `start()`. - internal var mockStart = { (_: Grpc_Testing_ReconnectParams) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockStart = { (_: Connectrpc_Conformance_V1_ReconnectParams) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `start()`. - internal var mockAsyncStart = { (_: Grpc_Testing_ReconnectParams) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncStart = { (_: Connectrpc_Conformance_V1_ReconnectParams) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `stop()`. - internal var mockStop = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockStop = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `stop()`. - internal var mockAsyncStop = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncStop = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } internal init() {} @discardableResult - internal func `start`(request: Grpc_Testing_ReconnectParams, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `start`(request: Connectrpc_Conformance_V1_ReconnectParams, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockStart(request)) return Connect.Cancelable {} } - internal func `start`(request: Grpc_Testing_ReconnectParams, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `start`(request: Connectrpc_Conformance_V1_ReconnectParams, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncStart(request) } @discardableResult - internal func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockStop(request)) return Connect.Cancelable {} } - internal func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncStop(request) } } -/// Mock implementation of `Grpc_Testing_LoadBalancerStatsServiceClientInterface`. +/// Mock implementation of `Connectrpc_Conformance_V1_LoadBalancerStatsServiceClientInterface`. /// /// Production implementations can be substituted with instances of this /// class, allowing for mocking RPC calls. Behavior can be customized /// either through the properties on this class or by /// subclassing the class and overriding its methods. @available(iOS 13, *) -internal class Grpc_Testing_LoadBalancerStatsServiceClientMock: Grpc_Testing_LoadBalancerStatsServiceClientInterface { +internal class Connectrpc_Conformance_V1_LoadBalancerStatsServiceClientMock: Connectrpc_Conformance_V1_LoadBalancerStatsServiceClientInterface { private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `getClientStats()`. - internal var mockGetClientStats = { (_: Grpc_Testing_LoadBalancerStatsRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockGetClientStats = { (_: Connectrpc_Conformance_V1_LoadBalancerStatsRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `getClientStats()`. - internal var mockAsyncGetClientStats = { (_: Grpc_Testing_LoadBalancerStatsRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncGetClientStats = { (_: Connectrpc_Conformance_V1_LoadBalancerStatsRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `getClientAccumulatedStats()`. - internal var mockGetClientAccumulatedStats = { (_: Grpc_Testing_LoadBalancerAccumulatedStatsRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockGetClientAccumulatedStats = { (_: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `getClientAccumulatedStats()`. - internal var mockAsyncGetClientAccumulatedStats = { (_: Grpc_Testing_LoadBalancerAccumulatedStatsRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncGetClientAccumulatedStats = { (_: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest) -> ResponseMessage in .init(result: .success(.init())) } internal init() {} @discardableResult - internal func `getClientStats`(request: Grpc_Testing_LoadBalancerStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `getClientStats`(request: Connectrpc_Conformance_V1_LoadBalancerStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockGetClientStats(request)) return Connect.Cancelable {} } - internal func `getClientStats`(request: Grpc_Testing_LoadBalancerStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `getClientStats`(request: Connectrpc_Conformance_V1_LoadBalancerStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncGetClientStats(request) } @discardableResult - internal func `getClientAccumulatedStats`(request: Grpc_Testing_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `getClientAccumulatedStats`(request: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockGetClientAccumulatedStats(request)) return Connect.Cancelable {} } - internal func `getClientAccumulatedStats`(request: Grpc_Testing_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `getClientAccumulatedStats`(request: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncGetClientAccumulatedStats(request) } } -/// Mock implementation of `Grpc_Testing_XdsUpdateHealthServiceClientInterface`. +/// Mock implementation of `Connectrpc_Conformance_V1_XdsUpdateHealthServiceClientInterface`. /// /// Production implementations can be substituted with instances of this /// class, allowing for mocking RPC calls. Behavior can be customized /// either through the properties on this class or by /// subclassing the class and overriding its methods. @available(iOS 13, *) -internal class Grpc_Testing_XdsUpdateHealthServiceClientMock: Grpc_Testing_XdsUpdateHealthServiceClientInterface { +internal class Connectrpc_Conformance_V1_XdsUpdateHealthServiceClientMock: Connectrpc_Conformance_V1_XdsUpdateHealthServiceClientInterface { private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `setServing()`. @@ -338,30 +338,30 @@ internal class Grpc_Testing_XdsUpdateHealthServiceClientMock: Grpc_Testing_XdsUp } } -/// Mock implementation of `Grpc_Testing_XdsUpdateClientConfigureServiceClientInterface`. +/// Mock implementation of `Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClientInterface`. /// /// Production implementations can be substituted with instances of this /// class, allowing for mocking RPC calls. Behavior can be customized /// either through the properties on this class or by /// subclassing the class and overriding its methods. @available(iOS 13, *) -internal class Grpc_Testing_XdsUpdateClientConfigureServiceClientMock: Grpc_Testing_XdsUpdateClientConfigureServiceClientInterface { +internal class Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClientMock: Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClientInterface { private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `configure()`. - internal var mockConfigure = { (_: Grpc_Testing_ClientConfigureRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockConfigure = { (_: Connectrpc_Conformance_V1_ClientConfigureRequest) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `configure()`. - internal var mockAsyncConfigure = { (_: Grpc_Testing_ClientConfigureRequest) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncConfigure = { (_: Connectrpc_Conformance_V1_ClientConfigureRequest) -> ResponseMessage in .init(result: .success(.init())) } internal init() {} @discardableResult - internal func `configure`(request: Grpc_Testing_ClientConfigureRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `configure`(request: Connectrpc_Conformance_V1_ClientConfigureRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockConfigure(request)) return Connect.Cancelable {} } - internal func `configure`(request: Grpc_Testing_ClientConfigureRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `configure`(request: Connectrpc_Conformance_V1_ClientConfigureRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncConfigure(request) } } diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.pb.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.pb.swift similarity index 79% rename from Tests/ConnectLibraryTests/Generated/grpc/testing/test.pb.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.pb.swift index ea5677fb..12171131 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.pb.swift +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.pb.swift @@ -2,11 +2,25 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: grpc/testing/test.proto +// Source: connectrpc/conformance/v1/test.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ +// Copyright 2022 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/test.proto // // The TestService has been extended to include the following RPCs: diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift b/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift deleted file mode 100644 index e8acb2d1..00000000 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift +++ /dev/null @@ -1,502 +0,0 @@ -// Code generated by protoc-gen-connect-swift. DO NOT EDIT. -// -// Source: grpc/testing/test.proto -// - -import Connect -import Foundation -import SwiftProtobuf - -/// A simple service to test the various types of RPCs and experiment with -/// performance with various types of payload. -internal protocol Grpc_Testing_TestServiceClientInterface { - - /// One empty request followed by one empty response. - @discardableResult - func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - /// One empty request followed by one empty response. - @available(iOS 13, *) - func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage - - /// One request followed by one response. - @discardableResult - func `unaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - /// One request followed by one response. - @available(iOS 13, *) - func `unaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage - - /// One request followed by one response. This RPC always fails. - @discardableResult - func `failUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - /// One request followed by one response. This RPC always fails. - @available(iOS 13, *) - func `failUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage - - /// One request followed by one response. Response has cache control - /// headers set such that a caching HTTP proxy (such as GFE) can - /// satisfy subsequent requests. - @discardableResult - func `cacheableUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - /// One request followed by one response. Response has cache control - /// headers set such that a caching HTTP proxy (such as GFE) can - /// satisfy subsequent requests. - @available(iOS 13, *) - func `cacheableUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage - - /// One request followed by a sequence of responses (streamed download). - /// The server returns the payload with client desired type and sizes. - func `streamingOutputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface - - /// One request followed by a sequence of responses (streamed download). - /// The server returns the payload with client desired type and sizes. - @available(iOS 13, *) - func `streamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface - - /// One request followed by a sequence of responses (streamed download). - /// The server returns the payload with client desired type and sizes. - /// This RPC always responds with an error status. - func `failStreamingOutputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface - - /// One request followed by a sequence of responses (streamed download). - /// The server returns the payload with client desired type and sizes. - /// This RPC always responds with an error status. - @available(iOS 13, *) - func `failStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface - - /// A sequence of requests followed by one response (streamed upload). - /// The server returns the aggregated size of client payload as the result. - func `streamingInputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ClientOnlyStreamInterface - - /// A sequence of requests followed by one response (streamed upload). - /// The server returns the aggregated size of client payload as the result. - @available(iOS 13, *) - func `streamingInputCall`(headers: Connect.Headers) -> any Connect.ClientOnlyAsyncStreamInterface - - /// A sequence of requests with each request served by the server immediately. - /// As one request could lead to multiple responses, this interface - /// demonstrates the idea of full duplexing. - func `fullDuplexCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface - - /// A sequence of requests with each request served by the server immediately. - /// As one request could lead to multiple responses, this interface - /// demonstrates the idea of full duplexing. - @available(iOS 13, *) - func `fullDuplexCall`(headers: Connect.Headers) -> any Connect.BidirectionalAsyncStreamInterface - - /// A sequence of requests followed by a sequence of responses. - /// The server buffers all the client requests and then serves them in order. A - /// stream of responses are returned to the client when the server starts with - /// first request. - func `halfDuplexCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface - - /// A sequence of requests followed by a sequence of responses. - /// The server buffers all the client requests and then serves them in order. A - /// stream of responses are returned to the client when the server starts with - /// first request. - @available(iOS 13, *) - func `halfDuplexCall`(headers: Connect.Headers) -> any Connect.BidirectionalAsyncStreamInterface - - /// The test server will not implement this method. It will be used - /// to test the behavior when clients call unimplemented methods. - @discardableResult - func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - /// The test server will not implement this method. It will be used - /// to test the behavior when clients call unimplemented methods. - @available(iOS 13, *) - func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage - - /// The test server will not implement this method. It will be used - /// to test the behavior when clients call unimplemented streaming output methods. - func `unimplementedStreamingOutputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface - - /// The test server will not implement this method. It will be used - /// to test the behavior when clients call unimplemented streaming output methods. - @available(iOS 13, *) - func `unimplementedStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface -} - -/// Concrete implementation of `Grpc_Testing_TestServiceClientInterface`. -internal final class Grpc_Testing_TestServiceClient: Grpc_Testing_TestServiceClientInterface { - private let client: Connect.ProtocolClientInterface - - internal init(client: Connect.ProtocolClientInterface) { - self.client = client - } - - @discardableResult - internal func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.TestService/EmptyCall", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.TestService/EmptyCall", request: request, headers: headers) - } - - @discardableResult - internal func `unaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.TestService/UnaryCall", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `unaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.TestService/UnaryCall", request: request, headers: headers) - } - - @discardableResult - internal func `failUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.TestService/FailUnaryCall", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `failUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.TestService/FailUnaryCall", request: request, headers: headers) - } - - @discardableResult - internal func `cacheableUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.TestService/CacheableUnaryCall", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `cacheableUnaryCall`(request: Grpc_Testing_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.TestService/CacheableUnaryCall", request: request, headers: headers) - } - - internal func `streamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { - return self.client.serverOnlyStream(path: "/grpc.testing.TestService/StreamingOutputCall", headers: headers, onResult: onResult) - } - - @available(iOS 13, *) - internal func `streamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { - return self.client.serverOnlyStream(path: "/grpc.testing.TestService/StreamingOutputCall", headers: headers) - } - - internal func `failStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { - return self.client.serverOnlyStream(path: "/grpc.testing.TestService/FailStreamingOutputCall", headers: headers, onResult: onResult) - } - - @available(iOS 13, *) - internal func `failStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { - return self.client.serverOnlyStream(path: "/grpc.testing.TestService/FailStreamingOutputCall", headers: headers) - } - - internal func `streamingInputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ClientOnlyStreamInterface { - return self.client.clientOnlyStream(path: "/grpc.testing.TestService/StreamingInputCall", headers: headers, onResult: onResult) - } - - @available(iOS 13, *) - internal func `streamingInputCall`(headers: Connect.Headers = [:]) -> any Connect.ClientOnlyAsyncStreamInterface { - return self.client.clientOnlyStream(path: "/grpc.testing.TestService/StreamingInputCall", headers: headers) - } - - internal func `fullDuplexCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface { - return self.client.bidirectionalStream(path: "/grpc.testing.TestService/FullDuplexCall", headers: headers, onResult: onResult) - } - - @available(iOS 13, *) - internal func `fullDuplexCall`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { - return self.client.bidirectionalStream(path: "/grpc.testing.TestService/FullDuplexCall", headers: headers) - } - - internal func `halfDuplexCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.BidirectionalStreamInterface { - return self.client.bidirectionalStream(path: "/grpc.testing.TestService/HalfDuplexCall", headers: headers, onResult: onResult) - } - - @available(iOS 13, *) - internal func `halfDuplexCall`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { - return self.client.bidirectionalStream(path: "/grpc.testing.TestService/HalfDuplexCall", headers: headers) - } - - @discardableResult - internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.TestService/UnimplementedCall", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.TestService/UnimplementedCall", request: request, headers: headers) - } - - internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { - return self.client.serverOnlyStream(path: "/grpc.testing.TestService/UnimplementedStreamingOutputCall", headers: headers, onResult: onResult) - } - - @available(iOS 13, *) - internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { - return self.client.serverOnlyStream(path: "/grpc.testing.TestService/UnimplementedStreamingOutputCall", headers: headers) - } - - internal enum Metadata { - internal enum Methods { - internal static let emptyCall = Connect.MethodSpec(name: "EmptyCall", service: "grpc.testing.TestService", type: .unary) - internal static let unaryCall = Connect.MethodSpec(name: "UnaryCall", service: "grpc.testing.TestService", type: .unary) - internal static let failUnaryCall = Connect.MethodSpec(name: "FailUnaryCall", service: "grpc.testing.TestService", type: .unary) - internal static let cacheableUnaryCall = Connect.MethodSpec(name: "CacheableUnaryCall", service: "grpc.testing.TestService", type: .unary) - internal static let streamingOutputCall = Connect.MethodSpec(name: "StreamingOutputCall", service: "grpc.testing.TestService", type: .serverStream) - internal static let failStreamingOutputCall = Connect.MethodSpec(name: "FailStreamingOutputCall", service: "grpc.testing.TestService", type: .serverStream) - internal static let streamingInputCall = Connect.MethodSpec(name: "StreamingInputCall", service: "grpc.testing.TestService", type: .clientStream) - internal static let fullDuplexCall = Connect.MethodSpec(name: "FullDuplexCall", service: "grpc.testing.TestService", type: .bidirectionalStream) - internal static let halfDuplexCall = Connect.MethodSpec(name: "HalfDuplexCall", service: "grpc.testing.TestService", type: .bidirectionalStream) - internal static let unimplementedCall = Connect.MethodSpec(name: "UnimplementedCall", service: "grpc.testing.TestService", type: .unary) - internal static let unimplementedStreamingOutputCall = Connect.MethodSpec(name: "UnimplementedStreamingOutputCall", service: "grpc.testing.TestService", type: .serverStream) - } - } -} - -/// A simple service NOT implemented at servers so clients can test for -/// that case. -internal protocol Grpc_Testing_UnimplementedServiceClientInterface { - - /// A call that no server should implement - @discardableResult - func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - /// A call that no server should implement - @available(iOS 13, *) - func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage - - /// A call that no server should implement - func `unimplementedStreamingOutputCall`(headers: Connect.Headers, onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface - - /// A call that no server should implement - @available(iOS 13, *) - func `unimplementedStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface -} - -/// Concrete implementation of `Grpc_Testing_UnimplementedServiceClientInterface`. -internal final class Grpc_Testing_UnimplementedServiceClient: Grpc_Testing_UnimplementedServiceClientInterface { - private let client: Connect.ProtocolClientInterface - - internal init(client: Connect.ProtocolClientInterface) { - self.client = client - } - - @discardableResult - internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.UnimplementedService/UnimplementedCall", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.UnimplementedService/UnimplementedCall", request: request, headers: headers) - } - - internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { - return self.client.serverOnlyStream(path: "/grpc.testing.UnimplementedService/UnimplementedStreamingOutputCall", headers: headers, onResult: onResult) - } - - @available(iOS 13, *) - internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { - return self.client.serverOnlyStream(path: "/grpc.testing.UnimplementedService/UnimplementedStreamingOutputCall", headers: headers) - } - - internal enum Metadata { - internal enum Methods { - internal static let unimplementedCall = Connect.MethodSpec(name: "UnimplementedCall", service: "grpc.testing.UnimplementedService", type: .unary) - internal static let unimplementedStreamingOutputCall = Connect.MethodSpec(name: "UnimplementedStreamingOutputCall", service: "grpc.testing.UnimplementedService", type: .serverStream) - } - } -} - -/// A service used to control reconnect server. -internal protocol Grpc_Testing_ReconnectServiceClientInterface { - - @discardableResult - func `start`(request: Grpc_Testing_ReconnectParams, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - @available(iOS 13, *) - func `start`(request: Grpc_Testing_ReconnectParams, headers: Connect.Headers) async -> ResponseMessage - - @discardableResult - func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - @available(iOS 13, *) - func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage -} - -/// Concrete implementation of `Grpc_Testing_ReconnectServiceClientInterface`. -internal final class Grpc_Testing_ReconnectServiceClient: Grpc_Testing_ReconnectServiceClientInterface { - private let client: Connect.ProtocolClientInterface - - internal init(client: Connect.ProtocolClientInterface) { - self.client = client - } - - @discardableResult - internal func `start`(request: Grpc_Testing_ReconnectParams, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.ReconnectService/Start", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `start`(request: Grpc_Testing_ReconnectParams, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.ReconnectService/Start", request: request, headers: headers) - } - - @discardableResult - internal func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.ReconnectService/Stop", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.ReconnectService/Stop", request: request, headers: headers) - } - - internal enum Metadata { - internal enum Methods { - internal static let start = Connect.MethodSpec(name: "Start", service: "grpc.testing.ReconnectService", type: .unary) - internal static let stop = Connect.MethodSpec(name: "Stop", service: "grpc.testing.ReconnectService", type: .unary) - } - } -} - -/// A service used to obtain stats for verifying LB behavior. -internal protocol Grpc_Testing_LoadBalancerStatsServiceClientInterface { - - /// Gets the backend distribution for RPCs sent by a test client. - @discardableResult - func `getClientStats`(request: Grpc_Testing_LoadBalancerStatsRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - /// Gets the backend distribution for RPCs sent by a test client. - @available(iOS 13, *) - func `getClientStats`(request: Grpc_Testing_LoadBalancerStatsRequest, headers: Connect.Headers) async -> ResponseMessage - - /// Gets the accumulated stats for RPCs sent by a test client. - @discardableResult - func `getClientAccumulatedStats`(request: Grpc_Testing_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - /// Gets the accumulated stats for RPCs sent by a test client. - @available(iOS 13, *) - func `getClientAccumulatedStats`(request: Grpc_Testing_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers) async -> ResponseMessage -} - -/// Concrete implementation of `Grpc_Testing_LoadBalancerStatsServiceClientInterface`. -internal final class Grpc_Testing_LoadBalancerStatsServiceClient: Grpc_Testing_LoadBalancerStatsServiceClientInterface { - private let client: Connect.ProtocolClientInterface - - internal init(client: Connect.ProtocolClientInterface) { - self.client = client - } - - @discardableResult - internal func `getClientStats`(request: Grpc_Testing_LoadBalancerStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.LoadBalancerStatsService/GetClientStats", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `getClientStats`(request: Grpc_Testing_LoadBalancerStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.LoadBalancerStatsService/GetClientStats", request: request, headers: headers) - } - - @discardableResult - internal func `getClientAccumulatedStats`(request: Grpc_Testing_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `getClientAccumulatedStats`(request: Grpc_Testing_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers) - } - - internal enum Metadata { - internal enum Methods { - internal static let getClientStats = Connect.MethodSpec(name: "GetClientStats", service: "grpc.testing.LoadBalancerStatsService", type: .unary) - internal static let getClientAccumulatedStats = Connect.MethodSpec(name: "GetClientAccumulatedStats", service: "grpc.testing.LoadBalancerStatsService", type: .unary) - } - } -} - -/// A service to remotely control health status of an xDS test server. -internal protocol Grpc_Testing_XdsUpdateHealthServiceClientInterface { - - @discardableResult - func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - @available(iOS 13, *) - func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage - - @discardableResult - func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - @available(iOS 13, *) - func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage -} - -/// Concrete implementation of `Grpc_Testing_XdsUpdateHealthServiceClientInterface`. -internal final class Grpc_Testing_XdsUpdateHealthServiceClient: Grpc_Testing_XdsUpdateHealthServiceClientInterface { - private let client: Connect.ProtocolClientInterface - - internal init(client: Connect.ProtocolClientInterface) { - self.client = client - } - - @discardableResult - internal func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.XdsUpdateHealthService/SetServing", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.XdsUpdateHealthService/SetServing", request: request, headers: headers) - } - - @discardableResult - internal func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.XdsUpdateHealthService/SetNotServing", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.XdsUpdateHealthService/SetNotServing", request: request, headers: headers) - } - - internal enum Metadata { - internal enum Methods { - internal static let setServing = Connect.MethodSpec(name: "SetServing", service: "grpc.testing.XdsUpdateHealthService", type: .unary) - internal static let setNotServing = Connect.MethodSpec(name: "SetNotServing", service: "grpc.testing.XdsUpdateHealthService", type: .unary) - } - } -} - -/// A service to dynamically update the configuration of an xDS test client. -internal protocol Grpc_Testing_XdsUpdateClientConfigureServiceClientInterface { - - /// Update the tes client's configuration. - @discardableResult - func `configure`(request: Grpc_Testing_ClientConfigureRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable - - /// Update the tes client's configuration. - @available(iOS 13, *) - func `configure`(request: Grpc_Testing_ClientConfigureRequest, headers: Connect.Headers) async -> ResponseMessage -} - -/// Concrete implementation of `Grpc_Testing_XdsUpdateClientConfigureServiceClientInterface`. -internal final class Grpc_Testing_XdsUpdateClientConfigureServiceClient: Grpc_Testing_XdsUpdateClientConfigureServiceClientInterface { - private let client: Connect.ProtocolClientInterface - - internal init(client: Connect.ProtocolClientInterface) { - self.client = client - } - - @discardableResult - internal func `configure`(request: Grpc_Testing_ClientConfigureRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/grpc.testing.XdsUpdateClientConfigureService/Configure", request: request, headers: headers, completion: completion) - } - - @available(iOS 13, *) - internal func `configure`(request: Grpc_Testing_ClientConfigureRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.XdsUpdateClientConfigureService/Configure", request: request, headers: headers) - } - - internal enum Metadata { - internal enum Methods { - internal static let configure = Connect.MethodSpec(name: "Configure", service: "grpc.testing.XdsUpdateClientConfigureService", type: .unary) - } - } -}