api.pb.swift 18 KB

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