rls_config.pb.swift 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  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. var unknownFields = SwiftProtobuf.UnknownStorage()
  190. init() {}
  191. }
  192. struct Grpc_Lookup_V1_RouteLookupConfig: Sendable {
  193. // SwiftProtobuf.Message conformance is added in an extension below. See the
  194. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  195. // methods supported on all messages.
  196. /// Ordered specifications for constructing keys for HTTP requests. Last
  197. /// match wins. If no HttpKeyBuilder matches, an empty key_map will be sent to
  198. /// the lookup service; it should likely reply with a global default route
  199. /// and raise an alert.
  200. var httpKeybuilders: [Grpc_Lookup_V1_HttpKeyBuilder] = []
  201. /// Unordered specifications for constructing keys for gRPC requests. All
  202. /// GrpcKeyBuilders on this list must have unique "name" fields so that the
  203. /// client is free to prebuild a hash map keyed by name. If no GrpcKeyBuilder
  204. /// matches, an empty key_map will be sent to the lookup service; it should
  205. /// likely reply with a global default route and raise an alert.
  206. var grpcKeybuilders: [Grpc_Lookup_V1_GrpcKeyBuilder] = []
  207. /// The name of the lookup service as a gRPC URI. Typically, this will be
  208. /// a subdomain of the target, such as "lookup.datastore.googleapis.com".
  209. var lookupService: String = String()
  210. /// Configure a timeout value for lookup service requests.
  211. /// Defaults to 10 seconds if not specified.
  212. var lookupServiceTimeout: SwiftProtobuf.Google_Protobuf_Duration {
  213. get {return _lookupServiceTimeout ?? SwiftProtobuf.Google_Protobuf_Duration()}
  214. set {_lookupServiceTimeout = newValue}
  215. }
  216. /// Returns true if `lookupServiceTimeout` has been explicitly set.
  217. var hasLookupServiceTimeout: Bool {return self._lookupServiceTimeout != nil}
  218. /// Clears the value of `lookupServiceTimeout`. Subsequent reads from it will return its default value.
  219. mutating func clearLookupServiceTimeout() {self._lookupServiceTimeout = nil}
  220. /// How long are responses valid for (like HTTP Cache-Control).
  221. /// If omitted or zero, the longest valid cache time is used.
  222. /// This value is clamped to 5 minutes to avoid unflushable bad responses.
  223. var maxAge: SwiftProtobuf.Google_Protobuf_Duration {
  224. get {return _maxAge ?? SwiftProtobuf.Google_Protobuf_Duration()}
  225. set {_maxAge = newValue}
  226. }
  227. /// Returns true if `maxAge` has been explicitly set.
  228. var hasMaxAge: Bool {return self._maxAge != nil}
  229. /// Clears the value of `maxAge`. Subsequent reads from it will return its default value.
  230. mutating func clearMaxAge() {self._maxAge = nil}
  231. /// After a response has been in the client cache for this amount of time
  232. /// and is re-requested, start an asynchronous RPC to re-validate it.
  233. /// This value should be less than max_age by at least the length of a
  234. /// typical RTT to the Route Lookup Service to fully mask the RTT latency.
  235. /// If omitted, keys are only re-requested after they have expired.
  236. var staleAge: SwiftProtobuf.Google_Protobuf_Duration {
  237. get {return _staleAge ?? SwiftProtobuf.Google_Protobuf_Duration()}
  238. set {_staleAge = newValue}
  239. }
  240. /// Returns true if `staleAge` has been explicitly set.
  241. var hasStaleAge: Bool {return self._staleAge != nil}
  242. /// Clears the value of `staleAge`. Subsequent reads from it will return its default value.
  243. mutating func clearStaleAge() {self._staleAge = nil}
  244. /// Rough indicator of amount of memory to use for the client cache. Some of
  245. /// the data structure overhead is not accounted for, so actual memory consumed
  246. /// will be somewhat greater than this value. If this field is omitted or set
  247. /// to zero, a client default will be used. The value may be capped to a lower
  248. /// amount based on client configuration.
  249. var cacheSizeBytes: Int64 = 0
  250. /// This is a list of all the possible targets that can be returned by the
  251. /// lookup service. If a target not on this list is returned, it will be
  252. /// treated the same as an unhealthy target.
  253. var validTargets: [String] = []
  254. /// This value provides a default target to use if needed. If set, it will be
  255. /// used if RLS returns an error, times out, or returns an invalid response.
  256. /// Note that requests can be routed only to a subdomain of the original
  257. /// target, e.g. "us_east_1.cloudbigtable.googleapis.com".
  258. var defaultTarget: String = String()
  259. var unknownFields = SwiftProtobuf.UnknownStorage()
  260. init() {}
  261. fileprivate var _lookupServiceTimeout: SwiftProtobuf.Google_Protobuf_Duration? = nil
  262. fileprivate var _maxAge: SwiftProtobuf.Google_Protobuf_Duration? = nil
  263. fileprivate var _staleAge: SwiftProtobuf.Google_Protobuf_Duration? = nil
  264. }
  265. /// RouteLookupClusterSpecifier is used in xDS to represent a cluster specifier
  266. /// plugin for RLS.
  267. struct Grpc_Lookup_V1_RouteLookupClusterSpecifier: Sendable {
  268. // SwiftProtobuf.Message conformance is added in an extension below. See the
  269. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  270. // methods supported on all messages.
  271. /// The RLS config for this cluster specifier plugin instance.
  272. var routeLookupConfig: Grpc_Lookup_V1_RouteLookupConfig {
  273. get {return _routeLookupConfig ?? Grpc_Lookup_V1_RouteLookupConfig()}
  274. set {_routeLookupConfig = newValue}
  275. }
  276. /// Returns true if `routeLookupConfig` has been explicitly set.
  277. var hasRouteLookupConfig: Bool {return self._routeLookupConfig != nil}
  278. /// Clears the value of `routeLookupConfig`. Subsequent reads from it will return its default value.
  279. mutating func clearRouteLookupConfig() {self._routeLookupConfig = nil}
  280. var unknownFields = SwiftProtobuf.UnknownStorage()
  281. init() {}
  282. fileprivate var _routeLookupConfig: Grpc_Lookup_V1_RouteLookupConfig? = nil
  283. }
  284. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  285. fileprivate let _protobuf_package = "grpc.lookup.v1"
  286. extension Grpc_Lookup_V1_NameMatcher: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  287. static let protoMessageName: String = _protobuf_package + ".NameMatcher"
  288. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  289. 1: .same(proto: "key"),
  290. 2: .same(proto: "names"),
  291. 3: .standard(proto: "required_match"),
  292. ]
  293. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  294. while let fieldNumber = try decoder.nextFieldNumber() {
  295. // The use of inline closures is to circumvent an issue where the compiler
  296. // allocates stack space for every case branch when no optimizations are
  297. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  298. switch fieldNumber {
  299. case 1: try { try decoder.decodeSingularStringField(value: &self.key) }()
  300. case 2: try { try decoder.decodeRepeatedStringField(value: &self.names) }()
  301. case 3: try { try decoder.decodeSingularBoolField(value: &self.requiredMatch) }()
  302. default: break
  303. }
  304. }
  305. }
  306. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  307. if !self.key.isEmpty {
  308. try visitor.visitSingularStringField(value: self.key, fieldNumber: 1)
  309. }
  310. if !self.names.isEmpty {
  311. try visitor.visitRepeatedStringField(value: self.names, fieldNumber: 2)
  312. }
  313. if self.requiredMatch != false {
  314. try visitor.visitSingularBoolField(value: self.requiredMatch, fieldNumber: 3)
  315. }
  316. try unknownFields.traverse(visitor: &visitor)
  317. }
  318. static func ==(lhs: Grpc_Lookup_V1_NameMatcher, rhs: Grpc_Lookup_V1_NameMatcher) -> Bool {
  319. if lhs.key != rhs.key {return false}
  320. if lhs.names != rhs.names {return false}
  321. if lhs.requiredMatch != rhs.requiredMatch {return false}
  322. if lhs.unknownFields != rhs.unknownFields {return false}
  323. return true
  324. }
  325. }
  326. extension Grpc_Lookup_V1_GrpcKeyBuilder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  327. static let protoMessageName: String = _protobuf_package + ".GrpcKeyBuilder"
  328. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  329. 1: .same(proto: "names"),
  330. 3: .standard(proto: "extra_keys"),
  331. 2: .same(proto: "headers"),
  332. 4: .standard(proto: "constant_keys"),
  333. ]
  334. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  335. while let fieldNumber = try decoder.nextFieldNumber() {
  336. // The use of inline closures is to circumvent an issue where the compiler
  337. // allocates stack space for every case branch when no optimizations are
  338. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  339. switch fieldNumber {
  340. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.names) }()
  341. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.headers) }()
  342. case 3: try { try decoder.decodeSingularMessageField(value: &self._extraKeys) }()
  343. case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.constantKeys) }()
  344. default: break
  345. }
  346. }
  347. }
  348. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  349. // The use of inline closures is to circumvent an issue where the compiler
  350. // allocates stack space for every if/case branch local when no optimizations
  351. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  352. // https://github.com/apple/swift-protobuf/issues/1182
  353. if !self.names.isEmpty {
  354. try visitor.visitRepeatedMessageField(value: self.names, fieldNumber: 1)
  355. }
  356. if !self.headers.isEmpty {
  357. try visitor.visitRepeatedMessageField(value: self.headers, fieldNumber: 2)
  358. }
  359. try { if let v = self._extraKeys {
  360. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  361. } }()
  362. if !self.constantKeys.isEmpty {
  363. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.constantKeys, fieldNumber: 4)
  364. }
  365. try unknownFields.traverse(visitor: &visitor)
  366. }
  367. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder, rhs: Grpc_Lookup_V1_GrpcKeyBuilder) -> Bool {
  368. if lhs.names != rhs.names {return false}
  369. if lhs._extraKeys != rhs._extraKeys {return false}
  370. if lhs.headers != rhs.headers {return false}
  371. if lhs.constantKeys != rhs.constantKeys {return false}
  372. if lhs.unknownFields != rhs.unknownFields {return false}
  373. return true
  374. }
  375. }
  376. extension Grpc_Lookup_V1_GrpcKeyBuilder.Name: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  377. static let protoMessageName: String = Grpc_Lookup_V1_GrpcKeyBuilder.protoMessageName + ".Name"
  378. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  379. 1: .same(proto: "service"),
  380. 2: .same(proto: "method"),
  381. ]
  382. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  383. while let fieldNumber = try decoder.nextFieldNumber() {
  384. // The use of inline closures is to circumvent an issue where the compiler
  385. // allocates stack space for every case branch when no optimizations are
  386. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  387. switch fieldNumber {
  388. case 1: try { try decoder.decodeSingularStringField(value: &self.service) }()
  389. case 2: try { try decoder.decodeSingularStringField(value: &self.method) }()
  390. default: break
  391. }
  392. }
  393. }
  394. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  395. if !self.service.isEmpty {
  396. try visitor.visitSingularStringField(value: self.service, fieldNumber: 1)
  397. }
  398. if !self.method.isEmpty {
  399. try visitor.visitSingularStringField(value: self.method, fieldNumber: 2)
  400. }
  401. try unknownFields.traverse(visitor: &visitor)
  402. }
  403. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder.Name, rhs: Grpc_Lookup_V1_GrpcKeyBuilder.Name) -> Bool {
  404. if lhs.service != rhs.service {return false}
  405. if lhs.method != rhs.method {return false}
  406. if lhs.unknownFields != rhs.unknownFields {return false}
  407. return true
  408. }
  409. }
  410. extension Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  411. static let protoMessageName: String = Grpc_Lookup_V1_GrpcKeyBuilder.protoMessageName + ".ExtraKeys"
  412. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  413. 1: .same(proto: "host"),
  414. 2: .same(proto: "service"),
  415. 3: .same(proto: "method"),
  416. ]
  417. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  418. while let fieldNumber = try decoder.nextFieldNumber() {
  419. // The use of inline closures is to circumvent an issue where the compiler
  420. // allocates stack space for every case branch when no optimizations are
  421. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  422. switch fieldNumber {
  423. case 1: try { try decoder.decodeSingularStringField(value: &self.host) }()
  424. case 2: try { try decoder.decodeSingularStringField(value: &self.service) }()
  425. case 3: try { try decoder.decodeSingularStringField(value: &self.method) }()
  426. default: break
  427. }
  428. }
  429. }
  430. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  431. if !self.host.isEmpty {
  432. try visitor.visitSingularStringField(value: self.host, fieldNumber: 1)
  433. }
  434. if !self.service.isEmpty {
  435. try visitor.visitSingularStringField(value: self.service, fieldNumber: 2)
  436. }
  437. if !self.method.isEmpty {
  438. try visitor.visitSingularStringField(value: self.method, fieldNumber: 3)
  439. }
  440. try unknownFields.traverse(visitor: &visitor)
  441. }
  442. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys, rhs: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys) -> Bool {
  443. if lhs.host != rhs.host {return false}
  444. if lhs.service != rhs.service {return false}
  445. if lhs.method != rhs.method {return false}
  446. if lhs.unknownFields != rhs.unknownFields {return false}
  447. return true
  448. }
  449. }
  450. extension Grpc_Lookup_V1_HttpKeyBuilder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  451. static let protoMessageName: String = _protobuf_package + ".HttpKeyBuilder"
  452. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  453. 1: .standard(proto: "host_patterns"),
  454. 2: .standard(proto: "path_patterns"),
  455. 3: .standard(proto: "query_parameters"),
  456. 4: .same(proto: "headers"),
  457. 5: .standard(proto: "constant_keys"),
  458. ]
  459. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  460. while let fieldNumber = try decoder.nextFieldNumber() {
  461. // The use of inline closures is to circumvent an issue where the compiler
  462. // allocates stack space for every case branch when no optimizations are
  463. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  464. switch fieldNumber {
  465. case 1: try { try decoder.decodeRepeatedStringField(value: &self.hostPatterns) }()
  466. case 2: try { try decoder.decodeRepeatedStringField(value: &self.pathPatterns) }()
  467. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.queryParameters) }()
  468. case 4: try { try decoder.decodeRepeatedMessageField(value: &self.headers) }()
  469. case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.constantKeys) }()
  470. default: break
  471. }
  472. }
  473. }
  474. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  475. if !self.hostPatterns.isEmpty {
  476. try visitor.visitRepeatedStringField(value: self.hostPatterns, fieldNumber: 1)
  477. }
  478. if !self.pathPatterns.isEmpty {
  479. try visitor.visitRepeatedStringField(value: self.pathPatterns, fieldNumber: 2)
  480. }
  481. if !self.queryParameters.isEmpty {
  482. try visitor.visitRepeatedMessageField(value: self.queryParameters, fieldNumber: 3)
  483. }
  484. if !self.headers.isEmpty {
  485. try visitor.visitRepeatedMessageField(value: self.headers, fieldNumber: 4)
  486. }
  487. if !self.constantKeys.isEmpty {
  488. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.constantKeys, fieldNumber: 5)
  489. }
  490. try unknownFields.traverse(visitor: &visitor)
  491. }
  492. static func ==(lhs: Grpc_Lookup_V1_HttpKeyBuilder, rhs: Grpc_Lookup_V1_HttpKeyBuilder) -> Bool {
  493. if lhs.hostPatterns != rhs.hostPatterns {return false}
  494. if lhs.pathPatterns != rhs.pathPatterns {return false}
  495. if lhs.queryParameters != rhs.queryParameters {return false}
  496. if lhs.headers != rhs.headers {return false}
  497. if lhs.constantKeys != rhs.constantKeys {return false}
  498. if lhs.unknownFields != rhs.unknownFields {return false}
  499. return true
  500. }
  501. }
  502. extension Grpc_Lookup_V1_RouteLookupConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  503. static let protoMessageName: String = _protobuf_package + ".RouteLookupConfig"
  504. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  505. 1: .standard(proto: "http_keybuilders"),
  506. 2: .standard(proto: "grpc_keybuilders"),
  507. 3: .standard(proto: "lookup_service"),
  508. 4: .standard(proto: "lookup_service_timeout"),
  509. 5: .standard(proto: "max_age"),
  510. 6: .standard(proto: "stale_age"),
  511. 7: .standard(proto: "cache_size_bytes"),
  512. 8: .standard(proto: "valid_targets"),
  513. 9: .standard(proto: "default_target"),
  514. ]
  515. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  516. while let fieldNumber = try decoder.nextFieldNumber() {
  517. // The use of inline closures is to circumvent an issue where the compiler
  518. // allocates stack space for every case branch when no optimizations are
  519. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  520. switch fieldNumber {
  521. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.httpKeybuilders) }()
  522. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.grpcKeybuilders) }()
  523. case 3: try { try decoder.decodeSingularStringField(value: &self.lookupService) }()
  524. case 4: try { try decoder.decodeSingularMessageField(value: &self._lookupServiceTimeout) }()
  525. case 5: try { try decoder.decodeSingularMessageField(value: &self._maxAge) }()
  526. case 6: try { try decoder.decodeSingularMessageField(value: &self._staleAge) }()
  527. case 7: try { try decoder.decodeSingularInt64Field(value: &self.cacheSizeBytes) }()
  528. case 8: try { try decoder.decodeRepeatedStringField(value: &self.validTargets) }()
  529. case 9: try { try decoder.decodeSingularStringField(value: &self.defaultTarget) }()
  530. default: break
  531. }
  532. }
  533. }
  534. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  535. // The use of inline closures is to circumvent an issue where the compiler
  536. // allocates stack space for every if/case branch local when no optimizations
  537. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  538. // https://github.com/apple/swift-protobuf/issues/1182
  539. if !self.httpKeybuilders.isEmpty {
  540. try visitor.visitRepeatedMessageField(value: self.httpKeybuilders, fieldNumber: 1)
  541. }
  542. if !self.grpcKeybuilders.isEmpty {
  543. try visitor.visitRepeatedMessageField(value: self.grpcKeybuilders, fieldNumber: 2)
  544. }
  545. if !self.lookupService.isEmpty {
  546. try visitor.visitSingularStringField(value: self.lookupService, fieldNumber: 3)
  547. }
  548. try { if let v = self._lookupServiceTimeout {
  549. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  550. } }()
  551. try { if let v = self._maxAge {
  552. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  553. } }()
  554. try { if let v = self._staleAge {
  555. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  556. } }()
  557. if self.cacheSizeBytes != 0 {
  558. try visitor.visitSingularInt64Field(value: self.cacheSizeBytes, fieldNumber: 7)
  559. }
  560. if !self.validTargets.isEmpty {
  561. try visitor.visitRepeatedStringField(value: self.validTargets, fieldNumber: 8)
  562. }
  563. if !self.defaultTarget.isEmpty {
  564. try visitor.visitSingularStringField(value: self.defaultTarget, fieldNumber: 9)
  565. }
  566. try unknownFields.traverse(visitor: &visitor)
  567. }
  568. static func ==(lhs: Grpc_Lookup_V1_RouteLookupConfig, rhs: Grpc_Lookup_V1_RouteLookupConfig) -> Bool {
  569. if lhs.httpKeybuilders != rhs.httpKeybuilders {return false}
  570. if lhs.grpcKeybuilders != rhs.grpcKeybuilders {return false}
  571. if lhs.lookupService != rhs.lookupService {return false}
  572. if lhs._lookupServiceTimeout != rhs._lookupServiceTimeout {return false}
  573. if lhs._maxAge != rhs._maxAge {return false}
  574. if lhs._staleAge != rhs._staleAge {return false}
  575. if lhs.cacheSizeBytes != rhs.cacheSizeBytes {return false}
  576. if lhs.validTargets != rhs.validTargets {return false}
  577. if lhs.defaultTarget != rhs.defaultTarget {return false}
  578. if lhs.unknownFields != rhs.unknownFields {return false}
  579. return true
  580. }
  581. }
  582. extension Grpc_Lookup_V1_RouteLookupClusterSpecifier: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  583. static let protoMessageName: String = _protobuf_package + ".RouteLookupClusterSpecifier"
  584. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  585. 1: .standard(proto: "route_lookup_config"),
  586. ]
  587. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  588. while let fieldNumber = try decoder.nextFieldNumber() {
  589. // The use of inline closures is to circumvent an issue where the compiler
  590. // allocates stack space for every case branch when no optimizations are
  591. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  592. switch fieldNumber {
  593. case 1: try { try decoder.decodeSingularMessageField(value: &self._routeLookupConfig) }()
  594. default: break
  595. }
  596. }
  597. }
  598. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  599. // The use of inline closures is to circumvent an issue where the compiler
  600. // allocates stack space for every if/case branch local when no optimizations
  601. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  602. // https://github.com/apple/swift-protobuf/issues/1182
  603. try { if let v = self._routeLookupConfig {
  604. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  605. } }()
  606. try unknownFields.traverse(visitor: &visitor)
  607. }
  608. static func ==(lhs: Grpc_Lookup_V1_RouteLookupClusterSpecifier, rhs: Grpc_Lookup_V1_RouteLookupClusterSpecifier) -> Bool {
  609. if lhs._routeLookupConfig != rhs._routeLookupConfig {return false}
  610. if lhs.unknownFields != rhs.unknownFields {return false}
  611. return true
  612. }
  613. }