From 5532fb4ff1668ac873ebe5a841398a8692306562 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 11:20:11 -0400 Subject: [PATCH 01/19] Merge --- .../GeneratedSources/eliza.connect.swift | 6 +- Makefile | 5 +- Package.swift | 1 - .../AsyncAwaitConformance.swift | 66 +++- .../CallbackConformance.swift | 76 +++-- .../ConnectMocksTests/ConnectMocksTests.swift | 8 +- .../Generated/grpc/testing/empty.pb.swift | 81 ----- .../Generated/grpc/testing/messages.pb.swift | 73 +---- .../Generated/grpc/testing/test.connect.swift | 160 +++++----- .../Generated/grpc/testing/test.mock.swift | 72 ++--- .../Generated/grpc/testing/test.pb.swift | 4 +- .../Generated/server/v1/server.pb.swift | 2 +- Tests/ConnectLibraryTests/proto/README.md | 2 - Tests/ConnectLibraryTests/proto/buf.yaml | 12 - .../proto/grpc/testing/empty.proto | 29 -- .../proto/grpc/testing/messages.proto | 284 ------------------ .../proto/grpc/testing/test.proto | 122 -------- .../proto/server/v1/server.proto | 40 --- 18 files changed, 253 insertions(+), 790 deletions(-) delete mode 100644 Tests/ConnectLibraryTests/Generated/grpc/testing/empty.pb.swift delete mode 100644 Tests/ConnectLibraryTests/proto/README.md delete mode 100644 Tests/ConnectLibraryTests/proto/buf.yaml delete mode 100644 Tests/ConnectLibraryTests/proto/grpc/testing/empty.proto delete mode 100644 Tests/ConnectLibraryTests/proto/grpc/testing/messages.proto delete mode 100644 Tests/ConnectLibraryTests/proto/grpc/testing/test.proto delete mode 100644 Tests/ConnectLibraryTests/proto/server/v1/server.proto diff --git a/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift b/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift index cf4b6efe..5addaace 100644 --- a/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift +++ b/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift @@ -41,16 +41,16 @@ internal final class Connectrpc_Eliza_V1_ElizaServiceClient: Connectrpc_Eliza_V1 @available(iOS 13, *) internal func `say`(request: Connectrpc_Eliza_V1_SayRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/connectrpc.eliza.v1.ElizaService/Say", request: request, headers: headers) + return await self.client.unary(path: "connectrpc.eliza.v1.ElizaService/Say", request: request, headers: headers) } @available(iOS 13, *) internal func `converse`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { - return self.client.bidirectionalStream(path: "/connectrpc.eliza.v1.ElizaService/Converse", headers: headers) + return self.client.bidirectionalStream(path: "connectrpc.eliza.v1.ElizaService/Converse", headers: headers) } @available(iOS 13, *) internal func `introduce`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { - return self.client.serverOnlyStream(path: "/connectrpc.eliza.v1.ElizaService/Introduce", headers: headers) + return self.client.serverOnlyStream(path: "connectrpc.eliza.v1.ElizaService/Introduce", headers: headers) } } diff --git a/Makefile b/Makefile index 33cbb7ba..2ea95e98 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 := 4f4e96d8fea3ed9473b90a964a5ba429e7ea5649 +CONFORMANCE_VERSION := 36ce5b0ce50bc8cb3314eee08a72eeda4c96721e LICENSE_HEADER_VERSION := v1.12.0 LICENSE_IGNORE := -e Package.swift \ -e $(BIN)\/ \ @@ -57,7 +57,8 @@ conformanceserverrun: conformanceserverstop ## Start the conformance server generate: cleangenerated ## Regenerate outputs for all .proto files cd Examples; buf generate cd Libraries/Connect; buf generate - cd Tests/ConnectLibraryTests; buf generate + cd Tests/ConnectLibraryTests; buf generate https://github.com/connectrpc/conformance.git#ref=$(CONFORMANCE_VERSION),subdir=proto + # cd Tests/ConnectLibraryTests; buf generate .PHONY: help help: ## Describe useful make targets diff --git a/Package.swift b/Package.swift index f7425026..7ce1cbab 100644 --- a/Package.swift +++ b/Package.swift @@ -90,7 +90,6 @@ let package = Package( exclude: [ "buf.gen.yaml", "buf.work.yaml", - "proto", ], resources: [ .copy("TestResources"), diff --git a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index 21915f96..c721514c 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -14,6 +14,7 @@ import Connect import Foundation +import SwiftProtobuf import XCTest private let kTimeout = TimeInterval(10.0) @@ -56,8 +57,8 @@ final class AsyncAwaitConformance: XCTestCase { func testEmptyUnary() async { await self.executeTestWithClients { client in - let response = await client.emptyCall(request: Grpc_Testing_Empty()) - XCTAssertEqual(response.message, Grpc_Testing_Empty()) + let response = await client.emptyCall(request: SwiftProtobuf.Google_Protobuf_Empty()) + XCTAssertEqual(response.message, SwiftProtobuf.Google_Protobuf_Empty()) } } @@ -273,7 +274,7 @@ final class AsyncAwaitConformance: XCTestCase { func testUnimplementedMethod() async { await self.executeTestWithClients { client in - let response = await client.unimplementedCall(request: Grpc_Testing_Empty()) + let response = await client.unimplementedCall(request: SwiftProtobuf.Google_Protobuf_Empty()) XCTAssertEqual(response.code, .unimplemented) XCTAssertEqual( response.error?.message, @@ -286,7 +287,7 @@ final class AsyncAwaitConformance: XCTestCase { try await self.executeTestWithClients { client in let expectation = self.expectation(description: "Stream completes") let stream = client.unimplementedStreamingOutputCall() - try stream.send(Grpc_Testing_Empty()) + try stream.send(SwiftProtobuf.Google_Protobuf_Empty()) for await result in stream.results() { switch result { case .headers, .message: @@ -310,7 +311,7 @@ final class AsyncAwaitConformance: XCTestCase { func testUnimplementedService() async { await self.executeTestWithUnimplementedClients { client in - let response = await client.unimplementedCall(request: Grpc_Testing_Empty()) + let response = await client.unimplementedCall(request: SwiftProtobuf.Google_Protobuf_Empty()) XCTAssertEqual(response.code, .unimplemented) XCTAssertNotNil(response.error) } @@ -320,7 +321,7 @@ final class AsyncAwaitConformance: XCTestCase { try await self.executeTestWithUnimplementedClients { client in let expectation = self.expectation(description: "Stream completes") let stream = client.unimplementedStreamingOutputCall() - try stream.send(Grpc_Testing_Empty()) + try stream.send(SwiftProtobuf.Google_Protobuf_Empty()) for await result in stream.results() { switch result { case .headers: @@ -361,14 +362,7 @@ final class AsyncAwaitConformance: XCTestCase { let expectation = self.expectation(description: "Stream completes") let stream = client.failStreamingOutputCall() try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in - proto.responseParameters = [31_415, 9, 2_653, 58_979] - .enumerated() - .map { index, value in - return Grpc_Testing_ResponseParameters.with { parameters in - parameters.size = Int32(value) - parameters.intervalUs = Int32(index * 10) - } - } + proto.responseParameters = [] }) for await result in stream.results() { switch result { @@ -390,8 +384,52 @@ final class AsyncAwaitConformance: XCTestCase { expectation.fulfill() } } + XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) + } + } + + func testFailServerStreamingAfterResponse() async throws { + try await self.executeTestWithClients { client in + let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + proto.reason = "soirée 🎉" + proto.domain = "connect-crosstest" + } + let sizes = [31_415, 9, 2_653, 58_979] + let stream = client.failStreamingOutputCall() + try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + proto.responseParameters = sizes.enumerated().map { index, size in + return .with { parameters in + parameters.size = Int32(size) + parameters.intervalUs = Int32(index * 10) + } + } + }) + let expectation = self.expectation(description: "Stream completes") + var responseCount = 0 + for await result in stream.results() { + switch result { + case .headers: + continue + + case .message(let output): + XCTAssertEqual(output.payload.body.count, sizes[responseCount]) + responseCount += 1 + + case .complete(_, let error, _): + guard let connectError = error as? ConnectError else { + XCTFail("Expected ConnectError") + return + } + + XCTAssertEqual(connectError.code, .resourceExhausted) + XCTAssertEqual(connectError.message, "soirée 🎉") + XCTAssertEqual(connectError.unpackedDetails(), [expectedErrorDetail]) + expectation.fulfill() + } + } XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) + XCTAssertEqual(responseCount, 4) } } } diff --git a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift index 1c91b4c5..b3660f24 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift @@ -16,6 +16,7 @@ import Connect import Foundation +import SwiftProtobuf import XCTest private let kTimeout = TimeInterval(10.0) @@ -56,9 +57,9 @@ final class CallbackConformance: XCTestCase { func testEmptyUnary() { self.executeTestWithClients { client in let expectation = self.expectation(description: "Receives successful response") - client.emptyCall(request: Grpc_Testing_Empty()) { response in + client.emptyCall(request: SwiftProtobuf.Google_Protobuf_Empty()) { response in XCTAssertNil(response.error) - XCTAssertEqual(response.message, Grpc_Testing_Empty()) + XCTAssertEqual(response.message, SwiftProtobuf.Google_Protobuf_Empty()) expectation.fulfill() } XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) @@ -300,7 +301,7 @@ final class CallbackConformance: XCTestCase { func testUnimplementedMethod() { self.executeTestWithClients { client in let expectation = self.expectation(description: "Request completes") - client.unimplementedCall(request: Grpc_Testing_Empty()) { response in + client.unimplementedCall(request: SwiftProtobuf.Google_Protobuf_Empty()) { response in XCTAssertEqual(response.code, .unimplemented) XCTAssertEqual( response.error?.message, @@ -326,13 +327,14 @@ final class CallbackConformance: XCTestCase { XCTAssertEqual( (error as? ConnectError)?.message, """ - grpc.testing.TestService.UnimplementedStreamingOutputCall is not implemented + grpc.testing.TestService.UnimplementedStreamingOutputCall is \ + not implemented """ ) expectation.fulfill() } } - try stream.send(Grpc_Testing_Empty()) + try stream.send(SwiftProtobuf.Google_Protobuf_Empty()) XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) } @@ -341,7 +343,7 @@ final class CallbackConformance: XCTestCase { func testUnimplementedService() { self.executeTestWithUnimplementedClients { client in let expectation = self.expectation(description: "Request completes") - client.unimplementedCall(request: Grpc_Testing_Empty()) { response in + client.unimplementedCall(request: SwiftProtobuf.Google_Protobuf_Empty()) { response in XCTAssertEqual(response.code, .unimplemented) XCTAssertNotNil(response.error) expectation.fulfill() @@ -367,7 +369,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Grpc_Testing_Empty()) + try stream.send(SwiftProtobuf.Google_Protobuf_Empty()) XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) } @@ -419,17 +421,54 @@ final class CallbackConformance: XCTestCase { } } try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in - proto.responseParameters = [31_415, 9, 2_653, 58_979] - .enumerated() - .map { index, value in - return Grpc_Testing_ResponseParameters.with { parameters in - parameters.size = Int32(value) - parameters.intervalUs = Int32(index * 10) - } + proto.responseParameters = [] + }) + + XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) + } + } + + func testFailServerStreamingAfterResponse() throws { + try self.executeTestWithClients { client in + let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + proto.reason = "soirée 🎉" + proto.domain = "connect-crosstest" + } + let expectation = self.expectation(description: "Stream completes") + var responseCount = 0 + let sizes = [31_415, 9, 2_653, 58_979] + let stream = client.failStreamingOutputCall { result in + switch result { + case .headers: + break + + case .message(let output): + XCTAssertEqual(output.payload.body.count, sizes[responseCount]) + responseCount += 1 + + case .complete(_, let error, _): + guard let connectError = error as? ConnectError else { + XCTFail("Expected ConnectError") + return + } + + XCTAssertEqual(connectError.code, .resourceExhausted) + XCTAssertEqual(connectError.message, "soirée 🎉") + XCTAssertEqual(connectError.unpackedDetails(), [expectedErrorDetail]) + expectation.fulfill() + } + } + try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + proto.responseParameters = sizes.enumerated().map { index, size in + return .with { parameters in + parameters.size = Int32(size) + parameters.intervalUs = Int32(index * 10) } + } }) XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) + XCTAssertEqual(responseCount, 4) } } @@ -438,10 +477,11 @@ final class CallbackConformance: XCTestCase { func testCancelingUnary() { self.executeTestWithClients { client in let expectation = self.expectation(description: "Receives canceled response") - let cancelable = client.emptyCall(request: Grpc_Testing_Empty()) { response in - XCTAssertEqual(response.code, .canceled) - XCTAssertEqual(response.error?.code, .canceled) - expectation.fulfill() + let cancelable = client.emptyCall( + request: SwiftProtobuf.Google_Protobuf_Empty()) { response in + XCTAssertEqual(response.code, .canceled) + XCTAssertEqual(response.error?.code, .canceled) + expectation.fulfill() } cancelable.cancel() XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) diff --git a/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift b/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift index 5ac38041..905d4862 100644 --- a/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift +++ b/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift @@ -122,19 +122,19 @@ final class ConnectMocksTests: XCTestCase { func testMockServerOnlyStreamCallbacks() throws { let client = Grpc_Testing_TestServiceClientMock() - let expectedInput = Grpc_Testing_Empty() - let expectedResults: [StreamResult] = [ + let expectedInput = SwiftProtobuf.Google_Protobuf_Empty() + let expectedResults: [StreamResult] = [ .headers(["x-header": ["123"]]), .message(.init()), .message(.init()), .complete(code: .ok, error: nil, trailers: nil), ] - var sentInputs = [Grpc_Testing_Empty]() + var sentInputs = [SwiftProtobuf.Google_Protobuf_Empty]() client.mockUnimplementedStreamingOutputCall.onSend = { sentInputs.append($0) } client.mockUnimplementedStreamingOutputCall.outputs = Array(expectedResults) - var receivedResults = [StreamResult]() + var receivedResults = [StreamResult]() let stream = client.unimplementedStreamingOutputCall { receivedResults.append($0) } try stream.send(expectedInput) diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/empty.pb.swift b/Tests/ConnectLibraryTests/Generated/grpc/testing/empty.pb.swift deleted file mode 100644 index 9244c547..00000000 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/empty.pb.swift +++ /dev/null @@ -1,81 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: grpc/testing/empty.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/empty.proto - -// Copyright 2015 gRPC authors. -// -// 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. - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// An empty message that you can re-use to avoid defining duplicated empty -/// messages in your project. A typical example is to use it as argument or the -/// return value of a service API. For instance: -/// -/// service Foo { -/// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; -/// }; -struct Grpc_Testing_Empty { - // 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. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -#if swift(>=5.5) && canImport(_Concurrency) -extension Grpc_Testing_Empty: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "grpc.testing" - -extension Grpc_Testing_Empty: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Empty" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Grpc_Testing_Empty, rhs: Grpc_Testing_Empty) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift b/Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift index ccc3fd4e..7c4427b4 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift +++ b/Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift @@ -133,22 +133,6 @@ extension Grpc_Testing_GrpclbRouteType: CaseIterable { #endif // swift(>=4.2) -/// TODO(dgq): Go back to using well-known types once -/// https://github.com/grpc/grpc/issues/6980 has been fixed. -/// import "google/protobuf/wrappers.proto"; -struct Grpc_Testing_BoolValue { - // 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 bool value. - var value: Bool = false - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - /// A block of data, to simply increase gRPC message size. struct Grpc_Testing_Payload { // SwiftProtobuf.Message conformance is added in an extension below. See the @@ -215,8 +199,8 @@ struct Grpc_Testing_SimpleRequest { /// "nullable" in order to interoperate seamlessly with clients not able to /// implement the full compression tests by introspecting the call to verify /// the response's compression status. - var responseCompressed: Grpc_Testing_BoolValue { - get {return _responseCompressed ?? Grpc_Testing_BoolValue()} + var responseCompressed: SwiftProtobuf.Google_Protobuf_BoolValue { + get {return _responseCompressed ?? SwiftProtobuf.Google_Protobuf_BoolValue()} set {_responseCompressed = newValue} } /// Returns true if `responseCompressed` has been explicitly set. @@ -235,8 +219,8 @@ struct Grpc_Testing_SimpleRequest { mutating func clearResponseStatus() {self._responseStatus = nil} /// Whether the server should expect this request to be compressed. - var expectCompressed: Grpc_Testing_BoolValue { - get {return _expectCompressed ?? Grpc_Testing_BoolValue()} + var expectCompressed: SwiftProtobuf.Google_Protobuf_BoolValue { + get {return _expectCompressed ?? SwiftProtobuf.Google_Protobuf_BoolValue()} set {_expectCompressed = newValue} } /// Returns true if `expectCompressed` has been explicitly set. @@ -255,9 +239,9 @@ struct Grpc_Testing_SimpleRequest { init() {} fileprivate var _payload: Grpc_Testing_Payload? = nil - fileprivate var _responseCompressed: Grpc_Testing_BoolValue? = nil + fileprivate var _responseCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil fileprivate var _responseStatus: Grpc_Testing_EchoStatus? = nil - fileprivate var _expectCompressed: Grpc_Testing_BoolValue? = nil + fileprivate var _expectCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil } /// Unary response, as configured by the request. @@ -320,8 +304,8 @@ struct Grpc_Testing_StreamingInputCallRequest { /// is "nullable" in order to interoperate seamlessly with servers not able to /// implement the full compression tests by introspecting the call to verify /// the request's compression status. - var expectCompressed: Grpc_Testing_BoolValue { - get {return _expectCompressed ?? Grpc_Testing_BoolValue()} + var expectCompressed: SwiftProtobuf.Google_Protobuf_BoolValue { + get {return _expectCompressed ?? SwiftProtobuf.Google_Protobuf_BoolValue()} set {_expectCompressed = newValue} } /// Returns true if `expectCompressed` has been explicitly set. @@ -334,7 +318,7 @@ struct Grpc_Testing_StreamingInputCallRequest { init() {} fileprivate var _payload: Grpc_Testing_Payload? = nil - fileprivate var _expectCompressed: Grpc_Testing_BoolValue? = nil + fileprivate var _expectCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil } /// Client-streaming response. @@ -368,8 +352,8 @@ struct Grpc_Testing_ResponseParameters { /// "nullable" in order to interoperate seamlessly with clients not able to /// implement the full compression tests by introspecting the call to verify /// the response's compression status. - var compressed: Grpc_Testing_BoolValue { - get {return _compressed ?? Grpc_Testing_BoolValue()} + var compressed: SwiftProtobuf.Google_Protobuf_BoolValue { + get {return _compressed ?? SwiftProtobuf.Google_Protobuf_BoolValue()} set {_compressed = newValue} } /// Returns true if `compressed` has been explicitly set. @@ -381,7 +365,7 @@ struct Grpc_Testing_ResponseParameters { init() {} - fileprivate var _compressed: Grpc_Testing_BoolValue? = nil + fileprivate var _compressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil } /// Server-streaming request. @@ -706,7 +690,6 @@ 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_BoolValue: @unchecked Sendable {} extension Grpc_Testing_Payload: @unchecked Sendable {} extension Grpc_Testing_EchoStatus: @unchecked Sendable {} extension Grpc_Testing_SimpleRequest: @unchecked Sendable {} @@ -750,38 +733,6 @@ extension Grpc_Testing_GrpclbRouteType: SwiftProtobuf._ProtoNameProviding { ] } -extension Grpc_Testing_BoolValue: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".BoolValue" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "value"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.value) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.value != false { - try visitor.visitSingularBoolField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Grpc_Testing_BoolValue, rhs: Grpc_Testing_BoolValue) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - extension Grpc_Testing_Payload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Payload" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift b/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift index c85d3f2b..8e941cd8 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift +++ b/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift @@ -13,11 +13,11 @@ internal protocol Grpc_Testing_TestServiceClientInterface { /// One empty request followed by one empty response. @discardableResult - func `emptyCall`(request: Grpc_Testing_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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: Grpc_Testing_Empty, headers: Connect.Headers) async -> ResponseMessage + func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage /// One request followed by one response. @discardableResult @@ -56,10 +56,14 @@ internal protocol Grpc_Testing_TestServiceClientInterface { @available(iOS 13, *) func `streamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface - /// One request followed by a sequence of responses (streamed download). This RPC always fails. + /// 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). This RPC always fails. + /// 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 @@ -99,21 +103,21 @@ internal protocol Grpc_Testing_TestServiceClientInterface { /// 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: Grpc_Testing_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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: Grpc_Testing_Empty, headers: Connect.Headers) async -> ResponseMessage + 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 + 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 + func `unimplementedStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface } /// Concrete implementation of `Grpc_Testing_TestServiceClientInterface`. @@ -125,107 +129,107 @@ internal final class Grpc_Testing_TestServiceClient: Grpc_Testing_TestServiceCli } @discardableResult - internal func `emptyCall`(request: Grpc_Testing_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) + 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: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.TestService/EmptyCall", request: request, headers: headers) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + return self.client.bidirectionalStream(path: "grpc.testing.TestService/HalfDuplexCall", headers: headers) } @discardableResult - internal func `unimplementedCall`(request: Grpc_Testing_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) + 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: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.TestService/UnimplementedCall", request: request, headers: headers) + 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) + 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 func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + return self.client.serverOnlyStream(path: "grpc.testing.TestService/UnimplementedStreamingOutputCall", headers: headers) } internal enum Metadata { @@ -251,18 +255,18 @@ internal protocol Grpc_Testing_UnimplementedServiceClientInterface { /// A call that no server should implement @discardableResult - func `unimplementedCall`(request: Grpc_Testing_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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: Grpc_Testing_Empty, headers: Connect.Headers) async -> ResponseMessage + 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 + 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 + func `unimplementedStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface } /// Concrete implementation of `Grpc_Testing_UnimplementedServiceClientInterface`. @@ -274,22 +278,22 @@ internal final class Grpc_Testing_UnimplementedServiceClient: Grpc_Testing_Unimp } @discardableResult - internal func `unimplementedCall`(request: Grpc_Testing_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) + 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: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.UnimplementedService/UnimplementedCall", request: request, headers: headers) + 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) + 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 func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + return self.client.serverOnlyStream(path: "grpc.testing.UnimplementedService/UnimplementedStreamingOutputCall", headers: headers) } internal enum Metadata { @@ -304,16 +308,16 @@ internal final class Grpc_Testing_UnimplementedServiceClient: Grpc_Testing_Unimp internal protocol Grpc_Testing_ReconnectServiceClientInterface { @discardableResult - func `start`(request: Grpc_Testing_ReconnectParams, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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 + func `start`(request: Grpc_Testing_ReconnectParams, headers: Connect.Headers) async -> ResponseMessage @discardableResult - func `stop`(request: Grpc_Testing_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable @available(iOS 13, *) - func `stop`(request: Grpc_Testing_Empty, headers: Connect.Headers) async -> ResponseMessage + func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage } /// Concrete implementation of `Grpc_Testing_ReconnectServiceClientInterface`. @@ -325,23 +329,23 @@ internal final class Grpc_Testing_ReconnectServiceClient: Grpc_Testing_Reconnect } @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) + 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) + 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: Grpc_Testing_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) + 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: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.ReconnectService/Stop", request: request, headers: headers) + 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 { @@ -382,22 +386,22 @@ internal final class Grpc_Testing_LoadBalancerStatsServiceClient: Grpc_Testing_L @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) + 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) + 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) + 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) + return await self.client.unary(path: "grpc.testing.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers) } internal enum Metadata { @@ -412,16 +416,16 @@ internal final class Grpc_Testing_LoadBalancerStatsServiceClient: Grpc_Testing_L internal protocol Grpc_Testing_XdsUpdateHealthServiceClientInterface { @discardableResult - func `setServing`(request: Grpc_Testing_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable @available(iOS 13, *) - func `setServing`(request: Grpc_Testing_Empty, headers: Connect.Headers) async -> ResponseMessage + func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage @discardableResult - func `setNotServing`(request: Grpc_Testing_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable @available(iOS 13, *) - func `setNotServing`(request: Grpc_Testing_Empty, headers: Connect.Headers) async -> ResponseMessage + func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage } /// Concrete implementation of `Grpc_Testing_XdsUpdateHealthServiceClientInterface`. @@ -433,23 +437,23 @@ internal final class Grpc_Testing_XdsUpdateHealthServiceClient: Grpc_Testing_Xds } @discardableResult - internal func `setServing`(request: Grpc_Testing_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) + 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: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.XdsUpdateHealthService/SetServing", request: request, headers: headers) + 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: Grpc_Testing_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) + 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: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/grpc.testing.XdsUpdateHealthService/SetNotServing", request: request, headers: headers) + 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 { @@ -482,12 +486,12 @@ internal final class Grpc_Testing_XdsUpdateClientConfigureServiceClient: Grpc_Te @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) + 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) + return await self.client.unary(path: "grpc.testing.XdsUpdateClientConfigureService/Configure", request: request, headers: headers) } internal enum Metadata { diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift b/Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift index d6eaca29..aa671261 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift +++ b/Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift @@ -20,9 +20,9 @@ internal class Grpc_Testing_TestServiceClientMock: Grpc_Testing_TestServiceClien private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `emptyCall()`. - internal var mockEmptyCall = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockEmptyCall = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `emptyCall()`. - internal var mockAsyncEmptyCall = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + 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())) } /// Mocked for async calls to `unaryCall()`. @@ -56,23 +56,23 @@ internal class Grpc_Testing_TestServiceClientMock: Grpc_Testing_TestServiceClien /// Mocked for async calls to `halfDuplexCall()`. internal var mockAsyncHalfDuplexCall = MockBidirectionalAsyncStream() /// Mocked for calls to `unimplementedCall()`. - internal var mockUnimplementedCall = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockUnimplementedCall = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `unimplementedCall()`. - internal var mockAsyncUnimplementedCall = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncUnimplementedCall = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `unimplementedStreamingOutputCall()`. - internal var mockUnimplementedStreamingOutputCall = MockServerOnlyStream() + internal var mockUnimplementedStreamingOutputCall = MockServerOnlyStream() /// Mocked for async calls to `unimplementedStreamingOutputCall()`. - internal var mockAsyncUnimplementedStreamingOutputCall = MockServerOnlyAsyncStream() + internal var mockAsyncUnimplementedStreamingOutputCall = MockServerOnlyAsyncStream() internal init() {} @discardableResult - internal func `emptyCall`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockEmptyCall(request)) return Connect.Cancelable {} } - internal func `emptyCall`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `emptyCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncEmptyCall(request) } @@ -152,21 +152,21 @@ internal class Grpc_Testing_TestServiceClientMock: Grpc_Testing_TestServiceClien } @discardableResult - internal func `unimplementedCall`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockUnimplementedCall(request)) return Connect.Cancelable {} } - internal func `unimplementedCall`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncUnimplementedCall(request) } - internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { + internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { self.mockUnimplementedStreamingOutputCall.$inputs.first { !$0.isEmpty }.sink { _ in self.mockUnimplementedStreamingOutputCall.outputs.forEach(onResult) }.store(in: &self.cancellables) return self.mockUnimplementedStreamingOutputCall } - internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { return self.mockAsyncUnimplementedStreamingOutputCall } } @@ -182,32 +182,32 @@ internal class Grpc_Testing_UnimplementedServiceClientMock: Grpc_Testing_Unimple private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `unimplementedCall()`. - internal var mockUnimplementedCall = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockUnimplementedCall = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `unimplementedCall()`. - internal var mockAsyncUnimplementedCall = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncUnimplementedCall = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `unimplementedStreamingOutputCall()`. - internal var mockUnimplementedStreamingOutputCall = MockServerOnlyStream() + internal var mockUnimplementedStreamingOutputCall = MockServerOnlyStream() /// Mocked for async calls to `unimplementedStreamingOutputCall()`. - internal var mockAsyncUnimplementedStreamingOutputCall = MockServerOnlyAsyncStream() + internal var mockAsyncUnimplementedStreamingOutputCall = MockServerOnlyAsyncStream() internal init() {} @discardableResult - internal func `unimplementedCall`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockUnimplementedCall(request)) return Connect.Cancelable {} } - internal func `unimplementedCall`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `unimplementedCall`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncUnimplementedCall(request) } - internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { + internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:], onResult: @escaping (Connect.StreamResult) -> Void) -> any Connect.ServerOnlyStreamInterface { self.mockUnimplementedStreamingOutputCall.$inputs.first { !$0.isEmpty }.sink { _ in self.mockUnimplementedStreamingOutputCall.outputs.forEach(onResult) }.store(in: &self.cancellables) return self.mockUnimplementedStreamingOutputCall } - internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { + internal func `unimplementedStreamingOutputCall`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { return self.mockAsyncUnimplementedStreamingOutputCall } } @@ -223,33 +223,33 @@ internal class Grpc_Testing_ReconnectServiceClientMock: Grpc_Testing_ReconnectSe 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 = { (_: Grpc_Testing_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 = { (_: Grpc_Testing_ReconnectParams) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `stop()`. - internal var mockStop = { (_: Grpc_Testing_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 = { (_: Grpc_Testing_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: Grpc_Testing_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: Grpc_Testing_ReconnectParams, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncStart(request) } @discardableResult - internal func `stop`(request: Grpc_Testing_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: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncStop(request) } } @@ -307,33 +307,33 @@ internal class Grpc_Testing_XdsUpdateHealthServiceClientMock: Grpc_Testing_XdsUp private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `setServing()`. - internal var mockSetServing = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockSetServing = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `setServing()`. - internal var mockAsyncSetServing = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncSetServing = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for calls to `setNotServing()`. - internal var mockSetNotServing = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockSetNotServing = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } /// Mocked for async calls to `setNotServing()`. - internal var mockAsyncSetNotServing = { (_: Grpc_Testing_Empty) -> ResponseMessage in .init(result: .success(.init())) } + internal var mockAsyncSetNotServing = { (_: SwiftProtobuf.Google_Protobuf_Empty) -> ResponseMessage in .init(result: .success(.init())) } internal init() {} @discardableResult - internal func `setServing`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockSetServing(request)) return Connect.Cancelable {} } - internal func `setServing`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncSetServing(request) } @discardableResult - internal func `setNotServing`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + internal func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { completion(self.mockSetNotServing(request)) return Connect.Cancelable {} } - internal func `setNotServing`(request: Grpc_Testing_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { + internal func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncSetNotServing(request) } } diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.pb.swift b/Tests/ConnectLibraryTests/Generated/grpc/testing/test.pb.swift index f527e08e..ea5677fb 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.pb.swift +++ b/Tests/ConnectLibraryTests/Generated/grpc/testing/test.pb.swift @@ -14,11 +14,11 @@ // call that always returns a readable non-ASCII error with error details. // FailStreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse): // this RPC is a server streaming call that always returns a readable non-ASCII error with error details. -// UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty): this RPC +// UnimplementedStreamingOutputCall(google.protobuf.Empty) returns (stream google.protobuf.Empty): this RPC // is a server streaming call that will not be implemented. // // The UnimplementedService has been extended to include the following RPCs: -// UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty): this RPC +// UnimplementedStreamingOutputCall(google.protobuf.Empty) returns (stream google.protobuf.Empty): this RPC // is a server streaming call that will not be implemented. // Copyright 2015-2016 gRPC authors. diff --git a/Tests/ConnectLibraryTests/Generated/server/v1/server.pb.swift b/Tests/ConnectLibraryTests/Generated/server/v1/server.pb.swift index 408026de..4ccdc44c 100644 --- a/Tests/ConnectLibraryTests/Generated/server/v1/server.pb.swift +++ b/Tests/ConnectLibraryTests/Generated/server/v1/server.pb.swift @@ -7,7 +7,7 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -// Copyright 2022-2023 Buf Technologies, Inc. +// 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. diff --git a/Tests/ConnectLibraryTests/proto/README.md b/Tests/ConnectLibraryTests/proto/README.md deleted file mode 100644 index fcc6cc73..00000000 --- a/Tests/ConnectLibraryTests/proto/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains `.proto` files that are used to communicate -with the conformance server when running tests. diff --git a/Tests/ConnectLibraryTests/proto/buf.yaml b/Tests/ConnectLibraryTests/proto/buf.yaml deleted file mode 100644 index 5efec8cf..00000000 --- a/Tests/ConnectLibraryTests/proto/buf.yaml +++ /dev/null @@ -1,12 +0,0 @@ -version: v1 -lint: - use: - - DEFAULT - ignore: - # We don't control these definitions, so we ignore lint errors. - - grpc/testing/empty.proto - - grpc/testing/messages.proto - - grpc/testing/test.proto -breaking: - use: - - WIRE_JSON diff --git a/Tests/ConnectLibraryTests/proto/grpc/testing/empty.proto b/Tests/ConnectLibraryTests/proto/grpc/testing/empty.proto deleted file mode 100644 index 4253b711..00000000 --- a/Tests/ConnectLibraryTests/proto/grpc/testing/empty.proto +++ /dev/null @@ -1,29 +0,0 @@ -// This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/empty.proto - -// Copyright 2015 gRPC authors. -// -// 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. - -syntax = "proto3"; - -package grpc.testing; - -// An empty message that you can re-use to avoid defining duplicated empty -// messages in your project. A typical example is to use it as argument or the -// return value of a service API. For instance: -// -// service Foo { -// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; -// }; -// -message Empty {} diff --git a/Tests/ConnectLibraryTests/proto/grpc/testing/messages.proto b/Tests/ConnectLibraryTests/proto/grpc/testing/messages.proto deleted file mode 100644 index 2b03b5ba..00000000 --- a/Tests/ConnectLibraryTests/proto/grpc/testing/messages.proto +++ /dev/null @@ -1,284 +0,0 @@ -// 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. -// -// 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. - -// Message definitions to be used by integration test service definitions. - -syntax = "proto3"; - -package grpc.testing; - -import "google/protobuf/any.proto"; - -// TODO(dgq): Go back to using well-known types once -// https://github.com/grpc/grpc/issues/6980 has been fixed. -// import "google/protobuf/wrappers.proto"; -message BoolValue { - // The bool value. - bool value = 1; -} - -// The type of payload that should be returned. -enum PayloadType { - // Compressable text format. - COMPRESSABLE = 0; -} - -// A block of data, to simply increase gRPC message size. -message Payload { - // The type of data in body. - PayloadType type = 1; - // Primary contents of payload. - bytes body = 2; -} - -// A protobuf representation for grpc status. This is used by test -// clients to specify a status that the server should attempt to return. -message EchoStatus { - int32 code = 1; - string message = 2; -} - -// The type of route that a client took to reach a server w.r.t. gRPCLB. -// The server must fill in "fallback" if it detects that the RPC reached -// the server via the "gRPCLB fallback" path, and "backend" if it detects -// 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 GrpclbRouteType { - // Server didn't detect the route that a client took to reach it. - GRPCLB_ROUTE_TYPE_UNKNOWN = 0; - // Indicates that a client reached a server via gRPCLB fallback. - GRPCLB_ROUTE_TYPE_FALLBACK = 1; - // Indicates that a client reached a server as a gRPCLB-given backend. - GRPCLB_ROUTE_TYPE_BACKEND = 2; -} - -// Unary request. -message SimpleRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - PayloadType response_type = 1; - - // Desired payload size in the response from the server. - int32 response_size = 2; - - // Optional input payload sent along with the request. - Payload payload = 3; - - // Whether SimpleResponse should include username. - bool fill_username = 4; - - // Whether SimpleResponse should include OAuth scope. - bool fill_oauth_scope = 5; - - // Whether to request the server to compress the response. This field is - // "nullable" in order to interoperate seamlessly with clients not able to - // implement the full compression tests by introspecting the call to verify - // the response's compression status. - BoolValue response_compressed = 6; - - // Whether server should return a given status - EchoStatus response_status = 7; - - // Whether the server should expect this request to be compressed. - BoolValue expect_compressed = 8; - - // Whether SimpleResponse should include server_id. - bool fill_server_id = 9; - - // Whether SimpleResponse should include grpclb_route_type. - bool fill_grpclb_route_type = 10; -} - -// Unary response, as configured by the request. -message SimpleResponse { - // Payload to increase message size. - Payload payload = 1; - // The user the request came from, for verifying authentication was - // successful when the client expected it. - string username = 2; - // OAuth scope. - string oauth_scope = 3; - - // Server ID. This must be unique among different server instances, - // but the same across all RPC's made to a particular server instance. - string server_id = 4; - // gRPCLB Path. - GrpclbRouteType grpclb_route_type = 5; - - // Server hostname. - string hostname = 6; -} - -// Client-streaming request. -message StreamingInputCallRequest { - // Optional input payload sent along with the request. - Payload payload = 1; - - // Whether the server should expect this request to be compressed. This field - // is "nullable" in order to interoperate seamlessly with servers not able to - // implement the full compression tests by introspecting the call to verify - // the request's compression status. - BoolValue expect_compressed = 2; - - // Not expecting any payload from the response. -} - -// Client-streaming response. -message StreamingInputCallResponse { - // Aggregated size of payloads received from the client. - int32 aggregated_payload_size = 1; -} - -// Configuration for a particular response. -message ResponseParameters { - // Desired payload sizes in responses from the server. - int32 size = 1; - - // Desired interval between consecutive responses in the response stream in - // microseconds. - int32 interval_us = 2; - - // Whether to request the server to compress the response. This field is - // "nullable" in order to interoperate seamlessly with clients not able to - // implement the full compression tests by introspecting the call to verify - // the response's compression status. - BoolValue compressed = 3; -} - -// Server-streaming request. -message StreamingOutputCallRequest { - // Desired payload type in the response from the server. - // 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. - PayloadType response_type = 1; - - // Configuration for each expected response message. - repeated ResponseParameters response_parameters = 2; - - // Optional input payload sent along with the request. - Payload payload = 3; - - // Whether server should return a given status - EchoStatus response_status = 7; -} - -// Server-streaming response, as configured by the request and parameters. -message StreamingOutputCallResponse { - // Payload to increase response size. - Payload payload = 1; -} - -// For reconnect interop test only. -// Client tells server what reconnection parameters it used. -message ReconnectParams { - int32 max_reconnect_backoff_ms = 1; -} - -// For reconnect interop test only. -// Server tells client whether its reconnects are following the spec and the -// reconnect backoffs it saw. -message ReconnectInfo { - bool passed = 1; - repeated int32 backoff_ms = 2; -} - -message LoadBalancerStatsRequest { - // Request stats for the next num_rpcs sent by client. - int32 num_rpcs = 1; - // If num_rpcs have not completed within timeout_sec, return partial results. - int32 timeout_sec = 2; -} - -message LoadBalancerStatsResponse { - message RpcsByPeer { - // The number of completed RPCs for each peer. - map rpcs_by_peer = 1; - } - // The number of completed RPCs for each peer. - map rpcs_by_peer = 1; - // The number of RPCs that failed to record a remote peer. - int32 num_failures = 2; - map rpcs_by_method = 3; -} - -// Request for retrieving a test client's accumulated stats. -message LoadBalancerAccumulatedStatsRequest {} - -// Accumulated stats for RPCs sent by a test client. -message LoadBalancerAccumulatedStatsResponse { - // The total number of RPCs have ever issued for each type. - // Deprecated: use stats_per_method.rpcs_started instead. - map num_rpcs_started_by_method = 1 [deprecated = true]; - // The total number of RPCs have ever completed successfully for each type. - // Deprecated: use stats_per_method.result instead. - map num_rpcs_succeeded_by_method = 2 [deprecated = true]; - // The total number of RPCs have ever failed for each type. - // Deprecated: use stats_per_method.result instead. - map num_rpcs_failed_by_method = 3 [deprecated = true]; - - message MethodStats { - // The number of RPCs that were started for this method. - int32 rpcs_started = 1; - - // The number of RPCs that completed with each status for this method. The - // key is the integral value of a google.rpc.Code; the value is the count. - map result = 2; - } - - // Per-method RPC statistics. The key is the RpcType in string form; e.g. - // 'EMPTY_CALL' or 'UNARY_CALL' - map stats_per_method = 4; -} - -// Configurations for a test client. -message ClientConfigureRequest { - // Type of RPCs to send. - enum RpcType { - EMPTY_CALL = 0; - UNARY_CALL = 1; - } - - // Metadata to be attached for the given type of RPCs. - message Metadata { - RpcType type = 1; - string key = 2; - string value = 3; - } - - // The types of RPCs the client sends. - repeated RpcType types = 1; - // The collection of custom metadata to be attached to RPCs sent by the client. - repeated Metadata metadata = 2; - // The deadline to use, in seconds, for all RPCs. If unset or zero, the - // client will use the default from the command-line. - int32 timeout_sec = 3; -} - -// Response for updating a test client's configuration. -message ClientConfigureResponse {} - -message ErrorDetail { - string reason = 1; - string domain = 2; -} - -message ErrorStatus { - int32 code = 1; - string message = 2; - repeated google.protobuf.Any details = 3; -} diff --git a/Tests/ConnectLibraryTests/proto/grpc/testing/test.proto b/Tests/ConnectLibraryTests/proto/grpc/testing/test.proto deleted file mode 100644 index 038d28f8..00000000 --- a/Tests/ConnectLibraryTests/proto/grpc/testing/test.proto +++ /dev/null @@ -1,122 +0,0 @@ -// 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: -// FailUnaryCall(SimpleRequest) returns (SimpleResponse): this RPC is a unary -// call that always returns a readable non-ASCII error with error details. -// FailStreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse): -// this RPC is a server streaming call that always returns a readable non-ASCII error with error details. -// UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty): this RPC -// is a server streaming call that will not be implemented. -// -// The UnimplementedService has been extended to include the following RPCs: -// UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty): this RPC -// is a server streaming call that will not be implemented. - -// Copyright 2015-2016 gRPC authors. -// -// 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. - -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. - -syntax = "proto3"; - -package grpc.testing; - -import "grpc/testing/empty.proto"; -import "grpc/testing/messages.proto"; - -// A simple service to test the various types of RPCs and experiment with -// performance with various types of payload. -service TestService { - // One empty request followed by one empty response. - rpc EmptyCall(grpc.testing.Empty) returns (grpc.testing.Empty); - - // One request followed by one response. - rpc UnaryCall(SimpleRequest) returns (SimpleResponse); - - // One request followed by one response. This RPC always fails. - rpc FailUnaryCall(SimpleRequest) returns (SimpleResponse); - - // 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. - rpc CacheableUnaryCall(SimpleRequest) returns (SimpleResponse); - - // One request followed by a sequence of responses (streamed download). - // The server returns the payload with client desired type and sizes. - rpc StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse); - - // One request followed by a sequence of responses (streamed download). This RPC always fails. - rpc FailStreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse); - - // A sequence of requests followed by one response (streamed upload). - // The server returns the aggregated size of client payload as the result. - rpc StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse); - - // 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. - rpc FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse); - - // 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. - rpc HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse); - - // The test server will not implement this method. It will be used - // to test the behavior when clients call unimplemented methods. - rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty); - - // The test server will not implement this method. It will be used - // to test the behavior when clients call unimplemented streaming output methods. - rpc UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty); -} - -// A simple service NOT implemented at servers so clients can test for -// that case. -service UnimplementedService { - // A call that no server should implement - rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty); - - // A call that no server should implement - rpc UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty); -} - -// A service used to control reconnect server. -service ReconnectService { - rpc Start(grpc.testing.ReconnectParams) returns (grpc.testing.Empty); - rpc Stop(grpc.testing.Empty) returns (grpc.testing.ReconnectInfo); -} - -// A service used to obtain stats for verifying LB behavior. -service LoadBalancerStatsService { - // Gets the backend distribution for RPCs sent by a test client. - rpc GetClientStats(LoadBalancerStatsRequest) returns (LoadBalancerStatsResponse) {} - - // Gets the accumulated stats for RPCs sent by a test client. - rpc GetClientAccumulatedStats(LoadBalancerAccumulatedStatsRequest) returns (LoadBalancerAccumulatedStatsResponse) {} -} - -// A service to remotely control health status of an xDS test server. -service XdsUpdateHealthService { - rpc SetServing(grpc.testing.Empty) returns (grpc.testing.Empty); - rpc SetNotServing(grpc.testing.Empty) returns (grpc.testing.Empty); -} - -// A service to dynamically update the configuration of an xDS test client. -service XdsUpdateClientConfigureService { - // Update the tes client's configuration. - rpc Configure(ClientConfigureRequest) returns (ClientConfigureResponse); -} diff --git a/Tests/ConnectLibraryTests/proto/server/v1/server.proto b/Tests/ConnectLibraryTests/proto/server/v1/server.proto deleted file mode 100644 index 0367e1d0..00000000 --- a/Tests/ConnectLibraryTests/proto/server/v1/server.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022-2023 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. - -syntax = "proto3"; - -package server.v1; - -// ServerMetadata is the metadata returned from the server started by the server binary. -message ServerMetadata { - string host = 1; - repeated ProtocolSupport protocols = 2; -} - -enum Protocol { - PROTOCOL_UNSPECIFIED = 0; - PROTOCOL_GRPC = 1; - PROTOCOL_GRPC_WEB = 2; -} - -message ProtocolSupport { - Protocol protocol = 1; - repeated HTTPVersion http_versions = 2; - string port = 3; -} - -message HTTPVersion { - int32 major = 1; - int32 minor = 2; -} From b737601cf7d17fedfdb11651f9d2bfc736b3fdfa Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 11:27:41 -0400 Subject: [PATCH 02/19] Makefile --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 2ea95e98..60380a88 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,6 @@ generate: cleangenerated ## Regenerate outputs for all .proto files cd Examples; buf generate cd Libraries/Connect; buf generate cd Tests/ConnectLibraryTests; buf generate https://github.com/connectrpc/conformance.git#ref=$(CONFORMANCE_VERSION),subdir=proto - # cd Tests/ConnectLibraryTests; buf generate .PHONY: help help: ## Describe useful make targets From 17f1eee368bc531e9da46724ad7ee5eaf29d579c Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 12:55:53 -0400 Subject: [PATCH 03/19] Padding --- .../GeneratedSources/eliza.connect.swift | 6 +- .../GRPC/ConnectError+GRPC.swift | 5 +- Makefile | 2 +- .../AsyncAwaitConformance.swift | 36 +- .../CallbackConformance.swift | 36 +- .../ConnectMocksTests/ConnectMocksTests.swift | 34 +- .../ConnectTests/ConnectErrorTests.swift | 10 +- .../ConnectTests/JSONCodecTests.swift | 2 +- .../ConnectTests/ProtoCodecTests.swift | 2 +- .../ConnectTests/ServiceMetadataTests.swift | 32 +- .../conformance}/messages.pb.swift | 292 +++++----- .../connectrpc/conformance/test.connect.swift | 502 ++++++++++++++++++ .../conformance}/test.mock.swift | 130 ++--- .../conformance}/test.pb.swift | 16 +- .../Generated/grpc/testing/test.connect.swift | 502 ------------------ 15 files changed, 819 insertions(+), 788 deletions(-) rename Tests/ConnectLibraryTests/Generated/{grpc/testing => connectrpc/conformance}/messages.pb.swift (81%) create mode 100644 Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.connect.swift rename Tests/ConnectLibraryTests/Generated/{grpc/testing => connectrpc/conformance}/test.mock.swift (59%) rename Tests/ConnectLibraryTests/Generated/{grpc/testing => connectrpc/conformance}/test.pb.swift (79%) delete mode 100644 Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift diff --git a/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift b/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift index 5addaace..cf4b6efe 100644 --- a/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift +++ b/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift @@ -41,16 +41,16 @@ internal final class Connectrpc_Eliza_V1_ElizaServiceClient: Connectrpc_Eliza_V1 @available(iOS 13, *) internal func `say`(request: Connectrpc_Eliza_V1_SayRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "connectrpc.eliza.v1.ElizaService/Say", request: request, headers: headers) + return await self.client.unary(path: "/connectrpc.eliza.v1.ElizaService/Say", request: request, headers: headers) } @available(iOS 13, *) internal func `converse`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { - return self.client.bidirectionalStream(path: "connectrpc.eliza.v1.ElizaService/Converse", headers: headers) + return self.client.bidirectionalStream(path: "/connectrpc.eliza.v1.ElizaService/Converse", headers: headers) } @available(iOS 13, *) internal func `introduce`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { - return self.client.serverOnlyStream(path: "connectrpc.eliza.v1.ElizaService/Introduce", headers: headers) + return self.client.serverOnlyStream(path: "/connectrpc.eliza.v1.ElizaService/Introduce", headers: headers) } } diff --git a/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift b/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift index 57e85a3b..5289f8eb 100644 --- a/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift +++ b/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift @@ -44,7 +44,10 @@ private extension Trailers { func connectErrorDetailsFromGRPC() -> [ConnectError.Detail] { return self[HeaderConstants.grpcStatusDetails]? .first - .flatMap { Data(base64Encoded: $0) } + .flatMap { + let padded = $0.padding(toLength: (($0.count+3)/4)*4, withPad: "=", startingAt: 0) + return Data(base64Encoded: padded) + } .flatMap { data -> Grpc_Status_V1_Status? in return try? ProtoCodec().deserialize(source: data) }? diff --git a/Makefile b/Makefile index 60380a88..fe11aeeb 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 := 56d92149a9c906d545bf38e222d75a3379842168 LICENSE_HEADER_VERSION := v1.12.0 LICENSE_IGNORE := -e Package.swift \ -e $(BIN)\/ \ diff --git a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index c721514c..bc1a03b1 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -19,8 +19,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_TestServiceClient +private typealias UnimplementedServiceClient = Connectrpc_Conformance_UnimplementedServiceClient /// This test suite runs against multiple protocols and serialization formats. /// Tests are based on https://github.com/connectrpc/conformance @@ -65,7 +65,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_SimpleRequest.with { proto in proto.responseSize = Int32(size) proto.payload = .with { $0.body = Data(repeating: 0, count: size) } } @@ -79,7 +79,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_StreamingOutputCallRequest.with { proto in proto.responseParameters = sizes.enumerated().map { index, size in return .with { parameters in parameters.size = Int32(size) @@ -115,7 +115,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_StreamingOutputCallRequest.with { proto in proto.responseParameters = [] }) for await result in stream.results() { @@ -148,7 +148,7 @@ final class AsyncAwaitConformance: XCTestCase { leadingKey: [leadingValue], trailingKey: [trailingValue.base64EncodedString()], ] - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_SimpleRequest.with { proto in proto.responseSize = Int32(size) proto.payload = .with { $0.body = Data(repeating: 0, count: size) } } @@ -180,7 +180,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_StreamingOutputCallRequest.with { proto in proto.responseParameters = [.with { $0.size = Int32(size) }] }) for await result in stream.results() { @@ -208,7 +208,7 @@ final class AsyncAwaitConformance: XCTestCase { } func testStatusCodeAndMessage() async { - let message = Grpc_Testing_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_SimpleRequest.with { proto in proto.responseStatus = .with { status in status.code = Int32(Code.unknown.rawValue) status.message = "test status message" @@ -225,7 +225,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_SimpleRequest.with { proto in proto.responseStatus = .with { status in status.code = 2 status.message = statusMessage @@ -242,7 +242,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_StreamingOutputCallRequest.with { proto in proto.payload = .with { $0.body = Data(count: 271_828) } proto.responseParameters = [ .with { parameters in @@ -278,7 +278,7 @@ final class AsyncAwaitConformance: XCTestCase { XCTAssertEqual(response.code, .unimplemented) XCTAssertEqual( response.error?.message, - "grpc.testing.TestService.UnimplementedCall is not implemented" + "connectrpc.conformance.TestService.UnimplementedCall is not implemented" ) } } @@ -298,7 +298,7 @@ final class AsyncAwaitConformance: XCTestCase { XCTAssertEqual( (error as? ConnectError)?.message, """ - grpc.testing.TestService.UnimplementedStreamingOutputCall is not implemented + connectrpc.conformance.TestService.UnimplementedStreamingOutputCall is not implemented """ ) expectation.fulfill() @@ -342,11 +342,11 @@ final class AsyncAwaitConformance: XCTestCase { func testFailUnary() async { await self.executeTestWithClients { client in - let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } - let response = await client.failUnaryCall(request: Grpc_Testing_SimpleRequest()) + let response = await client.failUnaryCall(request: Connectrpc_Conformance_SimpleRequest()) XCTAssertEqual(response.error?.code, .resourceExhausted) XCTAssertEqual(response.error?.message, "soirée 🎉") XCTAssertEqual(response.error?.unpackedDetails(), [expectedErrorDetail]) @@ -355,13 +355,13 @@ 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_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } let expectation = self.expectation(description: "Stream completes") let stream = client.failStreamingOutputCall() - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_StreamingOutputCallRequest.with { proto in proto.responseParameters = [] }) for await result in stream.results() { @@ -390,13 +390,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_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } 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_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 b3660f24..2fa6acea 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_TestServiceClient +private typealias UnimplementedServiceClient = Connectrpc_Conformance_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_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_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_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_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_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_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_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_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.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.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_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } let expectation = self.expectation(description: "Request completes") - client.failUnaryCall(request: Grpc_Testing_SimpleRequest()) { response in + client.failUnaryCall(request: Connectrpc_Conformance_SimpleRequest()) { response in XCTAssertEqual(response.error?.code, .resourceExhausted) XCTAssertEqual(response.error?.message, "soirée 🎉") XCTAssertEqual(response.error?.unpackedDetails(), [expectedErrorDetail]) @@ -395,7 +395,7 @@ final class CallbackConformance: XCTestCase { func testFailServerStreaming() throws { try self.executeTestWithClients { client in - let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } @@ -420,7 +420,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_StreamingOutputCallRequest.with { proto in proto.responseParameters = [] }) @@ -430,7 +430,7 @@ final class CallbackConformance: XCTestCase { func testFailServerStreamingAfterResponse() throws { try self.executeTestWithClients { client in - let expectedErrorDetail = Grpc_Testing_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } @@ -458,7 +458,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_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..63c9c478 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_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_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_TestServiceClientMock() client.mockAsyncUnaryCall = { request in XCTAssertTrue(request.fillUsername) return ResponseMessage(result: .success(.with { $0.hostname = "pong" })) @@ -50,12 +50,12 @@ final class ConnectMocksTests: XCTestCase { // MARK: - Bidirectional stream func testMockBidirectionalStreamCallbacks() throws { - let client = Grpc_Testing_TestServiceClientMock() - let expectedInputs: [Grpc_Testing_StreamingOutputCallRequest] = [ + let client = Connectrpc_Conformance_TestServiceClientMock() + let expectedInputs: [Connectrpc_Conformance_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 +63,13 @@ final class ConnectMocksTests: XCTestCase { ] XCTAssertFalse(client.mockFullDuplexCall.isClosed) - var sentInputs = [Grpc_Testing_StreamingOutputCallRequest]() + var sentInputs = [Connectrpc_Conformance_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 +83,12 @@ final class ConnectMocksTests: XCTestCase { } func testMockBidirectionalStreamAsyncAwait() async throws { - let client = Grpc_Testing_TestServiceClientMock() - let expectedInputs: [Grpc_Testing_StreamingOutputCallRequest] = [ + let client = Connectrpc_Conformance_TestServiceClientMock() + let expectedInputs: [Connectrpc_Conformance_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 +96,7 @@ final class ConnectMocksTests: XCTestCase { ] XCTAssertFalse(client.mockAsyncFullDuplexCall.isClosed) - var sentInputs = [Grpc_Testing_StreamingOutputCallRequest]() + var sentInputs = [Connectrpc_Conformance_StreamingOutputCallRequest]() var closeCalled = false client.mockAsyncFullDuplexCall.onSend = { sentInputs.append($0) } client.mockAsyncFullDuplexCall.onClose = { closeCalled = true } @@ -121,7 +121,7 @@ final class ConnectMocksTests: XCTestCase { // MARK: - Server-only stream func testMockServerOnlyStreamCallbacks() throws { - let client = Grpc_Testing_TestServiceClientMock() + let client = Connectrpc_Conformance_TestServiceClientMock() let expectedInput = SwiftProtobuf.Google_Protobuf_Empty() let expectedResults: [StreamResult] = [ .headers(["x-header": ["123"]]), @@ -144,18 +144,18 @@ 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_TestServiceClientMock() + let expectedInput = Connectrpc_Conformance_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_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..4ec00f02 100644 --- a/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift +++ b/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift @@ -19,7 +19,7 @@ import XCTest final class ConnectErrorTests: XCTestCase { func testDeserializingFullErrorAndUnpackingDetails() throws { - let expectedDetails = Grpc_Testing_SimpleResponse.with { $0.hostname = "foobar" } + let expectedDetails = Connectrpc_Conformance_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 +31,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_SimpleResponse.with { $0.hostname = "foo" } + let expectedDetails2 = Connectrpc_Conformance_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 +44,7 @@ final class ConnectErrorTests: XCTestCase { } func testDeserializingErrorUsingHelperFunctionLowercasesHeaderKeys() throws { - let expectedDetails = Grpc_Testing_SimpleResponse.with { $0.hostname = "foobar" } + let expectedDetails = Connectrpc_Conformance_SimpleResponse.with { $0.hostname = "foobar" } let errorData = try self.errorData(expectedDetails: [expectedDetails]) let error = ConnectError.from( code: .aborted, @@ -72,7 +72,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_SimpleResponse]()) XCTAssertTrue(error.metadata.isEmpty) } diff --git a/Tests/ConnectLibraryTests/ConnectTests/JSONCodecTests.swift b/Tests/ConnectLibraryTests/ConnectTests/JSONCodecTests.swift index 27beb928..334d0435 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_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..27ba54f0 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_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..70fd8a95 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_TestServiceClient.Metadata.Methods.unaryCall, MethodSpec( name: "UnaryCall", - service: "grpc.testing.TestService", + service: "connectrpc.conformance.TestService", type: .unary ) ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.unaryCall.path, - "grpc.testing.TestService/UnaryCall" + Connectrpc_Conformance_TestServiceClient.Metadata.Methods.unaryCall.path, + "connectrpc.conformance.TestService/UnaryCall" ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.streamingOutputCall, + Connectrpc_Conformance_TestServiceClient.Metadata.Methods.streamingOutputCall, MethodSpec( name: "StreamingOutputCall", - service: "grpc.testing.TestService", + service: "connectrpc.conformance.TestService", type: .serverStream ) ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.streamingOutputCall.path, - "grpc.testing.TestService/StreamingOutputCall" + Connectrpc_Conformance_TestServiceClient.Metadata.Methods.streamingOutputCall.path, + "connectrpc.conformance.TestService/StreamingOutputCall" ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.streamingInputCall, + Connectrpc_Conformance_TestServiceClient.Metadata.Methods.streamingInputCall, MethodSpec( name: "StreamingInputCall", - service: "grpc.testing.TestService", + service: "connectrpc.conformance.TestService", type: .clientStream ) ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.streamingInputCall.path, - "grpc.testing.TestService/StreamingInputCall" + Connectrpc_Conformance_TestServiceClient.Metadata.Methods.streamingInputCall.path, + "connectrpc.conformance.TestService/StreamingInputCall" ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.fullDuplexCall, + Connectrpc_Conformance_TestServiceClient.Metadata.Methods.fullDuplexCall, MethodSpec( name: "FullDuplexCall", - service: "grpc.testing.TestService", + service: "connectrpc.conformance.TestService", type: .bidirectionalStream ) ) XCTAssertEqual( - Grpc_Testing_TestServiceClient.Metadata.Methods.fullDuplexCall.path, - "grpc.testing.TestService/FullDuplexCall" + Connectrpc_Conformance_TestServiceClient.Metadata.Methods.fullDuplexCall.path, + "connectrpc.conformance.TestService/FullDuplexCall" ) } } diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/messages.pb.swift similarity index 81% rename from Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/messages.pb.swift index 7c4427b4..6b848d6b 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/messages.pb.swift +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/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/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_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_PayloadType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Grpc_Testing_PayloadType] = [ + static let allCases: [Connectrpc_Conformance_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_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_GrpclbRouteType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Grpc_Testing_GrpclbRouteType] = [ + static let allCases: [Connectrpc_Conformance_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_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_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_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_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_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_Payload { + get {return _payload ?? Connectrpc_Conformance_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_EchoStatus { + get {return _responseStatus ?? Connectrpc_Conformance_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_Payload? = nil fileprivate var _responseCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil - fileprivate var _responseStatus: Grpc_Testing_EchoStatus? = nil + fileprivate var _responseStatus: Connectrpc_Conformance_EchoStatus? = nil fileprivate var _expectCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil } /// Unary response, as configured by the request. -struct Grpc_Testing_SimpleResponse { +struct Connectrpc_Conformance_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_Payload { + get {return _payload ?? Connectrpc_Conformance_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_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_Payload? = nil } /// Client-streaming request. -struct Grpc_Testing_StreamingInputCallRequest { +struct Connectrpc_Conformance_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_Payload { + get {return _payload ?? Connectrpc_Conformance_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_Payload? = nil fileprivate var _expectCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil } /// Client-streaming response. -struct Grpc_Testing_StreamingInputCallResponse { +struct Connectrpc_Conformance_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_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_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_PayloadType = .compressable /// Configuration for each expected response message. - var responseParameters: [Grpc_Testing_ResponseParameters] = [] + var responseParameters: [Connectrpc_Conformance_ResponseParameters] = [] /// Optional input payload sent along with the request. - var payload: Grpc_Testing_Payload { - get {return _payload ?? Grpc_Testing_Payload()} + var payload: Connectrpc_Conformance_Payload { + get {return _payload ?? Connectrpc_Conformance_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_EchoStatus { + get {return _responseStatus ?? Connectrpc_Conformance_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_Payload? = nil + fileprivate var _responseStatus: Connectrpc_Conformance_EchoStatus? = nil } /// Server-streaming response, as configured by the request and parameters. -struct Grpc_Testing_StreamingOutputCallResponse { +struct Connectrpc_Conformance_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_Payload { + get {return _payload ?? Connectrpc_Conformance_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_Payload? = nil } /// For reconnect interop test only. /// Client tells server what reconnection parameters it used. -struct Grpc_Testing_ReconnectParams { +struct Connectrpc_Conformance_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_PayloadType: @unchecked Sendable {} +extension Connectrpc_Conformance_GrpclbRouteType: @unchecked Sendable {} +extension Connectrpc_Conformance_Payload: @unchecked Sendable {} +extension Connectrpc_Conformance_EchoStatus: @unchecked Sendable {} +extension Connectrpc_Conformance_SimpleRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_SimpleResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_StreamingInputCallRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_StreamingInputCallResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_ResponseParameters: @unchecked Sendable {} +extension Connectrpc_Conformance_StreamingOutputCallRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_StreamingOutputCallResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_ReconnectParams: @unchecked Sendable {} +extension Connectrpc_Conformance_ReconnectInfo: @unchecked Sendable {} +extension Connectrpc_Conformance_LoadBalancerStatsRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_LoadBalancerStatsResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_LoadBalancerStatsResponse.RpcsByPeer: @unchecked Sendable {} +extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse.MethodStats: @unchecked Sendable {} +extension Connectrpc_Conformance_ClientConfigureRequest: @unchecked Sendable {} +extension Connectrpc_Conformance_ClientConfigureRequest.RpcType: @unchecked Sendable {} +extension Connectrpc_Conformance_ClientConfigureRequest.Metadata: @unchecked Sendable {} +extension Connectrpc_Conformance_ClientConfigureResponse: @unchecked Sendable {} +extension Connectrpc_Conformance_ErrorDetail: @unchecked Sendable {} +extension Connectrpc_Conformance_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" -extension Grpc_Testing_PayloadType: SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_PayloadType: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "COMPRESSABLE"), ] } -extension Grpc_Testing_GrpclbRouteType: SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_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_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_Payload, rhs: Connectrpc_Conformance_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_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_EchoStatus, rhs: Connectrpc_Conformance_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_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_SimpleRequest, rhs: Connectrpc_Conformance_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_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_SimpleResponse, rhs: Connectrpc_Conformance_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_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_StreamingInputCallRequest, rhs: Connectrpc_Conformance_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_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_StreamingInputCallResponse, rhs: Connectrpc_Conformance_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_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_ResponseParameters, rhs: Connectrpc_Conformance_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_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_StreamingOutputCallRequest, rhs: Connectrpc_Conformance_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_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_StreamingOutputCallResponse, rhs: Connectrpc_Conformance_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_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_ReconnectParams, rhs: Connectrpc_Conformance_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_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_ReconnectInfo, rhs: Connectrpc_Conformance_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_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_LoadBalancerStatsRequest, rhs: Connectrpc_Conformance_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_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_LoadBalancerStatsResponse, rhs: Connectrpc_Conformance_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_LoadBalancerStatsResponse.RpcsByPeer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Connectrpc_Conformance_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_LoadBalancerStatsResponse.RpcsByPeer, rhs: Connectrpc_Conformance_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_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_LoadBalancerAccumulatedStatsRequest, rhs: Connectrpc_Conformance_LoadBalancerAccumulatedStatsRequest) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Grpc_Testing_LoadBalancerAccumulatedStatsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_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_LoadBalancerAccumulatedStatsResponse, rhs: Connectrpc_Conformance_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_LoadBalancerAccumulatedStatsResponse.MethodStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Connectrpc_Conformance_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_LoadBalancerAccumulatedStatsResponse.MethodStats, rhs: Connectrpc_Conformance_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_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_ClientConfigureRequest, rhs: Connectrpc_Conformance_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_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_ClientConfigureRequest.Metadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Connectrpc_Conformance_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_ClientConfigureRequest.Metadata, rhs: Connectrpc_Conformance_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_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_ClientConfigureResponse, rhs: Connectrpc_Conformance_ClientConfigureResponse) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Grpc_Testing_ErrorDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_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_ErrorDetail, rhs: Connectrpc_Conformance_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_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_ErrorStatus, rhs: Connectrpc_Conformance_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/test.connect.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.connect.swift new file mode 100644 index 00000000..7bdb510c --- /dev/null +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.connect.swift @@ -0,0 +1,502 @@ +// Code generated by protoc-gen-connect-swift. DO NOT EDIT. +// +// Source: connectrpc/conformance/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_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_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// One request followed by one response. + @available(iOS 13, *) + func `unaryCall`(request: Connectrpc_Conformance_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage + + /// One request followed by one response. This RPC always fails. + @discardableResult + func `failUnaryCall`(request: Connectrpc_Conformance_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_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_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_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_TestServiceClientInterface`. +internal final class Connectrpc_Conformance_TestServiceClient: Connectrpc_Conformance_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.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.TestService/EmptyCall", request: request, headers: headers) + } + + @discardableResult + internal func `unaryCall`(request: Connectrpc_Conformance_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.TestService/UnaryCall", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `unaryCall`(request: Connectrpc_Conformance_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.TestService/UnaryCall", request: request, headers: headers) + } + + @discardableResult + internal func `failUnaryCall`(request: Connectrpc_Conformance_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.TestService/FailUnaryCall", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `failUnaryCall`(request: Connectrpc_Conformance_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.TestService/FailUnaryCall", request: request, headers: headers) + } + + @discardableResult + internal func `cacheableUnaryCall`(request: Connectrpc_Conformance_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.TestService/CacheableUnaryCall", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `cacheableUnaryCall`(request: Connectrpc_Conformance_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.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.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.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.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.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.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.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.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.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.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.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.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.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.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.TestService/UnimplementedStreamingOutputCall", headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let emptyCall = Connect.MethodSpec(name: "EmptyCall", service: "connectrpc.conformance.TestService", type: .unary) + internal static let unaryCall = Connect.MethodSpec(name: "UnaryCall", service: "connectrpc.conformance.TestService", type: .unary) + internal static let failUnaryCall = Connect.MethodSpec(name: "FailUnaryCall", service: "connectrpc.conformance.TestService", type: .unary) + internal static let cacheableUnaryCall = Connect.MethodSpec(name: "CacheableUnaryCall", service: "connectrpc.conformance.TestService", type: .unary) + internal static let streamingOutputCall = Connect.MethodSpec(name: "StreamingOutputCall", service: "connectrpc.conformance.TestService", type: .serverStream) + internal static let failStreamingOutputCall = Connect.MethodSpec(name: "FailStreamingOutputCall", service: "connectrpc.conformance.TestService", type: .serverStream) + internal static let streamingInputCall = Connect.MethodSpec(name: "StreamingInputCall", service: "connectrpc.conformance.TestService", type: .clientStream) + internal static let fullDuplexCall = Connect.MethodSpec(name: "FullDuplexCall", service: "connectrpc.conformance.TestService", type: .bidirectionalStream) + internal static let halfDuplexCall = Connect.MethodSpec(name: "HalfDuplexCall", service: "connectrpc.conformance.TestService", type: .bidirectionalStream) + internal static let unimplementedCall = Connect.MethodSpec(name: "UnimplementedCall", service: "connectrpc.conformance.TestService", type: .unary) + internal static let unimplementedStreamingOutputCall = Connect.MethodSpec(name: "UnimplementedStreamingOutputCall", service: "connectrpc.conformance.TestService", type: .serverStream) + } + } +} + +/// A simple service NOT implemented at servers so clients can test for +/// that case. +internal protocol Connectrpc_Conformance_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_UnimplementedServiceClientInterface`. +internal final class Connectrpc_Conformance_UnimplementedServiceClient: Connectrpc_Conformance_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.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.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.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.UnimplementedService/UnimplementedStreamingOutputCall", headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let unimplementedCall = Connect.MethodSpec(name: "UnimplementedCall", service: "connectrpc.conformance.UnimplementedService", type: .unary) + internal static let unimplementedStreamingOutputCall = Connect.MethodSpec(name: "UnimplementedStreamingOutputCall", service: "connectrpc.conformance.UnimplementedService", type: .serverStream) + } + } +} + +/// A service used to control reconnect server. +internal protocol Connectrpc_Conformance_ReconnectServiceClientInterface { + + @discardableResult + func `start`(request: Connectrpc_Conformance_ReconnectParams, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + @available(iOS 13, *) + func `start`(request: Connectrpc_Conformance_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_ReconnectServiceClientInterface`. +internal final class Connectrpc_Conformance_ReconnectServiceClient: Connectrpc_Conformance_ReconnectServiceClientInterface { + private let client: Connect.ProtocolClientInterface + + internal init(client: Connect.ProtocolClientInterface) { + self.client = client + } + + @discardableResult + internal func `start`(request: Connectrpc_Conformance_ReconnectParams, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.ReconnectService/Start", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `start`(request: Connectrpc_Conformance_ReconnectParams, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.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.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.ReconnectService/Stop", request: request, headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let start = Connect.MethodSpec(name: "Start", service: "connectrpc.conformance.ReconnectService", type: .unary) + internal static let stop = Connect.MethodSpec(name: "Stop", service: "connectrpc.conformance.ReconnectService", type: .unary) + } + } +} + +/// A service used to obtain stats for verifying LB behavior. +internal protocol Connectrpc_Conformance_LoadBalancerStatsServiceClientInterface { + + /// Gets the backend distribution for RPCs sent by a test client. + @discardableResult + func `getClientStats`(request: Connectrpc_Conformance_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_LoadBalancerStatsRequest, headers: Connect.Headers) async -> ResponseMessage + + /// Gets the accumulated stats for RPCs sent by a test client. + @discardableResult + func `getClientAccumulatedStats`(request: Connectrpc_Conformance_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_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers) async -> ResponseMessage +} + +/// Concrete implementation of `Connectrpc_Conformance_LoadBalancerStatsServiceClientInterface`. +internal final class Connectrpc_Conformance_LoadBalancerStatsServiceClient: Connectrpc_Conformance_LoadBalancerStatsServiceClientInterface { + private let client: Connect.ProtocolClientInterface + + internal init(client: Connect.ProtocolClientInterface) { + self.client = client + } + + @discardableResult + internal func `getClientStats`(request: Connectrpc_Conformance_LoadBalancerStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.LoadBalancerStatsService/GetClientStats", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `getClientStats`(request: Connectrpc_Conformance_LoadBalancerStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.LoadBalancerStatsService/GetClientStats", request: request, headers: headers) + } + + @discardableResult + internal func `getClientAccumulatedStats`(request: Connectrpc_Conformance_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `getClientAccumulatedStats`(request: Connectrpc_Conformance_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let getClientStats = Connect.MethodSpec(name: "GetClientStats", service: "connectrpc.conformance.LoadBalancerStatsService", type: .unary) + internal static let getClientAccumulatedStats = Connect.MethodSpec(name: "GetClientAccumulatedStats", service: "connectrpc.conformance.LoadBalancerStatsService", type: .unary) + } + } +} + +/// A service to remotely control health status of an xDS test server. +internal protocol Connectrpc_Conformance_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_XdsUpdateHealthServiceClientInterface`. +internal final class Connectrpc_Conformance_XdsUpdateHealthServiceClient: Connectrpc_Conformance_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.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.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.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.XdsUpdateHealthService/SetNotServing", request: request, headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let setServing = Connect.MethodSpec(name: "SetServing", service: "connectrpc.conformance.XdsUpdateHealthService", type: .unary) + internal static let setNotServing = Connect.MethodSpec(name: "SetNotServing", service: "connectrpc.conformance.XdsUpdateHealthService", type: .unary) + } + } +} + +/// A service to dynamically update the configuration of an xDS test client. +internal protocol Connectrpc_Conformance_XdsUpdateClientConfigureServiceClientInterface { + + /// Update the tes client's configuration. + @discardableResult + func `configure`(request: Connectrpc_Conformance_ClientConfigureRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + + /// Update the tes client's configuration. + @available(iOS 13, *) + func `configure`(request: Connectrpc_Conformance_ClientConfigureRequest, headers: Connect.Headers) async -> ResponseMessage +} + +/// Concrete implementation of `Connectrpc_Conformance_XdsUpdateClientConfigureServiceClientInterface`. +internal final class Connectrpc_Conformance_XdsUpdateClientConfigureServiceClient: Connectrpc_Conformance_XdsUpdateClientConfigureServiceClientInterface { + private let client: Connect.ProtocolClientInterface + + internal init(client: Connect.ProtocolClientInterface) { + self.client = client + } + + @discardableResult + internal func `configure`(request: Connectrpc_Conformance_ClientConfigureRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { + return self.client.unary(path: "/connectrpc.conformance.XdsUpdateClientConfigureService/Configure", request: request, headers: headers, completion: completion) + } + + @available(iOS 13, *) + internal func `configure`(request: Connectrpc_Conformance_ClientConfigureRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { + return await self.client.unary(path: "/connectrpc.conformance.XdsUpdateClientConfigureService/Configure", request: request, headers: headers) + } + + internal enum Metadata { + internal enum Methods { + internal static let configure = Connect.MethodSpec(name: "Configure", service: "connectrpc.conformance.XdsUpdateClientConfigureService", type: .unary) + } + } +} diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.mock.swift similarity index 59% rename from Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.mock.swift index aa671261..a399e891 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/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/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_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_TestServiceClientMock: Connectrpc_Conformance_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_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_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_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_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_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_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_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_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_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_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_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_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_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_UnimplementedServiceClientMock: Connectrpc_Conformance_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_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_ReconnectServiceClientMock: Connectrpc_Conformance_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_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_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_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_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_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_LoadBalancerStatsServiceClientMock: Connectrpc_Conformance_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_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_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_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_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_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_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_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_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { return self.mockAsyncGetClientAccumulatedStats(request) } } -/// Mock implementation of `Grpc_Testing_XdsUpdateHealthServiceClientInterface`. +/// Mock implementation of `Connectrpc_Conformance_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_XdsUpdateHealthServiceClientMock: Connectrpc_Conformance_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_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_XdsUpdateClientConfigureServiceClientMock: Connectrpc_Conformance_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_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_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_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_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/test.pb.swift similarity index 79% rename from Tests/ConnectLibraryTests/Generated/grpc/testing/test.pb.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.pb.swift index ea5677fb..030ecbca 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.pb.swift +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/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/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 8e941cd8..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) - } - } -} From 52545332fa74f32ce36be8c19c02c436c7795711 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 12:59:36 -0400 Subject: [PATCH 04/19] Lint and generate --- .../GeneratedSources/eliza.connect.swift | 6 +- .../AsyncAwaitConformance.swift | 10 ++- .../Generated/grpc/testing/test.connect.swift | 80 +++++++++---------- 3 files changed, 51 insertions(+), 45 deletions(-) diff --git a/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift b/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift index 5addaace..cf4b6efe 100644 --- a/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift +++ b/Examples/ElizaSharedSources/GeneratedSources/eliza.connect.swift @@ -41,16 +41,16 @@ internal final class Connectrpc_Eliza_V1_ElizaServiceClient: Connectrpc_Eliza_V1 @available(iOS 13, *) internal func `say`(request: Connectrpc_Eliza_V1_SayRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "connectrpc.eliza.v1.ElizaService/Say", request: request, headers: headers) + return await self.client.unary(path: "/connectrpc.eliza.v1.ElizaService/Say", request: request, headers: headers) } @available(iOS 13, *) internal func `converse`(headers: Connect.Headers = [:]) -> any Connect.BidirectionalAsyncStreamInterface { - return self.client.bidirectionalStream(path: "connectrpc.eliza.v1.ElizaService/Converse", headers: headers) + return self.client.bidirectionalStream(path: "/connectrpc.eliza.v1.ElizaService/Converse", headers: headers) } @available(iOS 13, *) internal func `introduce`(headers: Connect.Headers = [:]) -> any Connect.ServerOnlyAsyncStreamInterface { - return self.client.serverOnlyStream(path: "connectrpc.eliza.v1.ElizaService/Introduce", headers: headers) + return self.client.serverOnlyStream(path: "/connectrpc.eliza.v1.ElizaService/Introduce", headers: headers) } } diff --git a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index c721514c..96404b4e 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// swiftlint:disable file_length + import Connect import Foundation import SwiftProtobuf @@ -274,7 +276,9 @@ final class AsyncAwaitConformance: XCTestCase { func testUnimplementedMethod() async { await self.executeTestWithClients { client in - let response = await client.unimplementedCall(request: SwiftProtobuf.Google_Protobuf_Empty()) + let response = await client.unimplementedCall( + request: SwiftProtobuf.Google_Protobuf_Empty() + ) XCTAssertEqual(response.code, .unimplemented) XCTAssertEqual( response.error?.message, @@ -311,7 +315,9 @@ final class AsyncAwaitConformance: XCTestCase { func testUnimplementedService() async { await self.executeTestWithUnimplementedClients { client in - let response = await client.unimplementedCall(request: SwiftProtobuf.Google_Protobuf_Empty()) + let response = await client.unimplementedCall( + request: SwiftProtobuf.Google_Protobuf_Empty() + ) XCTAssertEqual(response.code, .unimplemented) XCTAssertNotNil(response.error) } diff --git a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift b/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift index 8e941cd8..e8acb2d1 100644 --- a/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift +++ b/Tests/ConnectLibraryTests/Generated/grpc/testing/test.connect.swift @@ -130,106 +130,106 @@ internal final class Grpc_Testing_TestServiceClient: Grpc_Testing_TestServiceCli @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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + return self.client.serverOnlyStream(path: "/grpc.testing.TestService/UnimplementedStreamingOutputCall", headers: headers) } internal enum Metadata { @@ -279,21 +279,21 @@ internal final class Grpc_Testing_UnimplementedServiceClient: Grpc_Testing_Unimp @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) + 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) + 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) + 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) + return self.client.serverOnlyStream(path: "/grpc.testing.UnimplementedService/UnimplementedStreamingOutputCall", headers: headers) } internal enum Metadata { @@ -330,22 +330,22 @@ internal final class Grpc_Testing_ReconnectServiceClient: Grpc_Testing_Reconnect @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) + 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) + 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) + 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) + return await self.client.unary(path: "/grpc.testing.ReconnectService/Stop", request: request, headers: headers) } internal enum Metadata { @@ -386,22 +386,22 @@ internal final class Grpc_Testing_LoadBalancerStatsServiceClient: Grpc_Testing_L @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) + 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) + 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) + 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) + return await self.client.unary(path: "/grpc.testing.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers) } internal enum Metadata { @@ -438,22 +438,22 @@ internal final class Grpc_Testing_XdsUpdateHealthServiceClient: Grpc_Testing_Xds @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) + 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) + 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) + 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) + return await self.client.unary(path: "/grpc.testing.XdsUpdateHealthService/SetNotServing", request: request, headers: headers) } internal enum Metadata { @@ -486,12 +486,12 @@ internal final class Grpc_Testing_XdsUpdateClientConfigureServiceClient: Grpc_Te @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) + 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) + return await self.client.unary(path: "/grpc.testing.XdsUpdateClientConfigureService/Configure", request: request, headers: headers) } internal enum Metadata { From 30fbf9dd57e53810763765f2fb5bcda72e622f1f Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 13:09:16 -0400 Subject: [PATCH 05/19] Fixed base64 --- Makefile | 2 +- .../AsyncAwaitConformance.swift | 36 +-- .../CallbackConformance.swift | 36 +-- .../ConnectMocksTests/ConnectMocksTests.swift | 34 +-- .../ConnectTests/ConnectErrorTests.swift | 10 +- .../ConnectTests/JSONCodecTests.swift | 2 +- .../ConnectTests/ProtoCodecTests.swift | 2 +- .../ConnectTests/ServiceMetadataTests.swift | 32 +- .../conformance/{ => v1}/messages.pb.swift | 278 +++++++++--------- .../conformance/{ => v1}/test.connect.swift | 262 ++++++++--------- .../conformance/{ => v1}/test.mock.swift | 130 ++++---- .../conformance/{ => v1}/test.pb.swift | 2 +- 12 files changed, 413 insertions(+), 413 deletions(-) rename Tests/ConnectLibraryTests/Generated/connectrpc/conformance/{ => v1}/messages.pb.swift (82%) rename Tests/ConnectLibraryTests/Generated/connectrpc/conformance/{ => v1}/test.connect.swift (59%) rename Tests/ConnectLibraryTests/Generated/connectrpc/conformance/{ => v1}/test.mock.swift (66%) rename Tests/ConnectLibraryTests/Generated/connectrpc/conformance/{ => v1}/test.pb.swift (98%) diff --git a/Makefile b/Makefile index fe11aeeb..628d12c3 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 := 56d92149a9c906d545bf38e222d75a3379842168 +CONFORMANCE_VERSION := 56c4c7061f85848e393b109b6671516b1dc5a620 LICENSE_HEADER_VERSION := v1.12.0 LICENSE_IGNORE := -e Package.swift \ -e $(BIN)\/ \ diff --git a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index bc1a03b1..57a1f42a 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -19,8 +19,8 @@ import XCTest private let kTimeout = TimeInterval(10.0) -private typealias TestServiceClient = Connectrpc_Conformance_TestServiceClient -private typealias UnimplementedServiceClient = Connectrpc_Conformance_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 @@ -65,7 +65,7 @@ final class AsyncAwaitConformance: XCTestCase { func testLargeUnary() async { await self.executeTestWithClients { client in let size = 314_159 - let message = Connectrpc_Conformance_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) } } @@ -79,7 +79,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(Connectrpc_Conformance_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) @@ -115,7 +115,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(Connectrpc_Conformance_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = [] }) for await result in stream.results() { @@ -148,7 +148,7 @@ final class AsyncAwaitConformance: XCTestCase { leadingKey: [leadingValue], trailingKey: [trailingValue.base64EncodedString()], ] - let message = Connectrpc_Conformance_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) } } @@ -180,7 +180,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(Connectrpc_Conformance_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() { @@ -208,7 +208,7 @@ final class AsyncAwaitConformance: XCTestCase { } func testStatusCodeAndMessage() async { - let message = Connectrpc_Conformance_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" @@ -225,7 +225,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 = Connectrpc_Conformance_SimpleRequest.with { proto in + let message = Connectrpc_Conformance_V1_SimpleRequest.with { proto in proto.responseStatus = .with { status in status.code = 2 status.message = statusMessage @@ -242,7 +242,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 = Connectrpc_Conformance_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 @@ -278,7 +278,7 @@ final class AsyncAwaitConformance: XCTestCase { XCTAssertEqual(response.code, .unimplemented) XCTAssertEqual( response.error?.message, - "connectrpc.conformance.TestService.UnimplementedCall is not implemented" + "connectrpc.conformance.v1.TestService.UnimplementedCall is not implemented" ) } } @@ -298,7 +298,7 @@ final class AsyncAwaitConformance: XCTestCase { XCTAssertEqual( (error as? ConnectError)?.message, """ - connectrpc.conformance.TestService.UnimplementedStreamingOutputCall is not implemented + connectrpc.conformance.v1.TestService.UnimplementedStreamingOutputCall is not implemented """ ) expectation.fulfill() @@ -342,11 +342,11 @@ final class AsyncAwaitConformance: XCTestCase { func testFailUnary() async { await self.executeTestWithClients { client in - let expectedErrorDetail = Connectrpc_Conformance_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } - let response = await client.failUnaryCall(request: Connectrpc_Conformance_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]) @@ -355,13 +355,13 @@ final class AsyncAwaitConformance: XCTestCase { func testFailServerStreaming() async throws { try await self.executeTestWithClients { client in - let expectedErrorDetail = Connectrpc_Conformance_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } let expectation = self.expectation(description: "Stream completes") let stream = client.failStreamingOutputCall() - try stream.send(Connectrpc_Conformance_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = [] }) for await result in stream.results() { @@ -390,13 +390,13 @@ final class AsyncAwaitConformance: XCTestCase { func testFailServerStreamingAfterResponse() async throws { try await self.executeTestWithClients { client in - let expectedErrorDetail = Connectrpc_Conformance_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } let sizes = [31_415, 9, 2_653, 58_979] let stream = client.failStreamingOutputCall() - try stream.send(Connectrpc_Conformance_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 2fa6acea..93bd68f7 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 = Connectrpc_Conformance_TestServiceClient -private typealias UnimplementedServiceClient = Connectrpc_Conformance_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 = Connectrpc_Conformance_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(Connectrpc_Conformance_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(Connectrpc_Conformance_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 = Connectrpc_Conformance_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(Connectrpc_Conformance_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 = Connectrpc_Conformance_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 = Connectrpc_Conformance_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 = Connectrpc_Conformance_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, - "connectrpc.conformance.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, """ - connectrpc.conformance.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 = Connectrpc_Conformance_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } let expectation = self.expectation(description: "Request completes") - client.failUnaryCall(request: Connectrpc_Conformance_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,7 +395,7 @@ final class CallbackConformance: XCTestCase { func testFailServerStreaming() throws { try self.executeTestWithClients { client in - let expectedErrorDetail = Connectrpc_Conformance_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } @@ -420,7 +420,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Connectrpc_Conformance_StreamingOutputCallRequest.with { proto in + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in proto.responseParameters = [] }) @@ -430,7 +430,7 @@ final class CallbackConformance: XCTestCase { func testFailServerStreamingAfterResponse() throws { try self.executeTestWithClients { client in - let expectedErrorDetail = Connectrpc_Conformance_ErrorDetail.with { proto in + let expectedErrorDetail = Connectrpc_Conformance_V1_ErrorDetail.with { proto in proto.reason = "soirée 🎉" proto.domain = "connect-crosstest" } @@ -458,7 +458,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Connectrpc_Conformance_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 63c9c478..864cb4c3 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 = Connectrpc_Conformance_TestServiceClientMock() + let client = Connectrpc_Conformance_V1_TestServiceClientMock() client.mockUnaryCall = { request in XCTAssertTrue(request.fillUsername) return ResponseMessage(result: .success(.with { $0.hostname = "pong" })) } - var receivedMessage: Connectrpc_Conformance_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 = Connectrpc_Conformance_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,12 @@ final class ConnectMocksTests: XCTestCase { // MARK: - Bidirectional stream func testMockBidirectionalStreamCallbacks() throws { - let client = Connectrpc_Conformance_TestServiceClientMock() - let expectedInputs: [Connectrpc_Conformance_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 +63,13 @@ final class ConnectMocksTests: XCTestCase { ] XCTAssertFalse(client.mockFullDuplexCall.isClosed) - var sentInputs = [Connectrpc_Conformance_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 +83,12 @@ final class ConnectMocksTests: XCTestCase { } func testMockBidirectionalStreamAsyncAwait() async throws { - let client = Connectrpc_Conformance_TestServiceClientMock() - let expectedInputs: [Connectrpc_Conformance_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 +96,7 @@ final class ConnectMocksTests: XCTestCase { ] XCTAssertFalse(client.mockAsyncFullDuplexCall.isClosed) - var sentInputs = [Connectrpc_Conformance_StreamingOutputCallRequest]() + var sentInputs = [Connectrpc_Conformance_V1_StreamingOutputCallRequest]() var closeCalled = false client.mockAsyncFullDuplexCall.onSend = { sentInputs.append($0) } client.mockAsyncFullDuplexCall.onClose = { closeCalled = true } @@ -121,7 +121,7 @@ final class ConnectMocksTests: XCTestCase { // MARK: - Server-only stream func testMockServerOnlyStreamCallbacks() throws { - let client = Connectrpc_Conformance_TestServiceClientMock() + let client = Connectrpc_Conformance_V1_TestServiceClientMock() let expectedInput = SwiftProtobuf.Google_Protobuf_Empty() let expectedResults: [StreamResult] = [ .headers(["x-header": ["123"]]), @@ -144,18 +144,18 @@ final class ConnectMocksTests: XCTestCase { } func testMockServerOnlyStreamAsyncAwait() async throws { - let client = Connectrpc_Conformance_TestServiceClientMock() - let expectedInput = Connectrpc_Conformance_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 = [Connectrpc_Conformance_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 4ec00f02..8343c97e 100644 --- a/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift +++ b/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift @@ -19,7 +19,7 @@ import XCTest final class ConnectErrorTests: XCTestCase { func testDeserializingFullErrorAndUnpackingDetails() throws { - let expectedDetails = Connectrpc_Conformance_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 +31,8 @@ final class ConnectErrorTests: XCTestCase { } func testDeserializingFullErrorAndUnpackingMultipleDetails() throws { - let expectedDetails1 = Connectrpc_Conformance_SimpleResponse.with { $0.hostname = "foo" } - let expectedDetails2 = Connectrpc_Conformance_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 +44,7 @@ final class ConnectErrorTests: XCTestCase { } func testDeserializingErrorUsingHelperFunctionLowercasesHeaderKeys() throws { - let expectedDetails = Connectrpc_Conformance_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 +72,7 @@ final class ConnectErrorTests: XCTestCase { XCTAssertNil(error.message) XCTAssertNil(error.exception) XCTAssertTrue(error.details.isEmpty) - XCTAssertEqual(error.unpackedDetails(), [Connectrpc_Conformance_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 334d0435..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: Connectrpc_Conformance_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 27ba54f0..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: Connectrpc_Conformance_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 70fd8a95..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( - Connectrpc_Conformance_TestServiceClient.Metadata.Methods.unaryCall, + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.unaryCall, MethodSpec( name: "UnaryCall", - service: "connectrpc.conformance.TestService", + service: "connectrpc.conformance.v1.TestService", type: .unary ) ) XCTAssertEqual( - Connectrpc_Conformance_TestServiceClient.Metadata.Methods.unaryCall.path, - "connectrpc.conformance.TestService/UnaryCall" + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.unaryCall.path, + "connectrpc.conformance.v1.TestService/UnaryCall" ) XCTAssertEqual( - Connectrpc_Conformance_TestServiceClient.Metadata.Methods.streamingOutputCall, + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.streamingOutputCall, MethodSpec( name: "StreamingOutputCall", - service: "connectrpc.conformance.TestService", + service: "connectrpc.conformance.v1.TestService", type: .serverStream ) ) XCTAssertEqual( - Connectrpc_Conformance_TestServiceClient.Metadata.Methods.streamingOutputCall.path, - "connectrpc.conformance.TestService/StreamingOutputCall" + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.streamingOutputCall.path, + "connectrpc.conformance.v1.TestService/StreamingOutputCall" ) XCTAssertEqual( - Connectrpc_Conformance_TestServiceClient.Metadata.Methods.streamingInputCall, + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.streamingInputCall, MethodSpec( name: "StreamingInputCall", - service: "connectrpc.conformance.TestService", + service: "connectrpc.conformance.v1.TestService", type: .clientStream ) ) XCTAssertEqual( - Connectrpc_Conformance_TestServiceClient.Metadata.Methods.streamingInputCall.path, - "connectrpc.conformance.TestService/StreamingInputCall" + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.streamingInputCall.path, + "connectrpc.conformance.v1.TestService/StreamingInputCall" ) XCTAssertEqual( - Connectrpc_Conformance_TestServiceClient.Metadata.Methods.fullDuplexCall, + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.fullDuplexCall, MethodSpec( name: "FullDuplexCall", - service: "connectrpc.conformance.TestService", + service: "connectrpc.conformance.v1.TestService", type: .bidirectionalStream ) ) XCTAssertEqual( - Connectrpc_Conformance_TestServiceClient.Metadata.Methods.fullDuplexCall.path, - "connectrpc.conformance.TestService/FullDuplexCall" + Connectrpc_Conformance_V1_TestServiceClient.Metadata.Methods.fullDuplexCall.path, + "connectrpc.conformance.v1.TestService/FullDuplexCall" ) } } diff --git a/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/messages.pb.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/messages.pb.swift similarity index 82% rename from Tests/ConnectLibraryTests/Generated/connectrpc/conformance/messages.pb.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/messages.pb.swift index 6b848d6b..e46a3b68 100644 --- a/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/messages.pb.swift +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/messages.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: connectrpc/conformance/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/ @@ -53,7 +53,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP } /// The type of payload that should be returned. -enum Connectrpc_Conformance_PayloadType: SwiftProtobuf.Enum { +enum Connectrpc_Conformance_V1_PayloadType: SwiftProtobuf.Enum { typealias RawValue = Int /// Compressable text format. @@ -82,9 +82,9 @@ enum Connectrpc_Conformance_PayloadType: SwiftProtobuf.Enum { #if swift(>=4.2) -extension Connectrpc_Conformance_PayloadType: CaseIterable { +extension Connectrpc_Conformance_V1_PayloadType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Connectrpc_Conformance_PayloadType] = [ + static let allCases: [Connectrpc_Conformance_V1_PayloadType] = [ .compressable, ] } @@ -97,7 +97,7 @@ extension Connectrpc_Conformance_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 Connectrpc_Conformance_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. @@ -136,9 +136,9 @@ enum Connectrpc_Conformance_GrpclbRouteType: SwiftProtobuf.Enum { #if swift(>=4.2) -extension Connectrpc_Conformance_GrpclbRouteType: CaseIterable { +extension Connectrpc_Conformance_V1_GrpclbRouteType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Connectrpc_Conformance_GrpclbRouteType] = [ + static let allCases: [Connectrpc_Conformance_V1_GrpclbRouteType] = [ .unknown, .fallback, .backend, @@ -148,13 +148,13 @@ extension Connectrpc_Conformance_GrpclbRouteType: CaseIterable { #endif // swift(>=4.2) /// A block of data, to simply increase gRPC message size. -struct Connectrpc_Conformance_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: Connectrpc_Conformance_PayloadType = .compressable + var type: Connectrpc_Conformance_V1_PayloadType = .compressable /// Primary contents of payload. var body: Data = Data() @@ -166,7 +166,7 @@ struct Connectrpc_Conformance_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 Connectrpc_Conformance_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. @@ -181,21 +181,21 @@ struct Connectrpc_Conformance_EchoStatus { } /// Unary request. -struct Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_Payload { - get {return _payload ?? Connectrpc_Conformance_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. @@ -223,8 +223,8 @@ struct Connectrpc_Conformance_SimpleRequest { mutating func clearResponseCompressed() {self._responseCompressed = nil} /// Whether server should return a given status - var responseStatus: Connectrpc_Conformance_EchoStatus { - get {return _responseStatus ?? Connectrpc_Conformance_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. @@ -252,21 +252,21 @@ struct Connectrpc_Conformance_SimpleRequest { init() {} - fileprivate var _payload: Connectrpc_Conformance_Payload? = nil + fileprivate var _payload: Connectrpc_Conformance_V1_Payload? = nil fileprivate var _responseCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil - fileprivate var _responseStatus: Connectrpc_Conformance_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 Connectrpc_Conformance_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: Connectrpc_Conformance_Payload { - get {return _payload ?? Connectrpc_Conformance_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. @@ -286,7 +286,7 @@ struct Connectrpc_Conformance_SimpleResponse { var serverID: String = String() /// gRPCLB Path. - var grpclbRouteType: Connectrpc_Conformance_GrpclbRouteType = .unknown + var grpclbRouteType: Connectrpc_Conformance_V1_GrpclbRouteType = .unknown /// Server hostname. var hostname: String = String() @@ -295,18 +295,18 @@ struct Connectrpc_Conformance_SimpleResponse { init() {} - fileprivate var _payload: Connectrpc_Conformance_Payload? = nil + fileprivate var _payload: Connectrpc_Conformance_V1_Payload? = nil } /// Client-streaming request. -struct Connectrpc_Conformance_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: Connectrpc_Conformance_Payload { - get {return _payload ?? Connectrpc_Conformance_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. @@ -331,12 +331,12 @@ struct Connectrpc_Conformance_StreamingInputCallRequest { init() {} - fileprivate var _payload: Connectrpc_Conformance_Payload? = nil + fileprivate var _payload: Connectrpc_Conformance_V1_Payload? = nil fileprivate var _expectCompressed: SwiftProtobuf.Google_Protobuf_BoolValue? = nil } /// Client-streaming response. -struct Connectrpc_Conformance_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. @@ -350,7 +350,7 @@ struct Connectrpc_Conformance_StreamingInputCallResponse { } /// Configuration for a particular response. -struct Connectrpc_Conformance_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. @@ -383,7 +383,7 @@ struct Connectrpc_Conformance_ResponseParameters { } /// Server-streaming request. -struct Connectrpc_Conformance_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. @@ -392,14 +392,14 @@ struct Connectrpc_Conformance_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: Connectrpc_Conformance_PayloadType = .compressable + var responseType: Connectrpc_Conformance_V1_PayloadType = .compressable /// Configuration for each expected response message. - var responseParameters: [Connectrpc_Conformance_ResponseParameters] = [] + var responseParameters: [Connectrpc_Conformance_V1_ResponseParameters] = [] /// Optional input payload sent along with the request. - var payload: Connectrpc_Conformance_Payload { - get {return _payload ?? Connectrpc_Conformance_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. @@ -408,8 +408,8 @@ struct Connectrpc_Conformance_StreamingOutputCallRequest { mutating func clearPayload() {self._payload = nil} /// Whether server should return a given status - var responseStatus: Connectrpc_Conformance_EchoStatus { - get {return _responseStatus ?? Connectrpc_Conformance_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. @@ -421,19 +421,19 @@ struct Connectrpc_Conformance_StreamingOutputCallRequest { init() {} - fileprivate var _payload: Connectrpc_Conformance_Payload? = nil - fileprivate var _responseStatus: Connectrpc_Conformance_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 Connectrpc_Conformance_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: Connectrpc_Conformance_Payload { - get {return _payload ?? Connectrpc_Conformance_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. @@ -445,12 +445,12 @@ struct Connectrpc_Conformance_StreamingOutputCallResponse { init() {} - fileprivate var _payload: Connectrpc_Conformance_Payload? = nil + fileprivate var _payload: Connectrpc_Conformance_V1_Payload? = nil } /// For reconnect interop test only. /// Client tells server what reconnection parameters it used. -struct Connectrpc_Conformance_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. @@ -465,7 +465,7 @@ struct Connectrpc_Conformance_ReconnectParams { /// For reconnect interop test only. /// Server tells client whether its reconnects are following the spec and the /// reconnect backoffs it saw. -struct Connectrpc_Conformance_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. @@ -479,7 +479,7 @@ struct Connectrpc_Conformance_ReconnectInfo { init() {} } -struct Connectrpc_Conformance_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. @@ -495,7 +495,7 @@ struct Connectrpc_Conformance_LoadBalancerStatsRequest { init() {} } -struct Connectrpc_Conformance_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. @@ -506,7 +506,7 @@ struct Connectrpc_Conformance_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() @@ -527,7 +527,7 @@ struct Connectrpc_Conformance_LoadBalancerStatsResponse { } /// Request for retrieving a test client's accumulated stats. -struct Connectrpc_Conformance_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. @@ -538,7 +538,7 @@ struct Connectrpc_Conformance_LoadBalancerAccumulatedStatsRequest { } /// Accumulated stats for RPCs sent by a test client. -struct Connectrpc_Conformance_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. @@ -557,7 +557,7 @@ struct Connectrpc_Conformance_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() @@ -582,16 +582,16 @@ struct Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse { } /// Configurations for a test client. -struct Connectrpc_Conformance_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: [Connectrpc_Conformance_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: [Connectrpc_Conformance_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. @@ -634,7 +634,7 @@ struct Connectrpc_Conformance_ClientConfigureRequest { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var type: Connectrpc_Conformance_ClientConfigureRequest.RpcType = .emptyCall + var type: Connectrpc_Conformance_V1_ClientConfigureRequest.RpcType = .emptyCall var key: String = String() @@ -650,9 +650,9 @@ struct Connectrpc_Conformance_ClientConfigureRequest { #if swift(>=4.2) -extension Connectrpc_Conformance_ClientConfigureRequest.RpcType: CaseIterable { +extension Connectrpc_Conformance_V1_ClientConfigureRequest.RpcType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Connectrpc_Conformance_ClientConfigureRequest.RpcType] = [ + static let allCases: [Connectrpc_Conformance_V1_ClientConfigureRequest.RpcType] = [ .emptyCall, .unaryCall, ] @@ -661,7 +661,7 @@ extension Connectrpc_Conformance_ClientConfigureRequest.RpcType: CaseIterable { #endif // swift(>=4.2) /// Response for updating a test client's configuration. -struct Connectrpc_Conformance_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. @@ -671,7 +671,7 @@ struct Connectrpc_Conformance_ClientConfigureResponse { init() {} } -struct Connectrpc_Conformance_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. @@ -685,7 +685,7 @@ struct Connectrpc_Conformance_ErrorDetail { init() {} } -struct Connectrpc_Conformance_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. @@ -702,44 +702,44 @@ struct Connectrpc_Conformance_ErrorStatus { } #if swift(>=5.5) && canImport(_Concurrency) -extension Connectrpc_Conformance_PayloadType: @unchecked Sendable {} -extension Connectrpc_Conformance_GrpclbRouteType: @unchecked Sendable {} -extension Connectrpc_Conformance_Payload: @unchecked Sendable {} -extension Connectrpc_Conformance_EchoStatus: @unchecked Sendable {} -extension Connectrpc_Conformance_SimpleRequest: @unchecked Sendable {} -extension Connectrpc_Conformance_SimpleResponse: @unchecked Sendable {} -extension Connectrpc_Conformance_StreamingInputCallRequest: @unchecked Sendable {} -extension Connectrpc_Conformance_StreamingInputCallResponse: @unchecked Sendable {} -extension Connectrpc_Conformance_ResponseParameters: @unchecked Sendable {} -extension Connectrpc_Conformance_StreamingOutputCallRequest: @unchecked Sendable {} -extension Connectrpc_Conformance_StreamingOutputCallResponse: @unchecked Sendable {} -extension Connectrpc_Conformance_ReconnectParams: @unchecked Sendable {} -extension Connectrpc_Conformance_ReconnectInfo: @unchecked Sendable {} -extension Connectrpc_Conformance_LoadBalancerStatsRequest: @unchecked Sendable {} -extension Connectrpc_Conformance_LoadBalancerStatsResponse: @unchecked Sendable {} -extension Connectrpc_Conformance_LoadBalancerStatsResponse.RpcsByPeer: @unchecked Sendable {} -extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsRequest: @unchecked Sendable {} -extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse: @unchecked Sendable {} -extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse.MethodStats: @unchecked Sendable {} -extension Connectrpc_Conformance_ClientConfigureRequest: @unchecked Sendable {} -extension Connectrpc_Conformance_ClientConfigureRequest.RpcType: @unchecked Sendable {} -extension Connectrpc_Conformance_ClientConfigureRequest.Metadata: @unchecked Sendable {} -extension Connectrpc_Conformance_ClientConfigureResponse: @unchecked Sendable {} -extension Connectrpc_Conformance_ErrorDetail: @unchecked Sendable {} -extension Connectrpc_Conformance_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 = "connectrpc.conformance" +fileprivate let _protobuf_package = "connectrpc.conformance.v1" -extension Connectrpc_Conformance_PayloadType: SwiftProtobuf._ProtoNameProviding { +extension Connectrpc_Conformance_V1_PayloadType: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "COMPRESSABLE"), ] } -extension Connectrpc_Conformance_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"), @@ -747,7 +747,7 @@ extension Connectrpc_Conformance_GrpclbRouteType: SwiftProtobuf._ProtoNameProvid ] } -extension Connectrpc_Conformance_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"), @@ -777,7 +777,7 @@ extension Connectrpc_Conformance_Payload: SwiftProtobuf.Message, SwiftProtobuf._ try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_Payload, rhs: Connectrpc_Conformance_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} @@ -785,7 +785,7 @@ extension Connectrpc_Conformance_Payload: SwiftProtobuf.Message, SwiftProtobuf._ } } -extension Connectrpc_Conformance_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"), @@ -815,7 +815,7 @@ extension Connectrpc_Conformance_EchoStatus: SwiftProtobuf.Message, SwiftProtobu try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_EchoStatus, rhs: Connectrpc_Conformance_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} @@ -823,7 +823,7 @@ extension Connectrpc_Conformance_EchoStatus: SwiftProtobuf.Message, SwiftProtobu } } -extension Connectrpc_Conformance_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"), @@ -897,7 +897,7 @@ extension Connectrpc_Conformance_SimpleRequest: SwiftProtobuf.Message, SwiftProt try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_SimpleRequest, rhs: Connectrpc_Conformance_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} @@ -913,7 +913,7 @@ extension Connectrpc_Conformance_SimpleRequest: SwiftProtobuf.Message, SwiftProt } } -extension Connectrpc_Conformance_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"), @@ -967,7 +967,7 @@ extension Connectrpc_Conformance_SimpleResponse: SwiftProtobuf.Message, SwiftPro try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_SimpleResponse, rhs: Connectrpc_Conformance_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} @@ -979,7 +979,7 @@ extension Connectrpc_Conformance_SimpleResponse: SwiftProtobuf.Message, SwiftPro } } -extension Connectrpc_Conformance_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"), @@ -1013,7 +1013,7 @@ extension Connectrpc_Conformance_StreamingInputCallRequest: SwiftProtobuf.Messag try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_StreamingInputCallRequest, rhs: Connectrpc_Conformance_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} @@ -1021,7 +1021,7 @@ extension Connectrpc_Conformance_StreamingInputCallRequest: SwiftProtobuf.Messag } } -extension Connectrpc_Conformance_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"), @@ -1046,14 +1046,14 @@ extension Connectrpc_Conformance_StreamingInputCallResponse: SwiftProtobuf.Messa try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_StreamingInputCallResponse, rhs: Connectrpc_Conformance_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 Connectrpc_Conformance_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"), @@ -1092,7 +1092,7 @@ extension Connectrpc_Conformance_ResponseParameters: SwiftProtobuf.Message, Swif try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_ResponseParameters, rhs: Connectrpc_Conformance_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} @@ -1101,7 +1101,7 @@ extension Connectrpc_Conformance_ResponseParameters: SwiftProtobuf.Message, Swif } } -extension Connectrpc_Conformance_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"), @@ -1145,7 +1145,7 @@ extension Connectrpc_Conformance_StreamingOutputCallRequest: SwiftProtobuf.Messa try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_StreamingOutputCallRequest, rhs: Connectrpc_Conformance_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} @@ -1155,7 +1155,7 @@ extension Connectrpc_Conformance_StreamingOutputCallRequest: SwiftProtobuf.Messa } } -extension Connectrpc_Conformance_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"), @@ -1184,14 +1184,14 @@ extension Connectrpc_Conformance_StreamingOutputCallResponse: SwiftProtobuf.Mess try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_StreamingOutputCallResponse, rhs: Connectrpc_Conformance_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 Connectrpc_Conformance_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"), @@ -1216,14 +1216,14 @@ extension Connectrpc_Conformance_ReconnectParams: SwiftProtobuf.Message, SwiftPr try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_ReconnectParams, rhs: Connectrpc_Conformance_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 Connectrpc_Conformance_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"), @@ -1253,7 +1253,7 @@ extension Connectrpc_Conformance_ReconnectInfo: SwiftProtobuf.Message, SwiftProt try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_ReconnectInfo, rhs: Connectrpc_Conformance_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} @@ -1261,7 +1261,7 @@ extension Connectrpc_Conformance_ReconnectInfo: SwiftProtobuf.Message, SwiftProt } } -extension Connectrpc_Conformance_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"), @@ -1291,7 +1291,7 @@ extension Connectrpc_Conformance_LoadBalancerStatsRequest: SwiftProtobuf.Message try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_LoadBalancerStatsRequest, rhs: Connectrpc_Conformance_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} @@ -1299,7 +1299,7 @@ extension Connectrpc_Conformance_LoadBalancerStatsRequest: SwiftProtobuf.Message } } -extension Connectrpc_Conformance_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"), @@ -1315,7 +1315,7 @@ extension Connectrpc_Conformance_LoadBalancerStatsResponse: SwiftProtobuf.Messag 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 } } @@ -1329,12 +1329,12 @@ extension Connectrpc_Conformance_LoadBalancerStatsResponse: SwiftProtobuf.Messag 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: Connectrpc_Conformance_LoadBalancerStatsResponse, rhs: Connectrpc_Conformance_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} @@ -1343,8 +1343,8 @@ extension Connectrpc_Conformance_LoadBalancerStatsResponse: SwiftProtobuf.Messag } } -extension Connectrpc_Conformance_LoadBalancerStatsResponse.RpcsByPeer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Connectrpc_Conformance_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"), ] @@ -1368,14 +1368,14 @@ extension Connectrpc_Conformance_LoadBalancerStatsResponse.RpcsByPeer: SwiftProt try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_LoadBalancerStatsResponse.RpcsByPeer, rhs: Connectrpc_Conformance_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 Connectrpc_Conformance_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() @@ -1388,13 +1388,13 @@ extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsRequest: SwiftProto try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_LoadBalancerAccumulatedStatsRequest, rhs: Connectrpc_Conformance_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 Connectrpc_Conformance_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"), @@ -1412,7 +1412,7 @@ extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse: SwiftProt 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 } } @@ -1429,12 +1429,12 @@ extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse: SwiftProt 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: Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse, rhs: Connectrpc_Conformance_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} @@ -1444,8 +1444,8 @@ extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse: SwiftProt } } -extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse.MethodStats: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Connectrpc_Conformance_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"), @@ -1474,7 +1474,7 @@ extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse.MethodStat try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse.MethodStats, rhs: Connectrpc_Conformance_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} @@ -1482,7 +1482,7 @@ extension Connectrpc_Conformance_LoadBalancerAccumulatedStatsResponse.MethodStat } } -extension Connectrpc_Conformance_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"), @@ -1517,7 +1517,7 @@ extension Connectrpc_Conformance_ClientConfigureRequest: SwiftProtobuf.Message, try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_ClientConfigureRequest, rhs: Connectrpc_Conformance_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} @@ -1526,15 +1526,15 @@ extension Connectrpc_Conformance_ClientConfigureRequest: SwiftProtobuf.Message, } } -extension Connectrpc_Conformance_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 Connectrpc_Conformance_ClientConfigureRequest.Metadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Connectrpc_Conformance_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"), @@ -1568,7 +1568,7 @@ extension Connectrpc_Conformance_ClientConfigureRequest.Metadata: SwiftProtobuf. try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_ClientConfigureRequest.Metadata, rhs: Connectrpc_Conformance_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} @@ -1577,7 +1577,7 @@ extension Connectrpc_Conformance_ClientConfigureRequest.Metadata: SwiftProtobuf. } } -extension Connectrpc_Conformance_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() @@ -1590,13 +1590,13 @@ extension Connectrpc_Conformance_ClientConfigureResponse: SwiftProtobuf.Message, try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_ClientConfigureResponse, rhs: Connectrpc_Conformance_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 Connectrpc_Conformance_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"), @@ -1626,7 +1626,7 @@ extension Connectrpc_Conformance_ErrorDetail: SwiftProtobuf.Message, SwiftProtob try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_ErrorDetail, rhs: Connectrpc_Conformance_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} @@ -1634,7 +1634,7 @@ extension Connectrpc_Conformance_ErrorDetail: SwiftProtobuf.Message, SwiftProtob } } -extension Connectrpc_Conformance_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"), @@ -1669,7 +1669,7 @@ extension Connectrpc_Conformance_ErrorStatus: SwiftProtobuf.Message, SwiftProtob try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Connectrpc_Conformance_ErrorStatus, rhs: Connectrpc_Conformance_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/test.connect.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.connect.swift similarity index 59% rename from Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.connect.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.connect.swift index 7bdb510c..841b9765 100644 --- a/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.connect.swift +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.connect.swift @@ -1,6 +1,6 @@ // Code generated by protoc-gen-connect-swift. DO NOT EDIT. // -// Source: connectrpc/conformance/test.proto +// Source: connectrpc/conformance/v1/test.proto // import Connect @@ -9,7 +9,7 @@ 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_TestServiceClientInterface { +internal protocol Connectrpc_Conformance_V1_TestServiceClientInterface { /// One empty request followed by one empty response. @discardableResult @@ -21,84 +21,84 @@ internal protocol Connectrpc_Conformance_TestServiceClientInterface { /// One request followed by one response. @discardableResult - func `unaryCall`(request: Connectrpc_Conformance_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage + 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_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage + 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_SimpleRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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_SimpleRequest, headers: Connect.Headers) async -> ResponseMessage + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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. @@ -120,8 +120,8 @@ internal protocol Connectrpc_Conformance_TestServiceClientInterface { func `unimplementedStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface } -/// Concrete implementation of `Connectrpc_Conformance_TestServiceClientInterface`. -internal final class Connectrpc_Conformance_TestServiceClient: Connectrpc_Conformance_TestServiceClientInterface { +/// 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) { @@ -130,128 +130,128 @@ internal final class Connectrpc_Conformance_TestServiceClient: Connectrpc_Confor @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.TestService/EmptyCall", request: request, headers: headers, completion: completion) + 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.TestService/EmptyCall", request: request, headers: headers) + return await self.client.unary(path: "/connectrpc.conformance.v1.TestService/EmptyCall", request: request, headers: headers) } @discardableResult - internal func `unaryCall`(request: Connectrpc_Conformance_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/connectrpc.conformance.TestService/UnaryCall", request: request, headers: headers, completion: completion) + 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_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/connectrpc.conformance.TestService/UnaryCall", request: request, headers: headers) + 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_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/connectrpc.conformance.TestService/FailUnaryCall", request: request, headers: headers, completion: completion) + 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_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/connectrpc.conformance.TestService/FailUnaryCall", request: request, headers: headers) + 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_SimpleRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/connectrpc.conformance.TestService/CacheableUnaryCall", request: request, headers: headers, completion: completion) + 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_SimpleRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/connectrpc.conformance.TestService/CacheableUnaryCall", request: request, headers: headers) + 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.TestService/StreamingOutputCall", headers: headers, onResult: onResult) + 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.TestService/StreamingOutputCall", headers: headers) + 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.TestService/FailStreamingOutputCall", headers: headers, onResult: onResult) + 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.TestService/FailStreamingOutputCall", headers: headers) + 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.TestService/StreamingInputCall", headers: headers, onResult: onResult) + 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.TestService/StreamingInputCall", headers: headers) + 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.TestService/FullDuplexCall", headers: headers, onResult: onResult) + 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.TestService/FullDuplexCall", headers: headers) + 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.TestService/HalfDuplexCall", headers: headers, onResult: onResult) + 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.TestService/HalfDuplexCall", headers: headers) + 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.TestService/UnimplementedCall", request: request, headers: headers, completion: completion) + 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.TestService/UnimplementedCall", request: request, headers: headers) + 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.TestService/UnimplementedStreamingOutputCall", headers: headers, onResult: onResult) + 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.TestService/UnimplementedStreamingOutputCall", headers: headers) + 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.TestService", type: .unary) - internal static let unaryCall = Connect.MethodSpec(name: "UnaryCall", service: "connectrpc.conformance.TestService", type: .unary) - internal static let failUnaryCall = Connect.MethodSpec(name: "FailUnaryCall", service: "connectrpc.conformance.TestService", type: .unary) - internal static let cacheableUnaryCall = Connect.MethodSpec(name: "CacheableUnaryCall", service: "connectrpc.conformance.TestService", type: .unary) - internal static let streamingOutputCall = Connect.MethodSpec(name: "StreamingOutputCall", service: "connectrpc.conformance.TestService", type: .serverStream) - internal static let failStreamingOutputCall = Connect.MethodSpec(name: "FailStreamingOutputCall", service: "connectrpc.conformance.TestService", type: .serverStream) - internal static let streamingInputCall = Connect.MethodSpec(name: "StreamingInputCall", service: "connectrpc.conformance.TestService", type: .clientStream) - internal static let fullDuplexCall = Connect.MethodSpec(name: "FullDuplexCall", service: "connectrpc.conformance.TestService", type: .bidirectionalStream) - internal static let halfDuplexCall = Connect.MethodSpec(name: "HalfDuplexCall", service: "connectrpc.conformance.TestService", type: .bidirectionalStream) - internal static let unimplementedCall = Connect.MethodSpec(name: "UnimplementedCall", service: "connectrpc.conformance.TestService", type: .unary) - internal static let unimplementedStreamingOutputCall = Connect.MethodSpec(name: "UnimplementedStreamingOutputCall", service: "connectrpc.conformance.TestService", type: .serverStream) + 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_UnimplementedServiceClientInterface { +internal protocol Connectrpc_Conformance_V1_UnimplementedServiceClientInterface { /// A call that no server should implement @discardableResult @@ -269,8 +269,8 @@ internal protocol Connectrpc_Conformance_UnimplementedServiceClientInterface { func `unimplementedStreamingOutputCall`(headers: Connect.Headers) -> any Connect.ServerOnlyAsyncStreamInterface } -/// Concrete implementation of `Connectrpc_Conformance_UnimplementedServiceClientInterface`. -internal final class Connectrpc_Conformance_UnimplementedServiceClient: Connectrpc_Conformance_UnimplementedServiceClientInterface { +/// 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) { @@ -279,49 +279,49 @@ internal final class Connectrpc_Conformance_UnimplementedServiceClient: Connectr @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.UnimplementedService/UnimplementedCall", request: request, headers: headers, completion: completion) + 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.UnimplementedService/UnimplementedCall", request: request, headers: headers) + 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.UnimplementedService/UnimplementedStreamingOutputCall", headers: headers, onResult: onResult) + 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.UnimplementedService/UnimplementedStreamingOutputCall", headers: headers) + 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.UnimplementedService", type: .unary) - internal static let unimplementedStreamingOutputCall = Connect.MethodSpec(name: "UnimplementedStreamingOutputCall", service: "connectrpc.conformance.UnimplementedService", type: .serverStream) + 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_ReconnectServiceClientInterface { +internal protocol Connectrpc_Conformance_V1_ReconnectServiceClientInterface { @discardableResult - func `start`(request: Connectrpc_Conformance_ReconnectParams, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + func `start`(request: Connectrpc_Conformance_V1_ReconnectParams, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable @available(iOS 13, *) - func `start`(request: Connectrpc_Conformance_ReconnectParams, headers: Connect.Headers) async -> ResponseMessage + 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 + 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 + func `stop`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage } -/// Concrete implementation of `Connectrpc_Conformance_ReconnectServiceClientInterface`. -internal final class Connectrpc_Conformance_ReconnectServiceClient: Connectrpc_Conformance_ReconnectServiceClientInterface { +/// 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) { @@ -329,55 +329,55 @@ internal final class Connectrpc_Conformance_ReconnectServiceClient: Connectrpc_C } @discardableResult - internal func `start`(request: Connectrpc_Conformance_ReconnectParams, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/connectrpc.conformance.ReconnectService/Start", request: request, headers: headers, completion: completion) + 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_ReconnectParams, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/connectrpc.conformance.ReconnectService/Start", request: request, headers: headers) + 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.ReconnectService/Stop", request: request, headers: headers, completion: completion) + 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.ReconnectService/Stop", request: request, headers: headers) + 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.ReconnectService", type: .unary) - internal static let stop = Connect.MethodSpec(name: "Stop", service: "connectrpc.conformance.ReconnectService", type: .unary) + 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_LoadBalancerStatsServiceClientInterface { +internal protocol Connectrpc_Conformance_V1_LoadBalancerStatsServiceClientInterface { /// Gets the backend distribution for RPCs sent by a test client. @discardableResult - func `getClientStats`(request: Connectrpc_Conformance_LoadBalancerStatsRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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_LoadBalancerStatsRequest, headers: Connect.Headers) async -> ResponseMessage + 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_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers) async -> ResponseMessage + func `getClientAccumulatedStats`(request: Connectrpc_Conformance_V1_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers) async -> ResponseMessage } -/// Concrete implementation of `Connectrpc_Conformance_LoadBalancerStatsServiceClientInterface`. -internal final class Connectrpc_Conformance_LoadBalancerStatsServiceClient: Connectrpc_Conformance_LoadBalancerStatsServiceClientInterface { +/// 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) { @@ -385,35 +385,35 @@ internal final class Connectrpc_Conformance_LoadBalancerStatsServiceClient: Conn } @discardableResult - internal func `getClientStats`(request: Connectrpc_Conformance_LoadBalancerStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/connectrpc.conformance.LoadBalancerStatsService/GetClientStats", request: request, headers: headers, completion: completion) + 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_LoadBalancerStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/connectrpc.conformance.LoadBalancerStatsService/GetClientStats", request: request, headers: headers) + 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_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/connectrpc.conformance.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers, completion: completion) + 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_LoadBalancerAccumulatedStatsRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/connectrpc.conformance.LoadBalancerStatsService/GetClientAccumulatedStats", request: request, headers: headers) + 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.LoadBalancerStatsService", type: .unary) - internal static let getClientAccumulatedStats = Connect.MethodSpec(name: "GetClientAccumulatedStats", service: "connectrpc.conformance.LoadBalancerStatsService", type: .unary) + 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_XdsUpdateHealthServiceClientInterface { +internal protocol Connectrpc_Conformance_V1_XdsUpdateHealthServiceClientInterface { @discardableResult func `setServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable @@ -428,8 +428,8 @@ internal protocol Connectrpc_Conformance_XdsUpdateHealthServiceClientInterface { func `setNotServing`(request: SwiftProtobuf.Google_Protobuf_Empty, headers: Connect.Headers) async -> ResponseMessage } -/// Concrete implementation of `Connectrpc_Conformance_XdsUpdateHealthServiceClientInterface`. -internal final class Connectrpc_Conformance_XdsUpdateHealthServiceClient: Connectrpc_Conformance_XdsUpdateHealthServiceClientInterface { +/// 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) { @@ -438,46 +438,46 @@ internal final class Connectrpc_Conformance_XdsUpdateHealthServiceClient: Connec @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.XdsUpdateHealthService/SetServing", request: request, headers: headers, completion: completion) + 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.XdsUpdateHealthService/SetServing", request: request, headers: headers) + 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.XdsUpdateHealthService/SetNotServing", request: request, headers: headers, completion: completion) + 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.XdsUpdateHealthService/SetNotServing", request: request, headers: headers) + 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.XdsUpdateHealthService", type: .unary) - internal static let setNotServing = Connect.MethodSpec(name: "SetNotServing", service: "connectrpc.conformance.XdsUpdateHealthService", type: .unary) + 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_XdsUpdateClientConfigureServiceClientInterface { +internal protocol Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClientInterface { /// Update the tes client's configuration. @discardableResult - func `configure`(request: Connectrpc_Conformance_ClientConfigureRequest, headers: Connect.Headers, completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable + 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_ClientConfigureRequest, headers: Connect.Headers) async -> ResponseMessage + func `configure`(request: Connectrpc_Conformance_V1_ClientConfigureRequest, headers: Connect.Headers) async -> ResponseMessage } -/// Concrete implementation of `Connectrpc_Conformance_XdsUpdateClientConfigureServiceClientInterface`. -internal final class Connectrpc_Conformance_XdsUpdateClientConfigureServiceClient: Connectrpc_Conformance_XdsUpdateClientConfigureServiceClientInterface { +/// 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) { @@ -485,18 +485,18 @@ internal final class Connectrpc_Conformance_XdsUpdateClientConfigureServiceClien } @discardableResult - internal func `configure`(request: Connectrpc_Conformance_ClientConfigureRequest, headers: Connect.Headers = [:], completion: @escaping (ResponseMessage) -> Void) -> Connect.Cancelable { - return self.client.unary(path: "/connectrpc.conformance.XdsUpdateClientConfigureService/Configure", request: request, headers: headers, completion: completion) + 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_ClientConfigureRequest, headers: Connect.Headers = [:]) async -> ResponseMessage { - return await self.client.unary(path: "/connectrpc.conformance.XdsUpdateClientConfigureService/Configure", request: request, headers: headers) + 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.XdsUpdateClientConfigureService", type: .unary) + internal static let configure = Connect.MethodSpec(name: "Configure", service: "connectrpc.conformance.v1.XdsUpdateClientConfigureService", type: .unary) } } } diff --git a/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.mock.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.mock.swift similarity index 66% rename from Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.mock.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.mock.swift index a399e891..bf22c7dd 100644 --- a/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/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: connectrpc/conformance/test.proto +// Source: connectrpc/conformance/v1/test.proto // import Combine @@ -9,14 +9,14 @@ import ConnectMocks import Foundation import SwiftProtobuf -/// Mock implementation of `Connectrpc_Conformance_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 Connectrpc_Conformance_TestServiceClientMock: Connectrpc_Conformance_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 Connectrpc_Conformance_TestServiceClientMock: Connectrpc_Conforma /// 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 = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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 Connectrpc_Conformance_TestServiceClientMock: Connectrpc_Conforma } @discardableResult - internal func `unaryCall`(request: Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_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 Connectrpc_Conformance_TestServiceClientMock: Connectrpc_Conforma } } -/// Mock implementation of `Connectrpc_Conformance_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 Connectrpc_Conformance_UnimplementedServiceClientMock: Connectrpc_Conformance_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 Connectrpc_Conformance_UnimplementedServiceClientMock: Connectrpc } } -/// Mock implementation of `Connectrpc_Conformance_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 Connectrpc_Conformance_ReconnectServiceClientMock: Connectrpc_Conformance_ReconnectServiceClientInterface { +internal class Connectrpc_Conformance_V1_ReconnectServiceClientMock: Connectrpc_Conformance_V1_ReconnectServiceClientInterface { private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `start()`. - internal var mockStart = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_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 `Connectrpc_Conformance_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 Connectrpc_Conformance_LoadBalancerStatsServiceClientMock: Connectrpc_Conformance_LoadBalancerStatsServiceClientInterface { +internal class Connectrpc_Conformance_V1_LoadBalancerStatsServiceClientMock: Connectrpc_Conformance_V1_LoadBalancerStatsServiceClientInterface { private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `getClientStats()`. - internal var mockGetClientStats = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_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 `Connectrpc_Conformance_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 Connectrpc_Conformance_XdsUpdateHealthServiceClientMock: Connectrpc_Conformance_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 Connectrpc_Conformance_XdsUpdateHealthServiceClientMock: Connectr } } -/// Mock implementation of `Connectrpc_Conformance_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 Connectrpc_Conformance_XdsUpdateClientConfigureServiceClientMock: Connectrpc_Conformance_XdsUpdateClientConfigureServiceClientInterface { +internal class Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClientMock: Connectrpc_Conformance_V1_XdsUpdateClientConfigureServiceClientInterface { private var cancellables = [Combine.AnyCancellable]() /// Mocked for calls to `configure()`. - internal var mockConfigure = { (_: Connectrpc_Conformance_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 = { (_: Connectrpc_Conformance_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: Connectrpc_Conformance_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: Connectrpc_Conformance_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/connectrpc/conformance/test.pb.swift b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.pb.swift similarity index 98% rename from Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.pb.swift rename to Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.pb.swift index 030ecbca..12171131 100644 --- a/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/test.pb.swift +++ b/Tests/ConnectLibraryTests/Generated/connectrpc/conformance/v1/test.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: connectrpc/conformance/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/ From a309950684d8e80b03f5c8b5122e0b175844a3fa Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 13:13:55 -0400 Subject: [PATCH 06/19] Latest --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 628d12c3..706c266e 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 := 56c4c7061f85848e393b109b6671516b1dc5a620 +CONFORMANCE_VERSION := 3d74b3c470b0e98995cc67644d14ecb4f32db790 LICENSE_HEADER_VERSION := v1.12.0 LICENSE_IGNORE := -e Package.swift \ -e $(BIN)\/ \ From 17a3952b4de67a350acc44c17b6bb12039940d18 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 14:51:44 -0400 Subject: [PATCH 07/19] Fix --- Libraries/Connect/Interfaces/ConnectError.swift | 11 +++++++++++ Makefile | 6 +++--- .../ConnectConformance/AsyncAwaitConformance.swift | 6 +++--- .../ConnectConformance/CallbackConformance.swift | 6 +++--- .../ConnectConformance/ConformanceConfiguration.swift | 4 ++-- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Libraries/Connect/Interfaces/ConnectError.swift b/Libraries/Connect/Interfaces/ConnectError.swift index e1a3ac1e..a7c0ee66 100644 --- a/Libraries/Connect/Interfaces/ConnectError.swift +++ b/Libraries/Connect/Interfaces/ConnectError.swift @@ -73,6 +73,17 @@ public struct ConnectError: Swift.Error, Sendable { case payload = "value" } + public init(from decoder: Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let encodedPayload = try container.decode(String.self, forKey: .payload) + let padded = encodedPayload.padding(toLength: ((encodedPayload.count+3)/4)*4, withPad: "=", startingAt: 0) + + self.init( + type: try container.decodeIfPresent(String.self, forKey: .type) ?? "", + payload: Data(base64Encoded: padded) + ) + } + public init(type: String, payload: Data?) { self.type = type self.payload = payload diff --git a/Makefile b/Makefile index 706c266e..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 := 3d74b3c470b0e98995cc67644d14ecb4f32db790 +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/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index 57a1f42a..2d37a919 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -344,7 +344,7 @@ final class AsyncAwaitConformance: XCTestCase { await self.executeTestWithClients { client 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: Connectrpc_Conformance_V1_SimpleRequest()) XCTAssertEqual(response.error?.code, .resourceExhausted) @@ -357,7 +357,7 @@ final class AsyncAwaitConformance: XCTestCase { try await self.executeTestWithClients { client 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() @@ -392,7 +392,7 @@ final class AsyncAwaitConformance: XCTestCase { try await self.executeTestWithClients { client 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() diff --git a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift index 93bd68f7..d69a05cf 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift @@ -379,7 +379,7 @@ final class CallbackConformance: XCTestCase { self.executeTestWithClients { client 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: Connectrpc_Conformance_V1_SimpleRequest()) { response in @@ -397,7 +397,7 @@ final class CallbackConformance: XCTestCase { try self.executeTestWithClients { client 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 @@ -432,7 +432,7 @@ final class CallbackConformance: XCTestCase { try self.executeTestWithClients { client 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 diff --git a/Tests/ConnectLibraryTests/ConnectConformance/ConformanceConfiguration.swift b/Tests/ConnectLibraryTests/ConnectConformance/ConformanceConfiguration.swift index 3f9df361..ba7968fc 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/ConformanceConfiguration.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/ConformanceConfiguration.swift @@ -40,8 +40,8 @@ final class ConformanceConfiguration { ) let matrix: [(networkProtocol: NetworkProtocol, httpClients: [HTTPClientInterface])] = [ (.connect, [urlSessionClient, nioClient]), - (.grpcWeb, [urlSessionClient, nioClient]), - (.grpc, [nioClient]), // URLSession client does not support gRPC +// (.grpcWeb, [urlSessionClient, nioClient]), +// (.grpc, [nioClient]), // URLSession client does not support gRPC ] let codecs: [Codec] = [JSONCodec(), ProtoCodec()] return matrix.reduce(into: []) { configurations, tuple in From b36132035387221a961f28db48093b40c62a1623 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 14:53:23 -0400 Subject: [PATCH 08/19] Update Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift Co-authored-by: Michael Rebello --- .../ConnectConformance/CallbackConformance.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift index b3660f24..981fbfe5 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift @@ -478,7 +478,8 @@ final class CallbackConformance: XCTestCase { self.executeTestWithClients { client in let expectation = self.expectation(description: "Receives canceled response") let cancelable = client.emptyCall( - request: SwiftProtobuf.Google_Protobuf_Empty()) { response in + request: SwiftProtobuf.Google_Protobuf_Empty() + ) { response in XCTAssertEqual(response.code, .canceled) XCTAssertEqual(response.error?.code, .canceled) expectation.fulfill() From ba933ef7968ae1caf73ae7f382ce894faa5d8179 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 14:53:51 -0400 Subject: [PATCH 09/19] Feedback --- .../ConnectConformance/AsyncAwaitConformance.swift | 4 +--- .../ConnectConformance/CallbackConformance.swift | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index 96404b4e..763ec921 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -367,9 +367,7 @@ final class AsyncAwaitConformance: XCTestCase { } let expectation = self.expectation(description: "Stream completes") let stream = client.failStreamingOutputCall() - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in - proto.responseParameters = [] - }) + try stream.send(Grpc_Testing_StreamingOutputCallRequest()) for await result in stream.results() { switch result { case .headers: diff --git a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift index 981fbfe5..c407b579 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift @@ -420,9 +420,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Grpc_Testing_StreamingOutputCallRequest.with { proto in - proto.responseParameters = [] - }) + try stream.send(Grpc_Testing_StreamingOutputCallRequest()) XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) } From 107518db05954e76579e48ecf21945ab40d0f08d Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 16:08:34 -0400 Subject: [PATCH 10/19] Remove unnecessary conversion --- Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift | 3 +-- .../ConnectConformance/ConformanceConfiguration.swift | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift b/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift index 5289f8eb..90501b29 100644 --- a/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift +++ b/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift @@ -45,8 +45,7 @@ private extension Trailers { return self[HeaderConstants.grpcStatusDetails]? .first .flatMap { - let padded = $0.padding(toLength: (($0.count+3)/4)*4, withPad: "=", startingAt: 0) - return Data(base64Encoded: padded) + return Data(base64Encoded: $0) } .flatMap { data -> Grpc_Status_V1_Status? in return try? ProtoCodec().deserialize(source: data) diff --git a/Tests/ConnectLibraryTests/ConnectConformance/ConformanceConfiguration.swift b/Tests/ConnectLibraryTests/ConnectConformance/ConformanceConfiguration.swift index ba7968fc..3f9df361 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/ConformanceConfiguration.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/ConformanceConfiguration.swift @@ -40,8 +40,8 @@ final class ConformanceConfiguration { ) let matrix: [(networkProtocol: NetworkProtocol, httpClients: [HTTPClientInterface])] = [ (.connect, [urlSessionClient, nioClient]), -// (.grpcWeb, [urlSessionClient, nioClient]), -// (.grpc, [nioClient]), // URLSession client does not support gRPC + (.grpcWeb, [urlSessionClient, nioClient]), + (.grpc, [nioClient]), // URLSession client does not support gRPC ] let codecs: [Codec] = [JSONCodec(), ProtoCodec()] return matrix.reduce(into: []) { configurations, tuple in From 23ac1c72e41ee4abc4ba1440cd45f58aa9a16dd5 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 16:11:36 -0400 Subject: [PATCH 11/19] Add comments --- .../Connect/Implementation/GRPC/ConnectError+GRPC.swift | 4 +--- Libraries/Connect/Interfaces/ConnectError.swift | 8 +++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift b/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift index 90501b29..57e85a3b 100644 --- a/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift +++ b/Libraries/Connect/Implementation/GRPC/ConnectError+GRPC.swift @@ -44,9 +44,7 @@ private extension Trailers { func connectErrorDetailsFromGRPC() -> [ConnectError.Detail] { return self[HeaderConstants.grpcStatusDetails]? .first - .flatMap { - return Data(base64Encoded: $0) - } + .flatMap { Data(base64Encoded: $0) } .flatMap { data -> Grpc_Status_V1_Status? in return try? ProtoCodec().deserialize(source: data) }? diff --git a/Libraries/Connect/Interfaces/ConnectError.swift b/Libraries/Connect/Interfaces/ConnectError.swift index a7c0ee66..fac7a829 100644 --- a/Libraries/Connect/Interfaces/ConnectError.swift +++ b/Libraries/Connect/Interfaces/ConnectError.swift @@ -75,8 +75,14 @@ public struct ConnectError: Swift.Error, Sendable { public init(from decoder: Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) + + // Read the base64-encoded payload and then pad if needed let encodedPayload = try container.decode(String.self, forKey: .payload) - let padded = encodedPayload.padding(toLength: ((encodedPayload.count+3)/4)*4, withPad: "=", startingAt: 0) + let padded = encodedPayload.padding( + toLength: ((encodedPayload.count+3)/4)*4, + withPad: "=", + startingAt: 0 + ) self.init( type: try container.decodeIfPresent(String.self, forKey: .type) ?? "", From 20f2c4ee0bc296c8725d6c1a6d94089d76669514 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 16:39:08 -0400 Subject: [PATCH 12/19] Update Libraries/Connect/Interfaces/ConnectError.swift Co-authored-by: Michael Rebello --- Libraries/Connect/Interfaces/ConnectError.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Connect/Interfaces/ConnectError.swift b/Libraries/Connect/Interfaces/ConnectError.swift index fac7a829..03aeda85 100644 --- a/Libraries/Connect/Interfaces/ConnectError.swift +++ b/Libraries/Connect/Interfaces/ConnectError.swift @@ -79,7 +79,7 @@ public struct ConnectError: Swift.Error, Sendable { // Read the base64-encoded payload and then pad if needed let encodedPayload = try container.decode(String.self, forKey: .payload) let padded = encodedPayload.padding( - toLength: ((encodedPayload.count+3)/4)*4, + toLength: ((encodedPayload.count + 3) / 4) * 4, withPad: "=", startingAt: 0 ) From d2b5788fb6829cc3c8bdf85714bc7c646fc76e43 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 12:59:36 -0400 Subject: [PATCH 13/19] Lint and generate --- Libraries/Connect/Interfaces/ConnectError.swift | 7 ++++++- .../ConnectConformance/AsyncAwaitConformance.swift | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Libraries/Connect/Interfaces/ConnectError.swift b/Libraries/Connect/Interfaces/ConnectError.swift index 03aeda85..4b0f0761 100644 --- a/Libraries/Connect/Interfaces/ConnectError.swift +++ b/Libraries/Connect/Interfaces/ConnectError.swift @@ -77,8 +77,13 @@ public struct ConnectError: Swift.Error, Sendable { let container = try decoder.container(keyedBy: CodingKeys.self) // Read the base64-encoded payload and then pad if needed - let encodedPayload = try container.decode(String.self, forKey: .payload) + // base64-encoded strings should be a length that is a multiple of four and if the + // original string is not, it should be padded with '='. This helps to guard against a + // corrupted string. + let encodedPayload = try container.decodeIfPresent(String.self, forKey: .payload) ?? "" let padded = 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 diff --git a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index 2d37a919..0777cf98 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// swiftlint:disable file_length + import Connect import Foundation import SwiftProtobuf @@ -274,7 +276,9 @@ final class AsyncAwaitConformance: XCTestCase { func testUnimplementedMethod() async { await self.executeTestWithClients { client in - let response = await client.unimplementedCall(request: SwiftProtobuf.Google_Protobuf_Empty()) + let response = await client.unimplementedCall( + request: SwiftProtobuf.Google_Protobuf_Empty() + ) XCTAssertEqual(response.code, .unimplemented) XCTAssertEqual( response.error?.message, @@ -311,7 +315,9 @@ final class AsyncAwaitConformance: XCTestCase { func testUnimplementedService() async { await self.executeTestWithUnimplementedClients { client in - let response = await client.unimplementedCall(request: SwiftProtobuf.Google_Protobuf_Empty()) + let response = await client.unimplementedCall( + request: SwiftProtobuf.Google_Protobuf_Empty() + ) XCTAssertEqual(response.code, .unimplemented) XCTAssertNotNil(response.error) } From ec409d5d1eb7c9b87c37880d7f52abc283eaed1e Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 14:53:23 -0400 Subject: [PATCH 14/19] Update Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift Co-authored-by: Michael Rebello --- .../ConnectConformance/CallbackConformance.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift index d69a05cf..bda80711 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift @@ -478,7 +478,8 @@ final class CallbackConformance: XCTestCase { self.executeTestWithClients { client in let expectation = self.expectation(description: "Receives canceled response") let cancelable = client.emptyCall( - request: SwiftProtobuf.Google_Protobuf_Empty()) { response in + request: SwiftProtobuf.Google_Protobuf_Empty() + ) { response in XCTAssertEqual(response.code, .canceled) XCTAssertEqual(response.error?.code, .canceled) expectation.fulfill() From 5c63170e22fe29beddc8e8bbd4336ac0eb34cab8 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 14:53:51 -0400 Subject: [PATCH 15/19] Feedback --- .../ConnectConformance/AsyncAwaitConformance.swift | 5 ++--- .../ConnectConformance/CallbackConformance.swift | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index 0777cf98..2167bbe4 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -367,9 +367,8 @@ final class AsyncAwaitConformance: XCTestCase { } let expectation = self.expectation(description: "Stream completes") let stream = client.failStreamingOutputCall() - try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in - proto.responseParameters = [] - }) + + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest()) for await result in stream.results() { switch result { case .headers: diff --git a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift index bda80711..70a48878 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/CallbackConformance.swift @@ -420,9 +420,7 @@ final class CallbackConformance: XCTestCase { expectation.fulfill() } } - try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest.with { proto in - proto.responseParameters = [] - }) + try stream.send(Connectrpc_Conformance_V1_StreamingOutputCallRequest()) XCTAssertEqual(XCTWaiter().wait(for: [expectation], timeout: kTimeout), .completed) } From fbd816bc122b69fd8b4ff30e2d4ae09ee1cac39d Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 17:14:35 -0400 Subject: [PATCH 16/19] Lint --- .../ConnectConformance/AsyncAwaitConformance.swift | 7 +++++-- .../ConnectMocksTests/ConnectMocksTests.swift | 13 +++++++++---- .../ConnectTests/ConnectErrorTests.swift | 8 ++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift index 2167bbe4..56d26f6d 100644 --- a/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift +++ b/Tests/ConnectLibraryTests/ConnectConformance/AsyncAwaitConformance.swift @@ -302,7 +302,8 @@ final class AsyncAwaitConformance: XCTestCase { XCTAssertEqual( (error as? ConnectError)?.message, """ - connectrpc.conformance.v1.TestService.UnimplementedStreamingOutputCall is not implemented + connectrpc.conformance.v1.TestService.UnimplementedStreamingOutputCall is \ + not implemented """ ) expectation.fulfill() @@ -352,7 +353,9 @@ final class AsyncAwaitConformance: XCTestCase { proto.reason = "soirée 🎉" proto.domain = "connect-conformance" } - let response = await client.failUnaryCall(request: Connectrpc_Conformance_V1_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]) diff --git a/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift b/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift index 864cb4c3..b2605045 100644 --- a/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift +++ b/Tests/ConnectLibraryTests/ConnectMocksTests/ConnectMocksTests.swift @@ -55,7 +55,8 @@ final class ConnectMocksTests: XCTestCase { .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) }), @@ -69,7 +70,9 @@ final class ConnectMocksTests: XCTestCase { 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]) @@ -88,7 +91,8 @@ final class ConnectMocksTests: XCTestCase { .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) }), @@ -148,7 +152,8 @@ final class ConnectMocksTests: XCTestCase { 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) }), diff --git a/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift b/Tests/ConnectLibraryTests/ConnectTests/ConnectErrorTests.swift index 8343c97e..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 = Connectrpc_Conformance_V1_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) @@ -44,7 +46,9 @@ final class ConnectErrorTests: XCTestCase { } func testDeserializingErrorUsingHelperFunctionLowercasesHeaderKeys() throws { - let expectedDetails = Connectrpc_Conformance_V1_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, From 59febf058fbc3c003b35b00862a7fa488153d029 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 17:16:03 -0400 Subject: [PATCH 17/19] Fix link on README to be consistent with other repos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 2b7432cdeef3b89f4271200f1e821788c728bd13 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 18:24:39 -0400 Subject: [PATCH 18/19] Update Libraries/Connect/Interfaces/ConnectError.swift Co-authored-by: Michael Rebello --- Libraries/Connect/Interfaces/ConnectError.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/Connect/Interfaces/ConnectError.swift b/Libraries/Connect/Interfaces/ConnectError.swift index 4b0f0761..6cf93c16 100644 --- a/Libraries/Connect/Interfaces/ConnectError.swift +++ b/Libraries/Connect/Interfaces/ConnectError.swift @@ -76,9 +76,9 @@ public struct ConnectError: Swift.Error, Sendable { public init(from decoder: Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - // Read the base64-encoded payload and then pad if needed - // base64-encoded strings should be a length that is a multiple of four and if the - // original string is not, it should be padded with '='. This helps to guard against a + // 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 padded = encodedPayload.padding( From 503353e7dbdd0a949d9e7c60b6aa1b5cf79f17be Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 12 Sep 2023 18:24:53 -0400 Subject: [PATCH 19/19] Update Libraries/Connect/Interfaces/ConnectError.swift Co-authored-by: Michael Rebello --- Libraries/Connect/Interfaces/ConnectError.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Libraries/Connect/Interfaces/ConnectError.swift b/Libraries/Connect/Interfaces/ConnectError.swift index 6cf93c16..92c1ed79 100644 --- a/Libraries/Connect/Interfaces/ConnectError.swift +++ b/Libraries/Connect/Interfaces/ConnectError.swift @@ -81,17 +81,16 @@ public struct ConnectError: Swift.Error, Sendable { // 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 padded = encodedPayload.padding( - // Calculate the nearest multiple of 4 that is >= the length of encodedPayload - // Then, pad the string to that length + 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: padded) + payload: Data(base64Encoded: paddedPayload) ) }