wrappers.pb.swift 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  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: google/protobuf/wrappers.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Protocol Buffers - Google's data interchange format
  11. // Copyright 2008 Google Inc. All rights reserved.
  12. // https://developers.google.com/protocol-buffers/
  13. //
  14. // Redistribution and use in source and binary forms, with or without
  15. // modification, are permitted provided that the following conditions are
  16. // met:
  17. //
  18. // * Redistributions of source code must retain the above copyright
  19. // notice, this list of conditions and the following disclaimer.
  20. // * Redistributions in binary form must reproduce the above
  21. // copyright notice, this list of conditions and the following disclaimer
  22. // in the documentation and/or other materials provided with the
  23. // distribution.
  24. // * Neither the name of Google Inc. nor the names of its
  25. // contributors may be used to endorse or promote products derived from
  26. // this software without specific prior written permission.
  27. //
  28. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  29. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  30. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  31. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  32. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  33. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  34. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  35. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  36. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  37. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  38. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. //
  40. // Wrappers for primitive (non-message) types. These types were needed
  41. // for legacy reasons and are not recommended for use in new APIs.
  42. //
  43. // Historically these wrappers were useful to have presence on proto3 primitive
  44. // fields, but proto3 syntax has been updated to support the `optional` keyword.
  45. // Using that keyword is now the strongly preferred way to add presence to
  46. // proto3 primitive fields.
  47. //
  48. // A secondary usecase was to embed primitives in the `google.protobuf.Any`
  49. // type: it is now recommended that you embed your value in your own wrapper
  50. // message which can be specifically documented.
  51. //
  52. // These wrappers have no meaningful use within repeated fields as they lack
  53. // the ability to detect presence on individual elements.
  54. // These wrappers have no meaningful use within a map or a oneof since
  55. // individual entries of a map or fields of a oneof can already detect presence.
  56. import Foundation
  57. // 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.
  58. // If the compiler emits an error on this type, it is because this file
  59. // was generated by a version of the `protoc` Swift plug-in that is
  60. // incompatible with the version of SwiftProtobuf to which you are linking.
  61. // Please ensure that you are building against the same version of the API
  62. // that was used to generate this file.
  63. fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck {
  64. struct _2: ProtobufAPIVersion_2 {}
  65. typealias Version = _2
  66. }
  67. /// Wrapper message for `double`.
  68. ///
  69. /// The JSON representation for `DoubleValue` is JSON number.
  70. ///
  71. /// Not recommended for use in new APIs, but still useful for legacy APIs and
  72. /// has no plan to be removed.
  73. public struct Google_Protobuf_DoubleValue: Sendable {
  74. // SwiftProtobuf.Message conformance is added in an extension below. See the
  75. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  76. // methods supported on all messages.
  77. /// The double value.
  78. public var value: Double = 0
  79. public var unknownFields = UnknownStorage()
  80. public init() {}
  81. }
  82. /// Wrapper message for `float`.
  83. ///
  84. /// The JSON representation for `FloatValue` is JSON number.
  85. ///
  86. /// Not recommended for use in new APIs, but still useful for legacy APIs and
  87. /// has no plan to be removed.
  88. public struct Google_Protobuf_FloatValue: Sendable {
  89. // SwiftProtobuf.Message conformance is added in an extension below. See the
  90. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  91. // methods supported on all messages.
  92. /// The float value.
  93. public var value: Float = 0
  94. public var unknownFields = UnknownStorage()
  95. public init() {}
  96. }
  97. /// Wrapper message for `int64`.
  98. ///
  99. /// The JSON representation for `Int64Value` is JSON string.
  100. ///
  101. /// Not recommended for use in new APIs, but still useful for legacy APIs and
  102. /// has no plan to be removed.
  103. public struct Google_Protobuf_Int64Value: Sendable {
  104. // SwiftProtobuf.Message conformance is added in an extension below. See the
  105. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  106. // methods supported on all messages.
  107. /// The int64 value.
  108. public var value: Int64 = 0
  109. public var unknownFields = UnknownStorage()
  110. public init() {}
  111. }
  112. /// Wrapper message for `uint64`.
  113. ///
  114. /// The JSON representation for `UInt64Value` is JSON string.
  115. ///
  116. /// Not recommended for use in new APIs, but still useful for legacy APIs and
  117. /// has no plan to be removed.
  118. public struct Google_Protobuf_UInt64Value: Sendable {
  119. // SwiftProtobuf.Message conformance is added in an extension below. See the
  120. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  121. // methods supported on all messages.
  122. /// The uint64 value.
  123. public var value: UInt64 = 0
  124. public var unknownFields = UnknownStorage()
  125. public init() {}
  126. }
  127. /// Wrapper message for `int32`.
  128. ///
  129. /// The JSON representation for `Int32Value` is JSON number.
  130. ///
  131. /// Not recommended for use in new APIs, but still useful for legacy APIs and
  132. /// has no plan to be removed.
  133. public struct Google_Protobuf_Int32Value: Sendable {
  134. // SwiftProtobuf.Message conformance is added in an extension below. See the
  135. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  136. // methods supported on all messages.
  137. /// The int32 value.
  138. public var value: Int32 = 0
  139. public var unknownFields = UnknownStorage()
  140. public init() {}
  141. }
  142. /// Wrapper message for `uint32`.
  143. ///
  144. /// The JSON representation for `UInt32Value` is JSON number.
  145. ///
  146. /// Not recommended for use in new APIs, but still useful for legacy APIs and
  147. /// has no plan to be removed.
  148. public struct Google_Protobuf_UInt32Value: Sendable {
  149. // SwiftProtobuf.Message conformance is added in an extension below. See the
  150. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  151. // methods supported on all messages.
  152. /// The uint32 value.
  153. public var value: UInt32 = 0
  154. public var unknownFields = UnknownStorage()
  155. public init() {}
  156. }
  157. /// Wrapper message for `bool`.
  158. ///
  159. /// The JSON representation for `BoolValue` is JSON `true` and `false`.
  160. ///
  161. /// Not recommended for use in new APIs, but still useful for legacy APIs and
  162. /// has no plan to be removed.
  163. public struct Google_Protobuf_BoolValue: Sendable {
  164. // SwiftProtobuf.Message conformance is added in an extension below. See the
  165. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  166. // methods supported on all messages.
  167. /// The bool value.
  168. public var value: Bool = false
  169. public var unknownFields = UnknownStorage()
  170. public init() {}
  171. }
  172. /// Wrapper message for `string`.
  173. ///
  174. /// The JSON representation for `StringValue` is JSON string.
  175. ///
  176. /// Not recommended for use in new APIs, but still useful for legacy APIs and
  177. /// has no plan to be removed.
  178. public struct Google_Protobuf_StringValue: Sendable {
  179. // SwiftProtobuf.Message conformance is added in an extension below. See the
  180. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  181. // methods supported on all messages.
  182. /// The string value.
  183. public var value: String = String()
  184. public var unknownFields = UnknownStorage()
  185. public init() {}
  186. }
  187. /// Wrapper message for `bytes`.
  188. ///
  189. /// The JSON representation for `BytesValue` is JSON string.
  190. ///
  191. /// Not recommended for use in new APIs, but still useful for legacy APIs and
  192. /// has no plan to be removed.
  193. public struct Google_Protobuf_BytesValue: Sendable {
  194. // SwiftProtobuf.Message conformance is added in an extension below. See the
  195. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  196. // methods supported on all messages.
  197. /// The bytes value.
  198. public var value: Data = Data()
  199. public var unknownFields = UnknownStorage()
  200. public init() {}
  201. }
  202. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  203. fileprivate let _protobuf_package = "google.protobuf"
  204. extension Google_Protobuf_DoubleValue: Message, _MessageImplementationBase, _ProtoNameProviding {
  205. public static let protoMessageName: String = _protobuf_package + ".DoubleValue"
  206. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}value\0")
  207. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  208. while let fieldNumber = try decoder.nextFieldNumber() {
  209. // The use of inline closures is to circumvent an issue where the compiler
  210. // allocates stack space for every case branch when no optimizations are
  211. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  212. switch fieldNumber {
  213. case 1: try { try decoder.decodeSingularDoubleField(value: &self.value) }()
  214. default: break
  215. }
  216. }
  217. }
  218. public func traverse<V: Visitor>(visitor: inout V) throws {
  219. if self.value.bitPattern != 0 {
  220. try visitor.visitSingularDoubleField(value: self.value, fieldNumber: 1)
  221. }
  222. try unknownFields.traverse(visitor: &visitor)
  223. }
  224. public static func ==(lhs: Google_Protobuf_DoubleValue, rhs: Google_Protobuf_DoubleValue) -> Bool {
  225. if lhs.value != rhs.value {return false}
  226. if lhs.unknownFields != rhs.unknownFields {return false}
  227. return true
  228. }
  229. }
  230. extension Google_Protobuf_FloatValue: Message, _MessageImplementationBase, _ProtoNameProviding {
  231. public static let protoMessageName: String = _protobuf_package + ".FloatValue"
  232. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}value\0")
  233. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  234. while let fieldNumber = try decoder.nextFieldNumber() {
  235. // The use of inline closures is to circumvent an issue where the compiler
  236. // allocates stack space for every case branch when no optimizations are
  237. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  238. switch fieldNumber {
  239. case 1: try { try decoder.decodeSingularFloatField(value: &self.value) }()
  240. default: break
  241. }
  242. }
  243. }
  244. public func traverse<V: Visitor>(visitor: inout V) throws {
  245. if self.value.bitPattern != 0 {
  246. try visitor.visitSingularFloatField(value: self.value, fieldNumber: 1)
  247. }
  248. try unknownFields.traverse(visitor: &visitor)
  249. }
  250. public static func ==(lhs: Google_Protobuf_FloatValue, rhs: Google_Protobuf_FloatValue) -> Bool {
  251. if lhs.value != rhs.value {return false}
  252. if lhs.unknownFields != rhs.unknownFields {return false}
  253. return true
  254. }
  255. }
  256. extension Google_Protobuf_Int64Value: Message, _MessageImplementationBase, _ProtoNameProviding {
  257. public static let protoMessageName: String = _protobuf_package + ".Int64Value"
  258. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}value\0")
  259. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  260. while let fieldNumber = try decoder.nextFieldNumber() {
  261. // The use of inline closures is to circumvent an issue where the compiler
  262. // allocates stack space for every case branch when no optimizations are
  263. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  264. switch fieldNumber {
  265. case 1: try { try decoder.decodeSingularInt64Field(value: &self.value) }()
  266. default: break
  267. }
  268. }
  269. }
  270. public func traverse<V: Visitor>(visitor: inout V) throws {
  271. if self.value != 0 {
  272. try visitor.visitSingularInt64Field(value: self.value, fieldNumber: 1)
  273. }
  274. try unknownFields.traverse(visitor: &visitor)
  275. }
  276. public static func ==(lhs: Google_Protobuf_Int64Value, rhs: Google_Protobuf_Int64Value) -> Bool {
  277. if lhs.value != rhs.value {return false}
  278. if lhs.unknownFields != rhs.unknownFields {return false}
  279. return true
  280. }
  281. }
  282. extension Google_Protobuf_UInt64Value: Message, _MessageImplementationBase, _ProtoNameProviding {
  283. public static let protoMessageName: String = _protobuf_package + ".UInt64Value"
  284. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}value\0")
  285. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  286. while let fieldNumber = try decoder.nextFieldNumber() {
  287. // The use of inline closures is to circumvent an issue where the compiler
  288. // allocates stack space for every case branch when no optimizations are
  289. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  290. switch fieldNumber {
  291. case 1: try { try decoder.decodeSingularUInt64Field(value: &self.value) }()
  292. default: break
  293. }
  294. }
  295. }
  296. public func traverse<V: Visitor>(visitor: inout V) throws {
  297. if self.value != 0 {
  298. try visitor.visitSingularUInt64Field(value: self.value, fieldNumber: 1)
  299. }
  300. try unknownFields.traverse(visitor: &visitor)
  301. }
  302. public static func ==(lhs: Google_Protobuf_UInt64Value, rhs: Google_Protobuf_UInt64Value) -> Bool {
  303. if lhs.value != rhs.value {return false}
  304. if lhs.unknownFields != rhs.unknownFields {return false}
  305. return true
  306. }
  307. }
  308. extension Google_Protobuf_Int32Value: Message, _MessageImplementationBase, _ProtoNameProviding {
  309. public static let protoMessageName: String = _protobuf_package + ".Int32Value"
  310. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}value\0")
  311. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  312. while let fieldNumber = try decoder.nextFieldNumber() {
  313. // The use of inline closures is to circumvent an issue where the compiler
  314. // allocates stack space for every case branch when no optimizations are
  315. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  316. switch fieldNumber {
  317. case 1: try { try decoder.decodeSingularInt32Field(value: &self.value) }()
  318. default: break
  319. }
  320. }
  321. }
  322. public func traverse<V: Visitor>(visitor: inout V) throws {
  323. if self.value != 0 {
  324. try visitor.visitSingularInt32Field(value: self.value, fieldNumber: 1)
  325. }
  326. try unknownFields.traverse(visitor: &visitor)
  327. }
  328. public static func ==(lhs: Google_Protobuf_Int32Value, rhs: Google_Protobuf_Int32Value) -> Bool {
  329. if lhs.value != rhs.value {return false}
  330. if lhs.unknownFields != rhs.unknownFields {return false}
  331. return true
  332. }
  333. }
  334. extension Google_Protobuf_UInt32Value: Message, _MessageImplementationBase, _ProtoNameProviding {
  335. public static let protoMessageName: String = _protobuf_package + ".UInt32Value"
  336. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}value\0")
  337. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  338. while let fieldNumber = try decoder.nextFieldNumber() {
  339. // The use of inline closures is to circumvent an issue where the compiler
  340. // allocates stack space for every case branch when no optimizations are
  341. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  342. switch fieldNumber {
  343. case 1: try { try decoder.decodeSingularUInt32Field(value: &self.value) }()
  344. default: break
  345. }
  346. }
  347. }
  348. public func traverse<V: Visitor>(visitor: inout V) throws {
  349. if self.value != 0 {
  350. try visitor.visitSingularUInt32Field(value: self.value, fieldNumber: 1)
  351. }
  352. try unknownFields.traverse(visitor: &visitor)
  353. }
  354. public static func ==(lhs: Google_Protobuf_UInt32Value, rhs: Google_Protobuf_UInt32Value) -> Bool {
  355. if lhs.value != rhs.value {return false}
  356. if lhs.unknownFields != rhs.unknownFields {return false}
  357. return true
  358. }
  359. }
  360. extension Google_Protobuf_BoolValue: Message, _MessageImplementationBase, _ProtoNameProviding {
  361. public static let protoMessageName: String = _protobuf_package + ".BoolValue"
  362. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}value\0")
  363. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  364. while let fieldNumber = try decoder.nextFieldNumber() {
  365. // The use of inline closures is to circumvent an issue where the compiler
  366. // allocates stack space for every case branch when no optimizations are
  367. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  368. switch fieldNumber {
  369. case 1: try { try decoder.decodeSingularBoolField(value: &self.value) }()
  370. default: break
  371. }
  372. }
  373. }
  374. public func traverse<V: Visitor>(visitor: inout V) throws {
  375. if self.value != false {
  376. try visitor.visitSingularBoolField(value: self.value, fieldNumber: 1)
  377. }
  378. try unknownFields.traverse(visitor: &visitor)
  379. }
  380. public static func ==(lhs: Google_Protobuf_BoolValue, rhs: Google_Protobuf_BoolValue) -> Bool {
  381. if lhs.value != rhs.value {return false}
  382. if lhs.unknownFields != rhs.unknownFields {return false}
  383. return true
  384. }
  385. }
  386. extension Google_Protobuf_StringValue: Message, _MessageImplementationBase, _ProtoNameProviding {
  387. public static let protoMessageName: String = _protobuf_package + ".StringValue"
  388. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}value\0")
  389. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  390. while let fieldNumber = try decoder.nextFieldNumber() {
  391. // The use of inline closures is to circumvent an issue where the compiler
  392. // allocates stack space for every case branch when no optimizations are
  393. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  394. switch fieldNumber {
  395. case 1: try { try decoder.decodeSingularStringField(value: &self.value) }()
  396. default: break
  397. }
  398. }
  399. }
  400. public func traverse<V: Visitor>(visitor: inout V) throws {
  401. if !self.value.isEmpty {
  402. try visitor.visitSingularStringField(value: self.value, fieldNumber: 1)
  403. }
  404. try unknownFields.traverse(visitor: &visitor)
  405. }
  406. public static func ==(lhs: Google_Protobuf_StringValue, rhs: Google_Protobuf_StringValue) -> Bool {
  407. if lhs.value != rhs.value {return false}
  408. if lhs.unknownFields != rhs.unknownFields {return false}
  409. return true
  410. }
  411. }
  412. extension Google_Protobuf_BytesValue: Message, _MessageImplementationBase, _ProtoNameProviding {
  413. public static let protoMessageName: String = _protobuf_package + ".BytesValue"
  414. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}value\0")
  415. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  416. while let fieldNumber = try decoder.nextFieldNumber() {
  417. // The use of inline closures is to circumvent an issue where the compiler
  418. // allocates stack space for every case branch when no optimizations are
  419. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  420. switch fieldNumber {
  421. case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }()
  422. default: break
  423. }
  424. }
  425. }
  426. public func traverse<V: Visitor>(visitor: inout V) throws {
  427. if !self.value.isEmpty {
  428. try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1)
  429. }
  430. try unknownFields.traverse(visitor: &visitor)
  431. }
  432. public static func ==(lhs: Google_Protobuf_BytesValue, rhs: Google_Protobuf_BytesValue) -> Bool {
  433. if lhs.value != rhs.value {return false}
  434. if lhs.unknownFields != rhs.unknownFields {return false}
  435. return true
  436. }
  437. }