rls_config.pb.swift 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  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: grpc/lookup/v1/rls_config.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Copyright 2020 The gRPC Authors
  11. //
  12. // Licensed under the Apache License, Version 2.0 (the "License");
  13. // you may not use this file except in compliance with the License.
  14. // You may obtain a copy of the License at
  15. //
  16. // http://www.apache.org/licenses/LICENSE-2.0
  17. //
  18. // Unless required by applicable law or agreed to in writing, software
  19. // distributed under the License is distributed on an "AS IS" BASIS,
  20. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  21. // See the License for the specific language governing permissions and
  22. // limitations under the License.
  23. import SwiftProtobuf
  24. // If the compiler emits an error on this type, it is because this file
  25. // was generated by a version of the `protoc` Swift plug-in that is
  26. // incompatible with the version of SwiftProtobuf to which you are linking.
  27. // Please ensure that you are building against the same version of the API
  28. // that was used to generate this file.
  29. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  30. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  31. typealias Version = _2
  32. }
  33. /// Extract a key based on a given name (e.g. header name or query parameter
  34. /// name). The name must match one of the names listed in the "name" field. If
  35. /// the "required_match" field is true, one of the specified names must be
  36. /// present for the keybuilder to match.
  37. struct Grpc_Lookup_V1_NameMatcher: Sendable {
  38. // SwiftProtobuf.Message conformance is added in an extension below. See the
  39. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  40. // methods supported on all messages.
  41. /// The name that will be used in the RLS key_map to refer to this value.
  42. /// If required_match is true, you may omit this field or set it to an empty
  43. /// string, in which case the matcher will require a match, but won't update
  44. /// the key_map.
  45. var key: String = String()
  46. /// Ordered list of names (headers or query parameter names) that can supply
  47. /// this value; the first one with a non-empty value is used.
  48. var names: [String] = []
  49. /// If true, make this extraction required; the key builder will not match
  50. /// if no value is found.
  51. var requiredMatch: Bool = false
  52. var unknownFields = SwiftProtobuf.UnknownStorage()
  53. init() {}
  54. }
  55. /// A GrpcKeyBuilder applies to a given gRPC service, name, and headers.
  56. struct Grpc_Lookup_V1_GrpcKeyBuilder: Sendable {
  57. // SwiftProtobuf.Message conformance is added in an extension below. See the
  58. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  59. // methods supported on all messages.
  60. var names: [Grpc_Lookup_V1_GrpcKeyBuilder.Name] = []
  61. var extraKeys: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys {
  62. get {return _extraKeys ?? Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys()}
  63. set {_extraKeys = newValue}
  64. }
  65. /// Returns true if `extraKeys` has been explicitly set.
  66. var hasExtraKeys: Bool {return self._extraKeys != nil}
  67. /// Clears the value of `extraKeys`. Subsequent reads from it will return its default value.
  68. mutating func clearExtraKeys() {self._extraKeys = nil}
  69. /// Extract keys from all listed headers.
  70. /// For gRPC, it is an error to specify "required_match" on the NameMatcher
  71. /// protos.
  72. var headers: [Grpc_Lookup_V1_NameMatcher] = []
  73. /// You can optionally set one or more specific key/value pairs to be added to
  74. /// the key_map. This can be useful to identify which builder built the key,
  75. /// for example if you are suppressing the actual method, but need to
  76. /// separately cache and request all the matched methods.
  77. var constantKeys: Dictionary<String,String> = [:]
  78. var unknownFields = SwiftProtobuf.UnknownStorage()
  79. /// To match, one of the given Name fields must match; the service and method
  80. /// fields are specified as fixed strings. The service name is required and
  81. /// includes the proto package name. The method name may be omitted, in
  82. /// which case any method on the given service is matched.
  83. struct Name: Sendable {
  84. // SwiftProtobuf.Message conformance is added in an extension below. See the
  85. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  86. // methods supported on all messages.
  87. var service: String = String()
  88. var method: String = String()
  89. var unknownFields = SwiftProtobuf.UnknownStorage()
  90. init() {}
  91. }
  92. /// If you wish to include the host, service, or method names as keys in the
  93. /// generated RouteLookupRequest, specify key names to use in the extra_keys
  94. /// submessage. If a key name is empty, no key will be set for that value.
  95. /// If this submessage is specified, the normal host/path fields will be left
  96. /// unset in the RouteLookupRequest. We are deprecating host/path in the
  97. /// RouteLookupRequest, so services should migrate to the ExtraKeys approach.
  98. struct ExtraKeys: Sendable {
  99. // SwiftProtobuf.Message conformance is added in an extension below. See the
  100. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  101. // methods supported on all messages.
  102. var host: String = String()
  103. var service: String = String()
  104. var method: String = String()
  105. var unknownFields = SwiftProtobuf.UnknownStorage()
  106. init() {}
  107. }
  108. init() {}
  109. fileprivate var _extraKeys: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys? = nil
  110. }
  111. /// An HttpKeyBuilder applies to a given HTTP URL and headers.
  112. ///
  113. /// Path and host patterns use the matching syntax from gRPC transcoding to
  114. /// extract named key/value pairs from the path and host components of the URL:
  115. /// https://github.com/googleapis/googleapis/blob/master/google/api/http.proto
  116. ///
  117. /// It is invalid to specify the same key name in multiple places in a pattern.
  118. ///
  119. /// For a service where the project id can be expressed either as a subdomain or
  120. /// in the path, separate HttpKeyBuilders must be used:
  121. /// host_pattern: 'example.com' path_pattern: '/{id}/{object}/**'
  122. /// host_pattern: '{id}.example.com' path_pattern: '/{object}/**'
  123. /// If the host is exactly 'example.com', the first path segment will be used as
  124. /// the id and the second segment as the object. If the host has a subdomain, the
  125. /// subdomain will be used as the id and the first segment as the object. If
  126. /// neither pattern matches, no keys will be extracted.
  127. struct Grpc_Lookup_V1_HttpKeyBuilder: Sendable {
  128. // SwiftProtobuf.Message conformance is added in an extension below. See the
  129. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  130. // methods supported on all messages.
  131. /// host_pattern is an ordered list of host template patterns for the desired
  132. /// value. If any host_pattern values are specified, then at least one must
  133. /// match, and the last one wins and sets any specified variables. A host
  134. /// consists of labels separated by dots. Each label is matched against the
  135. /// label in the pattern as follows:
  136. /// - "*": Matches any single label.
  137. /// - "**": Matches zero or more labels (first or last part of host only).
  138. /// - "{<name>=...}": One or more label capture, where "..." can be any
  139. /// template that does not include a capture.
  140. /// - "{<name>}": A single label capture. Identical to {<name>=*}.
  141. ///
  142. /// Examples:
  143. /// - "example.com": Only applies to the exact host example.com.
  144. /// - "*.example.com": Matches subdomains of example.com.
  145. /// - "**.example.com": matches example.com, and all levels of subdomains.
  146. /// - "{project}.example.com": Extracts the third level subdomain.
  147. /// - "{project=**}.example.com": Extracts the third level+ subdomains.
  148. /// - "{project=**}": Extracts the entire host.
  149. var hostPatterns: [String] = []
  150. /// path_pattern is an ordered list of path template patterns for the desired
  151. /// value. If any path_pattern values are specified, then at least one must
  152. /// match, and the last one wins and sets any specified variables. A path
  153. /// consists of segments separated by slashes. Each segment is matched against
  154. /// the segment in the pattern as follows:
  155. /// - "*": Matches any single segment.
  156. /// - "**": Matches zero or more segments (first or last part of path only).
  157. /// - "{<name>=...}": One or more segment capture, where "..." can be any
  158. /// template that does not include a capture.
  159. /// - "{<name>}": A single segment capture. Identical to {<name>=*}.
  160. /// A custom method may also be specified by appending ":" and the custom
  161. /// method name or "*" to indicate any custom method (including no custom
  162. /// method). For example, "/*/projects/{project_id}/**:*" extracts
  163. /// `{project_id}` for any version, resource and custom method that includes
  164. /// it. By default, any custom method will be matched.
  165. ///
  166. /// Examples:
  167. /// - "/v1/{name=messages/*}": extracts a name like "messages/12345".
  168. /// - "/v1/messages/{message_id}": extracts a message_id like "12345".
  169. /// - "/v1/users/{user_id}/messages/{message_id}": extracts two key values.
  170. var pathPatterns: [String] = []
  171. /// List of query parameter names to try to match.
  172. /// For example: ["parent", "name", "resource.name"]
  173. /// We extract all the specified query_parameters (case-sensitively). If any
  174. /// are marked as "required_match" and are not present, this keybuilder fails
  175. /// to match. If a given parameter appears multiple times (?foo=a&foo=b) we
  176. /// will report it as a comma-separated string (foo=a,b).
  177. var queryParameters: [Grpc_Lookup_V1_NameMatcher] = []
  178. /// List of headers to try to match.
  179. /// We extract all the specified header values (case-insensitively). If any
  180. /// are marked as "required_match" and are not present, this keybuilder fails
  181. /// to match. If a given header appears multiple times in the request we will
  182. /// report it as a comma-separated string, in standard HTTP fashion.
  183. var headers: [Grpc_Lookup_V1_NameMatcher] = []
  184. /// You can optionally set one or more specific key/value pairs to be added to
  185. /// the key_map. This can be useful to identify which builder built the key,
  186. /// for example if you are suppressing a lot of information from the URL, but
  187. /// need to separately cache and request URLs with that content.
  188. var constantKeys: Dictionary<String,String> = [:]
  189. /// If specified, the HTTP method/verb will be extracted under this key name.
  190. var method: String = String()
  191. var unknownFields = SwiftProtobuf.UnknownStorage()
  192. init() {}
  193. }
  194. struct Grpc_Lookup_V1_RouteLookupConfig: Sendable {
  195. // SwiftProtobuf.Message conformance is added in an extension below. See the
  196. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  197. // methods supported on all messages.
  198. /// Ordered specifications for constructing keys for HTTP requests. Last
  199. /// match wins. If no HttpKeyBuilder matches, an empty key_map will be sent to
  200. /// the lookup service; it should likely reply with a global default route
  201. /// and raise an alert.
  202. var httpKeybuilders: [Grpc_Lookup_V1_HttpKeyBuilder] = []
  203. /// Unordered specifications for constructing keys for gRPC requests. All
  204. /// GrpcKeyBuilders on this list must have unique "name" fields so that the
  205. /// client is free to prebuild a hash map keyed by name. If no GrpcKeyBuilder
  206. /// matches, an empty key_map will be sent to the lookup service; it should
  207. /// likely reply with a global default route and raise an alert.
  208. var grpcKeybuilders: [Grpc_Lookup_V1_GrpcKeyBuilder] = []
  209. /// The name of the lookup service as a gRPC URI. Typically, this will be
  210. /// a subdomain of the target, such as "lookup.datastore.googleapis.com".
  211. var lookupService: String = String()
  212. /// Configure a timeout value for lookup service requests.
  213. /// Defaults to 10 seconds if not specified.
  214. var lookupServiceTimeout: SwiftProtobuf.Google_Protobuf_Duration {
  215. get {return _lookupServiceTimeout ?? SwiftProtobuf.Google_Protobuf_Duration()}
  216. set {_lookupServiceTimeout = newValue}
  217. }
  218. /// Returns true if `lookupServiceTimeout` has been explicitly set.
  219. var hasLookupServiceTimeout: Bool {return self._lookupServiceTimeout != nil}
  220. /// Clears the value of `lookupServiceTimeout`. Subsequent reads from it will return its default value.
  221. mutating func clearLookupServiceTimeout() {self._lookupServiceTimeout = nil}
  222. /// How long are responses valid for (like HTTP Cache-Control).
  223. /// If omitted or zero, the longest valid cache time is used.
  224. /// This value is clamped to 5 minutes to avoid unflushable bad responses.
  225. var maxAge: SwiftProtobuf.Google_Protobuf_Duration {
  226. get {return _maxAge ?? SwiftProtobuf.Google_Protobuf_Duration()}
  227. set {_maxAge = newValue}
  228. }
  229. /// Returns true if `maxAge` has been explicitly set.
  230. var hasMaxAge: Bool {return self._maxAge != nil}
  231. /// Clears the value of `maxAge`. Subsequent reads from it will return its default value.
  232. mutating func clearMaxAge() {self._maxAge = nil}
  233. /// After a response has been in the client cache for this amount of time
  234. /// and is re-requested, start an asynchronous RPC to re-validate it.
  235. /// This value should be less than max_age by at least the length of a
  236. /// typical RTT to the Route Lookup Service to fully mask the RTT latency.
  237. /// If omitted, keys are only re-requested after they have expired.
  238. var staleAge: SwiftProtobuf.Google_Protobuf_Duration {
  239. get {return _staleAge ?? SwiftProtobuf.Google_Protobuf_Duration()}
  240. set {_staleAge = newValue}
  241. }
  242. /// Returns true if `staleAge` has been explicitly set.
  243. var hasStaleAge: Bool {return self._staleAge != nil}
  244. /// Clears the value of `staleAge`. Subsequent reads from it will return its default value.
  245. mutating func clearStaleAge() {self._staleAge = nil}
  246. /// Rough indicator of amount of memory to use for the client cache. Some of
  247. /// the data structure overhead is not accounted for, so actual memory consumed
  248. /// will be somewhat greater than this value. If this field is omitted or set
  249. /// to zero, a client default will be used. The value may be capped to a lower
  250. /// amount based on client configuration.
  251. var cacheSizeBytes: Int64 = 0
  252. /// This is a list of all the possible targets that can be returned by the
  253. /// lookup service. If a target not on this list is returned, it will be
  254. /// treated the same as an unhealthy target.
  255. var validTargets: [String] = []
  256. /// This value provides a default target to use if needed. If set, it will be
  257. /// used if RLS returns an error, times out, or returns an invalid response.
  258. /// Note that requests can be routed only to a subdomain of the original
  259. /// target, e.g. "us_east_1.cloudbigtable.googleapis.com".
  260. var defaultTarget: String = String()
  261. var unknownFields = SwiftProtobuf.UnknownStorage()
  262. init() {}
  263. fileprivate var _lookupServiceTimeout: SwiftProtobuf.Google_Protobuf_Duration? = nil
  264. fileprivate var _maxAge: SwiftProtobuf.Google_Protobuf_Duration? = nil
  265. fileprivate var _staleAge: SwiftProtobuf.Google_Protobuf_Duration? = nil
  266. }
  267. /// RouteLookupClusterSpecifier is used in xDS to represent a cluster specifier
  268. /// plugin for RLS.
  269. struct Grpc_Lookup_V1_RouteLookupClusterSpecifier: Sendable {
  270. // SwiftProtobuf.Message conformance is added in an extension below. See the
  271. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  272. // methods supported on all messages.
  273. /// The RLS config for this cluster specifier plugin instance.
  274. var routeLookupConfig: Grpc_Lookup_V1_RouteLookupConfig {
  275. get {return _routeLookupConfig ?? Grpc_Lookup_V1_RouteLookupConfig()}
  276. set {_routeLookupConfig = newValue}
  277. }
  278. /// Returns true if `routeLookupConfig` has been explicitly set.
  279. var hasRouteLookupConfig: Bool {return self._routeLookupConfig != nil}
  280. /// Clears the value of `routeLookupConfig`. Subsequent reads from it will return its default value.
  281. mutating func clearRouteLookupConfig() {self._routeLookupConfig = nil}
  282. var unknownFields = SwiftProtobuf.UnknownStorage()
  283. init() {}
  284. fileprivate var _routeLookupConfig: Grpc_Lookup_V1_RouteLookupConfig? = nil
  285. }
  286. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  287. fileprivate let _protobuf_package = "grpc.lookup.v1"
  288. extension Grpc_Lookup_V1_NameMatcher: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  289. static let protoMessageName: String = _protobuf_package + ".NameMatcher"
  290. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  291. 1: .same(proto: "key"),
  292. 2: .same(proto: "names"),
  293. 3: .standard(proto: "required_match"),
  294. ]
  295. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  296. while let fieldNumber = try decoder.nextFieldNumber() {
  297. // The use of inline closures is to circumvent an issue where the compiler
  298. // allocates stack space for every case branch when no optimizations are
  299. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  300. switch fieldNumber {
  301. case 1: try { try decoder.decodeSingularStringField(value: &self.key) }()
  302. case 2: try { try decoder.decodeRepeatedStringField(value: &self.names) }()
  303. case 3: try { try decoder.decodeSingularBoolField(value: &self.requiredMatch) }()
  304. default: break
  305. }
  306. }
  307. }
  308. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  309. if !self.key.isEmpty {
  310. try visitor.visitSingularStringField(value: self.key, fieldNumber: 1)
  311. }
  312. if !self.names.isEmpty {
  313. try visitor.visitRepeatedStringField(value: self.names, fieldNumber: 2)
  314. }
  315. if self.requiredMatch != false {
  316. try visitor.visitSingularBoolField(value: self.requiredMatch, fieldNumber: 3)
  317. }
  318. try unknownFields.traverse(visitor: &visitor)
  319. }
  320. static func ==(lhs: Grpc_Lookup_V1_NameMatcher, rhs: Grpc_Lookup_V1_NameMatcher) -> Bool {
  321. if lhs.key != rhs.key {return false}
  322. if lhs.names != rhs.names {return false}
  323. if lhs.requiredMatch != rhs.requiredMatch {return false}
  324. if lhs.unknownFields != rhs.unknownFields {return false}
  325. return true
  326. }
  327. }
  328. extension Grpc_Lookup_V1_GrpcKeyBuilder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  329. static let protoMessageName: String = _protobuf_package + ".GrpcKeyBuilder"
  330. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  331. 1: .same(proto: "names"),
  332. 3: .standard(proto: "extra_keys"),
  333. 2: .same(proto: "headers"),
  334. 4: .standard(proto: "constant_keys"),
  335. ]
  336. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  337. while let fieldNumber = try decoder.nextFieldNumber() {
  338. // The use of inline closures is to circumvent an issue where the compiler
  339. // allocates stack space for every case branch when no optimizations are
  340. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  341. switch fieldNumber {
  342. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.names) }()
  343. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.headers) }()
  344. case 3: try { try decoder.decodeSingularMessageField(value: &self._extraKeys) }()
  345. case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.constantKeys) }()
  346. default: break
  347. }
  348. }
  349. }
  350. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  351. // The use of inline closures is to circumvent an issue where the compiler
  352. // allocates stack space for every if/case branch local when no optimizations
  353. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  354. // https://github.com/apple/swift-protobuf/issues/1182
  355. if !self.names.isEmpty {
  356. try visitor.visitRepeatedMessageField(value: self.names, fieldNumber: 1)
  357. }
  358. if !self.headers.isEmpty {
  359. try visitor.visitRepeatedMessageField(value: self.headers, fieldNumber: 2)
  360. }
  361. try { if let v = self._extraKeys {
  362. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  363. } }()
  364. if !self.constantKeys.isEmpty {
  365. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.constantKeys, fieldNumber: 4)
  366. }
  367. try unknownFields.traverse(visitor: &visitor)
  368. }
  369. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder, rhs: Grpc_Lookup_V1_GrpcKeyBuilder) -> Bool {
  370. if lhs.names != rhs.names {return false}
  371. if lhs._extraKeys != rhs._extraKeys {return false}
  372. if lhs.headers != rhs.headers {return false}
  373. if lhs.constantKeys != rhs.constantKeys {return false}
  374. if lhs.unknownFields != rhs.unknownFields {return false}
  375. return true
  376. }
  377. }
  378. extension Grpc_Lookup_V1_GrpcKeyBuilder.Name: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  379. static let protoMessageName: String = Grpc_Lookup_V1_GrpcKeyBuilder.protoMessageName + ".Name"
  380. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  381. 1: .same(proto: "service"),
  382. 2: .same(proto: "method"),
  383. ]
  384. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  385. while let fieldNumber = try decoder.nextFieldNumber() {
  386. // The use of inline closures is to circumvent an issue where the compiler
  387. // allocates stack space for every case branch when no optimizations are
  388. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  389. switch fieldNumber {
  390. case 1: try { try decoder.decodeSingularStringField(value: &self.service) }()
  391. case 2: try { try decoder.decodeSingularStringField(value: &self.method) }()
  392. default: break
  393. }
  394. }
  395. }
  396. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  397. if !self.service.isEmpty {
  398. try visitor.visitSingularStringField(value: self.service, fieldNumber: 1)
  399. }
  400. if !self.method.isEmpty {
  401. try visitor.visitSingularStringField(value: self.method, fieldNumber: 2)
  402. }
  403. try unknownFields.traverse(visitor: &visitor)
  404. }
  405. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder.Name, rhs: Grpc_Lookup_V1_GrpcKeyBuilder.Name) -> Bool {
  406. if lhs.service != rhs.service {return false}
  407. if lhs.method != rhs.method {return false}
  408. if lhs.unknownFields != rhs.unknownFields {return false}
  409. return true
  410. }
  411. }
  412. extension Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  413. static let protoMessageName: String = Grpc_Lookup_V1_GrpcKeyBuilder.protoMessageName + ".ExtraKeys"
  414. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  415. 1: .same(proto: "host"),
  416. 2: .same(proto: "service"),
  417. 3: .same(proto: "method"),
  418. ]
  419. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  420. while let fieldNumber = try decoder.nextFieldNumber() {
  421. // The use of inline closures is to circumvent an issue where the compiler
  422. // allocates stack space for every case branch when no optimizations are
  423. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  424. switch fieldNumber {
  425. case 1: try { try decoder.decodeSingularStringField(value: &self.host) }()
  426. case 2: try { try decoder.decodeSingularStringField(value: &self.service) }()
  427. case 3: try { try decoder.decodeSingularStringField(value: &self.method) }()
  428. default: break
  429. }
  430. }
  431. }
  432. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  433. if !self.host.isEmpty {
  434. try visitor.visitSingularStringField(value: self.host, fieldNumber: 1)
  435. }
  436. if !self.service.isEmpty {
  437. try visitor.visitSingularStringField(value: self.service, fieldNumber: 2)
  438. }
  439. if !self.method.isEmpty {
  440. try visitor.visitSingularStringField(value: self.method, fieldNumber: 3)
  441. }
  442. try unknownFields.traverse(visitor: &visitor)
  443. }
  444. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys, rhs: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys) -> Bool {
  445. if lhs.host != rhs.host {return false}
  446. if lhs.service != rhs.service {return false}
  447. if lhs.method != rhs.method {return false}
  448. if lhs.unknownFields != rhs.unknownFields {return false}
  449. return true
  450. }
  451. }
  452. extension Grpc_Lookup_V1_HttpKeyBuilder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  453. static let protoMessageName: String = _protobuf_package + ".HttpKeyBuilder"
  454. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  455. 1: .standard(proto: "host_patterns"),
  456. 2: .standard(proto: "path_patterns"),
  457. 3: .standard(proto: "query_parameters"),
  458. 4: .same(proto: "headers"),
  459. 5: .standard(proto: "constant_keys"),
  460. 6: .same(proto: "method"),
  461. ]
  462. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  463. while let fieldNumber = try decoder.nextFieldNumber() {
  464. // The use of inline closures is to circumvent an issue where the compiler
  465. // allocates stack space for every case branch when no optimizations are
  466. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  467. switch fieldNumber {
  468. case 1: try { try decoder.decodeRepeatedStringField(value: &self.hostPatterns) }()
  469. case 2: try { try decoder.decodeRepeatedStringField(value: &self.pathPatterns) }()
  470. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.queryParameters) }()
  471. case 4: try { try decoder.decodeRepeatedMessageField(value: &self.headers) }()
  472. case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.constantKeys) }()
  473. case 6: try { try decoder.decodeSingularStringField(value: &self.method) }()
  474. default: break
  475. }
  476. }
  477. }
  478. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  479. if !self.hostPatterns.isEmpty {
  480. try visitor.visitRepeatedStringField(value: self.hostPatterns, fieldNumber: 1)
  481. }
  482. if !self.pathPatterns.isEmpty {
  483. try visitor.visitRepeatedStringField(value: self.pathPatterns, fieldNumber: 2)
  484. }
  485. if !self.queryParameters.isEmpty {
  486. try visitor.visitRepeatedMessageField(value: self.queryParameters, fieldNumber: 3)
  487. }
  488. if !self.headers.isEmpty {
  489. try visitor.visitRepeatedMessageField(value: self.headers, fieldNumber: 4)
  490. }
  491. if !self.constantKeys.isEmpty {
  492. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.constantKeys, fieldNumber: 5)
  493. }
  494. if !self.method.isEmpty {
  495. try visitor.visitSingularStringField(value: self.method, fieldNumber: 6)
  496. }
  497. try unknownFields.traverse(visitor: &visitor)
  498. }
  499. static func ==(lhs: Grpc_Lookup_V1_HttpKeyBuilder, rhs: Grpc_Lookup_V1_HttpKeyBuilder) -> Bool {
  500. if lhs.hostPatterns != rhs.hostPatterns {return false}
  501. if lhs.pathPatterns != rhs.pathPatterns {return false}
  502. if lhs.queryParameters != rhs.queryParameters {return false}
  503. if lhs.headers != rhs.headers {return false}
  504. if lhs.constantKeys != rhs.constantKeys {return false}
  505. if lhs.method != rhs.method {return false}
  506. if lhs.unknownFields != rhs.unknownFields {return false}
  507. return true
  508. }
  509. }
  510. extension Grpc_Lookup_V1_RouteLookupConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  511. static let protoMessageName: String = _protobuf_package + ".RouteLookupConfig"
  512. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  513. 1: .standard(proto: "http_keybuilders"),
  514. 2: .standard(proto: "grpc_keybuilders"),
  515. 3: .standard(proto: "lookup_service"),
  516. 4: .standard(proto: "lookup_service_timeout"),
  517. 5: .standard(proto: "max_age"),
  518. 6: .standard(proto: "stale_age"),
  519. 7: .standard(proto: "cache_size_bytes"),
  520. 8: .standard(proto: "valid_targets"),
  521. 9: .standard(proto: "default_target"),
  522. ]
  523. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  524. while let fieldNumber = try decoder.nextFieldNumber() {
  525. // The use of inline closures is to circumvent an issue where the compiler
  526. // allocates stack space for every case branch when no optimizations are
  527. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  528. switch fieldNumber {
  529. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.httpKeybuilders) }()
  530. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.grpcKeybuilders) }()
  531. case 3: try { try decoder.decodeSingularStringField(value: &self.lookupService) }()
  532. case 4: try { try decoder.decodeSingularMessageField(value: &self._lookupServiceTimeout) }()
  533. case 5: try { try decoder.decodeSingularMessageField(value: &self._maxAge) }()
  534. case 6: try { try decoder.decodeSingularMessageField(value: &self._staleAge) }()
  535. case 7: try { try decoder.decodeSingularInt64Field(value: &self.cacheSizeBytes) }()
  536. case 8: try { try decoder.decodeRepeatedStringField(value: &self.validTargets) }()
  537. case 9: try { try decoder.decodeSingularStringField(value: &self.defaultTarget) }()
  538. default: break
  539. }
  540. }
  541. }
  542. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  543. // The use of inline closures is to circumvent an issue where the compiler
  544. // allocates stack space for every if/case branch local when no optimizations
  545. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  546. // https://github.com/apple/swift-protobuf/issues/1182
  547. if !self.httpKeybuilders.isEmpty {
  548. try visitor.visitRepeatedMessageField(value: self.httpKeybuilders, fieldNumber: 1)
  549. }
  550. if !self.grpcKeybuilders.isEmpty {
  551. try visitor.visitRepeatedMessageField(value: self.grpcKeybuilders, fieldNumber: 2)
  552. }
  553. if !self.lookupService.isEmpty {
  554. try visitor.visitSingularStringField(value: self.lookupService, fieldNumber: 3)
  555. }
  556. try { if let v = self._lookupServiceTimeout {
  557. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  558. } }()
  559. try { if let v = self._maxAge {
  560. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  561. } }()
  562. try { if let v = self._staleAge {
  563. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  564. } }()
  565. if self.cacheSizeBytes != 0 {
  566. try visitor.visitSingularInt64Field(value: self.cacheSizeBytes, fieldNumber: 7)
  567. }
  568. if !self.validTargets.isEmpty {
  569. try visitor.visitRepeatedStringField(value: self.validTargets, fieldNumber: 8)
  570. }
  571. if !self.defaultTarget.isEmpty {
  572. try visitor.visitSingularStringField(value: self.defaultTarget, fieldNumber: 9)
  573. }
  574. try unknownFields.traverse(visitor: &visitor)
  575. }
  576. static func ==(lhs: Grpc_Lookup_V1_RouteLookupConfig, rhs: Grpc_Lookup_V1_RouteLookupConfig) -> Bool {
  577. if lhs.httpKeybuilders != rhs.httpKeybuilders {return false}
  578. if lhs.grpcKeybuilders != rhs.grpcKeybuilders {return false}
  579. if lhs.lookupService != rhs.lookupService {return false}
  580. if lhs._lookupServiceTimeout != rhs._lookupServiceTimeout {return false}
  581. if lhs._maxAge != rhs._maxAge {return false}
  582. if lhs._staleAge != rhs._staleAge {return false}
  583. if lhs.cacheSizeBytes != rhs.cacheSizeBytes {return false}
  584. if lhs.validTargets != rhs.validTargets {return false}
  585. if lhs.defaultTarget != rhs.defaultTarget {return false}
  586. if lhs.unknownFields != rhs.unknownFields {return false}
  587. return true
  588. }
  589. }
  590. extension Grpc_Lookup_V1_RouteLookupClusterSpecifier: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  591. static let protoMessageName: String = _protobuf_package + ".RouteLookupClusterSpecifier"
  592. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  593. 1: .standard(proto: "route_lookup_config"),
  594. ]
  595. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  596. while let fieldNumber = try decoder.nextFieldNumber() {
  597. // The use of inline closures is to circumvent an issue where the compiler
  598. // allocates stack space for every case branch when no optimizations are
  599. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  600. switch fieldNumber {
  601. case 1: try { try decoder.decodeSingularMessageField(value: &self._routeLookupConfig) }()
  602. default: break
  603. }
  604. }
  605. }
  606. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  607. // The use of inline closures is to circumvent an issue where the compiler
  608. // allocates stack space for every if/case branch local when no optimizations
  609. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  610. // https://github.com/apple/swift-protobuf/issues/1182
  611. try { if let v = self._routeLookupConfig {
  612. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  613. } }()
  614. try unknownFields.traverse(visitor: &visitor)
  615. }
  616. static func ==(lhs: Grpc_Lookup_V1_RouteLookupClusterSpecifier, rhs: Grpc_Lookup_V1_RouteLookupClusterSpecifier) -> Bool {
  617. if lhs._routeLookupConfig != rhs._routeLookupConfig {return false}
  618. if lhs.unknownFields != rhs.unknownFields {return false}
  619. return true
  620. }
  621. }