api.pb.swift 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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/api.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. /// Api is a light-weight descriptor for an API Interface.
  50. ///
  51. /// Interfaces are also described as "protocol buffer services" in some contexts,
  52. /// such as by the "service" keyword in a .proto file, but they are different
  53. /// from API Services, which represent a concrete implementation of an interface
  54. /// as opposed to simply a description of methods and bindings. They are also
  55. /// sometimes simply referred to as "APIs" in other contexts, such as the name of
  56. /// this message itself. See https://cloud.google.com/apis/design/glossary for
  57. /// detailed terminology.
  58. ///
  59. /// New usages of this message as an alternative to ServiceDescriptorProto are
  60. /// strongly discouraged. This message does not reliability preserve all
  61. /// information necessary to model the schema and preserve semantics. Instead
  62. /// make use of FileDescriptorSet which preserves the necessary information.
  63. public struct Google_Protobuf_Api: Sendable {
  64. // SwiftProtobuf.Message conformance is added in an extension below. See the
  65. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  66. // methods supported on all messages.
  67. /// The fully qualified name of this interface, including package name
  68. /// followed by the interface's simple name.
  69. public var name: String = String()
  70. /// The methods of this interface, in unspecified order.
  71. public var methods: [Google_Protobuf_Method] = []
  72. /// Any metadata attached to the interface.
  73. public var options: [Google_Protobuf_Option] = []
  74. /// A version string for this interface. If specified, must have the form
  75. /// `major-version.minor-version`, as in `1.10`. If the minor version is
  76. /// omitted, it defaults to zero. If the entire version field is empty, the
  77. /// major version is derived from the package name, as outlined below. If the
  78. /// field is not empty, the version in the package name will be verified to be
  79. /// consistent with what is provided here.
  80. ///
  81. /// The versioning schema uses [semantic
  82. /// versioning](http://semver.org) where the major version number
  83. /// indicates a breaking change and the minor version an additive,
  84. /// non-breaking change. Both version numbers are signals to users
  85. /// what to expect from different versions, and should be carefully
  86. /// chosen based on the product plan.
  87. ///
  88. /// The major version is also reflected in the package name of the
  89. /// interface, which must end in `v<major-version>`, as in
  90. /// `google.feature.v1`. For major versions 0 and 1, the suffix can
  91. /// be omitted. Zero major versions must only be used for
  92. /// experimental, non-GA interfaces.
  93. public var version: String = String()
  94. /// Source context for the protocol buffer service represented by this
  95. /// message.
  96. public var sourceContext: Google_Protobuf_SourceContext {
  97. get {_sourceContext ?? Google_Protobuf_SourceContext()}
  98. set {_sourceContext = newValue}
  99. }
  100. /// Returns true if `sourceContext` has been explicitly set.
  101. public var hasSourceContext: Bool {self._sourceContext != nil}
  102. /// Clears the value of `sourceContext`. Subsequent reads from it will return its default value.
  103. public mutating func clearSourceContext() {self._sourceContext = nil}
  104. /// Included interfaces. See [Mixin][].
  105. public var mixins: [Google_Protobuf_Mixin] = []
  106. /// The source syntax of the service.
  107. public var syntax: Google_Protobuf_Syntax = .proto2
  108. /// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
  109. public var edition: String = String()
  110. public var unknownFields = UnknownStorage()
  111. public init() {}
  112. fileprivate var _sourceContext: Google_Protobuf_SourceContext? = nil
  113. }
  114. /// Method represents a method of an API interface.
  115. ///
  116. /// New usages of this message as an alternative to MethodDescriptorProto are
  117. /// strongly discouraged. This message does not reliability preserve all
  118. /// information necessary to model the schema and preserve semantics. Instead
  119. /// make use of FileDescriptorSet which preserves the necessary information.
  120. public struct Google_Protobuf_Method: Sendable {
  121. // SwiftProtobuf.Message conformance is added in an extension below. See the
  122. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  123. // methods supported on all messages.
  124. /// The simple name of this method.
  125. public var name: String = String()
  126. /// A URL of the input message type.
  127. public var requestTypeURL: String = String()
  128. /// If true, the request is streamed.
  129. public var requestStreaming: Bool = false
  130. /// The URL of the output message type.
  131. public var responseTypeURL: String = String()
  132. /// If true, the response is streamed.
  133. public var responseStreaming: Bool = false
  134. /// Any metadata attached to the method.
  135. public var options: [Google_Protobuf_Option] = []
  136. /// The source syntax of this method.
  137. ///
  138. /// This field should be ignored, instead the syntax should be inherited from
  139. /// Api. This is similar to Field and EnumValue.
  140. ///
  141. /// NOTE: This field was marked as deprecated in the .proto file.
  142. public var syntax: Google_Protobuf_Syntax = .proto2
  143. /// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
  144. ///
  145. /// This field should be ignored, instead the edition should be inherited from
  146. /// Api. This is similar to Field and EnumValue.
  147. ///
  148. /// NOTE: This field was marked as deprecated in the .proto file.
  149. public var edition: String = String()
  150. public var unknownFields = UnknownStorage()
  151. public init() {}
  152. }
  153. /// Declares an API Interface to be included in this interface. The including
  154. /// interface must redeclare all the methods from the included interface, but
  155. /// documentation and options are inherited as follows:
  156. ///
  157. /// - If after comment and whitespace stripping, the documentation
  158. /// string of the redeclared method is empty, it will be inherited
  159. /// from the original method.
  160. ///
  161. /// - Each annotation belonging to the service config (http,
  162. /// visibility) which is not set in the redeclared method will be
  163. /// inherited.
  164. ///
  165. /// - If an http annotation is inherited, the path pattern will be
  166. /// modified as follows. Any version prefix will be replaced by the
  167. /// version of the including interface plus the [root][] path if
  168. /// specified.
  169. ///
  170. /// Example of a simple mixin:
  171. ///
  172. /// package google.acl.v1;
  173. /// service AccessControl {
  174. /// // Get the underlying ACL object.
  175. /// rpc GetAcl(GetAclRequest) returns (Acl) {
  176. /// option (google.api.http).get = "/v1/{resource=**}:getAcl";
  177. /// }
  178. /// }
  179. ///
  180. /// package google.storage.v2;
  181. /// service Storage {
  182. /// rpc GetAcl(GetAclRequest) returns (Acl);
  183. ///
  184. /// // Get a data record.
  185. /// rpc GetData(GetDataRequest) returns (Data) {
  186. /// option (google.api.http).get = "/v2/{resource=**}";
  187. /// }
  188. /// }
  189. ///
  190. /// Example of a mixin configuration:
  191. ///
  192. /// apis:
  193. /// - name: google.storage.v2.Storage
  194. /// mixins:
  195. /// - name: google.acl.v1.AccessControl
  196. ///
  197. /// The mixin construct implies that all methods in `AccessControl` are
  198. /// also declared with same name and request/response types in
  199. /// `Storage`. A documentation generator or annotation processor will
  200. /// see the effective `Storage.GetAcl` method after inheriting
  201. /// documentation and annotations as follows:
  202. ///
  203. /// service Storage {
  204. /// // Get the underlying ACL object.
  205. /// rpc GetAcl(GetAclRequest) returns (Acl) {
  206. /// option (google.api.http).get = "/v2/{resource=**}:getAcl";
  207. /// }
  208. /// ...
  209. /// }
  210. ///
  211. /// Note how the version in the path pattern changed from `v1` to `v2`.
  212. ///
  213. /// If the `root` field in the mixin is specified, it should be a
  214. /// relative path under which inherited HTTP paths are placed. Example:
  215. ///
  216. /// apis:
  217. /// - name: google.storage.v2.Storage
  218. /// mixins:
  219. /// - name: google.acl.v1.AccessControl
  220. /// root: acls
  221. ///
  222. /// This implies the following inherited HTTP annotation:
  223. ///
  224. /// service Storage {
  225. /// // Get the underlying ACL object.
  226. /// rpc GetAcl(GetAclRequest) returns (Acl) {
  227. /// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
  228. /// }
  229. /// ...
  230. /// }
  231. public struct Google_Protobuf_Mixin: Sendable {
  232. // SwiftProtobuf.Message conformance is added in an extension below. See the
  233. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  234. // methods supported on all messages.
  235. /// The fully qualified name of the interface which is included.
  236. public var name: String = String()
  237. /// If non-empty specifies a path under which inherited HTTP paths
  238. /// are rooted.
  239. public var root: String = String()
  240. public var unknownFields = UnknownStorage()
  241. public init() {}
  242. }
  243. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  244. fileprivate let _protobuf_package = "google.protobuf"
  245. extension Google_Protobuf_Api: Message, _MessageImplementationBase, _ProtoNameProviding {
  246. public static let protoMessageName: String = _protobuf_package + ".Api"
  247. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}name\0\u{1}methods\0\u{1}options\0\u{1}version\0\u{3}source_context\0\u{1}mixins\0\u{1}syntax\0\u{1}edition\0")
  248. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  249. while let fieldNumber = try decoder.nextFieldNumber() {
  250. // The use of inline closures is to circumvent an issue where the compiler
  251. // allocates stack space for every case branch when no optimizations are
  252. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  253. switch fieldNumber {
  254. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  255. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.methods) }()
  256. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.options) }()
  257. case 4: try { try decoder.decodeSingularStringField(value: &self.version) }()
  258. case 5: try { try decoder.decodeSingularMessageField(value: &self._sourceContext) }()
  259. case 6: try { try decoder.decodeRepeatedMessageField(value: &self.mixins) }()
  260. case 7: try { try decoder.decodeSingularEnumField(value: &self.syntax) }()
  261. case 8: try { try decoder.decodeSingularStringField(value: &self.edition) }()
  262. default: break
  263. }
  264. }
  265. }
  266. public func traverse<V: Visitor>(visitor: inout V) throws {
  267. // The use of inline closures is to circumvent an issue where the compiler
  268. // allocates stack space for every if/case branch local when no optimizations
  269. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  270. // https://github.com/apple/swift-protobuf/issues/1182
  271. if !self.name.isEmpty {
  272. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  273. }
  274. if !self.methods.isEmpty {
  275. try visitor.visitRepeatedMessageField(value: self.methods, fieldNumber: 2)
  276. }
  277. if !self.options.isEmpty {
  278. try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 3)
  279. }
  280. if !self.version.isEmpty {
  281. try visitor.visitSingularStringField(value: self.version, fieldNumber: 4)
  282. }
  283. try { if let v = self._sourceContext {
  284. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  285. } }()
  286. if !self.mixins.isEmpty {
  287. try visitor.visitRepeatedMessageField(value: self.mixins, fieldNumber: 6)
  288. }
  289. if self.syntax != .proto2 {
  290. try visitor.visitSingularEnumField(value: self.syntax, fieldNumber: 7)
  291. }
  292. if !self.edition.isEmpty {
  293. try visitor.visitSingularStringField(value: self.edition, fieldNumber: 8)
  294. }
  295. try unknownFields.traverse(visitor: &visitor)
  296. }
  297. public static func ==(lhs: Google_Protobuf_Api, rhs: Google_Protobuf_Api) -> Bool {
  298. if lhs.name != rhs.name {return false}
  299. if lhs.methods != rhs.methods {return false}
  300. if lhs.options != rhs.options {return false}
  301. if lhs.version != rhs.version {return false}
  302. if lhs._sourceContext != rhs._sourceContext {return false}
  303. if lhs.mixins != rhs.mixins {return false}
  304. if lhs.syntax != rhs.syntax {return false}
  305. if lhs.edition != rhs.edition {return false}
  306. if lhs.unknownFields != rhs.unknownFields {return false}
  307. return true
  308. }
  309. }
  310. extension Google_Protobuf_Method: Message, _MessageImplementationBase, _ProtoNameProviding {
  311. public static let protoMessageName: String = _protobuf_package + ".Method"
  312. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}name\0\u{3}request_type_url\0\u{3}request_streaming\0\u{3}response_type_url\0\u{3}response_streaming\0\u{1}options\0\u{1}syntax\0\u{1}edition\0")
  313. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  314. while let fieldNumber = try decoder.nextFieldNumber() {
  315. // The use of inline closures is to circumvent an issue where the compiler
  316. // allocates stack space for every case branch when no optimizations are
  317. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  318. switch fieldNumber {
  319. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  320. case 2: try { try decoder.decodeSingularStringField(value: &self.requestTypeURL) }()
  321. case 3: try { try decoder.decodeSingularBoolField(value: &self.requestStreaming) }()
  322. case 4: try { try decoder.decodeSingularStringField(value: &self.responseTypeURL) }()
  323. case 5: try { try decoder.decodeSingularBoolField(value: &self.responseStreaming) }()
  324. case 6: try { try decoder.decodeRepeatedMessageField(value: &self.options) }()
  325. case 7: try { try decoder.decodeSingularEnumField(value: &self.syntax) }()
  326. case 8: try { try decoder.decodeSingularStringField(value: &self.edition) }()
  327. default: break
  328. }
  329. }
  330. }
  331. public func traverse<V: Visitor>(visitor: inout V) throws {
  332. if !self.name.isEmpty {
  333. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  334. }
  335. if !self.requestTypeURL.isEmpty {
  336. try visitor.visitSingularStringField(value: self.requestTypeURL, fieldNumber: 2)
  337. }
  338. if self.requestStreaming != false {
  339. try visitor.visitSingularBoolField(value: self.requestStreaming, fieldNumber: 3)
  340. }
  341. if !self.responseTypeURL.isEmpty {
  342. try visitor.visitSingularStringField(value: self.responseTypeURL, fieldNumber: 4)
  343. }
  344. if self.responseStreaming != false {
  345. try visitor.visitSingularBoolField(value: self.responseStreaming, fieldNumber: 5)
  346. }
  347. if !self.options.isEmpty {
  348. try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 6)
  349. }
  350. if self.syntax != .proto2 {
  351. try visitor.visitSingularEnumField(value: self.syntax, fieldNumber: 7)
  352. }
  353. if !self.edition.isEmpty {
  354. try visitor.visitSingularStringField(value: self.edition, fieldNumber: 8)
  355. }
  356. try unknownFields.traverse(visitor: &visitor)
  357. }
  358. public static func ==(lhs: Google_Protobuf_Method, rhs: Google_Protobuf_Method) -> Bool {
  359. if lhs.name != rhs.name {return false}
  360. if lhs.requestTypeURL != rhs.requestTypeURL {return false}
  361. if lhs.requestStreaming != rhs.requestStreaming {return false}
  362. if lhs.responseTypeURL != rhs.responseTypeURL {return false}
  363. if lhs.responseStreaming != rhs.responseStreaming {return false}
  364. if lhs.options != rhs.options {return false}
  365. if lhs.syntax != rhs.syntax {return false}
  366. if lhs.edition != rhs.edition {return false}
  367. if lhs.unknownFields != rhs.unknownFields {return false}
  368. return true
  369. }
  370. }
  371. extension Google_Protobuf_Mixin: Message, _MessageImplementationBase, _ProtoNameProviding {
  372. public static let protoMessageName: String = _protobuf_package + ".Mixin"
  373. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{1}name\0\u{1}root\0")
  374. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  375. while let fieldNumber = try decoder.nextFieldNumber() {
  376. // The use of inline closures is to circumvent an issue where the compiler
  377. // allocates stack space for every case branch when no optimizations are
  378. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  379. switch fieldNumber {
  380. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  381. case 2: try { try decoder.decodeSingularStringField(value: &self.root) }()
  382. default: break
  383. }
  384. }
  385. }
  386. public func traverse<V: Visitor>(visitor: inout V) throws {
  387. if !self.name.isEmpty {
  388. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  389. }
  390. if !self.root.isEmpty {
  391. try visitor.visitSingularStringField(value: self.root, fieldNumber: 2)
  392. }
  393. try unknownFields.traverse(visitor: &visitor)
  394. }
  395. public static func ==(lhs: Google_Protobuf_Mixin, rhs: Google_Protobuf_Mixin) -> Bool {
  396. if lhs.name != rhs.name {return false}
  397. if lhs.root != rhs.root {return false}
  398. if lhs.unknownFields != rhs.unknownFields {return false}
  399. return true
  400. }
  401. }