unittest_swift_deprecated_file.pb.swift 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. // swiftlint:disable all
  4. //
  5. // Generated by the Swift generator plugin for the protocol buffer compiler.
  6. // Source: unittest_swift_deprecated_file.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Protos/unittest_swift_deprecated_file.proto - test proto
  11. //
  12. // This source file is part of the Swift.org open source project
  13. //
  14. // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
  15. // Licensed under Apache License v2.0 with Runtime Library Exception
  16. //
  17. // See http://swift.org/LICENSE.txt for license information
  18. // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
  19. //
  20. // -----------------------------------------------------------------------------
  21. ///
  22. /// Test generation support of deprecated attributes.
  23. ///
  24. // -----------------------------------------------------------------------------
  25. import SwiftProtobuf
  26. // If the compiler emits an error on this type, it is because this file
  27. // was generated by a version of the `protoc` Swift plug-in that is
  28. // incompatible with the version of SwiftProtobuf to which you are linking.
  29. // Please ensure that you are building against the same version of the API
  30. // that was used to generate this file.
  31. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  32. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  33. typealias Version = _2
  34. }
  35. /// NOTE: The whole .proto file that defined this enum was marked as deprecated.
  36. enum SwiftProtoTesting_DeprecatedFile_MyEnum: Int, SwiftProtobuf.Enum, Swift.CaseIterable {
  37. case one = 1
  38. case two = 2
  39. case three = 3
  40. init() {
  41. self = .one
  42. }
  43. }
  44. /// Message comment
  45. ///
  46. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  47. struct SwiftProtoTesting_DeprecatedFile_MyMsg: SwiftProtobuf.ExtensibleMessage, Sendable {
  48. // SwiftProtobuf.Message conformance is added in an extension below. See the
  49. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  50. // methods supported on all messages.
  51. var stringField: String {
  52. get {_stringField ?? String()}
  53. set {_stringField = newValue}
  54. }
  55. /// Returns true if `stringField` has been explicitly set.
  56. var hasStringField: Bool {self._stringField != nil}
  57. /// Clears the value of `stringField`. Subsequent reads from it will return its default value.
  58. mutating func clearStringField() {self._stringField = nil}
  59. var unknownFields = SwiftProtobuf.UnknownStorage()
  60. init() {}
  61. var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
  62. fileprivate var _stringField: String? = nil
  63. }
  64. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  65. struct SwiftProtoTesting_DeprecatedFile_MsgScope: Sendable {
  66. // SwiftProtobuf.Message conformance is added in an extension below. See the
  67. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  68. // methods supported on all messages.
  69. var unknownFields = SwiftProtobuf.UnknownStorage()
  70. init() {}
  71. }
  72. // MARK: - Extension support defined in unittest_swift_deprecated_file.proto.
  73. // MARK: - Extension Properties
  74. // Swift Extensions on the extended Messages to add easy access to the declared
  75. // extension fields. The names are based on the extension field name from the proto
  76. // declaration. To avoid naming collisions, the names are prefixed with the name of
  77. // the scope where the extend directive occurs.
  78. extension SwiftProtoTesting_DeprecatedFile_MyMsg {
  79. /// Extension field comment
  80. ///
  81. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  82. var SwiftProtoTesting_DeprecatedFile_stringExtField: String {
  83. get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field) ?? String()}
  84. set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field, value: newValue)}
  85. }
  86. /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field`
  87. /// has been explicitly set.
  88. var hasSwiftProtoTesting_DeprecatedFile_stringExtField: Bool {
  89. return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field)
  90. }
  91. /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field`.
  92. /// Subsequent reads from it will return its default value.
  93. mutating func clearSwiftProtoTesting_DeprecatedFile_stringExtField() {
  94. clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field)
  95. }
  96. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  97. var SwiftProtoTesting_DeprecatedFile_intExtField: Int32 {
  98. get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field) ?? 0}
  99. set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field, value: newValue)}
  100. }
  101. /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field`
  102. /// has been explicitly set.
  103. var hasSwiftProtoTesting_DeprecatedFile_intExtField: Bool {
  104. return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field)
  105. }
  106. /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field`.
  107. /// Subsequent reads from it will return its default value.
  108. mutating func clearSwiftProtoTesting_DeprecatedFile_intExtField() {
  109. clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field)
  110. }
  111. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  112. var SwiftProtoTesting_DeprecatedFile_fixedExtField: [UInt32] {
  113. get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_fixed_ext_field) ?? []}
  114. set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_fixed_ext_field, value: newValue)}
  115. }
  116. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  117. var SwiftProtoTesting_DeprecatedFile_msgExtField: SwiftProtoTesting_DeprecatedFile_MyMsg {
  118. get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field) ?? SwiftProtoTesting_DeprecatedFile_MyMsg()}
  119. set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field, value: newValue)}
  120. }
  121. /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field`
  122. /// has been explicitly set.
  123. var hasSwiftProtoTesting_DeprecatedFile_msgExtField: Bool {
  124. return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field)
  125. }
  126. /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field`.
  127. /// Subsequent reads from it will return its default value.
  128. mutating func clearSwiftProtoTesting_DeprecatedFile_msgExtField() {
  129. clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field)
  130. }
  131. /// Another extension field comment
  132. ///
  133. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  134. var SwiftProtoTesting_DeprecatedFile_MsgScope_stringExt2Field: String {
  135. get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field) ?? String()}
  136. set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field, value: newValue)}
  137. }
  138. /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field`
  139. /// has been explicitly set.
  140. var hasSwiftProtoTesting_DeprecatedFile_MsgScope_stringExt2Field: Bool {
  141. return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field)
  142. }
  143. /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field`.
  144. /// Subsequent reads from it will return its default value.
  145. mutating func clearSwiftProtoTesting_DeprecatedFile_MsgScope_stringExt2Field() {
  146. clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field)
  147. }
  148. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  149. var SwiftProtoTesting_DeprecatedFile_MsgScope_intExt2Field: Int32 {
  150. get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field) ?? 0}
  151. set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field, value: newValue)}
  152. }
  153. /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field`
  154. /// has been explicitly set.
  155. var hasSwiftProtoTesting_DeprecatedFile_MsgScope_intExt2Field: Bool {
  156. return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field)
  157. }
  158. /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field`.
  159. /// Subsequent reads from it will return its default value.
  160. mutating func clearSwiftProtoTesting_DeprecatedFile_MsgScope_intExt2Field() {
  161. clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field)
  162. }
  163. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  164. var SwiftProtoTesting_DeprecatedFile_MsgScope_fixedExt2Field: [UInt32] {
  165. get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.fixed_ext2_field) ?? []}
  166. set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.fixed_ext2_field, value: newValue)}
  167. }
  168. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  169. var SwiftProtoTesting_DeprecatedFile_MsgScope_msgExt2Field: SwiftProtoTesting_DeprecatedFile_MyMsg {
  170. get {return getExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field) ?? SwiftProtoTesting_DeprecatedFile_MyMsg()}
  171. set {setExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field, value: newValue)}
  172. }
  173. /// Returns true if extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field`
  174. /// has been explicitly set.
  175. var hasSwiftProtoTesting_DeprecatedFile_MsgScope_msgExt2Field: Bool {
  176. return hasExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field)
  177. }
  178. /// Clears the value of extension `SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field`.
  179. /// Subsequent reads from it will return its default value.
  180. mutating func clearSwiftProtoTesting_DeprecatedFile_MsgScope_msgExt2Field() {
  181. clearExtensionValue(ext: SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field)
  182. }
  183. }
  184. // MARK: - File's ExtensionMap: SwiftProtoTesting_DeprecatedFile_UnittestSwiftDeprecatedFile_Extensions
  185. /// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
  186. /// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
  187. /// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
  188. /// a larger `SwiftProtobuf.SimpleExtensionMap`.
  189. let SwiftProtoTesting_DeprecatedFile_UnittestSwiftDeprecatedFile_Extensions: SwiftProtobuf.SimpleExtensionMap = [
  190. SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field,
  191. SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field,
  192. SwiftProtoTesting_DeprecatedFile_Extensions_fixed_ext_field,
  193. SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field,
  194. SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.string_ext2_field,
  195. SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.int_ext2_field,
  196. SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.fixed_ext2_field,
  197. SwiftProtoTesting_DeprecatedFile_MsgScope.Extensions.msg_ext2_field
  198. ]
  199. // Extension Objects - The only reason these might be needed is when manually
  200. // constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_
  201. // accessors for the extension fields on the messages directly.
  202. /// Extension field comment
  203. ///
  204. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  205. let SwiftProtoTesting_DeprecatedFile_Extensions_string_ext_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufString>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
  206. _protobuf_fieldNumber: 101,
  207. fieldName: "swift_proto_testing.deprecated_file.string_ext_field"
  208. )
  209. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  210. let SwiftProtoTesting_DeprecatedFile_Extensions_int_ext_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufInt32>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
  211. _protobuf_fieldNumber: 102,
  212. fieldName: "swift_proto_testing.deprecated_file.int_ext_field"
  213. )
  214. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  215. let SwiftProtoTesting_DeprecatedFile_Extensions_fixed_ext_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.RepeatedExtensionField<SwiftProtobuf.ProtobufFixed32>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
  216. _protobuf_fieldNumber: 103,
  217. fieldName: "swift_proto_testing.deprecated_file.fixed_ext_field"
  218. )
  219. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  220. let SwiftProtoTesting_DeprecatedFile_Extensions_msg_ext_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<SwiftProtoTesting_DeprecatedFile_MyMsg>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
  221. _protobuf_fieldNumber: 104,
  222. fieldName: "swift_proto_testing.deprecated_file.msg_ext_field"
  223. )
  224. extension SwiftProtoTesting_DeprecatedFile_MsgScope {
  225. enum Extensions {
  226. /// Another extension field comment
  227. ///
  228. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  229. static let string_ext2_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufString>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
  230. _protobuf_fieldNumber: 201,
  231. fieldName: "swift_proto_testing.deprecated_file.MsgScope.string_ext2_field"
  232. )
  233. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  234. static let int_ext2_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufInt32>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
  235. _protobuf_fieldNumber: 202,
  236. fieldName: "swift_proto_testing.deprecated_file.MsgScope.int_ext2_field"
  237. )
  238. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  239. static let fixed_ext2_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.RepeatedExtensionField<SwiftProtobuf.ProtobufFixed32>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
  240. _protobuf_fieldNumber: 203,
  241. fieldName: "swift_proto_testing.deprecated_file.MsgScope.fixed_ext2_field"
  242. )
  243. /// NOTE: The whole .proto file that defined this extension field was marked as deprecated.
  244. static let msg_ext2_field = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<SwiftProtoTesting_DeprecatedFile_MyMsg>, SwiftProtoTesting_DeprecatedFile_MyMsg>(
  245. _protobuf_fieldNumber: 204,
  246. fieldName: "swift_proto_testing.deprecated_file.MsgScope.msg_ext2_field"
  247. )
  248. }
  249. }
  250. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  251. fileprivate let _protobuf_package = "swift_proto_testing.deprecated_file"
  252. extension SwiftProtoTesting_DeprecatedFile_MyEnum: SwiftProtobuf._ProtoNameProviding {
  253. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}MYENUM_ONE\0\u{1}MYENUM_TWO\0\u{1}MYENUM_THREE\0")
  254. }
  255. extension SwiftProtoTesting_DeprecatedFile_MyMsg: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  256. static let protoMessageName: String = _protobuf_package + ".MyMsg"
  257. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}string_field\0")
  258. public var isInitialized: Bool {
  259. if !_protobuf_extensionFieldValues.isInitialized {return false}
  260. return true
  261. }
  262. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  263. while let fieldNumber = try decoder.nextFieldNumber() {
  264. // The use of inline closures is to circumvent an issue where the compiler
  265. // allocates stack space for every case branch when no optimizations are
  266. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  267. switch fieldNumber {
  268. case 1: try { try decoder.decodeSingularStringField(value: &self._stringField) }()
  269. case 100..<536870912:
  270. try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: SwiftProtoTesting_DeprecatedFile_MyMsg.self, fieldNumber: fieldNumber) }()
  271. default: break
  272. }
  273. }
  274. }
  275. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  276. // The use of inline closures is to circumvent an issue where the compiler
  277. // allocates stack space for every if/case branch local when no optimizations
  278. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  279. // https://github.com/apple/swift-protobuf/issues/1182
  280. try { if let v = self._stringField {
  281. try visitor.visitSingularStringField(value: v, fieldNumber: 1)
  282. } }()
  283. try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 100, end: 536870912)
  284. try unknownFields.traverse(visitor: &visitor)
  285. }
  286. static func ==(lhs: SwiftProtoTesting_DeprecatedFile_MyMsg, rhs: SwiftProtoTesting_DeprecatedFile_MyMsg) -> Bool {
  287. if lhs._stringField != rhs._stringField {return false}
  288. if lhs.unknownFields != rhs.unknownFields {return false}
  289. if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false}
  290. return true
  291. }
  292. }
  293. extension SwiftProtoTesting_DeprecatedFile_MsgScope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  294. static let protoMessageName: String = _protobuf_package + ".MsgScope"
  295. static let _protobuf_nameMap = SwiftProtobuf._NameMap()
  296. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  297. // Load everything into unknown fields
  298. while try decoder.nextFieldNumber() != nil {}
  299. }
  300. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  301. try unknownFields.traverse(visitor: &visitor)
  302. }
  303. static func ==(lhs: SwiftProtoTesting_DeprecatedFile_MsgScope, rhs: SwiftProtoTesting_DeprecatedFile_MsgScope) -> Bool {
  304. if lhs.unknownFields != rhs.unknownFields {return false}
  305. return true
  306. }
  307. }