plugin.pb.swift 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. //
  4. // Generated by the Swift generator plugin for the protocol buffer compiler.
  5. // Source: google/protobuf/compiler/plugin.proto
  6. //
  7. // For information on using the generated types, please see the documentation:
  8. // https://github.com/apple/swift-protobuf/
  9. // Protocol Buffers - Google's data interchange format
  10. // Copyright 2008 Google Inc. All rights reserved.
  11. //
  12. // Use of this source code is governed by a BSD-style
  13. // license that can be found in the LICENSE file or at
  14. // https://developers.google.com/open-source/licenses/bsd
  15. // Author: kenton@google.com (Kenton Varda)
  16. //
  17. // protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is
  18. // just a program that reads a CodeGeneratorRequest from stdin and writes a
  19. // CodeGeneratorResponse to stdout.
  20. //
  21. // Plugins written using C++ can use google/protobuf/compiler/plugin.h instead
  22. // of dealing with the raw protocol defined here.
  23. //
  24. // A plugin executable needs only to be placed somewhere in the path. The
  25. // plugin should be named "protoc-gen-$NAME", and will then be used when the
  26. // flag "--${NAME}_out" is passed to protoc.
  27. import Foundation
  28. import SwiftProtobuf
  29. // If the compiler emits an error on this type, it is because this file
  30. // was generated by a version of the `protoc` Swift plug-in that is
  31. // incompatible with the version of SwiftProtobuf to which you are linking.
  32. // Please ensure that you are building against the same version of the API
  33. // that was used to generate this file.
  34. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  35. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  36. typealias Version = _2
  37. }
  38. /// The version number of protocol compiler.
  39. public struct Google_Protobuf_Compiler_Version {
  40. // SwiftProtobuf.Message conformance is added in an extension below. See the
  41. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  42. // methods supported on all messages.
  43. public var major: Int32 {
  44. get {return _major ?? 0}
  45. set {_major = newValue}
  46. }
  47. /// Returns true if `major` has been explicitly set.
  48. public var hasMajor: Bool {return self._major != nil}
  49. /// Clears the value of `major`. Subsequent reads from it will return its default value.
  50. public mutating func clearMajor() {self._major = nil}
  51. public var minor: Int32 {
  52. get {return _minor ?? 0}
  53. set {_minor = newValue}
  54. }
  55. /// Returns true if `minor` has been explicitly set.
  56. public var hasMinor: Bool {return self._minor != nil}
  57. /// Clears the value of `minor`. Subsequent reads from it will return its default value.
  58. public mutating func clearMinor() {self._minor = nil}
  59. public var patch: Int32 {
  60. get {return _patch ?? 0}
  61. set {_patch = newValue}
  62. }
  63. /// Returns true if `patch` has been explicitly set.
  64. public var hasPatch: Bool {return self._patch != nil}
  65. /// Clears the value of `patch`. Subsequent reads from it will return its default value.
  66. public mutating func clearPatch() {self._patch = nil}
  67. /// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
  68. /// be empty for mainline stable releases.
  69. public var suffix: String {
  70. get {return _suffix ?? String()}
  71. set {_suffix = newValue}
  72. }
  73. /// Returns true if `suffix` has been explicitly set.
  74. public var hasSuffix: Bool {return self._suffix != nil}
  75. /// Clears the value of `suffix`. Subsequent reads from it will return its default value.
  76. public mutating func clearSuffix() {self._suffix = nil}
  77. public var unknownFields = SwiftProtobuf.UnknownStorage()
  78. public init() {}
  79. fileprivate var _major: Int32? = nil
  80. fileprivate var _minor: Int32? = nil
  81. fileprivate var _patch: Int32? = nil
  82. fileprivate var _suffix: String? = nil
  83. }
  84. /// An encoded CodeGeneratorRequest is written to the plugin's stdin.
  85. public struct Google_Protobuf_Compiler_CodeGeneratorRequest {
  86. // SwiftProtobuf.Message conformance is added in an extension below. See the
  87. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  88. // methods supported on all messages.
  89. /// The .proto files that were explicitly listed on the command-line. The
  90. /// code generator should generate code only for these files. Each file's
  91. /// descriptor will be included in proto_file, below.
  92. public var fileToGenerate: [String] = []
  93. /// The generator parameter passed on the command-line.
  94. public var parameter: String {
  95. get {return _parameter ?? String()}
  96. set {_parameter = newValue}
  97. }
  98. /// Returns true if `parameter` has been explicitly set.
  99. public var hasParameter: Bool {return self._parameter != nil}
  100. /// Clears the value of `parameter`. Subsequent reads from it will return its default value.
  101. public mutating func clearParameter() {self._parameter = nil}
  102. /// FileDescriptorProtos for all files in files_to_generate and everything
  103. /// they import. The files will appear in topological order, so each file
  104. /// appears before any file that imports it.
  105. ///
  106. /// Note: the files listed in files_to_generate will include runtime-retention
  107. /// options only, but all other files will include source-retention options.
  108. /// The source_file_descriptors field below is available in case you need
  109. /// source-retention options for files_to_generate.
  110. ///
  111. /// protoc guarantees that all proto_files will be written after
  112. /// the fields above, even though this is not technically guaranteed by the
  113. /// protobuf wire format. This theoretically could allow a plugin to stream
  114. /// in the FileDescriptorProtos and handle them one by one rather than read
  115. /// the entire set into memory at once. However, as of this writing, this
  116. /// is not similarly optimized on protoc's end -- it will store all fields in
  117. /// memory at once before sending them to the plugin.
  118. ///
  119. /// Type names of fields and extensions in the FileDescriptorProto are always
  120. /// fully qualified.
  121. public var protoFile: [SwiftProtobuf.Google_Protobuf_FileDescriptorProto] = []
  122. /// File descriptors with all options, including source-retention options.
  123. /// These descriptors are only provided for the files listed in
  124. /// files_to_generate.
  125. public var sourceFileDescriptors: [SwiftProtobuf.Google_Protobuf_FileDescriptorProto] = []
  126. /// The version number of protocol compiler.
  127. public var compilerVersion: Google_Protobuf_Compiler_Version {
  128. get {return _compilerVersion ?? Google_Protobuf_Compiler_Version()}
  129. set {_compilerVersion = newValue}
  130. }
  131. /// Returns true if `compilerVersion` has been explicitly set.
  132. public var hasCompilerVersion: Bool {return self._compilerVersion != nil}
  133. /// Clears the value of `compilerVersion`. Subsequent reads from it will return its default value.
  134. public mutating func clearCompilerVersion() {self._compilerVersion = nil}
  135. public var unknownFields = SwiftProtobuf.UnknownStorage()
  136. public init() {}
  137. fileprivate var _parameter: String? = nil
  138. fileprivate var _compilerVersion: Google_Protobuf_Compiler_Version? = nil
  139. }
  140. /// The plugin writes an encoded CodeGeneratorResponse to stdout.
  141. public struct Google_Protobuf_Compiler_CodeGeneratorResponse {
  142. // SwiftProtobuf.Message conformance is added in an extension below. See the
  143. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  144. // methods supported on all messages.
  145. /// Error message. If non-empty, code generation failed. The plugin process
  146. /// should exit with status code zero even if it reports an error in this way.
  147. ///
  148. /// This should be used to indicate errors in .proto files which prevent the
  149. /// code generator from generating correct code. Errors which indicate a
  150. /// problem in protoc itself -- such as the input CodeGeneratorRequest being
  151. /// unparseable -- should be reported by writing a message to stderr and
  152. /// exiting with a non-zero status code.
  153. public var error: String {
  154. get {return _error ?? String()}
  155. set {_error = newValue}
  156. }
  157. /// Returns true if `error` has been explicitly set.
  158. public var hasError: Bool {return self._error != nil}
  159. /// Clears the value of `error`. Subsequent reads from it will return its default value.
  160. public mutating func clearError() {self._error = nil}
  161. /// A bitmask of supported features that the code generator supports.
  162. /// This is a bitwise "or" of values from the Feature enum.
  163. public var supportedFeatures: UInt64 {
  164. get {return _supportedFeatures ?? 0}
  165. set {_supportedFeatures = newValue}
  166. }
  167. /// Returns true if `supportedFeatures` has been explicitly set.
  168. public var hasSupportedFeatures: Bool {return self._supportedFeatures != nil}
  169. /// Clears the value of `supportedFeatures`. Subsequent reads from it will return its default value.
  170. public mutating func clearSupportedFeatures() {self._supportedFeatures = nil}
  171. public var file: [Google_Protobuf_Compiler_CodeGeneratorResponse.File] = []
  172. public var unknownFields = SwiftProtobuf.UnknownStorage()
  173. /// Sync with code_generator.h.
  174. public enum Feature: SwiftProtobuf.Enum {
  175. public typealias RawValue = Int
  176. case none // = 0
  177. case proto3Optional // = 1
  178. case supportsEditions // = 2
  179. public init() {
  180. self = .none
  181. }
  182. public init?(rawValue: Int) {
  183. switch rawValue {
  184. case 0: self = .none
  185. case 1: self = .proto3Optional
  186. case 2: self = .supportsEditions
  187. default: return nil
  188. }
  189. }
  190. public var rawValue: Int {
  191. switch self {
  192. case .none: return 0
  193. case .proto3Optional: return 1
  194. case .supportsEditions: return 2
  195. }
  196. }
  197. }
  198. /// Represents a single generated file.
  199. public struct File {
  200. // SwiftProtobuf.Message conformance is added in an extension below. See the
  201. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  202. // methods supported on all messages.
  203. /// The file name, relative to the output directory. The name must not
  204. /// contain "." or ".." components and must be relative, not be absolute (so,
  205. /// the file cannot lie outside the output directory). "/" must be used as
  206. /// the path separator, not "\".
  207. ///
  208. /// If the name is omitted, the content will be appended to the previous
  209. /// file. This allows the generator to break large files into small chunks,
  210. /// and allows the generated text to be streamed back to protoc so that large
  211. /// files need not reside completely in memory at one time. Note that as of
  212. /// this writing protoc does not optimize for this -- it will read the entire
  213. /// CodeGeneratorResponse before writing files to disk.
  214. public var name: String {
  215. get {return _name ?? String()}
  216. set {_name = newValue}
  217. }
  218. /// Returns true if `name` has been explicitly set.
  219. public var hasName: Bool {return self._name != nil}
  220. /// Clears the value of `name`. Subsequent reads from it will return its default value.
  221. public mutating func clearName() {self._name = nil}
  222. /// If non-empty, indicates that the named file should already exist, and the
  223. /// content here is to be inserted into that file at a defined insertion
  224. /// point. This feature allows a code generator to extend the output
  225. /// produced by another code generator. The original generator may provide
  226. /// insertion points by placing special annotations in the file that look
  227. /// like:
  228. /// @@protoc_insertion_point(NAME)
  229. /// The annotation can have arbitrary text before and after it on the line,
  230. /// which allows it to be placed in a comment. NAME should be replaced with
  231. /// an identifier naming the point -- this is what other generators will use
  232. /// as the insertion_point. Code inserted at this point will be placed
  233. /// immediately above the line containing the insertion point (thus multiple
  234. /// insertions to the same point will come out in the order they were added).
  235. /// The double-@ is intended to make it unlikely that the generated code
  236. /// could contain things that look like insertion points by accident.
  237. ///
  238. /// For example, the C++ code generator places the following line in the
  239. /// .pb.h files that it generates:
  240. /// // @@protoc_insertion_point(namespace_scope)
  241. /// This line appears within the scope of the file's package namespace, but
  242. /// outside of any particular class. Another plugin can then specify the
  243. /// insertion_point "namespace_scope" to generate additional classes or
  244. /// other declarations that should be placed in this scope.
  245. ///
  246. /// Note that if the line containing the insertion point begins with
  247. /// whitespace, the same whitespace will be added to every line of the
  248. /// inserted text. This is useful for languages like Python, where
  249. /// indentation matters. In these languages, the insertion point comment
  250. /// should be indented the same amount as any inserted code will need to be
  251. /// in order to work correctly in that context.
  252. ///
  253. /// The code generator that generates the initial file and the one which
  254. /// inserts into it must both run as part of a single invocation of protoc.
  255. /// Code generators are executed in the order in which they appear on the
  256. /// command line.
  257. ///
  258. /// If |insertion_point| is present, |name| must also be present.
  259. public var insertionPoint: String {
  260. get {return _insertionPoint ?? String()}
  261. set {_insertionPoint = newValue}
  262. }
  263. /// Returns true if `insertionPoint` has been explicitly set.
  264. public var hasInsertionPoint: Bool {return self._insertionPoint != nil}
  265. /// Clears the value of `insertionPoint`. Subsequent reads from it will return its default value.
  266. public mutating func clearInsertionPoint() {self._insertionPoint = nil}
  267. /// The file contents.
  268. public var content: String {
  269. get {return _content ?? String()}
  270. set {_content = newValue}
  271. }
  272. /// Returns true if `content` has been explicitly set.
  273. public var hasContent: Bool {return self._content != nil}
  274. /// Clears the value of `content`. Subsequent reads from it will return its default value.
  275. public mutating func clearContent() {self._content = nil}
  276. /// Information describing the file content being inserted. If an insertion
  277. /// point is used, this information will be appropriately offset and inserted
  278. /// into the code generation metadata for the generated files.
  279. public var generatedCodeInfo: SwiftProtobuf.Google_Protobuf_GeneratedCodeInfo {
  280. get {return _generatedCodeInfo ?? SwiftProtobuf.Google_Protobuf_GeneratedCodeInfo()}
  281. set {_generatedCodeInfo = newValue}
  282. }
  283. /// Returns true if `generatedCodeInfo` has been explicitly set.
  284. public var hasGeneratedCodeInfo: Bool {return self._generatedCodeInfo != nil}
  285. /// Clears the value of `generatedCodeInfo`. Subsequent reads from it will return its default value.
  286. public mutating func clearGeneratedCodeInfo() {self._generatedCodeInfo = nil}
  287. public var unknownFields = SwiftProtobuf.UnknownStorage()
  288. public init() {}
  289. fileprivate var _name: String? = nil
  290. fileprivate var _insertionPoint: String? = nil
  291. fileprivate var _content: String? = nil
  292. fileprivate var _generatedCodeInfo: SwiftProtobuf.Google_Protobuf_GeneratedCodeInfo? = nil
  293. }
  294. public init() {}
  295. fileprivate var _error: String? = nil
  296. fileprivate var _supportedFeatures: UInt64? = nil
  297. }
  298. #if swift(>=4.2)
  299. extension Google_Protobuf_Compiler_CodeGeneratorResponse.Feature: CaseIterable {
  300. // Support synthesized by the compiler.
  301. }
  302. #endif // swift(>=4.2)
  303. #if swift(>=5.5) && canImport(_Concurrency)
  304. extension Google_Protobuf_Compiler_Version: @unchecked Sendable {}
  305. extension Google_Protobuf_Compiler_CodeGeneratorRequest: @unchecked Sendable {}
  306. extension Google_Protobuf_Compiler_CodeGeneratorResponse: @unchecked Sendable {}
  307. extension Google_Protobuf_Compiler_CodeGeneratorResponse.Feature: @unchecked Sendable {}
  308. extension Google_Protobuf_Compiler_CodeGeneratorResponse.File: @unchecked Sendable {}
  309. #endif // swift(>=5.5) && canImport(_Concurrency)
  310. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  311. fileprivate let _protobuf_package = "google.protobuf.compiler"
  312. extension Google_Protobuf_Compiler_Version: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  313. public static let protoMessageName: String = _protobuf_package + ".Version"
  314. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  315. 1: .same(proto: "major"),
  316. 2: .same(proto: "minor"),
  317. 3: .same(proto: "patch"),
  318. 4: .same(proto: "suffix"),
  319. ]
  320. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  321. while let fieldNumber = try decoder.nextFieldNumber() {
  322. // The use of inline closures is to circumvent an issue where the compiler
  323. // allocates stack space for every case branch when no optimizations are
  324. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  325. switch fieldNumber {
  326. case 1: try { try decoder.decodeSingularInt32Field(value: &self._major) }()
  327. case 2: try { try decoder.decodeSingularInt32Field(value: &self._minor) }()
  328. case 3: try { try decoder.decodeSingularInt32Field(value: &self._patch) }()
  329. case 4: try { try decoder.decodeSingularStringField(value: &self._suffix) }()
  330. default: break
  331. }
  332. }
  333. }
  334. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  335. // The use of inline closures is to circumvent an issue where the compiler
  336. // allocates stack space for every if/case branch local when no optimizations
  337. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  338. // https://github.com/apple/swift-protobuf/issues/1182
  339. try { if let v = self._major {
  340. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  341. } }()
  342. try { if let v = self._minor {
  343. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  344. } }()
  345. try { if let v = self._patch {
  346. try visitor.visitSingularInt32Field(value: v, fieldNumber: 3)
  347. } }()
  348. try { if let v = self._suffix {
  349. try visitor.visitSingularStringField(value: v, fieldNumber: 4)
  350. } }()
  351. try unknownFields.traverse(visitor: &visitor)
  352. }
  353. public static func ==(lhs: Google_Protobuf_Compiler_Version, rhs: Google_Protobuf_Compiler_Version) -> Bool {
  354. if lhs._major != rhs._major {return false}
  355. if lhs._minor != rhs._minor {return false}
  356. if lhs._patch != rhs._patch {return false}
  357. if lhs._suffix != rhs._suffix {return false}
  358. if lhs.unknownFields != rhs.unknownFields {return false}
  359. return true
  360. }
  361. }
  362. extension Google_Protobuf_Compiler_CodeGeneratorRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  363. public static let protoMessageName: String = _protobuf_package + ".CodeGeneratorRequest"
  364. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  365. 1: .standard(proto: "file_to_generate"),
  366. 2: .same(proto: "parameter"),
  367. 15: .standard(proto: "proto_file"),
  368. 17: .standard(proto: "source_file_descriptors"),
  369. 3: .standard(proto: "compiler_version"),
  370. ]
  371. public var isInitialized: Bool {
  372. if !SwiftProtobuf.Internal.areAllInitialized(self.protoFile) {return false}
  373. if !SwiftProtobuf.Internal.areAllInitialized(self.sourceFileDescriptors) {return false}
  374. return true
  375. }
  376. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  377. while let fieldNumber = try decoder.nextFieldNumber() {
  378. // The use of inline closures is to circumvent an issue where the compiler
  379. // allocates stack space for every case branch when no optimizations are
  380. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  381. switch fieldNumber {
  382. case 1: try { try decoder.decodeRepeatedStringField(value: &self.fileToGenerate) }()
  383. case 2: try { try decoder.decodeSingularStringField(value: &self._parameter) }()
  384. case 3: try { try decoder.decodeSingularMessageField(value: &self._compilerVersion) }()
  385. case 15: try { try decoder.decodeRepeatedMessageField(value: &self.protoFile) }()
  386. case 17: try { try decoder.decodeRepeatedMessageField(value: &self.sourceFileDescriptors) }()
  387. default: break
  388. }
  389. }
  390. }
  391. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  392. // The use of inline closures is to circumvent an issue where the compiler
  393. // allocates stack space for every if/case branch local when no optimizations
  394. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  395. // https://github.com/apple/swift-protobuf/issues/1182
  396. if !self.fileToGenerate.isEmpty {
  397. try visitor.visitRepeatedStringField(value: self.fileToGenerate, fieldNumber: 1)
  398. }
  399. try { if let v = self._parameter {
  400. try visitor.visitSingularStringField(value: v, fieldNumber: 2)
  401. } }()
  402. try { if let v = self._compilerVersion {
  403. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  404. } }()
  405. if !self.protoFile.isEmpty {
  406. try visitor.visitRepeatedMessageField(value: self.protoFile, fieldNumber: 15)
  407. }
  408. if !self.sourceFileDescriptors.isEmpty {
  409. try visitor.visitRepeatedMessageField(value: self.sourceFileDescriptors, fieldNumber: 17)
  410. }
  411. try unknownFields.traverse(visitor: &visitor)
  412. }
  413. public static func ==(lhs: Google_Protobuf_Compiler_CodeGeneratorRequest, rhs: Google_Protobuf_Compiler_CodeGeneratorRequest) -> Bool {
  414. if lhs.fileToGenerate != rhs.fileToGenerate {return false}
  415. if lhs._parameter != rhs._parameter {return false}
  416. if lhs.protoFile != rhs.protoFile {return false}
  417. if lhs.sourceFileDescriptors != rhs.sourceFileDescriptors {return false}
  418. if lhs._compilerVersion != rhs._compilerVersion {return false}
  419. if lhs.unknownFields != rhs.unknownFields {return false}
  420. return true
  421. }
  422. }
  423. extension Google_Protobuf_Compiler_CodeGeneratorResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  424. public static let protoMessageName: String = _protobuf_package + ".CodeGeneratorResponse"
  425. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  426. 1: .same(proto: "error"),
  427. 2: .standard(proto: "supported_features"),
  428. 15: .same(proto: "file"),
  429. ]
  430. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  431. while let fieldNumber = try decoder.nextFieldNumber() {
  432. // The use of inline closures is to circumvent an issue where the compiler
  433. // allocates stack space for every case branch when no optimizations are
  434. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  435. switch fieldNumber {
  436. case 1: try { try decoder.decodeSingularStringField(value: &self._error) }()
  437. case 2: try { try decoder.decodeSingularUInt64Field(value: &self._supportedFeatures) }()
  438. case 15: try { try decoder.decodeRepeatedMessageField(value: &self.file) }()
  439. default: break
  440. }
  441. }
  442. }
  443. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  444. // The use of inline closures is to circumvent an issue where the compiler
  445. // allocates stack space for every if/case branch local when no optimizations
  446. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  447. // https://github.com/apple/swift-protobuf/issues/1182
  448. try { if let v = self._error {
  449. try visitor.visitSingularStringField(value: v, fieldNumber: 1)
  450. } }()
  451. try { if let v = self._supportedFeatures {
  452. try visitor.visitSingularUInt64Field(value: v, fieldNumber: 2)
  453. } }()
  454. if !self.file.isEmpty {
  455. try visitor.visitRepeatedMessageField(value: self.file, fieldNumber: 15)
  456. }
  457. try unknownFields.traverse(visitor: &visitor)
  458. }
  459. public static func ==(lhs: Google_Protobuf_Compiler_CodeGeneratorResponse, rhs: Google_Protobuf_Compiler_CodeGeneratorResponse) -> Bool {
  460. if lhs._error != rhs._error {return false}
  461. if lhs._supportedFeatures != rhs._supportedFeatures {return false}
  462. if lhs.file != rhs.file {return false}
  463. if lhs.unknownFields != rhs.unknownFields {return false}
  464. return true
  465. }
  466. }
  467. extension Google_Protobuf_Compiler_CodeGeneratorResponse.Feature: SwiftProtobuf._ProtoNameProviding {
  468. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  469. 0: .same(proto: "FEATURE_NONE"),
  470. 1: .same(proto: "FEATURE_PROTO3_OPTIONAL"),
  471. 2: .same(proto: "FEATURE_SUPPORTS_EDITIONS"),
  472. ]
  473. }
  474. extension Google_Protobuf_Compiler_CodeGeneratorResponse.File: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  475. public static let protoMessageName: String = Google_Protobuf_Compiler_CodeGeneratorResponse.protoMessageName + ".File"
  476. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  477. 1: .same(proto: "name"),
  478. 2: .standard(proto: "insertion_point"),
  479. 15: .same(proto: "content"),
  480. 16: .standard(proto: "generated_code_info"),
  481. ]
  482. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  483. while let fieldNumber = try decoder.nextFieldNumber() {
  484. // The use of inline closures is to circumvent an issue where the compiler
  485. // allocates stack space for every case branch when no optimizations are
  486. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  487. switch fieldNumber {
  488. case 1: try { try decoder.decodeSingularStringField(value: &self._name) }()
  489. case 2: try { try decoder.decodeSingularStringField(value: &self._insertionPoint) }()
  490. case 15: try { try decoder.decodeSingularStringField(value: &self._content) }()
  491. case 16: try { try decoder.decodeSingularMessageField(value: &self._generatedCodeInfo) }()
  492. default: break
  493. }
  494. }
  495. }
  496. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  497. // The use of inline closures is to circumvent an issue where the compiler
  498. // allocates stack space for every if/case branch local when no optimizations
  499. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  500. // https://github.com/apple/swift-protobuf/issues/1182
  501. try { if let v = self._name {
  502. try visitor.visitSingularStringField(value: v, fieldNumber: 1)
  503. } }()
  504. try { if let v = self._insertionPoint {
  505. try visitor.visitSingularStringField(value: v, fieldNumber: 2)
  506. } }()
  507. try { if let v = self._content {
  508. try visitor.visitSingularStringField(value: v, fieldNumber: 15)
  509. } }()
  510. try { if let v = self._generatedCodeInfo {
  511. try visitor.visitSingularMessageField(value: v, fieldNumber: 16)
  512. } }()
  513. try unknownFields.traverse(visitor: &visitor)
  514. }
  515. public static func ==(lhs: Google_Protobuf_Compiler_CodeGeneratorResponse.File, rhs: Google_Protobuf_Compiler_CodeGeneratorResponse.File) -> Bool {
  516. if lhs._name != rhs._name {return false}
  517. if lhs._insertionPoint != rhs._insertionPoint {return false}
  518. if lhs._content != rhs._content {return false}
  519. if lhs._generatedCodeInfo != rhs._generatedCodeInfo {return false}
  520. if lhs.unknownFields != rhs.unknownFields {return false}
  521. return true
  522. }
  523. }