internal_options.pb.swift 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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/internal_options.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 2023 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. import SwiftProtobuf
  17. // If the compiler emits an error on this type, it is because this file
  18. // was generated by a version of the `protoc` Swift plug-in that is
  19. // incompatible with the version of SwiftProtobuf to which you are linking.
  20. // Please ensure that you are building against the same version of the API
  21. // that was used to generate this file.
  22. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  23. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  24. typealias Version = _2
  25. }
  26. struct Pb_InternalOptionsForce: Sendable {
  27. // SwiftProtobuf.Message conformance is added in an extension below. See the
  28. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  29. // methods supported on all messages.
  30. var unknownFields = SwiftProtobuf.UnknownStorage()
  31. enum Enum: SwiftProtobuf.Enum, Swift.CaseIterable {
  32. typealias RawValue = Int
  33. case unspecified // = 0
  34. case forceOn // = 1
  35. case forceOff // = 2
  36. case UNRECOGNIZED(Int)
  37. init() {
  38. self = .unspecified
  39. }
  40. init?(rawValue: Int) {
  41. switch rawValue {
  42. case 0: self = .unspecified
  43. case 1: self = .forceOn
  44. case 2: self = .forceOff
  45. default: self = .UNRECOGNIZED(rawValue)
  46. }
  47. }
  48. var rawValue: Int {
  49. switch self {
  50. case .unspecified: return 0
  51. case .forceOn: return 1
  52. case .forceOff: return 2
  53. case .UNRECOGNIZED(let i): return i
  54. }
  55. }
  56. // The compiler won't synthesize support with the UNRECOGNIZED case.
  57. static let allCases: [Pb_InternalOptionsForce.Enum] = [
  58. .unspecified,
  59. .forceOn,
  60. .forceOff,
  61. ]
  62. }
  63. init() {}
  64. }
  65. struct Pb_InternalFieldOptionsCpp: Sendable {
  66. // SwiftProtobuf.Message conformance is added in an extension below. See the
  67. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  68. // methods supported on all messages.
  69. var unknownFields = SwiftProtobuf.UnknownStorage()
  70. init() {}
  71. }
  72. struct Pb_InternalFieldOptions: Sendable {
  73. // SwiftProtobuf.Message conformance is added in an extension below. See the
  74. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  75. // methods supported on all messages.
  76. var cpp: Pb_InternalFieldOptionsCpp {
  77. get {_cpp ?? Pb_InternalFieldOptionsCpp()}
  78. set {_cpp = newValue}
  79. }
  80. /// Returns true if `cpp` has been explicitly set.
  81. var hasCpp: Bool {self._cpp != nil}
  82. /// Clears the value of `cpp`. Subsequent reads from it will return its default value.
  83. mutating func clearCpp() {self._cpp = nil}
  84. var unknownFields = SwiftProtobuf.UnknownStorage()
  85. init() {}
  86. fileprivate var _cpp: Pb_InternalFieldOptionsCpp? = nil
  87. }
  88. // MARK: - Extension support defined in internal_options.proto.
  89. // MARK: - Extension Properties
  90. // Swift Extensions on the extended Messages to add easy access to the declared
  91. // extension fields. The names are based on the extension field name from the proto
  92. // declaration. To avoid naming collisions, the names are prefixed with the name of
  93. // the scope where the extend directive occurs.
  94. extension SwiftProtobuf.Google_Protobuf_FieldOptions {
  95. var Pb_internalFieldOptions: Pb_InternalFieldOptions {
  96. get {return getExtensionValue(ext: Pb_Extensions_internal_field_options) ?? Pb_InternalFieldOptions()}
  97. set {setExtensionValue(ext: Pb_Extensions_internal_field_options, value: newValue)}
  98. }
  99. /// Returns true if extension `Pb_Extensions_internal_field_options`
  100. /// has been explicitly set.
  101. var hasPb_internalFieldOptions: Bool {
  102. return hasExtensionValue(ext: Pb_Extensions_internal_field_options)
  103. }
  104. /// Clears the value of extension `Pb_Extensions_internal_field_options`.
  105. /// Subsequent reads from it will return its default value.
  106. mutating func clearPb_internalFieldOptions() {
  107. clearExtensionValue(ext: Pb_Extensions_internal_field_options)
  108. }
  109. }
  110. // MARK: - File's ExtensionMap: Pb_InternalOptions_Extensions
  111. /// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
  112. /// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
  113. /// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
  114. /// a larger `SwiftProtobuf.SimpleExtensionMap`.
  115. let Pb_InternalOptions_Extensions: SwiftProtobuf.SimpleExtensionMap = [
  116. Pb_Extensions_internal_field_options
  117. ]
  118. // Extension Objects - The only reason these might be needed is when manually
  119. // constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_
  120. // accessors for the extension fields on the messages directly.
  121. let Pb_Extensions_internal_field_options = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<Pb_InternalFieldOptions>, SwiftProtobuf.Google_Protobuf_FieldOptions>(
  122. _protobuf_fieldNumber: 535801550,
  123. fieldName: "pb.internal_field_options"
  124. )
  125. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  126. fileprivate let _protobuf_package = "pb"
  127. extension Pb_InternalOptionsForce: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  128. static let protoMessageName: String = _protobuf_package + ".InternalOptionsForce"
  129. static let _protobuf_nameMap = SwiftProtobuf._NameMap()
  130. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  131. // Load everything into unknown fields
  132. while try decoder.nextFieldNumber() != nil {}
  133. }
  134. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  135. try unknownFields.traverse(visitor: &visitor)
  136. }
  137. static func ==(lhs: Pb_InternalOptionsForce, rhs: Pb_InternalOptionsForce) -> Bool {
  138. if lhs.unknownFields != rhs.unknownFields {return false}
  139. return true
  140. }
  141. }
  142. extension Pb_InternalOptionsForce.Enum: SwiftProtobuf._ProtoNameProviding {
  143. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNSPECIFIED\0\u{1}FORCE_ON\0\u{1}FORCE_OFF\0")
  144. }
  145. extension Pb_InternalFieldOptionsCpp: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  146. static let protoMessageName: String = _protobuf_package + ".InternalFieldOptionsCpp"
  147. static let _protobuf_nameMap = SwiftProtobuf._NameMap()
  148. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  149. // Load everything into unknown fields
  150. while try decoder.nextFieldNumber() != nil {}
  151. }
  152. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  153. try unknownFields.traverse(visitor: &visitor)
  154. }
  155. static func ==(lhs: Pb_InternalFieldOptionsCpp, rhs: Pb_InternalFieldOptionsCpp) -> Bool {
  156. if lhs.unknownFields != rhs.unknownFields {return false}
  157. return true
  158. }
  159. }
  160. extension Pb_InternalFieldOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  161. static let protoMessageName: String = _protobuf_package + ".InternalFieldOptions"
  162. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}cpp\0")
  163. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  164. while let fieldNumber = try decoder.nextFieldNumber() {
  165. // The use of inline closures is to circumvent an issue where the compiler
  166. // allocates stack space for every case branch when no optimizations are
  167. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  168. switch fieldNumber {
  169. case 1: try { try decoder.decodeSingularMessageField(value: &self._cpp) }()
  170. default: break
  171. }
  172. }
  173. }
  174. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  175. // The use of inline closures is to circumvent an issue where the compiler
  176. // allocates stack space for every if/case branch local when no optimizations
  177. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  178. // https://github.com/apple/swift-protobuf/issues/1182
  179. try { if let v = self._cpp {
  180. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  181. } }()
  182. try unknownFields.traverse(visitor: &visitor)
  183. }
  184. static func ==(lhs: Pb_InternalFieldOptions, rhs: Pb_InternalFieldOptions) -> Bool {
  185. if lhs._cpp != rhs._cpp {return false}
  186. if lhs.unknownFields != rhs.unknownFields {return false}
  187. return true
  188. }
  189. }