| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- // swiftlint:disable all
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: unittest_swift_deprecated_file.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/apple/swift-protobuf/
- // Protos/unittest_swift_deprecated_file.proto - test proto
- //
- // This source file is part of the Swift.org open source project
- //
- // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
- // Licensed under Apache License v2.0 with Runtime Library Exception
- //
- // See http://swift.org/LICENSE.txt for license information
- // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
- //
- // -----------------------------------------------------------------------------
- ///
- /// Test generation support of deprecated attributes.
- ///
- // -----------------------------------------------------------------------------
- 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
- }
- /// NOTE: The whole .proto file that defined this enum was marked as deprecated.
- enum SwiftProtoTesting_DeprecatedFile_MyEnum: Int, SwiftProtobuf.Enum, Swift.CaseIterable {
- case one = 1
- case two = 2
- case three = 3
- init() {
- self = .one
- }
- }
- /// Message comment
- ///
- /// NOTE: The whole .proto file that defined this message was marked as deprecated.
- struct SwiftProtoTesting_DeprecatedFile_MyMsg: SwiftProtobuf.ExtensibleMessage, 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 stringField: String {
- get {_stringField ?? String()}
- set {_stringField = newValue}
- }
- /// Returns true if `stringField` has been explicitly set.
- var hasStringField: Bool {self._stringField != nil}
- /// Clears the value of `stringField`. Subsequent reads from it will return its default value.
- mutating func clearStringField() {self._stringField = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
- fileprivate var _stringField: String? = nil
- }
- /// NOTE: The whole .proto file that defined this message was marked as deprecated.
- struct SwiftProtoTesting_DeprecatedFile_MsgScope: 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 unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- // MARK: - Extension support defined in unittest_swift_deprecated_file.proto.
- // MARK: - Extension Properties
- // Swift Extensions on the extended Messages to add easy access to the declared
- // extension fields. The names are based on the extension field name from the proto
- // declaration. To avoid naming collisions, the names are prefixed with the name of
- // the scope where the extend directive occurs.
- extension SwiftProtoTesting_DeprecatedFile_MyMsg {
- /// Extension field comment
- ///
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- var SwiftProtoTesting_DeprecatedFile_stringExtField: String {
- get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field) ?? String()}
- set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field, value: newValue)}
- }
- /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field`
- /// has been explicitly set.
- var hasSwiftProtoTesting_DeprecatedFile_stringExtField: Bool {
- return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field)
- }
- /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field`.
- /// Subsequent reads from it will return its default value.
- mutating func clearSwiftProtoTesting_DeprecatedFile_stringExtField() {
- clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field)
- }
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- var SwiftProtoTesting_DeprecatedFile_intExtField: Int32 {
- get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field) ?? 0}
- set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field, value: newValue)}
- }
- /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field`
- /// has been explicitly set.
- var hasSwiftProtoTesting_DeprecatedFile_intExtField: Bool {
- return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field)
- }
- /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field`.
- /// Subsequent reads from it will return its default value.
- mutating func clearSwiftProtoTesting_DeprecatedFile_intExtField() {
- clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field)
- }
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- var SwiftProtoTesting_DeprecatedFile_fixedExtField: [UInt32] {
- get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_fixed_ext_field) ?? []}
- set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_fixed_ext_field, value: newValue)}
- }
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- var SwiftProtoTesting_DeprecatedFile_msgExtField: SwiftProtoTesting_DeprecatedFile_MyMsg {
- get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field) ?? SwiftProtoTesting_DeprecatedFile_MyMsg()}
- set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field, value: newValue)}
- }
- /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field`
- /// has been explicitly set.
- var hasSwiftProtoTesting_DeprecatedFile_msgExtField: Bool {
- return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field)
- }
- /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field`.
- /// Subsequent reads from it will return its default value.
- mutating func clearSwiftProtoTesting_DeprecatedFile_msgExtField() {
- clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field)
- }
- /// Another extension field comment
- ///
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- var SwiftProtoTesting_DeprecatedFile_MsgScope_stringExt2Field: String {
- get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field) ?? String()}
- set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field, value: newValue)}
- }
- /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field`
- /// has been explicitly set.
- var hasSwiftProtoTesting_DeprecatedFile_MsgScope_stringExt2Field: Bool {
- return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field)
- }
- /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field`.
- /// Subsequent reads from it will return its default value.
- mutating func clearSwiftProtoTesting_DeprecatedFile_MsgScope_stringExt2Field() {
- clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field)
- }
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- var SwiftProtoTesting_DeprecatedFile_MsgScope_intExt2Field: Int32 {
- get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field) ?? 0}
- set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field, value: newValue)}
- }
- /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field`
- /// has been explicitly set.
- var hasSwiftProtoTesting_DeprecatedFile_MsgScope_intExt2Field: Bool {
- return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field)
- }
- /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field`.
- /// Subsequent reads from it will return its default value.
- mutating func clearSwiftProtoTesting_DeprecatedFile_MsgScope_intExt2Field() {
- clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field)
- }
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- var SwiftProtoTesting_DeprecatedFile_MsgScope_fixedExt2Field: [UInt32] {
- get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.fixed_ext2_field) ?? []}
- set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.fixed_ext2_field, value: newValue)}
- }
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- var SwiftProtoTesting_DeprecatedFile_MsgScope_msgExt2Field: SwiftProtoTesting_DeprecatedFile_MyMsg {
- get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field) ?? SwiftProtoTesting_DeprecatedFile_MyMsg()}
- set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field, value: newValue)}
- }
- /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field`
- /// has been explicitly set.
- var hasSwiftProtoTesting_DeprecatedFile_MsgScope_msgExt2Field: Bool {
- return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field)
- }
- /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field`.
- /// Subsequent reads from it will return its default value.
- mutating func clearSwiftProtoTesting_DeprecatedFile_MsgScope_msgExt2Field() {
- clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field)
- }
- }
- // MARK: - File's ExtensionMap: SwiftProtoTesting_DeprecatedFile_UnittestSwiftDeprecatedFile_Extensions
- /// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
- /// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
- /// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
- /// a larger `SwiftProtobuf.SimpleExtensionMap`.
- let SwiftProtoTesting_DeprecatedFile_UnittestSwiftDeprecatedFile_Extensions: SwiftProtobuf.SimpleExtensionMap = [
- SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field,
- SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field,
- SwiftProtoTesting_DeprecatedFile_Extensions_fixed_ext_field,
- SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field,
- SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field,
- SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field,
- SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.fixed_ext2_field,
- SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field
- ]
- // Extension Objects - The only reason these might be needed is when manually
- // constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_
- // accessors for the extension fields on the messages directly.
- /// Extension field comment
- ///
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- let SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufString>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
- _protobuf_fieldNumber: 101,
- fieldName: "swift_proto_testing.deprecated_file.string_ext_field"
- )
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- let SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufInt32>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
- _protobuf_fieldNumber: 102,
- fieldName: "swift_proto_testing.deprecated_file.int_ext_field"
- )
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- let SwiftProtoTesting_DeprecatedFile_Extensions_fixed_ext_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.RepeatedExtensionField<SwiftProtobuf.ProtobufFixed32>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
- _protobuf_fieldNumber: 103,
- fieldName: "swift_proto_testing.deprecated_file.fixed_ext_field"
- )
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- let SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<SwiftProtoTesting_DeprecatedFile_MyMsg>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
- _protobuf_fieldNumber: 104,
- fieldName: "swift_proto_testing.deprecated_file.msg_ext_field"
- )
- extension SwiftProtoTesting_DeprecatedFile_MsgScope {
- enum Extensions {
- /// Another extension field comment
- ///
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- static let string_ext2_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufString>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
- _protobuf_fieldNumber: 201,
- fieldName: "swift_proto_testing.deprecated_file.MsgScope.string_ext2_field"
- )
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- static let int_ext2_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufInt32>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
- _protobuf_fieldNumber: 202,
- fieldName: "swift_proto_testing.deprecated_file.MsgScope.int_ext2_field"
- )
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- static let fixed_ext2_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.RepeatedExtensionField<SwiftProtobuf.ProtobufFixed32>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
- _protobuf_fieldNumber: 203,
- fieldName: "swift_proto_testing.deprecated_file.MsgScope.fixed_ext2_field"
- )
- /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
- static let msg_ext2_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<SwiftProtoTesting_DeprecatedFile_MyMsg>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
- _protobuf_fieldNumber: 204,
- fieldName: "swift_proto_testing.deprecated_file.MsgScope.msg_ext2_field"
- )
- }
- }
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- fileprivate let _protobuf_package = "swift_proto_testing.deprecated_file"
- extension SwiftProtoTesting_DeprecatedFile_MyEnum: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}MYENUM_ONE\0\u{1}MYENUM_TWO\0\u{1}MYENUM_THREE\0")
- }
- extension SwiftProtoTesting_DeprecatedFile_MyMsg: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".MyMsg"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}string_field\0")
- public var isInitialized: Bool {
- if !_protobuf_extensionFieldValues.isInitialized {return false}
- return true
- }
- 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._stringField) }()
- case 100..<536870912:
- try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: SwiftProtoTesting_DeprecatedFile_MyMsg.self, fieldNumber: fieldNumber) }()
- 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
- try { if let v = self._stringField {
- try visitor.visitSingularStringField(value: v, fieldNumber: 1)
- } }()
- try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 100, end: 536870912)
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_DeprecatedFile_MyMsg, rhs: SwiftProtoTesting_DeprecatedFile_MyMsg) -> Bool {
- if lhs._stringField != rhs._stringField {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false}
- return true
- }
- }
- extension SwiftProtoTesting_DeprecatedFile_MsgScope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".MsgScope"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap()
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- // Load everything into unknown fields
- while try decoder.nextFieldNumber() != nil {}
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_DeprecatedFile_MsgScope, rhs: SwiftProtoTesting_DeprecatedFile_MsgScope) -> Bool {
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|