rls_config.pb.swift 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. //
  4. // Generated by the Swift generator plugin for the protocol buffer compiler.
  5. // Source: grpc/lookup/v1/rls_config.proto
  6. //
  7. // For information on using the generated types, please see the documentation:
  8. // https://github.com/apple/swift-protobuf/
  9. // Copyright 2020 The gRPC Authors
  10. //
  11. // Licensed under the Apache License, Version 2.0 (the "License");
  12. // you may not use this file except in compliance with the License.
  13. // You may obtain a copy of the License at
  14. //
  15. // http://www.apache.org/licenses/LICENSE-2.0
  16. //
  17. // Unless required by applicable law or agreed to in writing, software
  18. // distributed under the License is distributed on an "AS IS" BASIS,
  19. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20. // See the License for the specific language governing permissions and
  21. // limitations under the License.
  22. import Foundation
  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 {
  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 {
  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 {
  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 {
  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 {
  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 {
  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 {
  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. #if swift(>=5.5) && canImport(_Concurrency)
  285. extension Grpc_Lookup_V1_NameMatcher: @unchecked Sendable {}
  286. extension Grpc_Lookup_V1_GrpcKeyBuilder: @unchecked Sendable {}
  287. extension Grpc_Lookup_V1_GrpcKeyBuilder.Name: @unchecked Sendable {}
  288. extension Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys: @unchecked Sendable {}
  289. extension Grpc_Lookup_V1_HttpKeyBuilder: @unchecked Sendable {}
  290. extension Grpc_Lookup_V1_RouteLookupConfig: @unchecked Sendable {}
  291. extension Grpc_Lookup_V1_RouteLookupClusterSpecifier: @unchecked Sendable {}
  292. #endif // swift(>=5.5) && canImport(_Concurrency)
  293. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  294. fileprivate let _protobuf_package = "grpc.lookup.v1"
  295. extension Grpc_Lookup_V1_NameMatcher: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  296. static let protoMessageName: String = _protobuf_package + ".NameMatcher"
  297. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  298. 1: .same(proto: "key"),
  299. 2: .same(proto: "names"),
  300. 3: .standard(proto: "required_match"),
  301. ]
  302. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  303. while let fieldNumber = try decoder.nextFieldNumber() {
  304. // The use of inline closures is to circumvent an issue where the compiler
  305. // allocates stack space for every case branch when no optimizations are
  306. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  307. switch fieldNumber {
  308. case 1: try { try decoder.decodeSingularStringField(value: &self.key) }()
  309. case 2: try { try decoder.decodeRepeatedStringField(value: &self.names) }()
  310. case 3: try { try decoder.decodeSingularBoolField(value: &self.requiredMatch) }()
  311. default: break
  312. }
  313. }
  314. }
  315. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  316. if !self.key.isEmpty {
  317. try visitor.visitSingularStringField(value: self.key, fieldNumber: 1)
  318. }
  319. if !self.names.isEmpty {
  320. try visitor.visitRepeatedStringField(value: self.names, fieldNumber: 2)
  321. }
  322. if self.requiredMatch != false {
  323. try visitor.visitSingularBoolField(value: self.requiredMatch, fieldNumber: 3)
  324. }
  325. try unknownFields.traverse(visitor: &visitor)
  326. }
  327. static func ==(lhs: Grpc_Lookup_V1_NameMatcher, rhs: Grpc_Lookup_V1_NameMatcher) -> Bool {
  328. if lhs.key != rhs.key {return false}
  329. if lhs.names != rhs.names {return false}
  330. if lhs.requiredMatch != rhs.requiredMatch {return false}
  331. if lhs.unknownFields != rhs.unknownFields {return false}
  332. return true
  333. }
  334. }
  335. extension Grpc_Lookup_V1_GrpcKeyBuilder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  336. static let protoMessageName: String = _protobuf_package + ".GrpcKeyBuilder"
  337. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  338. 1: .same(proto: "names"),
  339. 3: .standard(proto: "extra_keys"),
  340. 2: .same(proto: "headers"),
  341. 4: .standard(proto: "constant_keys"),
  342. ]
  343. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  344. while let fieldNumber = try decoder.nextFieldNumber() {
  345. // The use of inline closures is to circumvent an issue where the compiler
  346. // allocates stack space for every case branch when no optimizations are
  347. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  348. switch fieldNumber {
  349. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.names) }()
  350. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.headers) }()
  351. case 3: try { try decoder.decodeSingularMessageField(value: &self._extraKeys) }()
  352. case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.constantKeys) }()
  353. default: break
  354. }
  355. }
  356. }
  357. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  358. // The use of inline closures is to circumvent an issue where the compiler
  359. // allocates stack space for every if/case branch local when no optimizations
  360. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  361. // https://github.com/apple/swift-protobuf/issues/1182
  362. if !self.names.isEmpty {
  363. try visitor.visitRepeatedMessageField(value: self.names, fieldNumber: 1)
  364. }
  365. if !self.headers.isEmpty {
  366. try visitor.visitRepeatedMessageField(value: self.headers, fieldNumber: 2)
  367. }
  368. try { if let v = self._extraKeys {
  369. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  370. } }()
  371. if !self.constantKeys.isEmpty {
  372. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.constantKeys, fieldNumber: 4)
  373. }
  374. try unknownFields.traverse(visitor: &visitor)
  375. }
  376. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder, rhs: Grpc_Lookup_V1_GrpcKeyBuilder) -> Bool {
  377. if lhs.names != rhs.names {return false}
  378. if lhs._extraKeys != rhs._extraKeys {return false}
  379. if lhs.headers != rhs.headers {return false}
  380. if lhs.constantKeys != rhs.constantKeys {return false}
  381. if lhs.unknownFields != rhs.unknownFields {return false}
  382. return true
  383. }
  384. }
  385. extension Grpc_Lookup_V1_GrpcKeyBuilder.Name: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  386. static let protoMessageName: String = Grpc_Lookup_V1_GrpcKeyBuilder.protoMessageName + ".Name"
  387. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  388. 1: .same(proto: "service"),
  389. 2: .same(proto: "method"),
  390. ]
  391. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  392. while let fieldNumber = try decoder.nextFieldNumber() {
  393. // The use of inline closures is to circumvent an issue where the compiler
  394. // allocates stack space for every case branch when no optimizations are
  395. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  396. switch fieldNumber {
  397. case 1: try { try decoder.decodeSingularStringField(value: &self.service) }()
  398. case 2: try { try decoder.decodeSingularStringField(value: &self.method) }()
  399. default: break
  400. }
  401. }
  402. }
  403. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  404. if !self.service.isEmpty {
  405. try visitor.visitSingularStringField(value: self.service, fieldNumber: 1)
  406. }
  407. if !self.method.isEmpty {
  408. try visitor.visitSingularStringField(value: self.method, fieldNumber: 2)
  409. }
  410. try unknownFields.traverse(visitor: &visitor)
  411. }
  412. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder.Name, rhs: Grpc_Lookup_V1_GrpcKeyBuilder.Name) -> Bool {
  413. if lhs.service != rhs.service {return false}
  414. if lhs.method != rhs.method {return false}
  415. if lhs.unknownFields != rhs.unknownFields {return false}
  416. return true
  417. }
  418. }
  419. extension Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  420. static let protoMessageName: String = Grpc_Lookup_V1_GrpcKeyBuilder.protoMessageName + ".ExtraKeys"
  421. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  422. 1: .same(proto: "host"),
  423. 2: .same(proto: "service"),
  424. 3: .same(proto: "method"),
  425. ]
  426. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  427. while let fieldNumber = try decoder.nextFieldNumber() {
  428. // The use of inline closures is to circumvent an issue where the compiler
  429. // allocates stack space for every case branch when no optimizations are
  430. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  431. switch fieldNumber {
  432. case 1: try { try decoder.decodeSingularStringField(value: &self.host) }()
  433. case 2: try { try decoder.decodeSingularStringField(value: &self.service) }()
  434. case 3: try { try decoder.decodeSingularStringField(value: &self.method) }()
  435. default: break
  436. }
  437. }
  438. }
  439. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  440. if !self.host.isEmpty {
  441. try visitor.visitSingularStringField(value: self.host, fieldNumber: 1)
  442. }
  443. if !self.service.isEmpty {
  444. try visitor.visitSingularStringField(value: self.service, fieldNumber: 2)
  445. }
  446. if !self.method.isEmpty {
  447. try visitor.visitSingularStringField(value: self.method, fieldNumber: 3)
  448. }
  449. try unknownFields.traverse(visitor: &visitor)
  450. }
  451. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys, rhs: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys) -> Bool {
  452. if lhs.host != rhs.host {return false}
  453. if lhs.service != rhs.service {return false}
  454. if lhs.method != rhs.method {return false}
  455. if lhs.unknownFields != rhs.unknownFields {return false}
  456. return true
  457. }
  458. }
  459. extension Grpc_Lookup_V1_HttpKeyBuilder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  460. static let protoMessageName: String = _protobuf_package + ".HttpKeyBuilder"
  461. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  462. 1: .standard(proto: "host_patterns"),
  463. 2: .standard(proto: "path_patterns"),
  464. 3: .standard(proto: "query_parameters"),
  465. 4: .same(proto: "headers"),
  466. 5: .standard(proto: "constant_keys"),
  467. ]
  468. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  469. while let fieldNumber = try decoder.nextFieldNumber() {
  470. // The use of inline closures is to circumvent an issue where the compiler
  471. // allocates stack space for every case branch when no optimizations are
  472. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  473. switch fieldNumber {
  474. case 1: try { try decoder.decodeRepeatedStringField(value: &self.hostPatterns) }()
  475. case 2: try { try decoder.decodeRepeatedStringField(value: &self.pathPatterns) }()
  476. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.queryParameters) }()
  477. case 4: try { try decoder.decodeRepeatedMessageField(value: &self.headers) }()
  478. case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.constantKeys) }()
  479. default: break
  480. }
  481. }
  482. }
  483. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  484. if !self.hostPatterns.isEmpty {
  485. try visitor.visitRepeatedStringField(value: self.hostPatterns, fieldNumber: 1)
  486. }
  487. if !self.pathPatterns.isEmpty {
  488. try visitor.visitRepeatedStringField(value: self.pathPatterns, fieldNumber: 2)
  489. }
  490. if !self.queryParameters.isEmpty {
  491. try visitor.visitRepeatedMessageField(value: self.queryParameters, fieldNumber: 3)
  492. }
  493. if !self.headers.isEmpty {
  494. try visitor.visitRepeatedMessageField(value: self.headers, fieldNumber: 4)
  495. }
  496. if !self.constantKeys.isEmpty {
  497. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.constantKeys, fieldNumber: 5)
  498. }
  499. try unknownFields.traverse(visitor: &visitor)
  500. }
  501. static func ==(lhs: Grpc_Lookup_V1_HttpKeyBuilder, rhs: Grpc_Lookup_V1_HttpKeyBuilder) -> Bool {
  502. if lhs.hostPatterns != rhs.hostPatterns {return false}
  503. if lhs.pathPatterns != rhs.pathPatterns {return false}
  504. if lhs.queryParameters != rhs.queryParameters {return false}
  505. if lhs.headers != rhs.headers {return false}
  506. if lhs.constantKeys != rhs.constantKeys {return false}
  507. if lhs.unknownFields != rhs.unknownFields {return false}
  508. return true
  509. }
  510. }
  511. extension Grpc_Lookup_V1_RouteLookupConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  512. static let protoMessageName: String = _protobuf_package + ".RouteLookupConfig"
  513. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  514. 1: .standard(proto: "http_keybuilders"),
  515. 2: .standard(proto: "grpc_keybuilders"),
  516. 3: .standard(proto: "lookup_service"),
  517. 4: .standard(proto: "lookup_service_timeout"),
  518. 5: .standard(proto: "max_age"),
  519. 6: .standard(proto: "stale_age"),
  520. 7: .standard(proto: "cache_size_bytes"),
  521. 8: .standard(proto: "valid_targets"),
  522. 9: .standard(proto: "default_target"),
  523. ]
  524. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  525. while let fieldNumber = try decoder.nextFieldNumber() {
  526. // The use of inline closures is to circumvent an issue where the compiler
  527. // allocates stack space for every case branch when no optimizations are
  528. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  529. switch fieldNumber {
  530. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.httpKeybuilders) }()
  531. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.grpcKeybuilders) }()
  532. case 3: try { try decoder.decodeSingularStringField(value: &self.lookupService) }()
  533. case 4: try { try decoder.decodeSingularMessageField(value: &self._lookupServiceTimeout) }()
  534. case 5: try { try decoder.decodeSingularMessageField(value: &self._maxAge) }()
  535. case 6: try { try decoder.decodeSingularMessageField(value: &self._staleAge) }()
  536. case 7: try { try decoder.decodeSingularInt64Field(value: &self.cacheSizeBytes) }()
  537. case 8: try { try decoder.decodeRepeatedStringField(value: &self.validTargets) }()
  538. case 9: try { try decoder.decodeSingularStringField(value: &self.defaultTarget) }()
  539. default: break
  540. }
  541. }
  542. }
  543. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  544. // The use of inline closures is to circumvent an issue where the compiler
  545. // allocates stack space for every if/case branch local when no optimizations
  546. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  547. // https://github.com/apple/swift-protobuf/issues/1182
  548. if !self.httpKeybuilders.isEmpty {
  549. try visitor.visitRepeatedMessageField(value: self.httpKeybuilders, fieldNumber: 1)
  550. }
  551. if !self.grpcKeybuilders.isEmpty {
  552. try visitor.visitRepeatedMessageField(value: self.grpcKeybuilders, fieldNumber: 2)
  553. }
  554. if !self.lookupService.isEmpty {
  555. try visitor.visitSingularStringField(value: self.lookupService, fieldNumber: 3)
  556. }
  557. try { if let v = self._lookupServiceTimeout {
  558. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  559. } }()
  560. try { if let v = self._maxAge {
  561. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  562. } }()
  563. try { if let v = self._staleAge {
  564. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  565. } }()
  566. if self.cacheSizeBytes != 0 {
  567. try visitor.visitSingularInt64Field(value: self.cacheSizeBytes, fieldNumber: 7)
  568. }
  569. if !self.validTargets.isEmpty {
  570. try visitor.visitRepeatedStringField(value: self.validTargets, fieldNumber: 8)
  571. }
  572. if !self.defaultTarget.isEmpty {
  573. try visitor.visitSingularStringField(value: self.defaultTarget, fieldNumber: 9)
  574. }
  575. try unknownFields.traverse(visitor: &visitor)
  576. }
  577. static func ==(lhs: Grpc_Lookup_V1_RouteLookupConfig, rhs: Grpc_Lookup_V1_RouteLookupConfig) -> Bool {
  578. if lhs.httpKeybuilders != rhs.httpKeybuilders {return false}
  579. if lhs.grpcKeybuilders != rhs.grpcKeybuilders {return false}
  580. if lhs.lookupService != rhs.lookupService {return false}
  581. if lhs._lookupServiceTimeout != rhs._lookupServiceTimeout {return false}
  582. if lhs._maxAge != rhs._maxAge {return false}
  583. if lhs._staleAge != rhs._staleAge {return false}
  584. if lhs.cacheSizeBytes != rhs.cacheSizeBytes {return false}
  585. if lhs.validTargets != rhs.validTargets {return false}
  586. if lhs.defaultTarget != rhs.defaultTarget {return false}
  587. if lhs.unknownFields != rhs.unknownFields {return false}
  588. return true
  589. }
  590. }
  591. extension Grpc_Lookup_V1_RouteLookupClusterSpecifier: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  592. static let protoMessageName: String = _protobuf_package + ".RouteLookupClusterSpecifier"
  593. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  594. 1: .standard(proto: "route_lookup_config"),
  595. ]
  596. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  597. while let fieldNumber = try decoder.nextFieldNumber() {
  598. // The use of inline closures is to circumvent an issue where the compiler
  599. // allocates stack space for every case branch when no optimizations are
  600. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  601. switch fieldNumber {
  602. case 1: try { try decoder.decodeSingularMessageField(value: &self._routeLookupConfig) }()
  603. default: break
  604. }
  605. }
  606. }
  607. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  608. // The use of inline closures is to circumvent an issue where the compiler
  609. // allocates stack space for every if/case branch local when no optimizations
  610. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  611. // https://github.com/apple/swift-protobuf/issues/1182
  612. try { if let v = self._routeLookupConfig {
  613. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  614. } }()
  615. try unknownFields.traverse(visitor: &visitor)
  616. }
  617. static func ==(lhs: Grpc_Lookup_V1_RouteLookupClusterSpecifier, rhs: Grpc_Lookup_V1_RouteLookupClusterSpecifier) -> Bool {
  618. if lhs._routeLookupConfig != rhs._routeLookupConfig {return false}
  619. if lhs.unknownFields != rhs.unknownFields {return false}
  620. return true
  621. }
  622. }