plugin.pb.swift 28 KB

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