| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- // swiftlint:disable all
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: conformance/conformance.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/apple/swift-protobuf/
- // Protocol Buffers - Google's data interchange format
- // Copyright 2008 Google Inc. All rights reserved.
- //
- // Use of this source code is governed by a BSD-style
- // license that can be found in the LICENSE file or at
- // https://developers.google.com/open-source/licenses/bsd
- 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
- }
- enum Conformance_WireFormat: SwiftProtobuf.Enum, Swift.CaseIterable {
- typealias RawValue = Int
- case unspecified // = 0
- case protobuf // = 1
- case json // = 2
- /// Only used inside Google. Opensource testees just skip it.
- case jspb // = 3
- case textFormat // = 4
- case UNRECOGNIZED(Int)
- init() {
- self = .unspecified
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unspecified
- case 1: self = .protobuf
- case 2: self = .json
- case 3: self = .jspb
- case 4: self = .textFormat
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unspecified: return 0
- case .protobuf: return 1
- case .json: return 2
- case .jspb: return 3
- case .textFormat: return 4
- case .UNRECOGNIZED(let i): return i
- }
- }
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static let allCases: [Conformance_WireFormat] = [
- .unspecified,
- .protobuf,
- .json,
- .jspb,
- .textFormat,
- ]
- }
- enum Conformance_TestCategory: SwiftProtobuf.Enum, Swift.CaseIterable {
- typealias RawValue = Int
- case unspecifiedTest // = 0
- /// Test binary wire format.
- case binaryTest // = 1
- /// Test json wire format.
- case jsonTest // = 2
- /// Similar to JSON_TEST. However, during parsing json, testee should ignore
- /// unknown fields. This feature is optional. Each implementation can decide
- /// whether to support it. See
- /// https://developers.google.com/protocol-buffers/docs/proto3#json_options
- /// for more detail.
- case jsonIgnoreUnknownParsingTest // = 3
- /// Test jspb wire format. Only used inside Google. Opensource testees just
- /// skip it.
- case jspbTest // = 4
- /// Test text format. For cpp, java and python, testees can already deal with
- /// this type. Testees of other languages can simply skip it.
- case textFormatTest // = 5
- case UNRECOGNIZED(Int)
- init() {
- self = .unspecifiedTest
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unspecifiedTest
- case 1: self = .binaryTest
- case 2: self = .jsonTest
- case 3: self = .jsonIgnoreUnknownParsingTest
- case 4: self = .jspbTest
- case 5: self = .textFormatTest
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unspecifiedTest: return 0
- case .binaryTest: return 1
- case .jsonTest: return 2
- case .jsonIgnoreUnknownParsingTest: return 3
- case .jspbTest: return 4
- case .textFormatTest: return 5
- case .UNRECOGNIZED(let i): return i
- }
- }
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static let allCases: [Conformance_TestCategory] = [
- .unspecifiedTest,
- .binaryTest,
- .jsonTest,
- .jsonIgnoreUnknownParsingTest,
- .jspbTest,
- .textFormatTest,
- ]
- }
- /// Meant to encapsulate all types of tests: successes, skips, failures, etc.
- /// Therefore, this may or may not have a failure message. Failure messages
- /// may be truncated for our failure lists.
- struct Conformance_TestStatus: Sendable {
- // 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 name: String = String()
- var failureMessage: String = String()
- /// What an actual test name matched to in a failure list. Can be wildcarded or
- /// an exact match without wildcards.
- var matchedName: String = String()
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// The conformance runner will request a list of failures as the first request.
- /// This will be known by message_type == "conformance.FailureSet", a conformance
- /// test should return a serialized FailureSet in protobuf_payload.
- struct Conformance_FailureSet: Sendable {
- // 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 test: [Conformance_TestStatus] = []
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// Represents a single test case's input. The testee should:
- ///
- /// 1. parse this proto (which should always succeed)
- /// 2. parse the protobuf or JSON payload in "payload" (which may fail)
- /// 3. if the parse succeeded, serialize the message in the requested format.
- struct Conformance_ConformanceRequest: Sendable {
- // 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 payload (whether protobuf of JSON) is always for a
- /// protobuf_test_messages.proto3.TestAllTypes proto (as defined in
- /// src/google/protobuf/proto3_test_messages.proto).
- var payload: Conformance_ConformanceRequest.OneOf_Payload? = nil
- var protobufPayload: Data {
- get {
- if case .protobufPayload(let v)? = payload {return v}
- return Data()
- }
- set {payload = .protobufPayload(newValue)}
- }
- var jsonPayload: String {
- get {
- if case .jsonPayload(let v)? = payload {return v}
- return String()
- }
- set {payload = .jsonPayload(newValue)}
- }
- /// Only used inside Google. Opensource testees just skip it.
- var jspbPayload: String {
- get {
- if case .jspbPayload(let v)? = payload {return v}
- return String()
- }
- set {payload = .jspbPayload(newValue)}
- }
- var textPayload: String {
- get {
- if case .textPayload(let v)? = payload {return v}
- return String()
- }
- set {payload = .textPayload(newValue)}
- }
- /// Which format should the testee serialize its message to?
- var requestedOutputFormat: Conformance_WireFormat = .unspecified
- /// The full name for the test message to use; for the moment, either:
- /// protobuf_test_messages.proto3.TestAllTypesProto3 or
- /// protobuf_test_messages.proto2.TestAllTypesProto2 or
- /// protobuf_test_messages.editions.proto2.TestAllTypesProto2 or
- /// protobuf_test_messages.editions.proto3.TestAllTypesProto3 or
- /// protobuf_test_messages.editions.TestAllTypesEdition2023.
- var messageType: String = String()
- /// Each test is given a specific test category. Some category may need
- /// specific support in testee programs. Refer to the definition of
- /// TestCategory for more information.
- var testCategory: Conformance_TestCategory = .unspecifiedTest
- /// Specify details for how to encode jspb.
- var jspbEncodingOptions: Conformance_JspbEncodingConfig {
- get {return _jspbEncodingOptions ?? Conformance_JspbEncodingConfig()}
- set {_jspbEncodingOptions = newValue}
- }
- /// Returns true if `jspbEncodingOptions` has been explicitly set.
- var hasJspbEncodingOptions: Bool {return self._jspbEncodingOptions != nil}
- /// Clears the value of `jspbEncodingOptions`. Subsequent reads from it will return its default value.
- mutating func clearJspbEncodingOptions() {self._jspbEncodingOptions = nil}
- /// This can be used in json and text format. If true, testee should print
- /// unknown fields instead of ignore. This feature is optional.
- var printUnknownFields: Bool = false
- var unknownFields = SwiftProtobuf.UnknownStorage()
- /// The payload (whether protobuf of JSON) is always for a
- /// protobuf_test_messages.proto3.TestAllTypes proto (as defined in
- /// src/google/protobuf/proto3_test_messages.proto).
- enum OneOf_Payload: Equatable, Sendable {
- case protobufPayload(Data)
- case jsonPayload(String)
- /// Only used inside Google. Opensource testees just skip it.
- case jspbPayload(String)
- case textPayload(String)
- }
- init() {}
- fileprivate var _jspbEncodingOptions: Conformance_JspbEncodingConfig? = nil
- }
- /// Represents a single test case's output.
- struct Conformance_ConformanceResponse: Sendable {
- // 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 result: Conformance_ConformanceResponse.OneOf_Result? = nil
- /// This string should be set to indicate parsing failed. The string can
- /// provide more information about the parse error if it is available.
- ///
- /// Setting this string does not necessarily mean the testee failed the
- /// test. Some of the test cases are intentionally invalid input.
- var parseError: String {
- get {
- if case .parseError(let v)? = result {return v}
- return String()
- }
- set {result = .parseError(newValue)}
- }
- /// If the input was successfully parsed but errors occurred when
- /// serializing it to the requested output format, set the error message in
- /// this field.
- var serializeError: String {
- get {
- if case .serializeError(let v)? = result {return v}
- return String()
- }
- set {result = .serializeError(newValue)}
- }
- /// This should be set if the test program timed out. The string should
- /// provide more information about what the child process was doing when it
- /// was killed.
- var timeoutError: String {
- get {
- if case .timeoutError(let v)? = result {return v}
- return String()
- }
- set {result = .timeoutError(newValue)}
- }
- /// This should be set if some other error occurred. This will always
- /// indicate that the test failed. The string can provide more information
- /// about the failure.
- var runtimeError: String {
- get {
- if case .runtimeError(let v)? = result {return v}
- return String()
- }
- set {result = .runtimeError(newValue)}
- }
- /// If the input was successfully parsed and the requested output was
- /// protobuf, serialize it to protobuf and set it in this field.
- var protobufPayload: Data {
- get {
- if case .protobufPayload(let v)? = result {return v}
- return Data()
- }
- set {result = .protobufPayload(newValue)}
- }
- /// If the input was successfully parsed and the requested output was JSON,
- /// serialize to JSON and set it in this field.
- var jsonPayload: String {
- get {
- if case .jsonPayload(let v)? = result {return v}
- return String()
- }
- set {result = .jsonPayload(newValue)}
- }
- /// For when the testee skipped the test, likely because a certain feature
- /// wasn't supported, like JSON input/output.
- var skipped: String {
- get {
- if case .skipped(let v)? = result {return v}
- return String()
- }
- set {result = .skipped(newValue)}
- }
- /// If the input was successfully parsed and the requested output was JSPB,
- /// serialize to JSPB and set it in this field. JSPB is only used inside
- /// Google. Opensource testees can just skip it.
- var jspbPayload: String {
- get {
- if case .jspbPayload(let v)? = result {return v}
- return String()
- }
- set {result = .jspbPayload(newValue)}
- }
- /// If the input was successfully parsed and the requested output was
- /// TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field.
- var textPayload: String {
- get {
- if case .textPayload(let v)? = result {return v}
- return String()
- }
- set {result = .textPayload(newValue)}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- enum OneOf_Result: Equatable, Sendable {
- /// This string should be set to indicate parsing failed. The string can
- /// provide more information about the parse error if it is available.
- ///
- /// Setting this string does not necessarily mean the testee failed the
- /// test. Some of the test cases are intentionally invalid input.
- case parseError(String)
- /// If the input was successfully parsed but errors occurred when
- /// serializing it to the requested output format, set the error message in
- /// this field.
- case serializeError(String)
- /// This should be set if the test program timed out. The string should
- /// provide more information about what the child process was doing when it
- /// was killed.
- case timeoutError(String)
- /// This should be set if some other error occurred. This will always
- /// indicate that the test failed. The string can provide more information
- /// about the failure.
- case runtimeError(String)
- /// If the input was successfully parsed and the requested output was
- /// protobuf, serialize it to protobuf and set it in this field.
- case protobufPayload(Data)
- /// If the input was successfully parsed and the requested output was JSON,
- /// serialize to JSON and set it in this field.
- case jsonPayload(String)
- /// For when the testee skipped the test, likely because a certain feature
- /// wasn't supported, like JSON input/output.
- case skipped(String)
- /// If the input was successfully parsed and the requested output was JSPB,
- /// serialize to JSPB and set it in this field. JSPB is only used inside
- /// Google. Opensource testees can just skip it.
- case jspbPayload(String)
- /// If the input was successfully parsed and the requested output was
- /// TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field.
- case textPayload(String)
- }
- init() {}
- }
- /// Encoding options for jspb format.
- struct Conformance_JspbEncodingConfig: Sendable {
- // 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.
- /// Encode the value field of Any as jspb array if true, otherwise binary.
- var useJspbArrayAnyFormat: Bool = false
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- fileprivate let _protobuf_package = "conformance"
- extension Conformance_WireFormat: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNSPECIFIED\0\u{1}PROTOBUF\0\u{1}JSON\0\u{1}JSPB\0\u{1}TEXT_FORMAT\0")
- }
- extension Conformance_TestCategory: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNSPECIFIED_TEST\0\u{1}BINARY_TEST\0\u{1}JSON_TEST\0\u{1}JSON_IGNORE_UNKNOWN_PARSING_TEST\0\u{1}JSPB_TEST\0\u{1}TEXT_FORMAT_TEST\0")
- }
- extension Conformance_TestStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestStatus"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}name\0\u{3}failure_message\0\u{3}matched_name\0")
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.decodeSingularStringField(value: &self.name) }()
- case 2: try { try decoder.decodeSingularStringField(value: &self.failureMessage) }()
- case 3: try { try decoder.decodeSingularStringField(value: &self.matchedName) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.name.isEmpty {
- try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
- }
- if !self.failureMessage.isEmpty {
- try visitor.visitSingularStringField(value: self.failureMessage, fieldNumber: 2)
- }
- if !self.matchedName.isEmpty {
- try visitor.visitSingularStringField(value: self.matchedName, fieldNumber: 3)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Conformance_TestStatus, rhs: Conformance_TestStatus) -> Bool {
- if lhs.name != rhs.name {return false}
- if lhs.failureMessage != rhs.failureMessage {return false}
- if lhs.matchedName != rhs.matchedName {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Conformance_FailureSet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".FailureSet"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\u{2}test\0\u{c}\u{1}\u{1}")
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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 2: try { try decoder.decodeRepeatedMessageField(value: &self.test) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.test.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.test, fieldNumber: 2)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Conformance_FailureSet, rhs: Conformance_FailureSet) -> Bool {
- if lhs.test != rhs.test {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Conformance_ConformanceRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".ConformanceRequest"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}protobuf_payload\0\u{3}json_payload\0\u{3}requested_output_format\0\u{3}message_type\0\u{3}test_category\0\u{3}jspb_encoding_options\0\u{3}jspb_payload\0\u{3}text_payload\0\u{3}print_unknown_fields\0")
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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 {
- var v: Data?
- try decoder.decodeSingularBytesField(value: &v)
- if let v = v {
- if self.payload != nil {try decoder.handleConflictingOneOf()}
- self.payload = .protobufPayload(v)
- }
- }()
- case 2: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.payload != nil {try decoder.handleConflictingOneOf()}
- self.payload = .jsonPayload(v)
- }
- }()
- case 3: try { try decoder.decodeSingularEnumField(value: &self.requestedOutputFormat) }()
- case 4: try { try decoder.decodeSingularStringField(value: &self.messageType) }()
- case 5: try { try decoder.decodeSingularEnumField(value: &self.testCategory) }()
- case 6: try { try decoder.decodeSingularMessageField(value: &self._jspbEncodingOptions) }()
- case 7: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.payload != nil {try decoder.handleConflictingOneOf()}
- self.payload = .jspbPayload(v)
- }
- }()
- case 8: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.payload != nil {try decoder.handleConflictingOneOf()}
- self.payload = .textPayload(v)
- }
- }()
- case 9: try { try decoder.decodeSingularBoolField(value: &self.printUnknownFields) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- switch self.payload {
- case .protobufPayload?: try {
- guard case .protobufPayload(let v)? = self.payload else { preconditionFailure() }
- try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
- }()
- case .jsonPayload?: try {
- guard case .jsonPayload(let v)? = self.payload else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 2)
- }()
- default: break
- }
- if self.requestedOutputFormat != .unspecified {
- try visitor.visitSingularEnumField(value: self.requestedOutputFormat, fieldNumber: 3)
- }
- if !self.messageType.isEmpty {
- try visitor.visitSingularStringField(value: self.messageType, fieldNumber: 4)
- }
- if self.testCategory != .unspecifiedTest {
- try visitor.visitSingularEnumField(value: self.testCategory, fieldNumber: 5)
- }
- try { if let v = self._jspbEncodingOptions {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
- } }()
- switch self.payload {
- case .jspbPayload?: try {
- guard case .jspbPayload(let v)? = self.payload else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 7)
- }()
- case .textPayload?: try {
- guard case .textPayload(let v)? = self.payload else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 8)
- }()
- default: break
- }
- if self.printUnknownFields != false {
- try visitor.visitSingularBoolField(value: self.printUnknownFields, fieldNumber: 9)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Conformance_ConformanceRequest, rhs: Conformance_ConformanceRequest) -> Bool {
- if lhs.payload != rhs.payload {return false}
- if lhs.requestedOutputFormat != rhs.requestedOutputFormat {return false}
- if lhs.messageType != rhs.messageType {return false}
- if lhs.testCategory != rhs.testCategory {return false}
- if lhs._jspbEncodingOptions != rhs._jspbEncodingOptions {return false}
- if lhs.printUnknownFields != rhs.printUnknownFields {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Conformance_ConformanceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".ConformanceResponse"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}parse_error\0\u{3}runtime_error\0\u{3}protobuf_payload\0\u{3}json_payload\0\u{1}skipped\0\u{3}serialize_error\0\u{3}jspb_payload\0\u{3}text_payload\0\u{3}timeout_error\0")
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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 {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.result != nil {try decoder.handleConflictingOneOf()}
- self.result = .parseError(v)
- }
- }()
- case 2: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.result != nil {try decoder.handleConflictingOneOf()}
- self.result = .runtimeError(v)
- }
- }()
- case 3: try {
- var v: Data?
- try decoder.decodeSingularBytesField(value: &v)
- if let v = v {
- if self.result != nil {try decoder.handleConflictingOneOf()}
- self.result = .protobufPayload(v)
- }
- }()
- case 4: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.result != nil {try decoder.handleConflictingOneOf()}
- self.result = .jsonPayload(v)
- }
- }()
- case 5: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.result != nil {try decoder.handleConflictingOneOf()}
- self.result = .skipped(v)
- }
- }()
- case 6: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.result != nil {try decoder.handleConflictingOneOf()}
- self.result = .serializeError(v)
- }
- }()
- case 7: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.result != nil {try decoder.handleConflictingOneOf()}
- self.result = .jspbPayload(v)
- }
- }()
- case 8: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.result != nil {try decoder.handleConflictingOneOf()}
- self.result = .textPayload(v)
- }
- }()
- case 9: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.result != nil {try decoder.handleConflictingOneOf()}
- self.result = .timeoutError(v)
- }
- }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- switch self.result {
- case .parseError?: try {
- guard case .parseError(let v)? = self.result else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 1)
- }()
- case .runtimeError?: try {
- guard case .runtimeError(let v)? = self.result else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 2)
- }()
- case .protobufPayload?: try {
- guard case .protobufPayload(let v)? = self.result else { preconditionFailure() }
- try visitor.visitSingularBytesField(value: v, fieldNumber: 3)
- }()
- case .jsonPayload?: try {
- guard case .jsonPayload(let v)? = self.result else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 4)
- }()
- case .skipped?: try {
- guard case .skipped(let v)? = self.result else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 5)
- }()
- case .serializeError?: try {
- guard case .serializeError(let v)? = self.result else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 6)
- }()
- case .jspbPayload?: try {
- guard case .jspbPayload(let v)? = self.result else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 7)
- }()
- case .textPayload?: try {
- guard case .textPayload(let v)? = self.result else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 8)
- }()
- case .timeoutError?: try {
- guard case .timeoutError(let v)? = self.result else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 9)
- }()
- case nil: break
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Conformance_ConformanceResponse, rhs: Conformance_ConformanceResponse) -> Bool {
- if lhs.result != rhs.result {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Conformance_JspbEncodingConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".JspbEncodingConfig"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}use_jspb_array_any_format\0")
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.useJspbArrayAnyFormat) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if self.useJspbArrayAnyFormat != false {
- try visitor.visitSingularBoolField(value: self.useJspbArrayAnyFormat, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Conformance_JspbEncodingConfig, rhs: Conformance_JspbEncodingConfig) -> Bool {
- if lhs.useJspbArrayAnyFormat != rhs.useJspbArrayAnyFormat {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|