type.pb.swift 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  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/type.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. // 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.
  40. // If the compiler emits an error on this type, it is because this file
  41. // was generated by a version of the `protoc` Swift plug-in that is
  42. // incompatible with the version of SwiftProtobuf to which you are linking.
  43. // Please ensure that you are building against the same version of the API
  44. // that was used to generate this file.
  45. fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck {
  46. struct _2: ProtobufAPIVersion_2 {}
  47. typealias Version = _2
  48. }
  49. /// The syntax in which a protocol buffer element is defined.
  50. public enum Google_Protobuf_Syntax: Enum, Swift.CaseIterable {
  51. public typealias RawValue = Int
  52. /// Syntax `proto2`.
  53. case proto2 // = 0
  54. /// Syntax `proto3`.
  55. case proto3 // = 1
  56. /// Syntax `editions`.
  57. case editions // = 2
  58. case UNRECOGNIZED(Int)
  59. public init() {
  60. self = .proto2
  61. }
  62. public init?(rawValue: Int) {
  63. switch rawValue {
  64. case 0: self = .proto2
  65. case 1: self = .proto3
  66. case 2: self = .editions
  67. default: self = .UNRECOGNIZED(rawValue)
  68. }
  69. }
  70. public var rawValue: Int {
  71. switch self {
  72. case .proto2: return 0
  73. case .proto3: return 1
  74. case .editions: return 2
  75. case .UNRECOGNIZED(let i): return i
  76. }
  77. }
  78. // The compiler won't synthesize support with the UNRECOGNIZED case.
  79. public static let allCases: [Google_Protobuf_Syntax] = [
  80. .proto2,
  81. .proto3,
  82. .editions,
  83. ]
  84. }
  85. /// A protocol buffer message type.
  86. ///
  87. /// New usages of this message as an alternative to DescriptorProto are strongly
  88. /// discouraged. This message does not reliability preserve all information
  89. /// necessary to model the schema and preserve semantics. Instead make use of
  90. /// FileDescriptorSet which preserves the necessary information.
  91. public struct Google_Protobuf_Type: Sendable {
  92. // SwiftProtobuf.Message conformance is added in an extension below. See the
  93. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  94. // methods supported on all messages.
  95. /// The fully qualified message name.
  96. public var name: String = String()
  97. /// The list of fields.
  98. public var fields: [Google_Protobuf_Field] = []
  99. /// The list of types appearing in `oneof` definitions in this type.
  100. public var oneofs: [String] = []
  101. /// The protocol buffer options.
  102. public var options: [Google_Protobuf_Option] = []
  103. /// The source context.
  104. public var sourceContext: Google_Protobuf_SourceContext {
  105. get {_sourceContext ?? Google_Protobuf_SourceContext()}
  106. set {_sourceContext = newValue}
  107. }
  108. /// Returns true if `sourceContext` has been explicitly set.
  109. public var hasSourceContext: Bool {self._sourceContext != nil}
  110. /// Clears the value of `sourceContext`. Subsequent reads from it will return its default value.
  111. public mutating func clearSourceContext() {self._sourceContext = nil}
  112. /// The source syntax.
  113. public var syntax: Google_Protobuf_Syntax = .proto2
  114. /// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
  115. public var edition: String = String()
  116. public var unknownFields = UnknownStorage()
  117. public init() {}
  118. fileprivate var _sourceContext: Google_Protobuf_SourceContext? = nil
  119. }
  120. /// A single field of a message type.
  121. ///
  122. /// New usages of this message as an alternative to FieldDescriptorProto are
  123. /// strongly discouraged. This message does not reliability preserve all
  124. /// information necessary to model the schema and preserve semantics. Instead
  125. /// make use of FileDescriptorSet which preserves the necessary information.
  126. public struct Google_Protobuf_Field: Sendable {
  127. // SwiftProtobuf.Message conformance is added in an extension below. See the
  128. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  129. // methods supported on all messages.
  130. /// The field type.
  131. public var kind: Google_Protobuf_Field.Kind = .typeUnknown
  132. /// The field cardinality.
  133. public var cardinality: Google_Protobuf_Field.Cardinality = .unknown
  134. /// The field number.
  135. public var number: Int32 = 0
  136. /// The field name.
  137. public var name: String = String()
  138. /// The field type URL, without the scheme, for message or enumeration
  139. /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
  140. public var typeURL: String = String()
  141. /// The index of the field type in `Type.oneofs`, for message or enumeration
  142. /// types. The first type has index 1; zero means the type is not in the list.
  143. public var oneofIndex: Int32 = 0
  144. /// Whether to use alternative packed wire representation.
  145. public var packed: Bool = false
  146. /// The protocol buffer options.
  147. public var options: [Google_Protobuf_Option] = []
  148. /// The field JSON name.
  149. public var jsonName: String = String()
  150. /// The string value of the default value of this field. Proto2 syntax only.
  151. public var defaultValue: String = String()
  152. public var unknownFields = UnknownStorage()
  153. /// Basic field types.
  154. public enum Kind: Enum, Swift.CaseIterable {
  155. public typealias RawValue = Int
  156. /// Field type unknown.
  157. case typeUnknown // = 0
  158. /// Field type double.
  159. case typeDouble // = 1
  160. /// Field type float.
  161. case typeFloat // = 2
  162. /// Field type int64.
  163. case typeInt64 // = 3
  164. /// Field type uint64.
  165. case typeUint64 // = 4
  166. /// Field type int32.
  167. case typeInt32 // = 5
  168. /// Field type fixed64.
  169. case typeFixed64 // = 6
  170. /// Field type fixed32.
  171. case typeFixed32 // = 7
  172. /// Field type bool.
  173. case typeBool // = 8
  174. /// Field type string.
  175. case typeString // = 9
  176. /// Field type group. Proto2 syntax only, and deprecated.
  177. case typeGroup // = 10
  178. /// Field type message.
  179. case typeMessage // = 11
  180. /// Field type bytes.
  181. case typeBytes // = 12
  182. /// Field type uint32.
  183. case typeUint32 // = 13
  184. /// Field type enum.
  185. case typeEnum // = 14
  186. /// Field type sfixed32.
  187. case typeSfixed32 // = 15
  188. /// Field type sfixed64.
  189. case typeSfixed64 // = 16
  190. /// Field type sint32.
  191. case typeSint32 // = 17
  192. /// Field type sint64.
  193. case typeSint64 // = 18
  194. case UNRECOGNIZED(Int)
  195. public init() {
  196. self = .typeUnknown
  197. }
  198. public init?(rawValue: Int) {
  199. switch rawValue {
  200. case 0: self = .typeUnknown
  201. case 1: self = .typeDouble
  202. case 2: self = .typeFloat
  203. case 3: self = .typeInt64
  204. case 4: self = .typeUint64
  205. case 5: self = .typeInt32
  206. case 6: self = .typeFixed64
  207. case 7: self = .typeFixed32
  208. case 8: self = .typeBool
  209. case 9: self = .typeString
  210. case 10: self = .typeGroup
  211. case 11: self = .typeMessage
  212. case 12: self = .typeBytes
  213. case 13: self = .typeUint32
  214. case 14: self = .typeEnum
  215. case 15: self = .typeSfixed32
  216. case 16: self = .typeSfixed64
  217. case 17: self = .typeSint32
  218. case 18: self = .typeSint64
  219. default: self = .UNRECOGNIZED(rawValue)
  220. }
  221. }
  222. public var rawValue: Int {
  223. switch self {
  224. case .typeUnknown: return 0
  225. case .typeDouble: return 1
  226. case .typeFloat: return 2
  227. case .typeInt64: return 3
  228. case .typeUint64: return 4
  229. case .typeInt32: return 5
  230. case .typeFixed64: return 6
  231. case .typeFixed32: return 7
  232. case .typeBool: return 8
  233. case .typeString: return 9
  234. case .typeGroup: return 10
  235. case .typeMessage: return 11
  236. case .typeBytes: return 12
  237. case .typeUint32: return 13
  238. case .typeEnum: return 14
  239. case .typeSfixed32: return 15
  240. case .typeSfixed64: return 16
  241. case .typeSint32: return 17
  242. case .typeSint64: return 18
  243. case .UNRECOGNIZED(let i): return i
  244. }
  245. }
  246. // The compiler won't synthesize support with the UNRECOGNIZED case.
  247. public static let allCases: [Google_Protobuf_Field.Kind] = [
  248. .typeUnknown,
  249. .typeDouble,
  250. .typeFloat,
  251. .typeInt64,
  252. .typeUint64,
  253. .typeInt32,
  254. .typeFixed64,
  255. .typeFixed32,
  256. .typeBool,
  257. .typeString,
  258. .typeGroup,
  259. .typeMessage,
  260. .typeBytes,
  261. .typeUint32,
  262. .typeEnum,
  263. .typeSfixed32,
  264. .typeSfixed64,
  265. .typeSint32,
  266. .typeSint64,
  267. ]
  268. }
  269. /// Whether a field is optional, required, or repeated.
  270. public enum Cardinality: Enum, Swift.CaseIterable {
  271. public typealias RawValue = Int
  272. /// For fields with unknown cardinality.
  273. case unknown // = 0
  274. /// For optional fields.
  275. case `optional` // = 1
  276. /// For required fields. Proto2 syntax only.
  277. case `required` // = 2
  278. /// For repeated fields.
  279. case repeated // = 3
  280. case UNRECOGNIZED(Int)
  281. public init() {
  282. self = .unknown
  283. }
  284. public init?(rawValue: Int) {
  285. switch rawValue {
  286. case 0: self = .unknown
  287. case 1: self = .optional
  288. case 2: self = .required
  289. case 3: self = .repeated
  290. default: self = .UNRECOGNIZED(rawValue)
  291. }
  292. }
  293. public var rawValue: Int {
  294. switch self {
  295. case .unknown: return 0
  296. case .optional: return 1
  297. case .required: return 2
  298. case .repeated: return 3
  299. case .UNRECOGNIZED(let i): return i
  300. }
  301. }
  302. // The compiler won't synthesize support with the UNRECOGNIZED case.
  303. public static let allCases: [Google_Protobuf_Field.Cardinality] = [
  304. .unknown,
  305. .optional,
  306. .required,
  307. .repeated,
  308. ]
  309. }
  310. public init() {}
  311. }
  312. /// Enum type definition.
  313. ///
  314. /// New usages of this message as an alternative to EnumDescriptorProto are
  315. /// strongly discouraged. This message does not reliability preserve all
  316. /// information necessary to model the schema and preserve semantics. Instead
  317. /// make use of FileDescriptorSet which preserves the necessary information.
  318. public struct Google_Protobuf_Enum: Sendable {
  319. // SwiftProtobuf.Message conformance is added in an extension below. See the
  320. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  321. // methods supported on all messages.
  322. /// Enum type name.
  323. public var name: String = String()
  324. /// Enum value definitions.
  325. public var enumvalue: [Google_Protobuf_EnumValue] = []
  326. /// Protocol buffer options.
  327. public var options: [Google_Protobuf_Option] = []
  328. /// The source context.
  329. public var sourceContext: Google_Protobuf_SourceContext {
  330. get {_sourceContext ?? Google_Protobuf_SourceContext()}
  331. set {_sourceContext = newValue}
  332. }
  333. /// Returns true if `sourceContext` has been explicitly set.
  334. public var hasSourceContext: Bool {self._sourceContext != nil}
  335. /// Clears the value of `sourceContext`. Subsequent reads from it will return its default value.
  336. public mutating func clearSourceContext() {self._sourceContext = nil}
  337. /// The source syntax.
  338. public var syntax: Google_Protobuf_Syntax = .proto2
  339. /// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
  340. public var edition: String = String()
  341. public var unknownFields = UnknownStorage()
  342. public init() {}
  343. fileprivate var _sourceContext: Google_Protobuf_SourceContext? = nil
  344. }
  345. /// Enum value definition.
  346. ///
  347. /// New usages of this message as an alternative to EnumValueDescriptorProto are
  348. /// strongly discouraged. This message does not reliability preserve all
  349. /// information necessary to model the schema and preserve semantics. Instead
  350. /// make use of FileDescriptorSet which preserves the necessary information.
  351. public struct Google_Protobuf_EnumValue: Sendable {
  352. // SwiftProtobuf.Message conformance is added in an extension below. See the
  353. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  354. // methods supported on all messages.
  355. /// Enum value name.
  356. public var name: String = String()
  357. /// Enum value number.
  358. public var number: Int32 = 0
  359. /// Protocol buffer options.
  360. public var options: [Google_Protobuf_Option] = []
  361. public var unknownFields = UnknownStorage()
  362. public init() {}
  363. }
  364. /// A protocol buffer option, which can be attached to a message, field,
  365. /// enumeration, etc.
  366. ///
  367. /// New usages of this message as an alternative to FileOptions, MessageOptions,
  368. /// FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions
  369. /// are strongly discouraged.
  370. public struct Google_Protobuf_Option: Sendable {
  371. // SwiftProtobuf.Message conformance is added in an extension below. See the
  372. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  373. // methods supported on all messages.
  374. /// The option's name. For protobuf built-in options (options defined in
  375. /// descriptor.proto), this is the short name. For example, `"map_entry"`.
  376. /// For custom options, it should be the fully-qualified name. For example,
  377. /// `"google.api.http"`.
  378. public var name: String = String()
  379. /// The option's value packed in an Any message. If the value is a primitive,
  380. /// the corresponding wrapper type defined in google/protobuf/wrappers.proto
  381. /// should be used. If the value is an enum, it should be stored as an int32
  382. /// value using the google.protobuf.Int32Value type.
  383. public var value: Google_Protobuf_Any {
  384. get {_value ?? Google_Protobuf_Any()}
  385. set {_value = newValue}
  386. }
  387. /// Returns true if `value` has been explicitly set.
  388. public var hasValue: Bool {self._value != nil}
  389. /// Clears the value of `value`. Subsequent reads from it will return its default value.
  390. public mutating func clearValue() {self._value = nil}
  391. public var unknownFields = UnknownStorage()
  392. public init() {}
  393. fileprivate var _value: Google_Protobuf_Any? = nil
  394. }
  395. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  396. fileprivate let _protobuf_package = "google.protobuf"
  397. extension Google_Protobuf_Syntax: _ProtoNameProviding {
  398. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{2}\0SYNTAX_PROTO2\0\u{1}SYNTAX_PROTO3\0\u{1}SYNTAX_EDITIONS\0")
  399. }
  400. extension Google_Protobuf_Type: Message, _MessageImplementationBase, _ProtoNameProviding {
  401. public static let protoMessageName: String = _protobuf_package + ".Type"
  402. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}name\0\u{1}fields\0\u{1}oneofs\0\u{1}options\0\u{3}source_context\0\u{1}syntax\0\u{1}edition\0")
  403. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  404. while let fieldNumber = try decoder.nextFieldNumber() {
  405. // The use of inline closures is to circumvent an issue where the compiler
  406. // allocates stack space for every case branch when no optimizations are
  407. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  408. switch fieldNumber {
  409. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  410. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.fields) }()
  411. case 3: try { try decoder.decodeRepeatedStringField(value: &self.oneofs) }()
  412. case 4: try { try decoder.decodeRepeatedMessageField(value: &self.options) }()
  413. case 5: try { try decoder.decodeSingularMessageField(value: &self._sourceContext) }()
  414. case 6: try { try decoder.decodeSingularEnumField(value: &self.syntax) }()
  415. case 7: try { try decoder.decodeSingularStringField(value: &self.edition) }()
  416. default: break
  417. }
  418. }
  419. }
  420. public func traverse<V: Visitor>(visitor: inout V) throws {
  421. // The use of inline closures is to circumvent an issue where the compiler
  422. // allocates stack space for every if/case branch local when no optimizations
  423. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  424. // https://github.com/apple/swift-protobuf/issues/1182
  425. if !self.name.isEmpty {
  426. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  427. }
  428. if !self.fields.isEmpty {
  429. try visitor.visitRepeatedMessageField(value: self.fields, fieldNumber: 2)
  430. }
  431. if !self.oneofs.isEmpty {
  432. try visitor.visitRepeatedStringField(value: self.oneofs, fieldNumber: 3)
  433. }
  434. if !self.options.isEmpty {
  435. try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 4)
  436. }
  437. try { if let v = self._sourceContext {
  438. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  439. } }()
  440. if self.syntax != .proto2 {
  441. try visitor.visitSingularEnumField(value: self.syntax, fieldNumber: 6)
  442. }
  443. if !self.edition.isEmpty {
  444. try visitor.visitSingularStringField(value: self.edition, fieldNumber: 7)
  445. }
  446. try unknownFields.traverse(visitor: &visitor)
  447. }
  448. public static func ==(lhs: Google_Protobuf_Type, rhs: Google_Protobuf_Type) -> Bool {
  449. if lhs.name != rhs.name {return false}
  450. if lhs.fields != rhs.fields {return false}
  451. if lhs.oneofs != rhs.oneofs {return false}
  452. if lhs.options != rhs.options {return false}
  453. if lhs._sourceContext != rhs._sourceContext {return false}
  454. if lhs.syntax != rhs.syntax {return false}
  455. if lhs.edition != rhs.edition {return false}
  456. if lhs.unknownFields != rhs.unknownFields {return false}
  457. return true
  458. }
  459. }
  460. extension Google_Protobuf_Field: Message, _MessageImplementationBase, _ProtoNameProviding {
  461. public static let protoMessageName: String = _protobuf_package + ".Field"
  462. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}kind\0\u{1}cardinality\0\u{1}number\0\u{1}name\0\u{4}\u{2}type_url\0\u{3}oneof_index\0\u{1}packed\0\u{1}options\0\u{3}json_name\0\u{3}default_value\0")
  463. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  464. while let fieldNumber = try decoder.nextFieldNumber() {
  465. // The use of inline closures is to circumvent an issue where the compiler
  466. // allocates stack space for every case branch when no optimizations are
  467. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  468. switch fieldNumber {
  469. case 1: try { try decoder.decodeSingularEnumField(value: &self.kind) }()
  470. case 2: try { try decoder.decodeSingularEnumField(value: &self.cardinality) }()
  471. case 3: try { try decoder.decodeSingularInt32Field(value: &self.number) }()
  472. case 4: try { try decoder.decodeSingularStringField(value: &self.name) }()
  473. case 6: try { try decoder.decodeSingularStringField(value: &self.typeURL) }()
  474. case 7: try { try decoder.decodeSingularInt32Field(value: &self.oneofIndex) }()
  475. case 8: try { try decoder.decodeSingularBoolField(value: &self.packed) }()
  476. case 9: try { try decoder.decodeRepeatedMessageField(value: &self.options) }()
  477. case 10: try { try decoder.decodeSingularStringField(value: &self.jsonName) }()
  478. case 11: try { try decoder.decodeSingularStringField(value: &self.defaultValue) }()
  479. default: break
  480. }
  481. }
  482. }
  483. public func traverse<V: Visitor>(visitor: inout V) throws {
  484. if self.kind != .typeUnknown {
  485. try visitor.visitSingularEnumField(value: self.kind, fieldNumber: 1)
  486. }
  487. if self.cardinality != .unknown {
  488. try visitor.visitSingularEnumField(value: self.cardinality, fieldNumber: 2)
  489. }
  490. if self.number != 0 {
  491. try visitor.visitSingularInt32Field(value: self.number, fieldNumber: 3)
  492. }
  493. if !self.name.isEmpty {
  494. try visitor.visitSingularStringField(value: self.name, fieldNumber: 4)
  495. }
  496. if !self.typeURL.isEmpty {
  497. try visitor.visitSingularStringField(value: self.typeURL, fieldNumber: 6)
  498. }
  499. if self.oneofIndex != 0 {
  500. try visitor.visitSingularInt32Field(value: self.oneofIndex, fieldNumber: 7)
  501. }
  502. if self.packed != false {
  503. try visitor.visitSingularBoolField(value: self.packed, fieldNumber: 8)
  504. }
  505. if !self.options.isEmpty {
  506. try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 9)
  507. }
  508. if !self.jsonName.isEmpty {
  509. try visitor.visitSingularStringField(value: self.jsonName, fieldNumber: 10)
  510. }
  511. if !self.defaultValue.isEmpty {
  512. try visitor.visitSingularStringField(value: self.defaultValue, fieldNumber: 11)
  513. }
  514. try unknownFields.traverse(visitor: &visitor)
  515. }
  516. public static func ==(lhs: Google_Protobuf_Field, rhs: Google_Protobuf_Field) -> Bool {
  517. if lhs.kind != rhs.kind {return false}
  518. if lhs.cardinality != rhs.cardinality {return false}
  519. if lhs.number != rhs.number {return false}
  520. if lhs.name != rhs.name {return false}
  521. if lhs.typeURL != rhs.typeURL {return false}
  522. if lhs.oneofIndex != rhs.oneofIndex {return false}
  523. if lhs.packed != rhs.packed {return false}
  524. if lhs.options != rhs.options {return false}
  525. if lhs.jsonName != rhs.jsonName {return false}
  526. if lhs.defaultValue != rhs.defaultValue {return false}
  527. if lhs.unknownFields != rhs.unknownFields {return false}
  528. return true
  529. }
  530. }
  531. extension Google_Protobuf_Field.Kind: _ProtoNameProviding {
  532. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{2}\0TYPE_UNKNOWN\0\u{1}TYPE_DOUBLE\0\u{1}TYPE_FLOAT\0\u{1}TYPE_INT64\0\u{1}TYPE_UINT64\0\u{1}TYPE_INT32\0\u{1}TYPE_FIXED64\0\u{1}TYPE_FIXED32\0\u{1}TYPE_BOOL\0\u{1}TYPE_STRING\0\u{1}TYPE_GROUP\0\u{1}TYPE_MESSAGE\0\u{1}TYPE_BYTES\0\u{1}TYPE_UINT32\0\u{1}TYPE_ENUM\0\u{1}TYPE_SFIXED32\0\u{1}TYPE_SFIXED64\0\u{1}TYPE_SINT32\0\u{1}TYPE_SINT64\0")
  533. }
  534. extension Google_Protobuf_Field.Cardinality: _ProtoNameProviding {
  535. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{2}\0CARDINALITY_UNKNOWN\0\u{1}CARDINALITY_OPTIONAL\0\u{1}CARDINALITY_REQUIRED\0\u{1}CARDINALITY_REPEATED\0")
  536. }
  537. extension Google_Protobuf_Enum: Message, _MessageImplementationBase, _ProtoNameProviding {
  538. public static let protoMessageName: String = _protobuf_package + ".Enum"
  539. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}name\0\u{1}enumvalue\0\u{1}options\0\u{3}source_context\0\u{1}syntax\0\u{1}edition\0")
  540. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  541. while let fieldNumber = try decoder.nextFieldNumber() {
  542. // The use of inline closures is to circumvent an issue where the compiler
  543. // allocates stack space for every case branch when no optimizations are
  544. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  545. switch fieldNumber {
  546. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  547. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.enumvalue) }()
  548. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.options) }()
  549. case 4: try { try decoder.decodeSingularMessageField(value: &self._sourceContext) }()
  550. case 5: try { try decoder.decodeSingularEnumField(value: &self.syntax) }()
  551. case 6: try { try decoder.decodeSingularStringField(value: &self.edition) }()
  552. default: break
  553. }
  554. }
  555. }
  556. public func traverse<V: Visitor>(visitor: inout V) throws {
  557. // The use of inline closures is to circumvent an issue where the compiler
  558. // allocates stack space for every if/case branch local when no optimizations
  559. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  560. // https://github.com/apple/swift-protobuf/issues/1182
  561. if !self.name.isEmpty {
  562. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  563. }
  564. if !self.enumvalue.isEmpty {
  565. try visitor.visitRepeatedMessageField(value: self.enumvalue, fieldNumber: 2)
  566. }
  567. if !self.options.isEmpty {
  568. try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 3)
  569. }
  570. try { if let v = self._sourceContext {
  571. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  572. } }()
  573. if self.syntax != .proto2 {
  574. try visitor.visitSingularEnumField(value: self.syntax, fieldNumber: 5)
  575. }
  576. if !self.edition.isEmpty {
  577. try visitor.visitSingularStringField(value: self.edition, fieldNumber: 6)
  578. }
  579. try unknownFields.traverse(visitor: &visitor)
  580. }
  581. public static func ==(lhs: Google_Protobuf_Enum, rhs: Google_Protobuf_Enum) -> Bool {
  582. if lhs.name != rhs.name {return false}
  583. if lhs.enumvalue != rhs.enumvalue {return false}
  584. if lhs.options != rhs.options {return false}
  585. if lhs._sourceContext != rhs._sourceContext {return false}
  586. if lhs.syntax != rhs.syntax {return false}
  587. if lhs.edition != rhs.edition {return false}
  588. if lhs.unknownFields != rhs.unknownFields {return false}
  589. return true
  590. }
  591. }
  592. extension Google_Protobuf_EnumValue: Message, _MessageImplementationBase, _ProtoNameProviding {
  593. public static let protoMessageName: String = _protobuf_package + ".EnumValue"
  594. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}name\0\u{1}number\0\u{1}options\0")
  595. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  596. while let fieldNumber = try decoder.nextFieldNumber() {
  597. // The use of inline closures is to circumvent an issue where the compiler
  598. // allocates stack space for every case branch when no optimizations are
  599. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  600. switch fieldNumber {
  601. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  602. case 2: try { try decoder.decodeSingularInt32Field(value: &self.number) }()
  603. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.options) }()
  604. default: break
  605. }
  606. }
  607. }
  608. public func traverse<V: Visitor>(visitor: inout V) throws {
  609. if !self.name.isEmpty {
  610. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  611. }
  612. if self.number != 0 {
  613. try visitor.visitSingularInt32Field(value: self.number, fieldNumber: 2)
  614. }
  615. if !self.options.isEmpty {
  616. try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 3)
  617. }
  618. try unknownFields.traverse(visitor: &visitor)
  619. }
  620. public static func ==(lhs: Google_Protobuf_EnumValue, rhs: Google_Protobuf_EnumValue) -> Bool {
  621. if lhs.name != rhs.name {return false}
  622. if lhs.number != rhs.number {return false}
  623. if lhs.options != rhs.options {return false}
  624. if lhs.unknownFields != rhs.unknownFields {return false}
  625. return true
  626. }
  627. }
  628. extension Google_Protobuf_Option: Message, _MessageImplementationBase, _ProtoNameProviding {
  629. public static let protoMessageName: String = _protobuf_package + ".Option"
  630. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}name\0\u{1}value\0")
  631. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  632. while let fieldNumber = try decoder.nextFieldNumber() {
  633. // The use of inline closures is to circumvent an issue where the compiler
  634. // allocates stack space for every case branch when no optimizations are
  635. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  636. switch fieldNumber {
  637. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  638. case 2: try { try decoder.decodeSingularMessageField(value: &self._value) }()
  639. default: break
  640. }
  641. }
  642. }
  643. public func traverse<V: Visitor>(visitor: inout V) throws {
  644. // The use of inline closures is to circumvent an issue where the compiler
  645. // allocates stack space for every if/case branch local when no optimizations
  646. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  647. // https://github.com/apple/swift-protobuf/issues/1182
  648. if !self.name.isEmpty {
  649. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  650. }
  651. try { if let v = self._value {
  652. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  653. } }()
  654. try unknownFields.traverse(visitor: &visitor)
  655. }
  656. public static func ==(lhs: Google_Protobuf_Option, rhs: Google_Protobuf_Option) -> Bool {
  657. if lhs.name != rhs.name {return false}
  658. if lhs._value != rhs._value {return false}
  659. if lhs.unknownFields != rhs.unknownFields {return false}
  660. return true
  661. }
  662. }