service_config.pb.swift 190 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165
  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/service_config/service_config.proto
  6. //
  7. // For information on using the generated types, please see the documentation:
  8. // https://github.com/apple/swift-protobuf/
  9. // Copyright 2016 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. // A ServiceConfig is supplied when a service is deployed. It mostly contains
  23. // parameters for how clients that connect to the service should behave (for
  24. // example, the load balancing policy to use to pick between service replicas).
  25. //
  26. // The configuration options provided here act as overrides to automatically
  27. // chosen option values. Service owners should be conservative in specifying
  28. // options as the system is likely to choose better values for these options in
  29. // the vast majority of cases. In other words, please specify a configuration
  30. // option only if you really have to, and avoid copy-paste inclusion of configs.
  31. //
  32. // Note that gRPC uses the service config in JSON form, not in protobuf
  33. // form. This proto definition is intended to help document the schema but
  34. // will not actually be used directly by gRPC.
  35. import Foundation
  36. import SwiftProtobuf
  37. // If the compiler emits an error on this type, it is because this file
  38. // was generated by a version of the `protoc` Swift plug-in that is
  39. // incompatible with the version of SwiftProtobuf to which you are linking.
  40. // Please ensure that you are building against the same version of the API
  41. // that was used to generate this file.
  42. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  43. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  44. typealias Version = _2
  45. }
  46. /// Configuration for a method.
  47. struct Grpc_ServiceConfig_MethodConfig {
  48. // SwiftProtobuf.Message conformance is added in an extension below. See the
  49. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  50. // methods supported on all messages.
  51. var name: [Grpc_ServiceConfig_MethodConfig.Name] = []
  52. /// Whether RPCs sent to this method should wait until the connection is
  53. /// ready by default. If false, the RPC will abort immediately if there is
  54. /// a transient failure connecting to the server. Otherwise, gRPC will
  55. /// attempt to connect until the deadline is exceeded.
  56. ///
  57. /// The value specified via the gRPC client API will override the value
  58. /// set here. However, note that setting the value in the client API will
  59. /// also affect transient errors encountered during name resolution, which
  60. /// cannot be caught by the value here, since the service config is
  61. /// obtained by the gRPC client via name resolution.
  62. var waitForReady: SwiftProtobuf.Google_Protobuf_BoolValue {
  63. get {return _waitForReady ?? SwiftProtobuf.Google_Protobuf_BoolValue()}
  64. set {_waitForReady = newValue}
  65. }
  66. /// Returns true if `waitForReady` has been explicitly set.
  67. var hasWaitForReady: Bool {return self._waitForReady != nil}
  68. /// Clears the value of `waitForReady`. Subsequent reads from it will return its default value.
  69. mutating func clearWaitForReady() {self._waitForReady = nil}
  70. /// The default timeout in seconds for RPCs sent to this method. This can be
  71. /// overridden in code. If no reply is received in the specified amount of
  72. /// time, the request is aborted and a DEADLINE_EXCEEDED error status
  73. /// is returned to the caller.
  74. ///
  75. /// The actual deadline used will be the minimum of the value specified here
  76. /// and the value set by the application via the gRPC client API. If either
  77. /// one is not set, then the other will be used. If neither is set, then the
  78. /// request has no deadline.
  79. var timeout: SwiftProtobuf.Google_Protobuf_Duration {
  80. get {return _timeout ?? SwiftProtobuf.Google_Protobuf_Duration()}
  81. set {_timeout = newValue}
  82. }
  83. /// Returns true if `timeout` has been explicitly set.
  84. var hasTimeout: Bool {return self._timeout != nil}
  85. /// Clears the value of `timeout`. Subsequent reads from it will return its default value.
  86. mutating func clearTimeout() {self._timeout = nil}
  87. /// The maximum allowed payload size for an individual request or object in a
  88. /// stream (client->server) in bytes. The size which is measured is the
  89. /// serialized payload after per-message compression (but before stream
  90. /// compression) in bytes. This applies both to streaming and non-streaming
  91. /// requests.
  92. ///
  93. /// The actual value used is the minimum of the value specified here and the
  94. /// value set by the application via the gRPC client API. If either one is
  95. /// not set, then the other will be used. If neither is set, then the
  96. /// built-in default is used.
  97. ///
  98. /// If a client attempts to send an object larger than this value, it will not
  99. /// be sent and the client will see a ClientError.
  100. /// Note that 0 is a valid value, meaning that the request message
  101. /// must be empty.
  102. var maxRequestMessageBytes: SwiftProtobuf.Google_Protobuf_UInt32Value {
  103. get {return _maxRequestMessageBytes ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  104. set {_maxRequestMessageBytes = newValue}
  105. }
  106. /// Returns true if `maxRequestMessageBytes` has been explicitly set.
  107. var hasMaxRequestMessageBytes: Bool {return self._maxRequestMessageBytes != nil}
  108. /// Clears the value of `maxRequestMessageBytes`. Subsequent reads from it will return its default value.
  109. mutating func clearMaxRequestMessageBytes() {self._maxRequestMessageBytes = nil}
  110. /// The maximum allowed payload size for an individual response or object in a
  111. /// stream (server->client) in bytes. The size which is measured is the
  112. /// serialized payload after per-message compression (but before stream
  113. /// compression) in bytes. This applies both to streaming and non-streaming
  114. /// requests.
  115. ///
  116. /// The actual value used is the minimum of the value specified here and the
  117. /// value set by the application via the gRPC client API. If either one is
  118. /// not set, then the other will be used. If neither is set, then the
  119. /// built-in default is used.
  120. ///
  121. /// If a server attempts to send an object larger than this value, it will not
  122. /// be sent, and a ServerError will be sent to the client instead.
  123. /// Note that 0 is a valid value, meaning that the response message
  124. /// must be empty.
  125. var maxResponseMessageBytes: SwiftProtobuf.Google_Protobuf_UInt32Value {
  126. get {return _maxResponseMessageBytes ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  127. set {_maxResponseMessageBytes = newValue}
  128. }
  129. /// Returns true if `maxResponseMessageBytes` has been explicitly set.
  130. var hasMaxResponseMessageBytes: Bool {return self._maxResponseMessageBytes != nil}
  131. /// Clears the value of `maxResponseMessageBytes`. Subsequent reads from it will return its default value.
  132. mutating func clearMaxResponseMessageBytes() {self._maxResponseMessageBytes = nil}
  133. /// Only one of retry_policy or hedging_policy may be set. If neither is set,
  134. /// RPCs will not be retried or hedged.
  135. var retryOrHedgingPolicy: Grpc_ServiceConfig_MethodConfig.OneOf_RetryOrHedgingPolicy? = nil
  136. var retryPolicy: Grpc_ServiceConfig_MethodConfig.RetryPolicy {
  137. get {
  138. if case .retryPolicy(let v)? = retryOrHedgingPolicy {return v}
  139. return Grpc_ServiceConfig_MethodConfig.RetryPolicy()
  140. }
  141. set {retryOrHedgingPolicy = .retryPolicy(newValue)}
  142. }
  143. var hedgingPolicy: Grpc_ServiceConfig_MethodConfig.HedgingPolicy {
  144. get {
  145. if case .hedgingPolicy(let v)? = retryOrHedgingPolicy {return v}
  146. return Grpc_ServiceConfig_MethodConfig.HedgingPolicy()
  147. }
  148. set {retryOrHedgingPolicy = .hedgingPolicy(newValue)}
  149. }
  150. var unknownFields = SwiftProtobuf.UnknownStorage()
  151. /// Only one of retry_policy or hedging_policy may be set. If neither is set,
  152. /// RPCs will not be retried or hedged.
  153. enum OneOf_RetryOrHedgingPolicy: Equatable {
  154. case retryPolicy(Grpc_ServiceConfig_MethodConfig.RetryPolicy)
  155. case hedgingPolicy(Grpc_ServiceConfig_MethodConfig.HedgingPolicy)
  156. #if !swift(>=4.1)
  157. static func ==(lhs: Grpc_ServiceConfig_MethodConfig.OneOf_RetryOrHedgingPolicy, rhs: Grpc_ServiceConfig_MethodConfig.OneOf_RetryOrHedgingPolicy) -> Bool {
  158. // The use of inline closures is to circumvent an issue where the compiler
  159. // allocates stack space for every case branch when no optimizations are
  160. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  161. switch (lhs, rhs) {
  162. case (.retryPolicy, .retryPolicy): return {
  163. guard case .retryPolicy(let l) = lhs, case .retryPolicy(let r) = rhs else { preconditionFailure() }
  164. return l == r
  165. }()
  166. case (.hedgingPolicy, .hedgingPolicy): return {
  167. guard case .hedgingPolicy(let l) = lhs, case .hedgingPolicy(let r) = rhs else { preconditionFailure() }
  168. return l == r
  169. }()
  170. default: return false
  171. }
  172. }
  173. #endif
  174. }
  175. /// The names of the methods to which this configuration applies.
  176. /// - MethodConfig without names (empty list) will be skipped.
  177. /// - Each name entry must be unique across the entire ServiceConfig.
  178. /// - If the 'method' field is empty, this MethodConfig specifies the defaults
  179. /// for all methods for the specified service.
  180. /// - If the 'service' field is empty, the 'method' field must be empty, and
  181. /// this MethodConfig specifies the default for all methods (it's the default
  182. /// config).
  183. ///
  184. /// When determining which MethodConfig to use for a given RPC, the most
  185. /// specific match wins. For example, let's say that the service config
  186. /// contains the following MethodConfig entries:
  187. ///
  188. /// method_config { name { } ... }
  189. /// method_config { name { service: "MyService" } ... }
  190. /// method_config { name { service: "MyService" method: "Foo" } ... }
  191. ///
  192. /// MyService/Foo will use the third entry, because it exactly matches the
  193. /// service and method name. MyService/Bar will use the second entry, because
  194. /// it provides the default for all methods of MyService. AnotherService/Baz
  195. /// will use the first entry, because it doesn't match the other two.
  196. ///
  197. /// In JSON representation, value "", value `null`, and not present are the
  198. /// same. The following are the same Name:
  199. /// - { "service": "s" }
  200. /// - { "service": "s", "method": null }
  201. /// - { "service": "s", "method": "" }
  202. struct Name {
  203. // SwiftProtobuf.Message conformance is added in an extension below. See the
  204. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  205. // methods supported on all messages.
  206. /// Required. Includes proto package name.
  207. var service: String = String()
  208. var method: String = String()
  209. var unknownFields = SwiftProtobuf.UnknownStorage()
  210. init() {}
  211. }
  212. /// The retry policy for outgoing RPCs.
  213. struct RetryPolicy {
  214. // SwiftProtobuf.Message conformance is added in an extension below. See the
  215. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  216. // methods supported on all messages.
  217. /// The maximum number of RPC attempts, including the original attempt.
  218. ///
  219. /// This field is required and must be greater than 1.
  220. /// Any value greater than 5 will be treated as if it were 5.
  221. var maxAttempts: UInt32 = 0
  222. /// Exponential backoff parameters. The initial retry attempt will occur at
  223. /// random(0, initial_backoff). In general, the nth attempt will occur at
  224. /// random(0,
  225. /// min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
  226. /// Required. Must be greater than zero.
  227. var initialBackoff: SwiftProtobuf.Google_Protobuf_Duration {
  228. get {return _initialBackoff ?? SwiftProtobuf.Google_Protobuf_Duration()}
  229. set {_initialBackoff = newValue}
  230. }
  231. /// Returns true if `initialBackoff` has been explicitly set.
  232. var hasInitialBackoff: Bool {return self._initialBackoff != nil}
  233. /// Clears the value of `initialBackoff`. Subsequent reads from it will return its default value.
  234. mutating func clearInitialBackoff() {self._initialBackoff = nil}
  235. /// Required. Must be greater than zero.
  236. var maxBackoff: SwiftProtobuf.Google_Protobuf_Duration {
  237. get {return _maxBackoff ?? SwiftProtobuf.Google_Protobuf_Duration()}
  238. set {_maxBackoff = newValue}
  239. }
  240. /// Returns true if `maxBackoff` has been explicitly set.
  241. var hasMaxBackoff: Bool {return self._maxBackoff != nil}
  242. /// Clears the value of `maxBackoff`. Subsequent reads from it will return its default value.
  243. mutating func clearMaxBackoff() {self._maxBackoff = nil}
  244. /// Required. Must be greater than zero.
  245. var backoffMultiplier: Float = 0
  246. /// The set of status codes which may be retried.
  247. ///
  248. /// This field is required and must be non-empty.
  249. var retryableStatusCodes: [Google_Rpc_Code] = []
  250. var unknownFields = SwiftProtobuf.UnknownStorage()
  251. init() {}
  252. fileprivate var _initialBackoff: SwiftProtobuf.Google_Protobuf_Duration? = nil
  253. fileprivate var _maxBackoff: SwiftProtobuf.Google_Protobuf_Duration? = nil
  254. }
  255. /// The hedging policy for outgoing RPCs. Hedged RPCs may execute more than
  256. /// once on the server, so only idempotent methods should specify a hedging
  257. /// policy.
  258. struct HedgingPolicy {
  259. // SwiftProtobuf.Message conformance is added in an extension below. See the
  260. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  261. // methods supported on all messages.
  262. /// The hedging policy will send up to max_requests RPCs.
  263. /// This number represents the total number of all attempts, including
  264. /// the original attempt.
  265. ///
  266. /// This field is required and must be greater than 1.
  267. /// Any value greater than 5 will be treated as if it were 5.
  268. var maxAttempts: UInt32 = 0
  269. /// The first RPC will be sent immediately, but the max_requests-1 subsequent
  270. /// hedged RPCs will be sent at intervals of every hedging_delay. Set this
  271. /// to 0 to immediately send all max_requests RPCs.
  272. var hedgingDelay: SwiftProtobuf.Google_Protobuf_Duration {
  273. get {return _hedgingDelay ?? SwiftProtobuf.Google_Protobuf_Duration()}
  274. set {_hedgingDelay = newValue}
  275. }
  276. /// Returns true if `hedgingDelay` has been explicitly set.
  277. var hasHedgingDelay: Bool {return self._hedgingDelay != nil}
  278. /// Clears the value of `hedgingDelay`. Subsequent reads from it will return its default value.
  279. mutating func clearHedgingDelay() {self._hedgingDelay = nil}
  280. /// The set of status codes which indicate other hedged RPCs may still
  281. /// succeed. If a non-fatal status code is returned by the server, hedged
  282. /// RPCs will continue. Otherwise, outstanding requests will be canceled and
  283. /// the error returned to the client application layer.
  284. ///
  285. /// This field is optional.
  286. var nonFatalStatusCodes: [Google_Rpc_Code] = []
  287. var unknownFields = SwiftProtobuf.UnknownStorage()
  288. init() {}
  289. fileprivate var _hedgingDelay: SwiftProtobuf.Google_Protobuf_Duration? = nil
  290. }
  291. init() {}
  292. fileprivate var _waitForReady: SwiftProtobuf.Google_Protobuf_BoolValue? = nil
  293. fileprivate var _timeout: SwiftProtobuf.Google_Protobuf_Duration? = nil
  294. fileprivate var _maxRequestMessageBytes: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  295. fileprivate var _maxResponseMessageBytes: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  296. }
  297. /// Configuration for pick_first LB policy.
  298. struct Grpc_ServiceConfig_PickFirstConfig {
  299. // SwiftProtobuf.Message conformance is added in an extension below. See the
  300. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  301. // methods supported on all messages.
  302. /// If set to true, instructs the LB policy to randomly shuffle the list of
  303. /// addresses received from the name resolver before attempting to connect to
  304. /// them.
  305. var shuffleAddressList: Bool = false
  306. var unknownFields = SwiftProtobuf.UnknownStorage()
  307. init() {}
  308. }
  309. /// Configuration for round_robin LB policy.
  310. struct Grpc_ServiceConfig_RoundRobinConfig {
  311. // SwiftProtobuf.Message conformance is added in an extension below. See the
  312. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  313. // methods supported on all messages.
  314. var unknownFields = SwiftProtobuf.UnknownStorage()
  315. init() {}
  316. }
  317. /// Configuration for weighted_round_robin LB policy.
  318. struct Grpc_ServiceConfig_WeightedRoundRobinLbConfig {
  319. // SwiftProtobuf.Message conformance is added in an extension below. See the
  320. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  321. // methods supported on all messages.
  322. /// Whether to enable out-of-band utilization reporting collection from
  323. /// the endpoints. By default, per-request utilization reporting is used.
  324. var enableOobLoadReport: SwiftProtobuf.Google_Protobuf_BoolValue {
  325. get {return _enableOobLoadReport ?? SwiftProtobuf.Google_Protobuf_BoolValue()}
  326. set {_enableOobLoadReport = newValue}
  327. }
  328. /// Returns true if `enableOobLoadReport` has been explicitly set.
  329. var hasEnableOobLoadReport: Bool {return self._enableOobLoadReport != nil}
  330. /// Clears the value of `enableOobLoadReport`. Subsequent reads from it will return its default value.
  331. mutating func clearEnableOobLoadReport() {self._enableOobLoadReport = nil}
  332. /// Load reporting interval to request from the server. Note that the
  333. /// server may not provide reports as frequently as the client requests.
  334. /// Used only when enable_oob_load_report is true. Default is 10 seconds.
  335. var oobReportingPeriod: SwiftProtobuf.Google_Protobuf_Duration {
  336. get {return _oobReportingPeriod ?? SwiftProtobuf.Google_Protobuf_Duration()}
  337. set {_oobReportingPeriod = newValue}
  338. }
  339. /// Returns true if `oobReportingPeriod` has been explicitly set.
  340. var hasOobReportingPeriod: Bool {return self._oobReportingPeriod != nil}
  341. /// Clears the value of `oobReportingPeriod`. Subsequent reads from it will return its default value.
  342. mutating func clearOobReportingPeriod() {self._oobReportingPeriod = nil}
  343. /// A given endpoint must report load metrics continuously for at least
  344. /// this long before the endpoint weight will be used. This avoids
  345. /// churn when the set of endpoint addresses changes. Takes effect
  346. /// both immediately after we establish a connection to an endpoint and
  347. /// after weight_expiration_period has caused us to stop using the most
  348. /// recent load metrics. Default is 10 seconds.
  349. var blackoutPeriod: SwiftProtobuf.Google_Protobuf_Duration {
  350. get {return _blackoutPeriod ?? SwiftProtobuf.Google_Protobuf_Duration()}
  351. set {_blackoutPeriod = newValue}
  352. }
  353. /// Returns true if `blackoutPeriod` has been explicitly set.
  354. var hasBlackoutPeriod: Bool {return self._blackoutPeriod != nil}
  355. /// Clears the value of `blackoutPeriod`. Subsequent reads from it will return its default value.
  356. mutating func clearBlackoutPeriod() {self._blackoutPeriod = nil}
  357. /// If a given endpoint has not reported load metrics in this long,
  358. /// then we stop using the reported weight. This ensures that we do
  359. /// not continue to use very stale weights. Once we stop using a stale
  360. /// value, if we later start seeing fresh reports again, the
  361. /// blackout_period applies. Defaults to 3 minutes.
  362. var weightExpirationPeriod: SwiftProtobuf.Google_Protobuf_Duration {
  363. get {return _weightExpirationPeriod ?? SwiftProtobuf.Google_Protobuf_Duration()}
  364. set {_weightExpirationPeriod = newValue}
  365. }
  366. /// Returns true if `weightExpirationPeriod` has been explicitly set.
  367. var hasWeightExpirationPeriod: Bool {return self._weightExpirationPeriod != nil}
  368. /// Clears the value of `weightExpirationPeriod`. Subsequent reads from it will return its default value.
  369. mutating func clearWeightExpirationPeriod() {self._weightExpirationPeriod = nil}
  370. /// How often endpoint weights are recalculated. Values less than 100ms are
  371. /// capped at 100ms. Default is 1 second.
  372. var weightUpdatePeriod: SwiftProtobuf.Google_Protobuf_Duration {
  373. get {return _weightUpdatePeriod ?? SwiftProtobuf.Google_Protobuf_Duration()}
  374. set {_weightUpdatePeriod = newValue}
  375. }
  376. /// Returns true if `weightUpdatePeriod` has been explicitly set.
  377. var hasWeightUpdatePeriod: Bool {return self._weightUpdatePeriod != nil}
  378. /// Clears the value of `weightUpdatePeriod`. Subsequent reads from it will return its default value.
  379. mutating func clearWeightUpdatePeriod() {self._weightUpdatePeriod = nil}
  380. /// The multiplier used to adjust endpoint weights with the error rate
  381. /// calculated as eps/qps. Configuration is rejected if this value is negative.
  382. /// Default is 1.0.
  383. var errorUtilizationPenalty: SwiftProtobuf.Google_Protobuf_FloatValue {
  384. get {return _errorUtilizationPenalty ?? SwiftProtobuf.Google_Protobuf_FloatValue()}
  385. set {_errorUtilizationPenalty = newValue}
  386. }
  387. /// Returns true if `errorUtilizationPenalty` has been explicitly set.
  388. var hasErrorUtilizationPenalty: Bool {return self._errorUtilizationPenalty != nil}
  389. /// Clears the value of `errorUtilizationPenalty`. Subsequent reads from it will return its default value.
  390. mutating func clearErrorUtilizationPenalty() {self._errorUtilizationPenalty = nil}
  391. var unknownFields = SwiftProtobuf.UnknownStorage()
  392. init() {}
  393. fileprivate var _enableOobLoadReport: SwiftProtobuf.Google_Protobuf_BoolValue? = nil
  394. fileprivate var _oobReportingPeriod: SwiftProtobuf.Google_Protobuf_Duration? = nil
  395. fileprivate var _blackoutPeriod: SwiftProtobuf.Google_Protobuf_Duration? = nil
  396. fileprivate var _weightExpirationPeriod: SwiftProtobuf.Google_Protobuf_Duration? = nil
  397. fileprivate var _weightUpdatePeriod: SwiftProtobuf.Google_Protobuf_Duration? = nil
  398. fileprivate var _errorUtilizationPenalty: SwiftProtobuf.Google_Protobuf_FloatValue? = nil
  399. }
  400. /// Configuration for outlier_detection LB policy
  401. struct Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig {
  402. // SwiftProtobuf.Message conformance is added in an extension below. See the
  403. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  404. // methods supported on all messages.
  405. /// The time interval between ejection analysis sweeps. This can result in
  406. /// both new ejections as well as addresses being returned to service. Defaults
  407. /// to 10000ms or 10s.
  408. var interval: SwiftProtobuf.Google_Protobuf_Duration {
  409. get {return _interval ?? SwiftProtobuf.Google_Protobuf_Duration()}
  410. set {_interval = newValue}
  411. }
  412. /// Returns true if `interval` has been explicitly set.
  413. var hasInterval: Bool {return self._interval != nil}
  414. /// Clears the value of `interval`. Subsequent reads from it will return its default value.
  415. mutating func clearInterval() {self._interval = nil}
  416. /// The base time that as address is ejected for. The real time is equal to the
  417. /// base time multiplied by the number of times the address has been ejected.
  418. /// Defaults to 30000ms or 30s.
  419. var baseEjectionTime: SwiftProtobuf.Google_Protobuf_Duration {
  420. get {return _baseEjectionTime ?? SwiftProtobuf.Google_Protobuf_Duration()}
  421. set {_baseEjectionTime = newValue}
  422. }
  423. /// Returns true if `baseEjectionTime` has been explicitly set.
  424. var hasBaseEjectionTime: Bool {return self._baseEjectionTime != nil}
  425. /// Clears the value of `baseEjectionTime`. Subsequent reads from it will return its default value.
  426. mutating func clearBaseEjectionTime() {self._baseEjectionTime = nil}
  427. /// The maximum time that an address is ejected for. If not specified, the default value (300000ms or 300s) or
  428. /// the base_ejection_time value is applied, whatever is larger.
  429. var maxEjectionTime: SwiftProtobuf.Google_Protobuf_Duration {
  430. get {return _maxEjectionTime ?? SwiftProtobuf.Google_Protobuf_Duration()}
  431. set {_maxEjectionTime = newValue}
  432. }
  433. /// Returns true if `maxEjectionTime` has been explicitly set.
  434. var hasMaxEjectionTime: Bool {return self._maxEjectionTime != nil}
  435. /// Clears the value of `maxEjectionTime`. Subsequent reads from it will return its default value.
  436. mutating func clearMaxEjectionTime() {self._maxEjectionTime = nil}
  437. /// The maximum % of an address list that can be ejected due to outlier
  438. /// detection. Defaults to 10% but will eject at least one address regardless of the value.
  439. var maxEjectionPercent: SwiftProtobuf.Google_Protobuf_UInt32Value {
  440. get {return _maxEjectionPercent ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  441. set {_maxEjectionPercent = newValue}
  442. }
  443. /// Returns true if `maxEjectionPercent` has been explicitly set.
  444. var hasMaxEjectionPercent: Bool {return self._maxEjectionPercent != nil}
  445. /// Clears the value of `maxEjectionPercent`. Subsequent reads from it will return its default value.
  446. mutating func clearMaxEjectionPercent() {self._maxEjectionPercent = nil}
  447. /// If set, success rate ejections will be performed
  448. var successRateEjection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection {
  449. get {return _successRateEjection ?? Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection()}
  450. set {_successRateEjection = newValue}
  451. }
  452. /// Returns true if `successRateEjection` has been explicitly set.
  453. var hasSuccessRateEjection: Bool {return self._successRateEjection != nil}
  454. /// Clears the value of `successRateEjection`. Subsequent reads from it will return its default value.
  455. mutating func clearSuccessRateEjection() {self._successRateEjection = nil}
  456. /// If set, failure rate ejections will be performed
  457. var failurePercentageEjection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection {
  458. get {return _failurePercentageEjection ?? Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection()}
  459. set {_failurePercentageEjection = newValue}
  460. }
  461. /// Returns true if `failurePercentageEjection` has been explicitly set.
  462. var hasFailurePercentageEjection: Bool {return self._failurePercentageEjection != nil}
  463. /// Clears the value of `failurePercentageEjection`. Subsequent reads from it will return its default value.
  464. mutating func clearFailurePercentageEjection() {self._failurePercentageEjection = nil}
  465. /// The config for the child policy
  466. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  467. var unknownFields = SwiftProtobuf.UnknownStorage()
  468. /// Parameters for the success rate ejection algorithm.
  469. /// This algorithm monitors the request success rate for all endpoints and
  470. /// ejects individual endpoints whose success rates are statistical outliers.
  471. struct SuccessRateEjection {
  472. // SwiftProtobuf.Message conformance is added in an extension below. See the
  473. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  474. // methods supported on all messages.
  475. /// This factor is used to determine the ejection threshold for success rate
  476. /// outlier ejection. The ejection threshold is the difference between the
  477. /// mean success rate, and the product of this factor and the standard
  478. /// deviation of the mean success rate: mean - (stdev *
  479. /// success_rate_stdev_factor). This factor is divided by a thousand to get a
  480. /// double. That is, if the desired factor is 1.9, the runtime value should
  481. /// be 1900. Defaults to 1900.
  482. var stdevFactor: SwiftProtobuf.Google_Protobuf_UInt32Value {
  483. get {return _stdevFactor ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  484. set {_stdevFactor = newValue}
  485. }
  486. /// Returns true if `stdevFactor` has been explicitly set.
  487. var hasStdevFactor: Bool {return self._stdevFactor != nil}
  488. /// Clears the value of `stdevFactor`. Subsequent reads from it will return its default value.
  489. mutating func clearStdevFactor() {self._stdevFactor = nil}
  490. /// The % chance that an address will be actually ejected when an outlier status
  491. /// is detected through success rate statistics. This setting can be used to
  492. /// disable ejection or to ramp it up slowly. Defaults to 100.
  493. var enforcementPercentage: SwiftProtobuf.Google_Protobuf_UInt32Value {
  494. get {return _enforcementPercentage ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  495. set {_enforcementPercentage = newValue}
  496. }
  497. /// Returns true if `enforcementPercentage` has been explicitly set.
  498. var hasEnforcementPercentage: Bool {return self._enforcementPercentage != nil}
  499. /// Clears the value of `enforcementPercentage`. Subsequent reads from it will return its default value.
  500. mutating func clearEnforcementPercentage() {self._enforcementPercentage = nil}
  501. /// The number of addresses that must have enough request volume to
  502. /// detect success rate outliers. If the number of addresses is less than this
  503. /// setting, outlier detection via success rate statistics is not performed
  504. /// for any addresses. Defaults to 5.
  505. var minimumHosts: SwiftProtobuf.Google_Protobuf_UInt32Value {
  506. get {return _minimumHosts ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  507. set {_minimumHosts = newValue}
  508. }
  509. /// Returns true if `minimumHosts` has been explicitly set.
  510. var hasMinimumHosts: Bool {return self._minimumHosts != nil}
  511. /// Clears the value of `minimumHosts`. Subsequent reads from it will return its default value.
  512. mutating func clearMinimumHosts() {self._minimumHosts = nil}
  513. /// The minimum number of total requests that must be collected in one
  514. /// interval (as defined by the interval duration above) to include this address
  515. /// in success rate based outlier detection. If the volume is lower than this
  516. /// setting, outlier detection via success rate statistics is not performed
  517. /// for that address. Defaults to 100.
  518. var requestVolume: SwiftProtobuf.Google_Protobuf_UInt32Value {
  519. get {return _requestVolume ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  520. set {_requestVolume = newValue}
  521. }
  522. /// Returns true if `requestVolume` has been explicitly set.
  523. var hasRequestVolume: Bool {return self._requestVolume != nil}
  524. /// Clears the value of `requestVolume`. Subsequent reads from it will return its default value.
  525. mutating func clearRequestVolume() {self._requestVolume = nil}
  526. var unknownFields = SwiftProtobuf.UnknownStorage()
  527. init() {}
  528. fileprivate var _stdevFactor: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  529. fileprivate var _enforcementPercentage: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  530. fileprivate var _minimumHosts: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  531. fileprivate var _requestVolume: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  532. }
  533. /// Parameters for the failure percentage algorithm.
  534. /// This algorithm ejects individual endpoints whose failure rate is greater than
  535. /// some threshold, independently of any other endpoint.
  536. struct FailurePercentageEjection {
  537. // SwiftProtobuf.Message conformance is added in an extension below. See the
  538. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  539. // methods supported on all messages.
  540. /// The failure percentage to use when determining failure percentage-based outlier detection. If
  541. /// the failure percentage of a given address is greater than or equal to this value, it will be
  542. /// ejected. Defaults to 85.
  543. var threshold: SwiftProtobuf.Google_Protobuf_UInt32Value {
  544. get {return _threshold ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  545. set {_threshold = newValue}
  546. }
  547. /// Returns true if `threshold` has been explicitly set.
  548. var hasThreshold: Bool {return self._threshold != nil}
  549. /// Clears the value of `threshold`. Subsequent reads from it will return its default value.
  550. mutating func clearThreshold() {self._threshold = nil}
  551. /// The % chance that an address will be actually ejected when an outlier status is detected through
  552. /// failure percentage statistics. This setting can be used to disable ejection or to ramp it up
  553. /// slowly. Defaults to 100.
  554. var enforcementPercentage: SwiftProtobuf.Google_Protobuf_UInt32Value {
  555. get {return _enforcementPercentage ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  556. set {_enforcementPercentage = newValue}
  557. }
  558. /// Returns true if `enforcementPercentage` has been explicitly set.
  559. var hasEnforcementPercentage: Bool {return self._enforcementPercentage != nil}
  560. /// Clears the value of `enforcementPercentage`. Subsequent reads from it will return its default value.
  561. mutating func clearEnforcementPercentage() {self._enforcementPercentage = nil}
  562. /// The minimum number of addresses in order to perform failure percentage-based ejection.
  563. /// If the total number of addresses is less than this value, failure percentage-based
  564. /// ejection will not be performed. Defaults to 5.
  565. var minimumHosts: SwiftProtobuf.Google_Protobuf_UInt32Value {
  566. get {return _minimumHosts ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  567. set {_minimumHosts = newValue}
  568. }
  569. /// Returns true if `minimumHosts` has been explicitly set.
  570. var hasMinimumHosts: Bool {return self._minimumHosts != nil}
  571. /// Clears the value of `minimumHosts`. Subsequent reads from it will return its default value.
  572. mutating func clearMinimumHosts() {self._minimumHosts = nil}
  573. /// The minimum number of total requests that must be collected in one interval (as defined by the
  574. /// interval duration above) to perform failure percentage-based ejection for this address. If the
  575. /// volume is lower than this setting, failure percentage-based ejection will not be performed for
  576. /// this host. Defaults to 50.
  577. var requestVolume: SwiftProtobuf.Google_Protobuf_UInt32Value {
  578. get {return _requestVolume ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  579. set {_requestVolume = newValue}
  580. }
  581. /// Returns true if `requestVolume` has been explicitly set.
  582. var hasRequestVolume: Bool {return self._requestVolume != nil}
  583. /// Clears the value of `requestVolume`. Subsequent reads from it will return its default value.
  584. mutating func clearRequestVolume() {self._requestVolume = nil}
  585. var unknownFields = SwiftProtobuf.UnknownStorage()
  586. init() {}
  587. fileprivate var _threshold: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  588. fileprivate var _enforcementPercentage: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  589. fileprivate var _minimumHosts: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  590. fileprivate var _requestVolume: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  591. }
  592. init() {}
  593. fileprivate var _interval: SwiftProtobuf.Google_Protobuf_Duration? = nil
  594. fileprivate var _baseEjectionTime: SwiftProtobuf.Google_Protobuf_Duration? = nil
  595. fileprivate var _maxEjectionTime: SwiftProtobuf.Google_Protobuf_Duration? = nil
  596. fileprivate var _maxEjectionPercent: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  597. fileprivate var _successRateEjection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection? = nil
  598. fileprivate var _failurePercentageEjection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection? = nil
  599. }
  600. /// Configuration for grpclb LB policy.
  601. struct Grpc_ServiceConfig_GrpcLbConfig {
  602. // SwiftProtobuf.Message conformance is added in an extension below. See the
  603. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  604. // methods supported on all messages.
  605. /// Optional. What LB policy to use for routing between the backend
  606. /// addresses. If unset, defaults to round_robin.
  607. /// Currently, the only supported values are round_robin and pick_first.
  608. /// Note that this will be used both in balancer mode and in fallback mode.
  609. /// Multiple LB policies can be specified; clients will iterate through
  610. /// the list in order and stop at the first policy that they support.
  611. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  612. /// Optional. If specified, overrides the name of the service to be sent to
  613. /// the balancer.
  614. var serviceName: String = String()
  615. /// Optional. The timeout in seconds for receiving the server list from the LB
  616. /// server. Defaults to 10s.
  617. var initialFallbackTimeout: SwiftProtobuf.Google_Protobuf_Duration {
  618. get {return _initialFallbackTimeout ?? SwiftProtobuf.Google_Protobuf_Duration()}
  619. set {_initialFallbackTimeout = newValue}
  620. }
  621. /// Returns true if `initialFallbackTimeout` has been explicitly set.
  622. var hasInitialFallbackTimeout: Bool {return self._initialFallbackTimeout != nil}
  623. /// Clears the value of `initialFallbackTimeout`. Subsequent reads from it will return its default value.
  624. mutating func clearInitialFallbackTimeout() {self._initialFallbackTimeout = nil}
  625. var unknownFields = SwiftProtobuf.UnknownStorage()
  626. init() {}
  627. fileprivate var _initialFallbackTimeout: SwiftProtobuf.Google_Protobuf_Duration? = nil
  628. }
  629. /// Configuration for priority LB policy.
  630. struct Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig {
  631. // SwiftProtobuf.Message conformance is added in an extension below. See the
  632. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  633. // methods supported on all messages.
  634. var children: Dictionary<String,Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child> = [:]
  635. /// A list of child names in decreasing priority order
  636. /// (i.e., first element is the highest priority).
  637. var priorities: [String] = []
  638. var unknownFields = SwiftProtobuf.UnknownStorage()
  639. /// A map of name to child policy configuration.
  640. /// The names are used to allow the priority policy to update
  641. /// existing child policies instead of creating new ones every
  642. /// time it receives a config update.
  643. struct Child {
  644. // SwiftProtobuf.Message conformance is added in an extension below. See the
  645. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  646. // methods supported on all messages.
  647. var config: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  648. /// If true, will ignore reresolution requests from this child.
  649. var ignoreReresolutionRequests: Bool = false
  650. var unknownFields = SwiftProtobuf.UnknownStorage()
  651. init() {}
  652. }
  653. init() {}
  654. }
  655. /// Configuration for weighted_target LB policy.
  656. struct Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig {
  657. // SwiftProtobuf.Message conformance is added in an extension below. See the
  658. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  659. // methods supported on all messages.
  660. var targets: Dictionary<String,Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target> = [:]
  661. var unknownFields = SwiftProtobuf.UnknownStorage()
  662. struct Target {
  663. // SwiftProtobuf.Message conformance is added in an extension below. See the
  664. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  665. // methods supported on all messages.
  666. var weight: UInt32 = 0
  667. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  668. var unknownFields = SwiftProtobuf.UnknownStorage()
  669. init() {}
  670. }
  671. init() {}
  672. }
  673. /// Config for RLS LB policy.
  674. struct Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig {
  675. // SwiftProtobuf.Message conformance is added in an extension below. See the
  676. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  677. // methods supported on all messages.
  678. var routeLookupConfig: Grpc_Lookup_V1_RouteLookupConfig {
  679. get {return _storage._routeLookupConfig ?? Grpc_Lookup_V1_RouteLookupConfig()}
  680. set {_uniqueStorage()._routeLookupConfig = newValue}
  681. }
  682. /// Returns true if `routeLookupConfig` has been explicitly set.
  683. var hasRouteLookupConfig: Bool {return _storage._routeLookupConfig != nil}
  684. /// Clears the value of `routeLookupConfig`. Subsequent reads from it will return its default value.
  685. mutating func clearRouteLookupConfig() {_uniqueStorage()._routeLookupConfig = nil}
  686. /// Service config to use for the RLS channel.
  687. var routeLookupChannelServiceConfig: Grpc_ServiceConfig_ServiceConfig {
  688. get {return _storage._routeLookupChannelServiceConfig ?? Grpc_ServiceConfig_ServiceConfig()}
  689. set {_uniqueStorage()._routeLookupChannelServiceConfig = newValue}
  690. }
  691. /// Returns true if `routeLookupChannelServiceConfig` has been explicitly set.
  692. var hasRouteLookupChannelServiceConfig: Bool {return _storage._routeLookupChannelServiceConfig != nil}
  693. /// Clears the value of `routeLookupChannelServiceConfig`. Subsequent reads from it will return its default value.
  694. mutating func clearRouteLookupChannelServiceConfig() {_uniqueStorage()._routeLookupChannelServiceConfig = nil}
  695. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] {
  696. get {return _storage._childPolicy}
  697. set {_uniqueStorage()._childPolicy = newValue}
  698. }
  699. /// Field name to add to child policy config to contain the target name.
  700. var childPolicyConfigTargetFieldName: String {
  701. get {return _storage._childPolicyConfigTargetFieldName}
  702. set {_uniqueStorage()._childPolicyConfigTargetFieldName = newValue}
  703. }
  704. var unknownFields = SwiftProtobuf.UnknownStorage()
  705. init() {}
  706. fileprivate var _storage = _StorageClass.defaultInstance
  707. }
  708. /// Configuration for xds_cluster_manager_experimental LB policy.
  709. struct Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig {
  710. // SwiftProtobuf.Message conformance is added in an extension below. See the
  711. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  712. // methods supported on all messages.
  713. var children: Dictionary<String,Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child> = [:]
  714. var unknownFields = SwiftProtobuf.UnknownStorage()
  715. struct Child {
  716. // SwiftProtobuf.Message conformance is added in an extension below. See the
  717. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  718. // methods supported on all messages.
  719. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  720. var unknownFields = SwiftProtobuf.UnknownStorage()
  721. init() {}
  722. }
  723. init() {}
  724. }
  725. /// Configuration for the cds LB policy.
  726. struct Grpc_ServiceConfig_CdsConfig {
  727. // SwiftProtobuf.Message conformance is added in an extension below. See the
  728. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  729. // methods supported on all messages.
  730. /// Required.
  731. var cluster: String = String()
  732. var unknownFields = SwiftProtobuf.UnknownStorage()
  733. init() {}
  734. }
  735. /// Represents an xDS server.
  736. struct Grpc_ServiceConfig_XdsServer {
  737. // SwiftProtobuf.Message conformance is added in an extension below. See the
  738. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  739. // methods supported on all messages.
  740. /// Required.
  741. var serverUri: String = String()
  742. /// A list of channel creds to use. The first supported type will be used.
  743. var channelCreds: [Grpc_ServiceConfig_XdsServer.ChannelCredentials] = []
  744. /// A repeated list of server features.
  745. var serverFeatures: [SwiftProtobuf.Google_Protobuf_Value] = []
  746. var unknownFields = SwiftProtobuf.UnknownStorage()
  747. struct ChannelCredentials {
  748. // SwiftProtobuf.Message conformance is added in an extension below. See the
  749. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  750. // methods supported on all messages.
  751. /// Required.
  752. var type: String = String()
  753. /// Optional JSON config.
  754. var config: SwiftProtobuf.Google_Protobuf_Struct {
  755. get {return _config ?? SwiftProtobuf.Google_Protobuf_Struct()}
  756. set {_config = newValue}
  757. }
  758. /// Returns true if `config` has been explicitly set.
  759. var hasConfig: Bool {return self._config != nil}
  760. /// Clears the value of `config`. Subsequent reads from it will return its default value.
  761. mutating func clearConfig() {self._config = nil}
  762. var unknownFields = SwiftProtobuf.UnknownStorage()
  763. init() {}
  764. fileprivate var _config: SwiftProtobuf.Google_Protobuf_Struct? = nil
  765. }
  766. init() {}
  767. }
  768. /// Configuration for xds_cluster_resolver LB policy.
  769. struct Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig {
  770. // SwiftProtobuf.Message conformance is added in an extension below. See the
  771. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  772. // methods supported on all messages.
  773. /// Ordered list of discovery mechanisms.
  774. /// Must have at least one element.
  775. /// Results from each discovery mechanism are concatenated together in
  776. /// successive priorities.
  777. var discoveryMechanisms: [Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism] = []
  778. /// xDS LB policy. Will be used as the child config of the xds_cluster_impl LB policy.
  779. var xdsLbPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  780. var unknownFields = SwiftProtobuf.UnknownStorage()
  781. /// Describes a discovery mechanism instance.
  782. /// For EDS or LOGICAL_DNS clusters, there will be exactly one
  783. /// DiscoveryMechanism, which will describe the cluster of the parent
  784. /// CDS policy.
  785. /// For aggregate clusters, there will be one DiscoveryMechanism for each
  786. /// underlying cluster.
  787. struct DiscoveryMechanism {
  788. // SwiftProtobuf.Message conformance is added in an extension below. See the
  789. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  790. // methods supported on all messages.
  791. /// Cluster name.
  792. var cluster: String {
  793. get {return _storage._cluster}
  794. set {_uniqueStorage()._cluster = newValue}
  795. }
  796. /// LRS server to send load reports to.
  797. /// If not present, load reporting will be disabled.
  798. /// If set to the empty string, load reporting will be sent to the same
  799. /// server that we obtained CDS data from.
  800. /// DEPRECATED: Use new lrs_load_reporting_server field instead.
  801. var lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue {
  802. get {return _storage._lrsLoadReportingServerName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  803. set {_uniqueStorage()._lrsLoadReportingServerName = newValue}
  804. }
  805. /// Returns true if `lrsLoadReportingServerName` has been explicitly set.
  806. var hasLrsLoadReportingServerName: Bool {return _storage._lrsLoadReportingServerName != nil}
  807. /// Clears the value of `lrsLoadReportingServerName`. Subsequent reads from it will return its default value.
  808. mutating func clearLrsLoadReportingServerName() {_uniqueStorage()._lrsLoadReportingServerName = nil}
  809. /// LRS server to send load reports to.
  810. /// If not present, load reporting will be disabled.
  811. /// Supercedes lrs_load_reporting_server_name field.
  812. var lrsLoadReportingServer: Grpc_ServiceConfig_XdsServer {
  813. get {return _storage._lrsLoadReportingServer ?? Grpc_ServiceConfig_XdsServer()}
  814. set {_uniqueStorage()._lrsLoadReportingServer = newValue}
  815. }
  816. /// Returns true if `lrsLoadReportingServer` has been explicitly set.
  817. var hasLrsLoadReportingServer: Bool {return _storage._lrsLoadReportingServer != nil}
  818. /// Clears the value of `lrsLoadReportingServer`. Subsequent reads from it will return its default value.
  819. mutating func clearLrsLoadReportingServer() {_uniqueStorage()._lrsLoadReportingServer = nil}
  820. /// Maximum number of outstanding requests can be made to the upstream
  821. /// cluster. Default is 1024.
  822. var maxConcurrentRequests: SwiftProtobuf.Google_Protobuf_UInt32Value {
  823. get {return _storage._maxConcurrentRequests ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  824. set {_uniqueStorage()._maxConcurrentRequests = newValue}
  825. }
  826. /// Returns true if `maxConcurrentRequests` has been explicitly set.
  827. var hasMaxConcurrentRequests: Bool {return _storage._maxConcurrentRequests != nil}
  828. /// Clears the value of `maxConcurrentRequests`. Subsequent reads from it will return its default value.
  829. mutating func clearMaxConcurrentRequests() {_uniqueStorage()._maxConcurrentRequests = nil}
  830. var type: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum {
  831. get {return _storage._type}
  832. set {_uniqueStorage()._type = newValue}
  833. }
  834. /// For type EDS only.
  835. /// EDS service name, as returned in CDS.
  836. /// May be unset if not specified in CDS.
  837. var edsServiceName: String {
  838. get {return _storage._edsServiceName}
  839. set {_uniqueStorage()._edsServiceName = newValue}
  840. }
  841. /// For type LOGICAL_DNS only.
  842. /// DNS name to resolve in "host:port" form.
  843. var dnsHostname: String {
  844. get {return _storage._dnsHostname}
  845. set {_uniqueStorage()._dnsHostname = newValue}
  846. }
  847. /// The configuration for outlier_detection child policies
  848. /// Within this message, the child_policy field will be ignored
  849. var outlierDetection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig {
  850. get {return _storage._outlierDetection ?? Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig()}
  851. set {_uniqueStorage()._outlierDetection = newValue}
  852. }
  853. /// Returns true if `outlierDetection` has been explicitly set.
  854. var hasOutlierDetection: Bool {return _storage._outlierDetection != nil}
  855. /// Clears the value of `outlierDetection`. Subsequent reads from it will return its default value.
  856. mutating func clearOutlierDetection() {_uniqueStorage()._outlierDetection = nil}
  857. /// The configuration for xds_override_host child policy
  858. var overrideHostStatus: [Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus] {
  859. get {return _storage._overrideHostStatus}
  860. set {_uniqueStorage()._overrideHostStatus = newValue}
  861. }
  862. /// Telemetry labels associated with this cluster
  863. var telemetryLabels: Dictionary<String,String> {
  864. get {return _storage._telemetryLabels}
  865. set {_uniqueStorage()._telemetryLabels = newValue}
  866. }
  867. var unknownFields = SwiftProtobuf.UnknownStorage()
  868. enum TypeEnum: SwiftProtobuf.Enum {
  869. typealias RawValue = Int
  870. case unknown // = 0
  871. case eds // = 1
  872. case logicalDns // = 2
  873. case UNRECOGNIZED(Int)
  874. init() {
  875. self = .unknown
  876. }
  877. init?(rawValue: Int) {
  878. switch rawValue {
  879. case 0: self = .unknown
  880. case 1: self = .eds
  881. case 2: self = .logicalDns
  882. default: self = .UNRECOGNIZED(rawValue)
  883. }
  884. }
  885. var rawValue: Int {
  886. switch self {
  887. case .unknown: return 0
  888. case .eds: return 1
  889. case .logicalDns: return 2
  890. case .UNRECOGNIZED(let i): return i
  891. }
  892. }
  893. }
  894. init() {}
  895. fileprivate var _storage = _StorageClass.defaultInstance
  896. }
  897. init() {}
  898. }
  899. #if swift(>=4.2)
  900. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum: CaseIterable {
  901. // The compiler won't synthesize support with the UNRECOGNIZED case.
  902. static let allCases: [Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum] = [
  903. .unknown,
  904. .eds,
  905. .logicalDns,
  906. ]
  907. }
  908. #endif // swift(>=4.2)
  909. /// Configuration for xds_cluster_impl LB policy.
  910. struct Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig {
  911. // SwiftProtobuf.Message conformance is added in an extension below. See the
  912. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  913. // methods supported on all messages.
  914. /// Cluster name. Required.
  915. var cluster: String = String()
  916. /// EDS service name.
  917. /// Not set if cluster is not an EDS cluster or if it does not
  918. /// specify an EDS service name.
  919. var edsServiceName: String = String()
  920. /// Server to send load reports to.
  921. /// If unset, no load reporting is done.
  922. /// If set to empty string, load reporting will be sent to the same
  923. /// server as we are getting xds data from.
  924. /// DEPRECATED: Use new lrs_load_reporting_server field instead.
  925. var lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue {
  926. get {return _lrsLoadReportingServerName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  927. set {_lrsLoadReportingServerName = newValue}
  928. }
  929. /// Returns true if `lrsLoadReportingServerName` has been explicitly set.
  930. var hasLrsLoadReportingServerName: Bool {return self._lrsLoadReportingServerName != nil}
  931. /// Clears the value of `lrsLoadReportingServerName`. Subsequent reads from it will return its default value.
  932. mutating func clearLrsLoadReportingServerName() {self._lrsLoadReportingServerName = nil}
  933. /// LRS server to send load reports to.
  934. /// If not present, load reporting will be disabled.
  935. /// Supercedes lrs_load_reporting_server_name field.
  936. var lrsLoadReportingServer: Grpc_ServiceConfig_XdsServer {
  937. get {return _lrsLoadReportingServer ?? Grpc_ServiceConfig_XdsServer()}
  938. set {_lrsLoadReportingServer = newValue}
  939. }
  940. /// Returns true if `lrsLoadReportingServer` has been explicitly set.
  941. var hasLrsLoadReportingServer: Bool {return self._lrsLoadReportingServer != nil}
  942. /// Clears the value of `lrsLoadReportingServer`. Subsequent reads from it will return its default value.
  943. mutating func clearLrsLoadReportingServer() {self._lrsLoadReportingServer = nil}
  944. /// Maximum number of outstanding requests can be made to the upstream cluster.
  945. /// Default is 1024.
  946. var maxConcurrentRequests: SwiftProtobuf.Google_Protobuf_UInt32Value {
  947. get {return _maxConcurrentRequests ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  948. set {_maxConcurrentRequests = newValue}
  949. }
  950. /// Returns true if `maxConcurrentRequests` has been explicitly set.
  951. var hasMaxConcurrentRequests: Bool {return self._maxConcurrentRequests != nil}
  952. /// Clears the value of `maxConcurrentRequests`. Subsequent reads from it will return its default value.
  953. mutating func clearMaxConcurrentRequests() {self._maxConcurrentRequests = nil}
  954. var dropCategories: [Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory] = []
  955. /// Child policy.
  956. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  957. /// Telemetry labels associated with this cluster
  958. var telemetryLabels: Dictionary<String,String> = [:]
  959. var unknownFields = SwiftProtobuf.UnknownStorage()
  960. /// Drop configuration.
  961. struct DropCategory {
  962. // SwiftProtobuf.Message conformance is added in an extension below. See the
  963. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  964. // methods supported on all messages.
  965. var category: String = String()
  966. var requestsPerMillion: UInt32 = 0
  967. var unknownFields = SwiftProtobuf.UnknownStorage()
  968. init() {}
  969. }
  970. init() {}
  971. fileprivate var _lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  972. fileprivate var _lrsLoadReportingServer: Grpc_ServiceConfig_XdsServer? = nil
  973. fileprivate var _maxConcurrentRequests: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  974. }
  975. /// Configuration for eds LB policy.
  976. struct Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig {
  977. // SwiftProtobuf.Message conformance is added in an extension below. See the
  978. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  979. // methods supported on all messages.
  980. /// Cluster name. Required.
  981. var cluster: String = String()
  982. /// EDS service name, as returned in CDS.
  983. /// May be unset if not specified in CDS.
  984. var edsServiceName: String = String()
  985. /// Server to send load reports to.
  986. /// If unset, no load reporting is done.
  987. /// If set to empty string, load reporting will be sent to the same
  988. /// server as we are getting xds data from.
  989. var lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue {
  990. get {return _lrsLoadReportingServerName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  991. set {_lrsLoadReportingServerName = newValue}
  992. }
  993. /// Returns true if `lrsLoadReportingServerName` has been explicitly set.
  994. var hasLrsLoadReportingServerName: Bool {return self._lrsLoadReportingServerName != nil}
  995. /// Clears the value of `lrsLoadReportingServerName`. Subsequent reads from it will return its default value.
  996. mutating func clearLrsLoadReportingServerName() {self._lrsLoadReportingServerName = nil}
  997. /// Locality-picking policy.
  998. /// This policy's config is expected to be in the format used
  999. /// by the weighted_target policy. Note that the config should include
  1000. /// an empty value for the "targets" field; that empty value will be
  1001. /// replaced by one that is dynamically generated based on the EDS data.
  1002. /// Optional; defaults to "weighted_target".
  1003. var localityPickingPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1004. /// Endpoint-picking policy.
  1005. /// This will be configured as the policy for each child in the
  1006. /// locality-policy's config.
  1007. /// Optional; defaults to "round_robin".
  1008. var endpointPickingPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1009. var unknownFields = SwiftProtobuf.UnknownStorage()
  1010. init() {}
  1011. fileprivate var _lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  1012. }
  1013. /// Configuration for ring_hash LB policy.
  1014. struct Grpc_ServiceConfig_RingHashLoadBalancingConfig {
  1015. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1016. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1017. // methods supported on all messages.
  1018. /// A client-side option will cap these values to 4096. If either of these
  1019. /// values are greater than the client-side cap, they will be treated
  1020. /// as the client-side cap value.
  1021. var minRingSize: UInt64 = 0
  1022. /// Optional, defaults to 4096, max 8M.
  1023. var maxRingSize: UInt64 = 0
  1024. var unknownFields = SwiftProtobuf.UnknownStorage()
  1025. init() {}
  1026. }
  1027. /// Configuration for lrs LB policy.
  1028. struct Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig {
  1029. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1030. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1031. // methods supported on all messages.
  1032. /// Cluster name. Required.
  1033. var clusterName: String = String()
  1034. /// EDS service name, as returned in CDS.
  1035. /// May be unset if not specified in CDS.
  1036. var edsServiceName: String = String()
  1037. /// Server to send load reports to. Required.
  1038. /// If set to empty string, load reporting will be sent to the same
  1039. /// server as we are getting xds data from.
  1040. var lrsLoadReportingServerName: String = String()
  1041. var locality: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality {
  1042. get {return _locality ?? Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality()}
  1043. set {_locality = newValue}
  1044. }
  1045. /// Returns true if `locality` has been explicitly set.
  1046. var hasLocality: Bool {return self._locality != nil}
  1047. /// Clears the value of `locality`. Subsequent reads from it will return its default value.
  1048. mutating func clearLocality() {self._locality = nil}
  1049. /// Endpoint-picking policy.
  1050. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1051. var unknownFields = SwiftProtobuf.UnknownStorage()
  1052. /// The locality for which this policy will report load. Required.
  1053. struct Locality {
  1054. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1055. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1056. // methods supported on all messages.
  1057. var region: String = String()
  1058. var zone: String = String()
  1059. var subzone: String = String()
  1060. var unknownFields = SwiftProtobuf.UnknownStorage()
  1061. init() {}
  1062. }
  1063. init() {}
  1064. fileprivate var _locality: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality? = nil
  1065. }
  1066. /// Configuration for the xds_wrr_locality load balancing policy.
  1067. struct Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig {
  1068. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1069. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1070. // methods supported on all messages.
  1071. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1072. var unknownFields = SwiftProtobuf.UnknownStorage()
  1073. init() {}
  1074. }
  1075. /// Configuration for the least_request LB policy.
  1076. struct Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig {
  1077. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1078. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1079. // methods supported on all messages.
  1080. var choiceCount: UInt64 = 0
  1081. var unknownFields = SwiftProtobuf.UnknownStorage()
  1082. init() {}
  1083. }
  1084. /// Configuration for the override_host LB policy.
  1085. struct Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig {
  1086. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1087. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1088. // methods supported on all messages.
  1089. /// valid health status for hosts that are considered when using
  1090. /// xds_override_host_experimental policy.
  1091. /// Default is [UNKNOWN, HEALTHY]
  1092. var overrideHostStatus: [Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus] = []
  1093. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1094. var unknownFields = SwiftProtobuf.UnknownStorage()
  1095. enum HealthStatus: SwiftProtobuf.Enum {
  1096. typealias RawValue = Int
  1097. case unknown // = 0
  1098. case healthy // = 1
  1099. case draining // = 3
  1100. case UNRECOGNIZED(Int)
  1101. init() {
  1102. self = .unknown
  1103. }
  1104. init?(rawValue: Int) {
  1105. switch rawValue {
  1106. case 0: self = .unknown
  1107. case 1: self = .healthy
  1108. case 3: self = .draining
  1109. default: self = .UNRECOGNIZED(rawValue)
  1110. }
  1111. }
  1112. var rawValue: Int {
  1113. switch self {
  1114. case .unknown: return 0
  1115. case .healthy: return 1
  1116. case .draining: return 3
  1117. case .UNRECOGNIZED(let i): return i
  1118. }
  1119. }
  1120. }
  1121. init() {}
  1122. }
  1123. #if swift(>=4.2)
  1124. extension Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus: CaseIterable {
  1125. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1126. static let allCases: [Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus] = [
  1127. .unknown,
  1128. .healthy,
  1129. .draining,
  1130. ]
  1131. }
  1132. #endif // swift(>=4.2)
  1133. /// Configuration for xds LB policy.
  1134. struct Grpc_ServiceConfig_XdsConfig {
  1135. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1136. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1137. // methods supported on all messages.
  1138. /// Name of balancer to connect to.
  1139. var balancerName: String = String()
  1140. /// Optional. What LB policy to use for intra-locality routing.
  1141. /// If unset, will use whatever algorithm is specified by the balancer.
  1142. /// Multiple LB policies can be specified; clients will iterate through
  1143. /// the list in order and stop at the first policy that they support.
  1144. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1145. /// Optional. What LB policy to use in fallback mode. If not
  1146. /// specified, defaults to round_robin.
  1147. /// Multiple LB policies can be specified; clients will iterate through
  1148. /// the list in order and stop at the first policy that they support.
  1149. var fallbackPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1150. /// Optional. Name to use in EDS query. If not present, defaults to
  1151. /// the server name from the target URI.
  1152. var edsServiceName: String = String()
  1153. /// LRS server to send load reports to.
  1154. /// If not present, load reporting will be disabled.
  1155. /// If set to the empty string, load reporting will be sent to the same
  1156. /// server that we obtained CDS data from.
  1157. var lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue {
  1158. get {return _lrsLoadReportingServerName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  1159. set {_lrsLoadReportingServerName = newValue}
  1160. }
  1161. /// Returns true if `lrsLoadReportingServerName` has been explicitly set.
  1162. var hasLrsLoadReportingServerName: Bool {return self._lrsLoadReportingServerName != nil}
  1163. /// Clears the value of `lrsLoadReportingServerName`. Subsequent reads from it will return its default value.
  1164. mutating func clearLrsLoadReportingServerName() {self._lrsLoadReportingServerName = nil}
  1165. var unknownFields = SwiftProtobuf.UnknownStorage()
  1166. init() {}
  1167. fileprivate var _lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  1168. }
  1169. /// Selects LB policy and provides corresponding configuration.
  1170. ///
  1171. /// In general, all instances of this field should be repeated. Clients will
  1172. /// iterate through the list in order and stop at the first policy that they
  1173. /// support. This allows the service config to specify custom policies that may
  1174. /// not be known to all clients.
  1175. ///
  1176. /// - If the config for the first supported policy is invalid, the whole service
  1177. /// config is invalid.
  1178. /// - If the list doesn't contain any supported policy, the whole service config
  1179. /// is invalid.
  1180. struct Grpc_ServiceConfig_LoadBalancingConfig {
  1181. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1182. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1183. // methods supported on all messages.
  1184. /// Exactly one LB policy may be configured.
  1185. var policy: Grpc_ServiceConfig_LoadBalancingConfig.OneOf_Policy? = nil
  1186. var pickFirst: Grpc_ServiceConfig_PickFirstConfig {
  1187. get {
  1188. if case .pickFirst(let v)? = policy {return v}
  1189. return Grpc_ServiceConfig_PickFirstConfig()
  1190. }
  1191. set {policy = .pickFirst(newValue)}
  1192. }
  1193. var roundRobin: Grpc_ServiceConfig_RoundRobinConfig {
  1194. get {
  1195. if case .roundRobin(let v)? = policy {return v}
  1196. return Grpc_ServiceConfig_RoundRobinConfig()
  1197. }
  1198. set {policy = .roundRobin(newValue)}
  1199. }
  1200. var weightedRoundRobin: Grpc_ServiceConfig_WeightedRoundRobinLbConfig {
  1201. get {
  1202. if case .weightedRoundRobin(let v)? = policy {return v}
  1203. return Grpc_ServiceConfig_WeightedRoundRobinLbConfig()
  1204. }
  1205. set {policy = .weightedRoundRobin(newValue)}
  1206. }
  1207. /// gRPC lookaside load balancing.
  1208. /// This will eventually be deprecated by the new xDS-based local
  1209. /// balancing policy.
  1210. var grpclb: Grpc_ServiceConfig_GrpcLbConfig {
  1211. get {
  1212. if case .grpclb(let v)? = policy {return v}
  1213. return Grpc_ServiceConfig_GrpcLbConfig()
  1214. }
  1215. set {policy = .grpclb(newValue)}
  1216. }
  1217. var priorityExperimental: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig {
  1218. get {
  1219. if case .priorityExperimental(let v)? = policy {return v}
  1220. return Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig()
  1221. }
  1222. set {policy = .priorityExperimental(newValue)}
  1223. }
  1224. var weightedTargetExperimental: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig {
  1225. get {
  1226. if case .weightedTargetExperimental(let v)? = policy {return v}
  1227. return Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig()
  1228. }
  1229. set {policy = .weightedTargetExperimental(newValue)}
  1230. }
  1231. var outlierDetection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig {
  1232. get {
  1233. if case .outlierDetection(let v)? = policy {return v}
  1234. return Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig()
  1235. }
  1236. set {policy = .outlierDetection(newValue)}
  1237. }
  1238. var rls: Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig {
  1239. get {
  1240. if case .rls(let v)? = policy {return v}
  1241. return Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig()
  1242. }
  1243. set {policy = .rls(newValue)}
  1244. }
  1245. /// xDS-based load balancing.
  1246. var xdsClusterManagerExperimental: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig {
  1247. get {
  1248. if case .xdsClusterManagerExperimental(let v)? = policy {return v}
  1249. return Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig()
  1250. }
  1251. set {policy = .xdsClusterManagerExperimental(newValue)}
  1252. }
  1253. var cdsExperimental: Grpc_ServiceConfig_CdsConfig {
  1254. get {
  1255. if case .cdsExperimental(let v)? = policy {return v}
  1256. return Grpc_ServiceConfig_CdsConfig()
  1257. }
  1258. set {policy = .cdsExperimental(newValue)}
  1259. }
  1260. var xdsClusterResolverExperimental: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig {
  1261. get {
  1262. if case .xdsClusterResolverExperimental(let v)? = policy {return v}
  1263. return Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig()
  1264. }
  1265. set {policy = .xdsClusterResolverExperimental(newValue)}
  1266. }
  1267. var xdsClusterImplExperimental: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig {
  1268. get {
  1269. if case .xdsClusterImplExperimental(let v)? = policy {return v}
  1270. return Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig()
  1271. }
  1272. set {policy = .xdsClusterImplExperimental(newValue)}
  1273. }
  1274. var overrideHostExperimental: Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig {
  1275. get {
  1276. if case .overrideHostExperimental(let v)? = policy {return v}
  1277. return Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig()
  1278. }
  1279. set {policy = .overrideHostExperimental(newValue)}
  1280. }
  1281. var xdsWrrLocalityExperimental: Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig {
  1282. get {
  1283. if case .xdsWrrLocalityExperimental(let v)? = policy {return v}
  1284. return Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig()
  1285. }
  1286. set {policy = .xdsWrrLocalityExperimental(newValue)}
  1287. }
  1288. var ringHashExperimental: Grpc_ServiceConfig_RingHashLoadBalancingConfig {
  1289. get {
  1290. if case .ringHashExperimental(let v)? = policy {return v}
  1291. return Grpc_ServiceConfig_RingHashLoadBalancingConfig()
  1292. }
  1293. set {policy = .ringHashExperimental(newValue)}
  1294. }
  1295. var leastRequestExperimental: Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig {
  1296. get {
  1297. if case .leastRequestExperimental(let v)? = policy {return v}
  1298. return Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig()
  1299. }
  1300. set {policy = .leastRequestExperimental(newValue)}
  1301. }
  1302. /// Deprecated xDS-related policies.
  1303. var lrsExperimental: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig {
  1304. get {
  1305. if case .lrsExperimental(let v)? = policy {return v}
  1306. return Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig()
  1307. }
  1308. set {policy = .lrsExperimental(newValue)}
  1309. }
  1310. var edsExperimental: Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig {
  1311. get {
  1312. if case .edsExperimental(let v)? = policy {return v}
  1313. return Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig()
  1314. }
  1315. set {policy = .edsExperimental(newValue)}
  1316. }
  1317. var xds: Grpc_ServiceConfig_XdsConfig {
  1318. get {
  1319. if case .xds(let v)? = policy {return v}
  1320. return Grpc_ServiceConfig_XdsConfig()
  1321. }
  1322. set {policy = .xds(newValue)}
  1323. }
  1324. var xdsExperimental: Grpc_ServiceConfig_XdsConfig {
  1325. get {
  1326. if case .xdsExperimental(let v)? = policy {return v}
  1327. return Grpc_ServiceConfig_XdsConfig()
  1328. }
  1329. set {policy = .xdsExperimental(newValue)}
  1330. }
  1331. var unknownFields = SwiftProtobuf.UnknownStorage()
  1332. /// Exactly one LB policy may be configured.
  1333. enum OneOf_Policy: Equatable {
  1334. case pickFirst(Grpc_ServiceConfig_PickFirstConfig)
  1335. case roundRobin(Grpc_ServiceConfig_RoundRobinConfig)
  1336. case weightedRoundRobin(Grpc_ServiceConfig_WeightedRoundRobinLbConfig)
  1337. /// gRPC lookaside load balancing.
  1338. /// This will eventually be deprecated by the new xDS-based local
  1339. /// balancing policy.
  1340. case grpclb(Grpc_ServiceConfig_GrpcLbConfig)
  1341. case priorityExperimental(Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig)
  1342. case weightedTargetExperimental(Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig)
  1343. case outlierDetection(Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig)
  1344. case rls(Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig)
  1345. /// xDS-based load balancing.
  1346. case xdsClusterManagerExperimental(Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig)
  1347. case cdsExperimental(Grpc_ServiceConfig_CdsConfig)
  1348. case xdsClusterResolverExperimental(Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig)
  1349. case xdsClusterImplExperimental(Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig)
  1350. case overrideHostExperimental(Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig)
  1351. case xdsWrrLocalityExperimental(Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig)
  1352. case ringHashExperimental(Grpc_ServiceConfig_RingHashLoadBalancingConfig)
  1353. case leastRequestExperimental(Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig)
  1354. /// Deprecated xDS-related policies.
  1355. case lrsExperimental(Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig)
  1356. case edsExperimental(Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig)
  1357. case xds(Grpc_ServiceConfig_XdsConfig)
  1358. case xdsExperimental(Grpc_ServiceConfig_XdsConfig)
  1359. #if !swift(>=4.1)
  1360. static func ==(lhs: Grpc_ServiceConfig_LoadBalancingConfig.OneOf_Policy, rhs: Grpc_ServiceConfig_LoadBalancingConfig.OneOf_Policy) -> Bool {
  1361. // The use of inline closures is to circumvent an issue where the compiler
  1362. // allocates stack space for every case branch when no optimizations are
  1363. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1364. switch (lhs, rhs) {
  1365. case (.pickFirst, .pickFirst): return {
  1366. guard case .pickFirst(let l) = lhs, case .pickFirst(let r) = rhs else { preconditionFailure() }
  1367. return l == r
  1368. }()
  1369. case (.roundRobin, .roundRobin): return {
  1370. guard case .roundRobin(let l) = lhs, case .roundRobin(let r) = rhs else { preconditionFailure() }
  1371. return l == r
  1372. }()
  1373. case (.weightedRoundRobin, .weightedRoundRobin): return {
  1374. guard case .weightedRoundRobin(let l) = lhs, case .weightedRoundRobin(let r) = rhs else { preconditionFailure() }
  1375. return l == r
  1376. }()
  1377. case (.grpclb, .grpclb): return {
  1378. guard case .grpclb(let l) = lhs, case .grpclb(let r) = rhs else { preconditionFailure() }
  1379. return l == r
  1380. }()
  1381. case (.priorityExperimental, .priorityExperimental): return {
  1382. guard case .priorityExperimental(let l) = lhs, case .priorityExperimental(let r) = rhs else { preconditionFailure() }
  1383. return l == r
  1384. }()
  1385. case (.weightedTargetExperimental, .weightedTargetExperimental): return {
  1386. guard case .weightedTargetExperimental(let l) = lhs, case .weightedTargetExperimental(let r) = rhs else { preconditionFailure() }
  1387. return l == r
  1388. }()
  1389. case (.outlierDetection, .outlierDetection): return {
  1390. guard case .outlierDetection(let l) = lhs, case .outlierDetection(let r) = rhs else { preconditionFailure() }
  1391. return l == r
  1392. }()
  1393. case (.rls, .rls): return {
  1394. guard case .rls(let l) = lhs, case .rls(let r) = rhs else { preconditionFailure() }
  1395. return l == r
  1396. }()
  1397. case (.xdsClusterManagerExperimental, .xdsClusterManagerExperimental): return {
  1398. guard case .xdsClusterManagerExperimental(let l) = lhs, case .xdsClusterManagerExperimental(let r) = rhs else { preconditionFailure() }
  1399. return l == r
  1400. }()
  1401. case (.cdsExperimental, .cdsExperimental): return {
  1402. guard case .cdsExperimental(let l) = lhs, case .cdsExperimental(let r) = rhs else { preconditionFailure() }
  1403. return l == r
  1404. }()
  1405. case (.xdsClusterResolverExperimental, .xdsClusterResolverExperimental): return {
  1406. guard case .xdsClusterResolverExperimental(let l) = lhs, case .xdsClusterResolverExperimental(let r) = rhs else { preconditionFailure() }
  1407. return l == r
  1408. }()
  1409. case (.xdsClusterImplExperimental, .xdsClusterImplExperimental): return {
  1410. guard case .xdsClusterImplExperimental(let l) = lhs, case .xdsClusterImplExperimental(let r) = rhs else { preconditionFailure() }
  1411. return l == r
  1412. }()
  1413. case (.overrideHostExperimental, .overrideHostExperimental): return {
  1414. guard case .overrideHostExperimental(let l) = lhs, case .overrideHostExperimental(let r) = rhs else { preconditionFailure() }
  1415. return l == r
  1416. }()
  1417. case (.xdsWrrLocalityExperimental, .xdsWrrLocalityExperimental): return {
  1418. guard case .xdsWrrLocalityExperimental(let l) = lhs, case .xdsWrrLocalityExperimental(let r) = rhs else { preconditionFailure() }
  1419. return l == r
  1420. }()
  1421. case (.ringHashExperimental, .ringHashExperimental): return {
  1422. guard case .ringHashExperimental(let l) = lhs, case .ringHashExperimental(let r) = rhs else { preconditionFailure() }
  1423. return l == r
  1424. }()
  1425. case (.leastRequestExperimental, .leastRequestExperimental): return {
  1426. guard case .leastRequestExperimental(let l) = lhs, case .leastRequestExperimental(let r) = rhs else { preconditionFailure() }
  1427. return l == r
  1428. }()
  1429. case (.lrsExperimental, .lrsExperimental): return {
  1430. guard case .lrsExperimental(let l) = lhs, case .lrsExperimental(let r) = rhs else { preconditionFailure() }
  1431. return l == r
  1432. }()
  1433. case (.edsExperimental, .edsExperimental): return {
  1434. guard case .edsExperimental(let l) = lhs, case .edsExperimental(let r) = rhs else { preconditionFailure() }
  1435. return l == r
  1436. }()
  1437. case (.xds, .xds): return {
  1438. guard case .xds(let l) = lhs, case .xds(let r) = rhs else { preconditionFailure() }
  1439. return l == r
  1440. }()
  1441. case (.xdsExperimental, .xdsExperimental): return {
  1442. guard case .xdsExperimental(let l) = lhs, case .xdsExperimental(let r) = rhs else { preconditionFailure() }
  1443. return l == r
  1444. }()
  1445. default: return false
  1446. }
  1447. }
  1448. #endif
  1449. }
  1450. init() {}
  1451. }
  1452. /// A ServiceConfig represents information about a service but is not specific to
  1453. /// any name resolver.
  1454. struct Grpc_ServiceConfig_ServiceConfig {
  1455. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1456. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1457. // methods supported on all messages.
  1458. var loadBalancingPolicy: Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy = .unspecified
  1459. /// Multiple LB policies can be specified; clients will iterate through
  1460. /// the list in order and stop at the first policy that they support. If none
  1461. /// are supported, the service config is considered invalid.
  1462. var loadBalancingConfig: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1463. /// Per-method configuration.
  1464. var methodConfig: [Grpc_ServiceConfig_MethodConfig] = []
  1465. var retryThrottling: Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy {
  1466. get {return _retryThrottling ?? Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy()}
  1467. set {_retryThrottling = newValue}
  1468. }
  1469. /// Returns true if `retryThrottling` has been explicitly set.
  1470. var hasRetryThrottling: Bool {return self._retryThrottling != nil}
  1471. /// Clears the value of `retryThrottling`. Subsequent reads from it will return its default value.
  1472. mutating func clearRetryThrottling() {self._retryThrottling = nil}
  1473. var healthCheckConfig: Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig {
  1474. get {return _healthCheckConfig ?? Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig()}
  1475. set {_healthCheckConfig = newValue}
  1476. }
  1477. /// Returns true if `healthCheckConfig` has been explicitly set.
  1478. var hasHealthCheckConfig: Bool {return self._healthCheckConfig != nil}
  1479. /// Clears the value of `healthCheckConfig`. Subsequent reads from it will return its default value.
  1480. mutating func clearHealthCheckConfig() {self._healthCheckConfig = nil}
  1481. var unknownFields = SwiftProtobuf.UnknownStorage()
  1482. /// Load balancing policy.
  1483. ///
  1484. /// Note that load_balancing_policy is deprecated in favor of
  1485. /// load_balancing_config; the former will be used only if the latter
  1486. /// is unset.
  1487. ///
  1488. /// If no LB policy is configured here, then the default is pick_first.
  1489. /// If the policy name is set via the client API, that value overrides
  1490. /// the value specified here.
  1491. ///
  1492. /// If the deprecated load_balancing_policy field is used, note that if the
  1493. /// resolver returns at least one balancer address (as opposed to backend
  1494. /// addresses), gRPC will use grpclb (see
  1495. /// https://github.com/grpc/grpc/blob/master/doc/load-balancing.md),
  1496. /// regardless of what policy is configured here. However, if the resolver
  1497. /// returns at least one backend address in addition to the balancer
  1498. /// address(es), the client may fall back to the requested policy if it
  1499. /// is unable to reach any of the grpclb load balancers.
  1500. enum LoadBalancingPolicy: SwiftProtobuf.Enum {
  1501. typealias RawValue = Int
  1502. case unspecified // = 0
  1503. case roundRobin // = 1
  1504. case UNRECOGNIZED(Int)
  1505. init() {
  1506. self = .unspecified
  1507. }
  1508. init?(rawValue: Int) {
  1509. switch rawValue {
  1510. case 0: self = .unspecified
  1511. case 1: self = .roundRobin
  1512. default: self = .UNRECOGNIZED(rawValue)
  1513. }
  1514. }
  1515. var rawValue: Int {
  1516. switch self {
  1517. case .unspecified: return 0
  1518. case .roundRobin: return 1
  1519. case .UNRECOGNIZED(let i): return i
  1520. }
  1521. }
  1522. }
  1523. /// If a RetryThrottlingPolicy is provided, gRPC will automatically throttle
  1524. /// retry attempts and hedged RPCs when the client's ratio of failures to
  1525. /// successes exceeds a threshold.
  1526. ///
  1527. /// For each server name, the gRPC client will maintain a token_count which is
  1528. /// initially set to max_tokens. Every outgoing RPC (regardless of service or
  1529. /// method invoked) will change token_count as follows:
  1530. ///
  1531. /// - Every failed RPC will decrement the token_count by 1.
  1532. /// - Every successful RPC will increment the token_count by token_ratio.
  1533. ///
  1534. /// If token_count is less than or equal to max_tokens / 2, then RPCs will not
  1535. /// be retried and hedged RPCs will not be sent.
  1536. struct RetryThrottlingPolicy {
  1537. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1538. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1539. // methods supported on all messages.
  1540. /// The number of tokens starts at max_tokens. The token_count will always be
  1541. /// between 0 and max_tokens.
  1542. ///
  1543. /// This field is required and must be greater than zero.
  1544. var maxTokens: UInt32 = 0
  1545. /// The amount of tokens to add on each successful RPC. Typically this will
  1546. /// be some number between 0 and 1, e.g., 0.1.
  1547. ///
  1548. /// This field is required and must be greater than zero. Up to 3 decimal
  1549. /// places are supported.
  1550. var tokenRatio: Float = 0
  1551. var unknownFields = SwiftProtobuf.UnknownStorage()
  1552. init() {}
  1553. }
  1554. struct HealthCheckConfig {
  1555. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1556. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1557. // methods supported on all messages.
  1558. /// Service name to use in the health-checking request.
  1559. var serviceName: SwiftProtobuf.Google_Protobuf_StringValue {
  1560. get {return _serviceName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  1561. set {_serviceName = newValue}
  1562. }
  1563. /// Returns true if `serviceName` has been explicitly set.
  1564. var hasServiceName: Bool {return self._serviceName != nil}
  1565. /// Clears the value of `serviceName`. Subsequent reads from it will return its default value.
  1566. mutating func clearServiceName() {self._serviceName = nil}
  1567. var unknownFields = SwiftProtobuf.UnknownStorage()
  1568. init() {}
  1569. fileprivate var _serviceName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  1570. }
  1571. init() {}
  1572. fileprivate var _retryThrottling: Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy? = nil
  1573. fileprivate var _healthCheckConfig: Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig? = nil
  1574. }
  1575. #if swift(>=4.2)
  1576. extension Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy: CaseIterable {
  1577. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1578. static let allCases: [Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy] = [
  1579. .unspecified,
  1580. .roundRobin,
  1581. ]
  1582. }
  1583. #endif // swift(>=4.2)
  1584. #if swift(>=5.5) && canImport(_Concurrency)
  1585. extension Grpc_ServiceConfig_MethodConfig: @unchecked Sendable {}
  1586. extension Grpc_ServiceConfig_MethodConfig.OneOf_RetryOrHedgingPolicy: @unchecked Sendable {}
  1587. extension Grpc_ServiceConfig_MethodConfig.Name: @unchecked Sendable {}
  1588. extension Grpc_ServiceConfig_MethodConfig.RetryPolicy: @unchecked Sendable {}
  1589. extension Grpc_ServiceConfig_MethodConfig.HedgingPolicy: @unchecked Sendable {}
  1590. extension Grpc_ServiceConfig_PickFirstConfig: @unchecked Sendable {}
  1591. extension Grpc_ServiceConfig_RoundRobinConfig: @unchecked Sendable {}
  1592. extension Grpc_ServiceConfig_WeightedRoundRobinLbConfig: @unchecked Sendable {}
  1593. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig: @unchecked Sendable {}
  1594. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection: @unchecked Sendable {}
  1595. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection: @unchecked Sendable {}
  1596. extension Grpc_ServiceConfig_GrpcLbConfig: @unchecked Sendable {}
  1597. extension Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig: @unchecked Sendable {}
  1598. extension Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child: @unchecked Sendable {}
  1599. extension Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig: @unchecked Sendable {}
  1600. extension Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target: @unchecked Sendable {}
  1601. extension Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig: @unchecked Sendable {}
  1602. extension Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig: @unchecked Sendable {}
  1603. extension Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child: @unchecked Sendable {}
  1604. extension Grpc_ServiceConfig_CdsConfig: @unchecked Sendable {}
  1605. extension Grpc_ServiceConfig_XdsServer: @unchecked Sendable {}
  1606. extension Grpc_ServiceConfig_XdsServer.ChannelCredentials: @unchecked Sendable {}
  1607. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig: @unchecked Sendable {}
  1608. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism: @unchecked Sendable {}
  1609. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum: @unchecked Sendable {}
  1610. extension Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig: @unchecked Sendable {}
  1611. extension Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory: @unchecked Sendable {}
  1612. extension Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig: @unchecked Sendable {}
  1613. extension Grpc_ServiceConfig_RingHashLoadBalancingConfig: @unchecked Sendable {}
  1614. extension Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig: @unchecked Sendable {}
  1615. extension Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality: @unchecked Sendable {}
  1616. extension Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig: @unchecked Sendable {}
  1617. extension Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig: @unchecked Sendable {}
  1618. extension Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig: @unchecked Sendable {}
  1619. extension Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus: @unchecked Sendable {}
  1620. extension Grpc_ServiceConfig_XdsConfig: @unchecked Sendable {}
  1621. extension Grpc_ServiceConfig_LoadBalancingConfig: @unchecked Sendable {}
  1622. extension Grpc_ServiceConfig_LoadBalancingConfig.OneOf_Policy: @unchecked Sendable {}
  1623. extension Grpc_ServiceConfig_ServiceConfig: @unchecked Sendable {}
  1624. extension Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy: @unchecked Sendable {}
  1625. extension Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy: @unchecked Sendable {}
  1626. extension Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig: @unchecked Sendable {}
  1627. #endif // swift(>=5.5) && canImport(_Concurrency)
  1628. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  1629. fileprivate let _protobuf_package = "grpc.service_config"
  1630. extension Grpc_ServiceConfig_MethodConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1631. static let protoMessageName: String = _protobuf_package + ".MethodConfig"
  1632. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1633. 1: .same(proto: "name"),
  1634. 2: .standard(proto: "wait_for_ready"),
  1635. 3: .same(proto: "timeout"),
  1636. 4: .standard(proto: "max_request_message_bytes"),
  1637. 5: .standard(proto: "max_response_message_bytes"),
  1638. 6: .standard(proto: "retry_policy"),
  1639. 7: .standard(proto: "hedging_policy"),
  1640. ]
  1641. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1642. while let fieldNumber = try decoder.nextFieldNumber() {
  1643. // The use of inline closures is to circumvent an issue where the compiler
  1644. // allocates stack space for every case branch when no optimizations are
  1645. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1646. switch fieldNumber {
  1647. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.name) }()
  1648. case 2: try { try decoder.decodeSingularMessageField(value: &self._waitForReady) }()
  1649. case 3: try { try decoder.decodeSingularMessageField(value: &self._timeout) }()
  1650. case 4: try { try decoder.decodeSingularMessageField(value: &self._maxRequestMessageBytes) }()
  1651. case 5: try { try decoder.decodeSingularMessageField(value: &self._maxResponseMessageBytes) }()
  1652. case 6: try {
  1653. var v: Grpc_ServiceConfig_MethodConfig.RetryPolicy?
  1654. var hadOneofValue = false
  1655. if let current = self.retryOrHedgingPolicy {
  1656. hadOneofValue = true
  1657. if case .retryPolicy(let m) = current {v = m}
  1658. }
  1659. try decoder.decodeSingularMessageField(value: &v)
  1660. if let v = v {
  1661. if hadOneofValue {try decoder.handleConflictingOneOf()}
  1662. self.retryOrHedgingPolicy = .retryPolicy(v)
  1663. }
  1664. }()
  1665. case 7: try {
  1666. var v: Grpc_ServiceConfig_MethodConfig.HedgingPolicy?
  1667. var hadOneofValue = false
  1668. if let current = self.retryOrHedgingPolicy {
  1669. hadOneofValue = true
  1670. if case .hedgingPolicy(let m) = current {v = m}
  1671. }
  1672. try decoder.decodeSingularMessageField(value: &v)
  1673. if let v = v {
  1674. if hadOneofValue {try decoder.handleConflictingOneOf()}
  1675. self.retryOrHedgingPolicy = .hedgingPolicy(v)
  1676. }
  1677. }()
  1678. default: break
  1679. }
  1680. }
  1681. }
  1682. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1683. // The use of inline closures is to circumvent an issue where the compiler
  1684. // allocates stack space for every if/case branch local when no optimizations
  1685. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1686. // https://github.com/apple/swift-protobuf/issues/1182
  1687. if !self.name.isEmpty {
  1688. try visitor.visitRepeatedMessageField(value: self.name, fieldNumber: 1)
  1689. }
  1690. try { if let v = self._waitForReady {
  1691. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  1692. } }()
  1693. try { if let v = self._timeout {
  1694. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  1695. } }()
  1696. try { if let v = self._maxRequestMessageBytes {
  1697. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  1698. } }()
  1699. try { if let v = self._maxResponseMessageBytes {
  1700. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  1701. } }()
  1702. switch self.retryOrHedgingPolicy {
  1703. case .retryPolicy?: try {
  1704. guard case .retryPolicy(let v)? = self.retryOrHedgingPolicy else { preconditionFailure() }
  1705. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  1706. }()
  1707. case .hedgingPolicy?: try {
  1708. guard case .hedgingPolicy(let v)? = self.retryOrHedgingPolicy else { preconditionFailure() }
  1709. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  1710. }()
  1711. case nil: break
  1712. }
  1713. try unknownFields.traverse(visitor: &visitor)
  1714. }
  1715. static func ==(lhs: Grpc_ServiceConfig_MethodConfig, rhs: Grpc_ServiceConfig_MethodConfig) -> Bool {
  1716. if lhs.name != rhs.name {return false}
  1717. if lhs._waitForReady != rhs._waitForReady {return false}
  1718. if lhs._timeout != rhs._timeout {return false}
  1719. if lhs._maxRequestMessageBytes != rhs._maxRequestMessageBytes {return false}
  1720. if lhs._maxResponseMessageBytes != rhs._maxResponseMessageBytes {return false}
  1721. if lhs.retryOrHedgingPolicy != rhs.retryOrHedgingPolicy {return false}
  1722. if lhs.unknownFields != rhs.unknownFields {return false}
  1723. return true
  1724. }
  1725. }
  1726. extension Grpc_ServiceConfig_MethodConfig.Name: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1727. static let protoMessageName: String = Grpc_ServiceConfig_MethodConfig.protoMessageName + ".Name"
  1728. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1729. 1: .same(proto: "service"),
  1730. 2: .same(proto: "method"),
  1731. ]
  1732. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1733. while let fieldNumber = try decoder.nextFieldNumber() {
  1734. // The use of inline closures is to circumvent an issue where the compiler
  1735. // allocates stack space for every case branch when no optimizations are
  1736. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1737. switch fieldNumber {
  1738. case 1: try { try decoder.decodeSingularStringField(value: &self.service) }()
  1739. case 2: try { try decoder.decodeSingularStringField(value: &self.method) }()
  1740. default: break
  1741. }
  1742. }
  1743. }
  1744. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1745. if !self.service.isEmpty {
  1746. try visitor.visitSingularStringField(value: self.service, fieldNumber: 1)
  1747. }
  1748. if !self.method.isEmpty {
  1749. try visitor.visitSingularStringField(value: self.method, fieldNumber: 2)
  1750. }
  1751. try unknownFields.traverse(visitor: &visitor)
  1752. }
  1753. static func ==(lhs: Grpc_ServiceConfig_MethodConfig.Name, rhs: Grpc_ServiceConfig_MethodConfig.Name) -> Bool {
  1754. if lhs.service != rhs.service {return false}
  1755. if lhs.method != rhs.method {return false}
  1756. if lhs.unknownFields != rhs.unknownFields {return false}
  1757. return true
  1758. }
  1759. }
  1760. extension Grpc_ServiceConfig_MethodConfig.RetryPolicy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1761. static let protoMessageName: String = Grpc_ServiceConfig_MethodConfig.protoMessageName + ".RetryPolicy"
  1762. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1763. 1: .standard(proto: "max_attempts"),
  1764. 2: .standard(proto: "initial_backoff"),
  1765. 3: .standard(proto: "max_backoff"),
  1766. 4: .standard(proto: "backoff_multiplier"),
  1767. 5: .standard(proto: "retryable_status_codes"),
  1768. ]
  1769. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1770. while let fieldNumber = try decoder.nextFieldNumber() {
  1771. // The use of inline closures is to circumvent an issue where the compiler
  1772. // allocates stack space for every case branch when no optimizations are
  1773. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1774. switch fieldNumber {
  1775. case 1: try { try decoder.decodeSingularUInt32Field(value: &self.maxAttempts) }()
  1776. case 2: try { try decoder.decodeSingularMessageField(value: &self._initialBackoff) }()
  1777. case 3: try { try decoder.decodeSingularMessageField(value: &self._maxBackoff) }()
  1778. case 4: try { try decoder.decodeSingularFloatField(value: &self.backoffMultiplier) }()
  1779. case 5: try { try decoder.decodeRepeatedEnumField(value: &self.retryableStatusCodes) }()
  1780. default: break
  1781. }
  1782. }
  1783. }
  1784. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1785. // The use of inline closures is to circumvent an issue where the compiler
  1786. // allocates stack space for every if/case branch local when no optimizations
  1787. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1788. // https://github.com/apple/swift-protobuf/issues/1182
  1789. if self.maxAttempts != 0 {
  1790. try visitor.visitSingularUInt32Field(value: self.maxAttempts, fieldNumber: 1)
  1791. }
  1792. try { if let v = self._initialBackoff {
  1793. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  1794. } }()
  1795. try { if let v = self._maxBackoff {
  1796. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  1797. } }()
  1798. if self.backoffMultiplier != 0 {
  1799. try visitor.visitSingularFloatField(value: self.backoffMultiplier, fieldNumber: 4)
  1800. }
  1801. if !self.retryableStatusCodes.isEmpty {
  1802. try visitor.visitPackedEnumField(value: self.retryableStatusCodes, fieldNumber: 5)
  1803. }
  1804. try unknownFields.traverse(visitor: &visitor)
  1805. }
  1806. static func ==(lhs: Grpc_ServiceConfig_MethodConfig.RetryPolicy, rhs: Grpc_ServiceConfig_MethodConfig.RetryPolicy) -> Bool {
  1807. if lhs.maxAttempts != rhs.maxAttempts {return false}
  1808. if lhs._initialBackoff != rhs._initialBackoff {return false}
  1809. if lhs._maxBackoff != rhs._maxBackoff {return false}
  1810. if lhs.backoffMultiplier != rhs.backoffMultiplier {return false}
  1811. if lhs.retryableStatusCodes != rhs.retryableStatusCodes {return false}
  1812. if lhs.unknownFields != rhs.unknownFields {return false}
  1813. return true
  1814. }
  1815. }
  1816. extension Grpc_ServiceConfig_MethodConfig.HedgingPolicy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1817. static let protoMessageName: String = Grpc_ServiceConfig_MethodConfig.protoMessageName + ".HedgingPolicy"
  1818. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1819. 1: .standard(proto: "max_attempts"),
  1820. 2: .standard(proto: "hedging_delay"),
  1821. 3: .standard(proto: "non_fatal_status_codes"),
  1822. ]
  1823. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1824. while let fieldNumber = try decoder.nextFieldNumber() {
  1825. // The use of inline closures is to circumvent an issue where the compiler
  1826. // allocates stack space for every case branch when no optimizations are
  1827. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1828. switch fieldNumber {
  1829. case 1: try { try decoder.decodeSingularUInt32Field(value: &self.maxAttempts) }()
  1830. case 2: try { try decoder.decodeSingularMessageField(value: &self._hedgingDelay) }()
  1831. case 3: try { try decoder.decodeRepeatedEnumField(value: &self.nonFatalStatusCodes) }()
  1832. default: break
  1833. }
  1834. }
  1835. }
  1836. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1837. // The use of inline closures is to circumvent an issue where the compiler
  1838. // allocates stack space for every if/case branch local when no optimizations
  1839. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1840. // https://github.com/apple/swift-protobuf/issues/1182
  1841. if self.maxAttempts != 0 {
  1842. try visitor.visitSingularUInt32Field(value: self.maxAttempts, fieldNumber: 1)
  1843. }
  1844. try { if let v = self._hedgingDelay {
  1845. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  1846. } }()
  1847. if !self.nonFatalStatusCodes.isEmpty {
  1848. try visitor.visitPackedEnumField(value: self.nonFatalStatusCodes, fieldNumber: 3)
  1849. }
  1850. try unknownFields.traverse(visitor: &visitor)
  1851. }
  1852. static func ==(lhs: Grpc_ServiceConfig_MethodConfig.HedgingPolicy, rhs: Grpc_ServiceConfig_MethodConfig.HedgingPolicy) -> Bool {
  1853. if lhs.maxAttempts != rhs.maxAttempts {return false}
  1854. if lhs._hedgingDelay != rhs._hedgingDelay {return false}
  1855. if lhs.nonFatalStatusCodes != rhs.nonFatalStatusCodes {return false}
  1856. if lhs.unknownFields != rhs.unknownFields {return false}
  1857. return true
  1858. }
  1859. }
  1860. extension Grpc_ServiceConfig_PickFirstConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1861. static let protoMessageName: String = _protobuf_package + ".PickFirstConfig"
  1862. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1863. 1: .standard(proto: "shuffle_address_list"),
  1864. ]
  1865. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1866. while let fieldNumber = try decoder.nextFieldNumber() {
  1867. // The use of inline closures is to circumvent an issue where the compiler
  1868. // allocates stack space for every case branch when no optimizations are
  1869. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1870. switch fieldNumber {
  1871. case 1: try { try decoder.decodeSingularBoolField(value: &self.shuffleAddressList) }()
  1872. default: break
  1873. }
  1874. }
  1875. }
  1876. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1877. if self.shuffleAddressList != false {
  1878. try visitor.visitSingularBoolField(value: self.shuffleAddressList, fieldNumber: 1)
  1879. }
  1880. try unknownFields.traverse(visitor: &visitor)
  1881. }
  1882. static func ==(lhs: Grpc_ServiceConfig_PickFirstConfig, rhs: Grpc_ServiceConfig_PickFirstConfig) -> Bool {
  1883. if lhs.shuffleAddressList != rhs.shuffleAddressList {return false}
  1884. if lhs.unknownFields != rhs.unknownFields {return false}
  1885. return true
  1886. }
  1887. }
  1888. extension Grpc_ServiceConfig_RoundRobinConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1889. static let protoMessageName: String = _protobuf_package + ".RoundRobinConfig"
  1890. static let _protobuf_nameMap = SwiftProtobuf._NameMap()
  1891. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1892. while let _ = try decoder.nextFieldNumber() {
  1893. }
  1894. }
  1895. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1896. try unknownFields.traverse(visitor: &visitor)
  1897. }
  1898. static func ==(lhs: Grpc_ServiceConfig_RoundRobinConfig, rhs: Grpc_ServiceConfig_RoundRobinConfig) -> Bool {
  1899. if lhs.unknownFields != rhs.unknownFields {return false}
  1900. return true
  1901. }
  1902. }
  1903. extension Grpc_ServiceConfig_WeightedRoundRobinLbConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1904. static let protoMessageName: String = _protobuf_package + ".WeightedRoundRobinLbConfig"
  1905. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1906. 1: .standard(proto: "enable_oob_load_report"),
  1907. 2: .standard(proto: "oob_reporting_period"),
  1908. 3: .standard(proto: "blackout_period"),
  1909. 4: .standard(proto: "weight_expiration_period"),
  1910. 5: .standard(proto: "weight_update_period"),
  1911. 6: .standard(proto: "error_utilization_penalty"),
  1912. ]
  1913. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1914. while let fieldNumber = try decoder.nextFieldNumber() {
  1915. // The use of inline closures is to circumvent an issue where the compiler
  1916. // allocates stack space for every case branch when no optimizations are
  1917. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1918. switch fieldNumber {
  1919. case 1: try { try decoder.decodeSingularMessageField(value: &self._enableOobLoadReport) }()
  1920. case 2: try { try decoder.decodeSingularMessageField(value: &self._oobReportingPeriod) }()
  1921. case 3: try { try decoder.decodeSingularMessageField(value: &self._blackoutPeriod) }()
  1922. case 4: try { try decoder.decodeSingularMessageField(value: &self._weightExpirationPeriod) }()
  1923. case 5: try { try decoder.decodeSingularMessageField(value: &self._weightUpdatePeriod) }()
  1924. case 6: try { try decoder.decodeSingularMessageField(value: &self._errorUtilizationPenalty) }()
  1925. default: break
  1926. }
  1927. }
  1928. }
  1929. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1930. // The use of inline closures is to circumvent an issue where the compiler
  1931. // allocates stack space for every if/case branch local when no optimizations
  1932. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1933. // https://github.com/apple/swift-protobuf/issues/1182
  1934. try { if let v = self._enableOobLoadReport {
  1935. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  1936. } }()
  1937. try { if let v = self._oobReportingPeriod {
  1938. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  1939. } }()
  1940. try { if let v = self._blackoutPeriod {
  1941. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  1942. } }()
  1943. try { if let v = self._weightExpirationPeriod {
  1944. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  1945. } }()
  1946. try { if let v = self._weightUpdatePeriod {
  1947. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  1948. } }()
  1949. try { if let v = self._errorUtilizationPenalty {
  1950. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  1951. } }()
  1952. try unknownFields.traverse(visitor: &visitor)
  1953. }
  1954. static func ==(lhs: Grpc_ServiceConfig_WeightedRoundRobinLbConfig, rhs: Grpc_ServiceConfig_WeightedRoundRobinLbConfig) -> Bool {
  1955. if lhs._enableOobLoadReport != rhs._enableOobLoadReport {return false}
  1956. if lhs._oobReportingPeriod != rhs._oobReportingPeriod {return false}
  1957. if lhs._blackoutPeriod != rhs._blackoutPeriod {return false}
  1958. if lhs._weightExpirationPeriod != rhs._weightExpirationPeriod {return false}
  1959. if lhs._weightUpdatePeriod != rhs._weightUpdatePeriod {return false}
  1960. if lhs._errorUtilizationPenalty != rhs._errorUtilizationPenalty {return false}
  1961. if lhs.unknownFields != rhs.unknownFields {return false}
  1962. return true
  1963. }
  1964. }
  1965. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1966. static let protoMessageName: String = _protobuf_package + ".OutlierDetectionLoadBalancingConfig"
  1967. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1968. 1: .same(proto: "interval"),
  1969. 2: .standard(proto: "base_ejection_time"),
  1970. 3: .standard(proto: "max_ejection_time"),
  1971. 4: .standard(proto: "max_ejection_percent"),
  1972. 5: .standard(proto: "success_rate_ejection"),
  1973. 6: .standard(proto: "failure_percentage_ejection"),
  1974. 13: .standard(proto: "child_policy"),
  1975. ]
  1976. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1977. while let fieldNumber = try decoder.nextFieldNumber() {
  1978. // The use of inline closures is to circumvent an issue where the compiler
  1979. // allocates stack space for every case branch when no optimizations are
  1980. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1981. switch fieldNumber {
  1982. case 1: try { try decoder.decodeSingularMessageField(value: &self._interval) }()
  1983. case 2: try { try decoder.decodeSingularMessageField(value: &self._baseEjectionTime) }()
  1984. case 3: try { try decoder.decodeSingularMessageField(value: &self._maxEjectionTime) }()
  1985. case 4: try { try decoder.decodeSingularMessageField(value: &self._maxEjectionPercent) }()
  1986. case 5: try { try decoder.decodeSingularMessageField(value: &self._successRateEjection) }()
  1987. case 6: try { try decoder.decodeSingularMessageField(value: &self._failurePercentageEjection) }()
  1988. case 13: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  1989. default: break
  1990. }
  1991. }
  1992. }
  1993. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1994. // The use of inline closures is to circumvent an issue where the compiler
  1995. // allocates stack space for every if/case branch local when no optimizations
  1996. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1997. // https://github.com/apple/swift-protobuf/issues/1182
  1998. try { if let v = self._interval {
  1999. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2000. } }()
  2001. try { if let v = self._baseEjectionTime {
  2002. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2003. } }()
  2004. try { if let v = self._maxEjectionTime {
  2005. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2006. } }()
  2007. try { if let v = self._maxEjectionPercent {
  2008. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2009. } }()
  2010. try { if let v = self._successRateEjection {
  2011. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  2012. } }()
  2013. try { if let v = self._failurePercentageEjection {
  2014. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  2015. } }()
  2016. if !self.childPolicy.isEmpty {
  2017. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 13)
  2018. }
  2019. try unknownFields.traverse(visitor: &visitor)
  2020. }
  2021. static func ==(lhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig, rhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig) -> Bool {
  2022. if lhs._interval != rhs._interval {return false}
  2023. if lhs._baseEjectionTime != rhs._baseEjectionTime {return false}
  2024. if lhs._maxEjectionTime != rhs._maxEjectionTime {return false}
  2025. if lhs._maxEjectionPercent != rhs._maxEjectionPercent {return false}
  2026. if lhs._successRateEjection != rhs._successRateEjection {return false}
  2027. if lhs._failurePercentageEjection != rhs._failurePercentageEjection {return false}
  2028. if lhs.childPolicy != rhs.childPolicy {return false}
  2029. if lhs.unknownFields != rhs.unknownFields {return false}
  2030. return true
  2031. }
  2032. }
  2033. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2034. static let protoMessageName: String = Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.protoMessageName + ".SuccessRateEjection"
  2035. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2036. 1: .standard(proto: "stdev_factor"),
  2037. 2: .standard(proto: "enforcement_percentage"),
  2038. 3: .standard(proto: "minimum_hosts"),
  2039. 4: .standard(proto: "request_volume"),
  2040. ]
  2041. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2042. while let fieldNumber = try decoder.nextFieldNumber() {
  2043. // The use of inline closures is to circumvent an issue where the compiler
  2044. // allocates stack space for every case branch when no optimizations are
  2045. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2046. switch fieldNumber {
  2047. case 1: try { try decoder.decodeSingularMessageField(value: &self._stdevFactor) }()
  2048. case 2: try { try decoder.decodeSingularMessageField(value: &self._enforcementPercentage) }()
  2049. case 3: try { try decoder.decodeSingularMessageField(value: &self._minimumHosts) }()
  2050. case 4: try { try decoder.decodeSingularMessageField(value: &self._requestVolume) }()
  2051. default: break
  2052. }
  2053. }
  2054. }
  2055. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2056. // The use of inline closures is to circumvent an issue where the compiler
  2057. // allocates stack space for every if/case branch local when no optimizations
  2058. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2059. // https://github.com/apple/swift-protobuf/issues/1182
  2060. try { if let v = self._stdevFactor {
  2061. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2062. } }()
  2063. try { if let v = self._enforcementPercentage {
  2064. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2065. } }()
  2066. try { if let v = self._minimumHosts {
  2067. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2068. } }()
  2069. try { if let v = self._requestVolume {
  2070. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2071. } }()
  2072. try unknownFields.traverse(visitor: &visitor)
  2073. }
  2074. static func ==(lhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection, rhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection) -> Bool {
  2075. if lhs._stdevFactor != rhs._stdevFactor {return false}
  2076. if lhs._enforcementPercentage != rhs._enforcementPercentage {return false}
  2077. if lhs._minimumHosts != rhs._minimumHosts {return false}
  2078. if lhs._requestVolume != rhs._requestVolume {return false}
  2079. if lhs.unknownFields != rhs.unknownFields {return false}
  2080. return true
  2081. }
  2082. }
  2083. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2084. static let protoMessageName: String = Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.protoMessageName + ".FailurePercentageEjection"
  2085. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2086. 1: .same(proto: "threshold"),
  2087. 2: .standard(proto: "enforcement_percentage"),
  2088. 3: .standard(proto: "minimum_hosts"),
  2089. 4: .standard(proto: "request_volume"),
  2090. ]
  2091. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2092. while let fieldNumber = try decoder.nextFieldNumber() {
  2093. // The use of inline closures is to circumvent an issue where the compiler
  2094. // allocates stack space for every case branch when no optimizations are
  2095. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2096. switch fieldNumber {
  2097. case 1: try { try decoder.decodeSingularMessageField(value: &self._threshold) }()
  2098. case 2: try { try decoder.decodeSingularMessageField(value: &self._enforcementPercentage) }()
  2099. case 3: try { try decoder.decodeSingularMessageField(value: &self._minimumHosts) }()
  2100. case 4: try { try decoder.decodeSingularMessageField(value: &self._requestVolume) }()
  2101. default: break
  2102. }
  2103. }
  2104. }
  2105. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2106. // The use of inline closures is to circumvent an issue where the compiler
  2107. // allocates stack space for every if/case branch local when no optimizations
  2108. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2109. // https://github.com/apple/swift-protobuf/issues/1182
  2110. try { if let v = self._threshold {
  2111. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2112. } }()
  2113. try { if let v = self._enforcementPercentage {
  2114. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2115. } }()
  2116. try { if let v = self._minimumHosts {
  2117. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2118. } }()
  2119. try { if let v = self._requestVolume {
  2120. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2121. } }()
  2122. try unknownFields.traverse(visitor: &visitor)
  2123. }
  2124. static func ==(lhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection, rhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection) -> Bool {
  2125. if lhs._threshold != rhs._threshold {return false}
  2126. if lhs._enforcementPercentage != rhs._enforcementPercentage {return false}
  2127. if lhs._minimumHosts != rhs._minimumHosts {return false}
  2128. if lhs._requestVolume != rhs._requestVolume {return false}
  2129. if lhs.unknownFields != rhs.unknownFields {return false}
  2130. return true
  2131. }
  2132. }
  2133. extension Grpc_ServiceConfig_GrpcLbConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2134. static let protoMessageName: String = _protobuf_package + ".GrpcLbConfig"
  2135. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2136. 1: .standard(proto: "child_policy"),
  2137. 2: .standard(proto: "service_name"),
  2138. 3: .standard(proto: "initial_fallback_timeout"),
  2139. ]
  2140. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2141. while let fieldNumber = try decoder.nextFieldNumber() {
  2142. // The use of inline closures is to circumvent an issue where the compiler
  2143. // allocates stack space for every case branch when no optimizations are
  2144. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2145. switch fieldNumber {
  2146. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2147. case 2: try { try decoder.decodeSingularStringField(value: &self.serviceName) }()
  2148. case 3: try { try decoder.decodeSingularMessageField(value: &self._initialFallbackTimeout) }()
  2149. default: break
  2150. }
  2151. }
  2152. }
  2153. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2154. // The use of inline closures is to circumvent an issue where the compiler
  2155. // allocates stack space for every if/case branch local when no optimizations
  2156. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2157. // https://github.com/apple/swift-protobuf/issues/1182
  2158. if !self.childPolicy.isEmpty {
  2159. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 1)
  2160. }
  2161. if !self.serviceName.isEmpty {
  2162. try visitor.visitSingularStringField(value: self.serviceName, fieldNumber: 2)
  2163. }
  2164. try { if let v = self._initialFallbackTimeout {
  2165. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2166. } }()
  2167. try unknownFields.traverse(visitor: &visitor)
  2168. }
  2169. static func ==(lhs: Grpc_ServiceConfig_GrpcLbConfig, rhs: Grpc_ServiceConfig_GrpcLbConfig) -> Bool {
  2170. if lhs.childPolicy != rhs.childPolicy {return false}
  2171. if lhs.serviceName != rhs.serviceName {return false}
  2172. if lhs._initialFallbackTimeout != rhs._initialFallbackTimeout {return false}
  2173. if lhs.unknownFields != rhs.unknownFields {return false}
  2174. return true
  2175. }
  2176. }
  2177. extension Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2178. static let protoMessageName: String = _protobuf_package + ".PriorityLoadBalancingPolicyConfig"
  2179. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2180. 1: .same(proto: "children"),
  2181. 2: .same(proto: "priorities"),
  2182. ]
  2183. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2184. while let fieldNumber = try decoder.nextFieldNumber() {
  2185. // The use of inline closures is to circumvent an issue where the compiler
  2186. // allocates stack space for every case branch when no optimizations are
  2187. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2188. switch fieldNumber {
  2189. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child>.self, value: &self.children) }()
  2190. case 2: try { try decoder.decodeRepeatedStringField(value: &self.priorities) }()
  2191. default: break
  2192. }
  2193. }
  2194. }
  2195. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2196. if !self.children.isEmpty {
  2197. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child>.self, value: self.children, fieldNumber: 1)
  2198. }
  2199. if !self.priorities.isEmpty {
  2200. try visitor.visitRepeatedStringField(value: self.priorities, fieldNumber: 2)
  2201. }
  2202. try unknownFields.traverse(visitor: &visitor)
  2203. }
  2204. static func ==(lhs: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig) -> Bool {
  2205. if lhs.children != rhs.children {return false}
  2206. if lhs.priorities != rhs.priorities {return false}
  2207. if lhs.unknownFields != rhs.unknownFields {return false}
  2208. return true
  2209. }
  2210. }
  2211. extension Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2212. static let protoMessageName: String = Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.protoMessageName + ".Child"
  2213. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2214. 1: .same(proto: "config"),
  2215. 2: .standard(proto: "ignore_reresolution_requests"),
  2216. ]
  2217. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2218. while let fieldNumber = try decoder.nextFieldNumber() {
  2219. // The use of inline closures is to circumvent an issue where the compiler
  2220. // allocates stack space for every case branch when no optimizations are
  2221. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2222. switch fieldNumber {
  2223. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.config) }()
  2224. case 2: try { try decoder.decodeSingularBoolField(value: &self.ignoreReresolutionRequests) }()
  2225. default: break
  2226. }
  2227. }
  2228. }
  2229. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2230. if !self.config.isEmpty {
  2231. try visitor.visitRepeatedMessageField(value: self.config, fieldNumber: 1)
  2232. }
  2233. if self.ignoreReresolutionRequests != false {
  2234. try visitor.visitSingularBoolField(value: self.ignoreReresolutionRequests, fieldNumber: 2)
  2235. }
  2236. try unknownFields.traverse(visitor: &visitor)
  2237. }
  2238. static func ==(lhs: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child, rhs: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child) -> Bool {
  2239. if lhs.config != rhs.config {return false}
  2240. if lhs.ignoreReresolutionRequests != rhs.ignoreReresolutionRequests {return false}
  2241. if lhs.unknownFields != rhs.unknownFields {return false}
  2242. return true
  2243. }
  2244. }
  2245. extension Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2246. static let protoMessageName: String = _protobuf_package + ".WeightedTargetLoadBalancingPolicyConfig"
  2247. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2248. 1: .same(proto: "targets"),
  2249. ]
  2250. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2251. while let fieldNumber = try decoder.nextFieldNumber() {
  2252. // The use of inline closures is to circumvent an issue where the compiler
  2253. // allocates stack space for every case branch when no optimizations are
  2254. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2255. switch fieldNumber {
  2256. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target>.self, value: &self.targets) }()
  2257. default: break
  2258. }
  2259. }
  2260. }
  2261. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2262. if !self.targets.isEmpty {
  2263. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target>.self, value: self.targets, fieldNumber: 1)
  2264. }
  2265. try unknownFields.traverse(visitor: &visitor)
  2266. }
  2267. static func ==(lhs: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig) -> Bool {
  2268. if lhs.targets != rhs.targets {return false}
  2269. if lhs.unknownFields != rhs.unknownFields {return false}
  2270. return true
  2271. }
  2272. }
  2273. extension Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2274. static let protoMessageName: String = Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.protoMessageName + ".Target"
  2275. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2276. 1: .same(proto: "weight"),
  2277. 2: .standard(proto: "child_policy"),
  2278. ]
  2279. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2280. while let fieldNumber = try decoder.nextFieldNumber() {
  2281. // The use of inline closures is to circumvent an issue where the compiler
  2282. // allocates stack space for every case branch when no optimizations are
  2283. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2284. switch fieldNumber {
  2285. case 1: try { try decoder.decodeSingularUInt32Field(value: &self.weight) }()
  2286. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2287. default: break
  2288. }
  2289. }
  2290. }
  2291. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2292. if self.weight != 0 {
  2293. try visitor.visitSingularUInt32Field(value: self.weight, fieldNumber: 1)
  2294. }
  2295. if !self.childPolicy.isEmpty {
  2296. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 2)
  2297. }
  2298. try unknownFields.traverse(visitor: &visitor)
  2299. }
  2300. static func ==(lhs: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target, rhs: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target) -> Bool {
  2301. if lhs.weight != rhs.weight {return false}
  2302. if lhs.childPolicy != rhs.childPolicy {return false}
  2303. if lhs.unknownFields != rhs.unknownFields {return false}
  2304. return true
  2305. }
  2306. }
  2307. extension Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2308. static let protoMessageName: String = _protobuf_package + ".RlsLoadBalancingPolicyConfig"
  2309. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2310. 1: .standard(proto: "route_lookup_config"),
  2311. 2: .standard(proto: "route_lookup_channel_service_config"),
  2312. 3: .standard(proto: "child_policy"),
  2313. 4: .standard(proto: "child_policy_config_target_field_name"),
  2314. ]
  2315. fileprivate class _StorageClass {
  2316. var _routeLookupConfig: Grpc_Lookup_V1_RouteLookupConfig? = nil
  2317. var _routeLookupChannelServiceConfig: Grpc_ServiceConfig_ServiceConfig? = nil
  2318. var _childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  2319. var _childPolicyConfigTargetFieldName: String = String()
  2320. #if swift(>=5.10)
  2321. // This property is used as the initial default value for new instances of the type.
  2322. // The type itself is protecting the reference to its storage via CoW semantics.
  2323. // This will force a copy to be made of this reference when the first mutation occurs;
  2324. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  2325. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  2326. #else
  2327. static let defaultInstance = _StorageClass()
  2328. #endif
  2329. private init() {}
  2330. init(copying source: _StorageClass) {
  2331. _routeLookupConfig = source._routeLookupConfig
  2332. _routeLookupChannelServiceConfig = source._routeLookupChannelServiceConfig
  2333. _childPolicy = source._childPolicy
  2334. _childPolicyConfigTargetFieldName = source._childPolicyConfigTargetFieldName
  2335. }
  2336. }
  2337. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  2338. if !isKnownUniquelyReferenced(&_storage) {
  2339. _storage = _StorageClass(copying: _storage)
  2340. }
  2341. return _storage
  2342. }
  2343. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2344. _ = _uniqueStorage()
  2345. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2346. while let fieldNumber = try decoder.nextFieldNumber() {
  2347. // The use of inline closures is to circumvent an issue where the compiler
  2348. // allocates stack space for every case branch when no optimizations are
  2349. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2350. switch fieldNumber {
  2351. case 1: try { try decoder.decodeSingularMessageField(value: &_storage._routeLookupConfig) }()
  2352. case 2: try { try decoder.decodeSingularMessageField(value: &_storage._routeLookupChannelServiceConfig) }()
  2353. case 3: try { try decoder.decodeRepeatedMessageField(value: &_storage._childPolicy) }()
  2354. case 4: try { try decoder.decodeSingularStringField(value: &_storage._childPolicyConfigTargetFieldName) }()
  2355. default: break
  2356. }
  2357. }
  2358. }
  2359. }
  2360. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2361. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2362. // The use of inline closures is to circumvent an issue where the compiler
  2363. // allocates stack space for every if/case branch local when no optimizations
  2364. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2365. // https://github.com/apple/swift-protobuf/issues/1182
  2366. try { if let v = _storage._routeLookupConfig {
  2367. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2368. } }()
  2369. try { if let v = _storage._routeLookupChannelServiceConfig {
  2370. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2371. } }()
  2372. if !_storage._childPolicy.isEmpty {
  2373. try visitor.visitRepeatedMessageField(value: _storage._childPolicy, fieldNumber: 3)
  2374. }
  2375. if !_storage._childPolicyConfigTargetFieldName.isEmpty {
  2376. try visitor.visitSingularStringField(value: _storage._childPolicyConfigTargetFieldName, fieldNumber: 4)
  2377. }
  2378. }
  2379. try unknownFields.traverse(visitor: &visitor)
  2380. }
  2381. static func ==(lhs: Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig) -> Bool {
  2382. if lhs._storage !== rhs._storage {
  2383. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  2384. let _storage = _args.0
  2385. let rhs_storage = _args.1
  2386. if _storage._routeLookupConfig != rhs_storage._routeLookupConfig {return false}
  2387. if _storage._routeLookupChannelServiceConfig != rhs_storage._routeLookupChannelServiceConfig {return false}
  2388. if _storage._childPolicy != rhs_storage._childPolicy {return false}
  2389. if _storage._childPolicyConfigTargetFieldName != rhs_storage._childPolicyConfigTargetFieldName {return false}
  2390. return true
  2391. }
  2392. if !storagesAreEqual {return false}
  2393. }
  2394. if lhs.unknownFields != rhs.unknownFields {return false}
  2395. return true
  2396. }
  2397. }
  2398. extension Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2399. static let protoMessageName: String = _protobuf_package + ".XdsClusterManagerLoadBalancingPolicyConfig"
  2400. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2401. 1: .same(proto: "children"),
  2402. ]
  2403. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2404. while let fieldNumber = try decoder.nextFieldNumber() {
  2405. // The use of inline closures is to circumvent an issue where the compiler
  2406. // allocates stack space for every case branch when no optimizations are
  2407. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2408. switch fieldNumber {
  2409. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child>.self, value: &self.children) }()
  2410. default: break
  2411. }
  2412. }
  2413. }
  2414. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2415. if !self.children.isEmpty {
  2416. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child>.self, value: self.children, fieldNumber: 1)
  2417. }
  2418. try unknownFields.traverse(visitor: &visitor)
  2419. }
  2420. static func ==(lhs: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig) -> Bool {
  2421. if lhs.children != rhs.children {return false}
  2422. if lhs.unknownFields != rhs.unknownFields {return false}
  2423. return true
  2424. }
  2425. }
  2426. extension Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2427. static let protoMessageName: String = Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.protoMessageName + ".Child"
  2428. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2429. 1: .standard(proto: "child_policy"),
  2430. ]
  2431. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2432. while let fieldNumber = try decoder.nextFieldNumber() {
  2433. // The use of inline closures is to circumvent an issue where the compiler
  2434. // allocates stack space for every case branch when no optimizations are
  2435. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2436. switch fieldNumber {
  2437. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2438. default: break
  2439. }
  2440. }
  2441. }
  2442. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2443. if !self.childPolicy.isEmpty {
  2444. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 1)
  2445. }
  2446. try unknownFields.traverse(visitor: &visitor)
  2447. }
  2448. static func ==(lhs: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child, rhs: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child) -> Bool {
  2449. if lhs.childPolicy != rhs.childPolicy {return false}
  2450. if lhs.unknownFields != rhs.unknownFields {return false}
  2451. return true
  2452. }
  2453. }
  2454. extension Grpc_ServiceConfig_CdsConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2455. static let protoMessageName: String = _protobuf_package + ".CdsConfig"
  2456. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2457. 1: .same(proto: "cluster"),
  2458. ]
  2459. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2460. while let fieldNumber = try decoder.nextFieldNumber() {
  2461. // The use of inline closures is to circumvent an issue where the compiler
  2462. // allocates stack space for every case branch when no optimizations are
  2463. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2464. switch fieldNumber {
  2465. case 1: try { try decoder.decodeSingularStringField(value: &self.cluster) }()
  2466. default: break
  2467. }
  2468. }
  2469. }
  2470. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2471. if !self.cluster.isEmpty {
  2472. try visitor.visitSingularStringField(value: self.cluster, fieldNumber: 1)
  2473. }
  2474. try unknownFields.traverse(visitor: &visitor)
  2475. }
  2476. static func ==(lhs: Grpc_ServiceConfig_CdsConfig, rhs: Grpc_ServiceConfig_CdsConfig) -> Bool {
  2477. if lhs.cluster != rhs.cluster {return false}
  2478. if lhs.unknownFields != rhs.unknownFields {return false}
  2479. return true
  2480. }
  2481. }
  2482. extension Grpc_ServiceConfig_XdsServer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2483. static let protoMessageName: String = _protobuf_package + ".XdsServer"
  2484. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2485. 1: .same(proto: "server_uri"),
  2486. 2: .same(proto: "channel_creds"),
  2487. 3: .same(proto: "server_features"),
  2488. ]
  2489. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2490. while let fieldNumber = try decoder.nextFieldNumber() {
  2491. // The use of inline closures is to circumvent an issue where the compiler
  2492. // allocates stack space for every case branch when no optimizations are
  2493. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2494. switch fieldNumber {
  2495. case 1: try { try decoder.decodeSingularStringField(value: &self.serverUri) }()
  2496. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.channelCreds) }()
  2497. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.serverFeatures) }()
  2498. default: break
  2499. }
  2500. }
  2501. }
  2502. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2503. if !self.serverUri.isEmpty {
  2504. try visitor.visitSingularStringField(value: self.serverUri, fieldNumber: 1)
  2505. }
  2506. if !self.channelCreds.isEmpty {
  2507. try visitor.visitRepeatedMessageField(value: self.channelCreds, fieldNumber: 2)
  2508. }
  2509. if !self.serverFeatures.isEmpty {
  2510. try visitor.visitRepeatedMessageField(value: self.serverFeatures, fieldNumber: 3)
  2511. }
  2512. try unknownFields.traverse(visitor: &visitor)
  2513. }
  2514. static func ==(lhs: Grpc_ServiceConfig_XdsServer, rhs: Grpc_ServiceConfig_XdsServer) -> Bool {
  2515. if lhs.serverUri != rhs.serverUri {return false}
  2516. if lhs.channelCreds != rhs.channelCreds {return false}
  2517. if lhs.serverFeatures != rhs.serverFeatures {return false}
  2518. if lhs.unknownFields != rhs.unknownFields {return false}
  2519. return true
  2520. }
  2521. }
  2522. extension Grpc_ServiceConfig_XdsServer.ChannelCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2523. static let protoMessageName: String = Grpc_ServiceConfig_XdsServer.protoMessageName + ".ChannelCredentials"
  2524. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2525. 1: .same(proto: "type"),
  2526. 2: .same(proto: "config"),
  2527. ]
  2528. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2529. while let fieldNumber = try decoder.nextFieldNumber() {
  2530. // The use of inline closures is to circumvent an issue where the compiler
  2531. // allocates stack space for every case branch when no optimizations are
  2532. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2533. switch fieldNumber {
  2534. case 1: try { try decoder.decodeSingularStringField(value: &self.type) }()
  2535. case 2: try { try decoder.decodeSingularMessageField(value: &self._config) }()
  2536. default: break
  2537. }
  2538. }
  2539. }
  2540. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2541. // The use of inline closures is to circumvent an issue where the compiler
  2542. // allocates stack space for every if/case branch local when no optimizations
  2543. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2544. // https://github.com/apple/swift-protobuf/issues/1182
  2545. if !self.type.isEmpty {
  2546. try visitor.visitSingularStringField(value: self.type, fieldNumber: 1)
  2547. }
  2548. try { if let v = self._config {
  2549. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2550. } }()
  2551. try unknownFields.traverse(visitor: &visitor)
  2552. }
  2553. static func ==(lhs: Grpc_ServiceConfig_XdsServer.ChannelCredentials, rhs: Grpc_ServiceConfig_XdsServer.ChannelCredentials) -> Bool {
  2554. if lhs.type != rhs.type {return false}
  2555. if lhs._config != rhs._config {return false}
  2556. if lhs.unknownFields != rhs.unknownFields {return false}
  2557. return true
  2558. }
  2559. }
  2560. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2561. static let protoMessageName: String = _protobuf_package + ".XdsClusterResolverLoadBalancingPolicyConfig"
  2562. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2563. 1: .standard(proto: "discovery_mechanisms"),
  2564. 2: .standard(proto: "xds_lb_policy"),
  2565. ]
  2566. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2567. while let fieldNumber = try decoder.nextFieldNumber() {
  2568. // The use of inline closures is to circumvent an issue where the compiler
  2569. // allocates stack space for every case branch when no optimizations are
  2570. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2571. switch fieldNumber {
  2572. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.discoveryMechanisms) }()
  2573. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.xdsLbPolicy) }()
  2574. default: break
  2575. }
  2576. }
  2577. }
  2578. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2579. if !self.discoveryMechanisms.isEmpty {
  2580. try visitor.visitRepeatedMessageField(value: self.discoveryMechanisms, fieldNumber: 1)
  2581. }
  2582. if !self.xdsLbPolicy.isEmpty {
  2583. try visitor.visitRepeatedMessageField(value: self.xdsLbPolicy, fieldNumber: 2)
  2584. }
  2585. try unknownFields.traverse(visitor: &visitor)
  2586. }
  2587. static func ==(lhs: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig) -> Bool {
  2588. if lhs.discoveryMechanisms != rhs.discoveryMechanisms {return false}
  2589. if lhs.xdsLbPolicy != rhs.xdsLbPolicy {return false}
  2590. if lhs.unknownFields != rhs.unknownFields {return false}
  2591. return true
  2592. }
  2593. }
  2594. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2595. static let protoMessageName: String = Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.protoMessageName + ".DiscoveryMechanism"
  2596. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2597. 1: .same(proto: "cluster"),
  2598. 2: .standard(proto: "lrs_load_reporting_server_name"),
  2599. 7: .standard(proto: "lrs_load_reporting_server"),
  2600. 3: .standard(proto: "max_concurrent_requests"),
  2601. 4: .same(proto: "type"),
  2602. 5: .standard(proto: "eds_service_name"),
  2603. 6: .standard(proto: "dns_hostname"),
  2604. 8: .standard(proto: "outlier_detection"),
  2605. 9: .standard(proto: "override_host_status"),
  2606. 10: .standard(proto: "telemetry_labels"),
  2607. ]
  2608. fileprivate class _StorageClass {
  2609. var _cluster: String = String()
  2610. var _lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  2611. var _lrsLoadReportingServer: Grpc_ServiceConfig_XdsServer? = nil
  2612. var _maxConcurrentRequests: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  2613. var _type: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum = .unknown
  2614. var _edsServiceName: String = String()
  2615. var _dnsHostname: String = String()
  2616. var _outlierDetection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig? = nil
  2617. var _overrideHostStatus: [Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus] = []
  2618. var _telemetryLabels: Dictionary<String,String> = [:]
  2619. #if swift(>=5.10)
  2620. // This property is used as the initial default value for new instances of the type.
  2621. // The type itself is protecting the reference to its storage via CoW semantics.
  2622. // This will force a copy to be made of this reference when the first mutation occurs;
  2623. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  2624. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  2625. #else
  2626. static let defaultInstance = _StorageClass()
  2627. #endif
  2628. private init() {}
  2629. init(copying source: _StorageClass) {
  2630. _cluster = source._cluster
  2631. _lrsLoadReportingServerName = source._lrsLoadReportingServerName
  2632. _lrsLoadReportingServer = source._lrsLoadReportingServer
  2633. _maxConcurrentRequests = source._maxConcurrentRequests
  2634. _type = source._type
  2635. _edsServiceName = source._edsServiceName
  2636. _dnsHostname = source._dnsHostname
  2637. _outlierDetection = source._outlierDetection
  2638. _overrideHostStatus = source._overrideHostStatus
  2639. _telemetryLabels = source._telemetryLabels
  2640. }
  2641. }
  2642. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  2643. if !isKnownUniquelyReferenced(&_storage) {
  2644. _storage = _StorageClass(copying: _storage)
  2645. }
  2646. return _storage
  2647. }
  2648. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2649. _ = _uniqueStorage()
  2650. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2651. while let fieldNumber = try decoder.nextFieldNumber() {
  2652. // The use of inline closures is to circumvent an issue where the compiler
  2653. // allocates stack space for every case branch when no optimizations are
  2654. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2655. switch fieldNumber {
  2656. case 1: try { try decoder.decodeSingularStringField(value: &_storage._cluster) }()
  2657. case 2: try { try decoder.decodeSingularMessageField(value: &_storage._lrsLoadReportingServerName) }()
  2658. case 3: try { try decoder.decodeSingularMessageField(value: &_storage._maxConcurrentRequests) }()
  2659. case 4: try { try decoder.decodeSingularEnumField(value: &_storage._type) }()
  2660. case 5: try { try decoder.decodeSingularStringField(value: &_storage._edsServiceName) }()
  2661. case 6: try { try decoder.decodeSingularStringField(value: &_storage._dnsHostname) }()
  2662. case 7: try { try decoder.decodeSingularMessageField(value: &_storage._lrsLoadReportingServer) }()
  2663. case 8: try { try decoder.decodeSingularMessageField(value: &_storage._outlierDetection) }()
  2664. case 9: try { try decoder.decodeRepeatedEnumField(value: &_storage._overrideHostStatus) }()
  2665. case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._telemetryLabels) }()
  2666. default: break
  2667. }
  2668. }
  2669. }
  2670. }
  2671. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2672. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2673. // The use of inline closures is to circumvent an issue where the compiler
  2674. // allocates stack space for every if/case branch local when no optimizations
  2675. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2676. // https://github.com/apple/swift-protobuf/issues/1182
  2677. if !_storage._cluster.isEmpty {
  2678. try visitor.visitSingularStringField(value: _storage._cluster, fieldNumber: 1)
  2679. }
  2680. try { if let v = _storage._lrsLoadReportingServerName {
  2681. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2682. } }()
  2683. try { if let v = _storage._maxConcurrentRequests {
  2684. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2685. } }()
  2686. if _storage._type != .unknown {
  2687. try visitor.visitSingularEnumField(value: _storage._type, fieldNumber: 4)
  2688. }
  2689. if !_storage._edsServiceName.isEmpty {
  2690. try visitor.visitSingularStringField(value: _storage._edsServiceName, fieldNumber: 5)
  2691. }
  2692. if !_storage._dnsHostname.isEmpty {
  2693. try visitor.visitSingularStringField(value: _storage._dnsHostname, fieldNumber: 6)
  2694. }
  2695. try { if let v = _storage._lrsLoadReportingServer {
  2696. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  2697. } }()
  2698. try { if let v = _storage._outlierDetection {
  2699. try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
  2700. } }()
  2701. if !_storage._overrideHostStatus.isEmpty {
  2702. try visitor.visitPackedEnumField(value: _storage._overrideHostStatus, fieldNumber: 9)
  2703. }
  2704. if !_storage._telemetryLabels.isEmpty {
  2705. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._telemetryLabels, fieldNumber: 10)
  2706. }
  2707. }
  2708. try unknownFields.traverse(visitor: &visitor)
  2709. }
  2710. static func ==(lhs: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism, rhs: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism) -> Bool {
  2711. if lhs._storage !== rhs._storage {
  2712. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  2713. let _storage = _args.0
  2714. let rhs_storage = _args.1
  2715. if _storage._cluster != rhs_storage._cluster {return false}
  2716. if _storage._lrsLoadReportingServerName != rhs_storage._lrsLoadReportingServerName {return false}
  2717. if _storage._lrsLoadReportingServer != rhs_storage._lrsLoadReportingServer {return false}
  2718. if _storage._maxConcurrentRequests != rhs_storage._maxConcurrentRequests {return false}
  2719. if _storage._type != rhs_storage._type {return false}
  2720. if _storage._edsServiceName != rhs_storage._edsServiceName {return false}
  2721. if _storage._dnsHostname != rhs_storage._dnsHostname {return false}
  2722. if _storage._outlierDetection != rhs_storage._outlierDetection {return false}
  2723. if _storage._overrideHostStatus != rhs_storage._overrideHostStatus {return false}
  2724. if _storage._telemetryLabels != rhs_storage._telemetryLabels {return false}
  2725. return true
  2726. }
  2727. if !storagesAreEqual {return false}
  2728. }
  2729. if lhs.unknownFields != rhs.unknownFields {return false}
  2730. return true
  2731. }
  2732. }
  2733. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum: SwiftProtobuf._ProtoNameProviding {
  2734. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2735. 0: .same(proto: "UNKNOWN"),
  2736. 1: .same(proto: "EDS"),
  2737. 2: .same(proto: "LOGICAL_DNS"),
  2738. ]
  2739. }
  2740. extension Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2741. static let protoMessageName: String = _protobuf_package + ".XdsClusterImplLoadBalancingPolicyConfig"
  2742. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2743. 1: .same(proto: "cluster"),
  2744. 2: .standard(proto: "eds_service_name"),
  2745. 3: .standard(proto: "lrs_load_reporting_server_name"),
  2746. 7: .standard(proto: "lrs_load_reporting_server"),
  2747. 4: .standard(proto: "max_concurrent_requests"),
  2748. 5: .standard(proto: "drop_categories"),
  2749. 6: .standard(proto: "child_policy"),
  2750. 8: .standard(proto: "telemetry_labels"),
  2751. ]
  2752. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2753. while let fieldNumber = try decoder.nextFieldNumber() {
  2754. // The use of inline closures is to circumvent an issue where the compiler
  2755. // allocates stack space for every case branch when no optimizations are
  2756. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2757. switch fieldNumber {
  2758. case 1: try { try decoder.decodeSingularStringField(value: &self.cluster) }()
  2759. case 2: try { try decoder.decodeSingularStringField(value: &self.edsServiceName) }()
  2760. case 3: try { try decoder.decodeSingularMessageField(value: &self._lrsLoadReportingServerName) }()
  2761. case 4: try { try decoder.decodeSingularMessageField(value: &self._maxConcurrentRequests) }()
  2762. case 5: try { try decoder.decodeRepeatedMessageField(value: &self.dropCategories) }()
  2763. case 6: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2764. case 7: try { try decoder.decodeSingularMessageField(value: &self._lrsLoadReportingServer) }()
  2765. case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.telemetryLabels) }()
  2766. default: break
  2767. }
  2768. }
  2769. }
  2770. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2771. // The use of inline closures is to circumvent an issue where the compiler
  2772. // allocates stack space for every if/case branch local when no optimizations
  2773. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2774. // https://github.com/apple/swift-protobuf/issues/1182
  2775. if !self.cluster.isEmpty {
  2776. try visitor.visitSingularStringField(value: self.cluster, fieldNumber: 1)
  2777. }
  2778. if !self.edsServiceName.isEmpty {
  2779. try visitor.visitSingularStringField(value: self.edsServiceName, fieldNumber: 2)
  2780. }
  2781. try { if let v = self._lrsLoadReportingServerName {
  2782. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2783. } }()
  2784. try { if let v = self._maxConcurrentRequests {
  2785. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2786. } }()
  2787. if !self.dropCategories.isEmpty {
  2788. try visitor.visitRepeatedMessageField(value: self.dropCategories, fieldNumber: 5)
  2789. }
  2790. if !self.childPolicy.isEmpty {
  2791. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 6)
  2792. }
  2793. try { if let v = self._lrsLoadReportingServer {
  2794. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  2795. } }()
  2796. if !self.telemetryLabels.isEmpty {
  2797. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.telemetryLabels, fieldNumber: 8)
  2798. }
  2799. try unknownFields.traverse(visitor: &visitor)
  2800. }
  2801. static func ==(lhs: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig) -> Bool {
  2802. if lhs.cluster != rhs.cluster {return false}
  2803. if lhs.edsServiceName != rhs.edsServiceName {return false}
  2804. if lhs._lrsLoadReportingServerName != rhs._lrsLoadReportingServerName {return false}
  2805. if lhs._lrsLoadReportingServer != rhs._lrsLoadReportingServer {return false}
  2806. if lhs._maxConcurrentRequests != rhs._maxConcurrentRequests {return false}
  2807. if lhs.dropCategories != rhs.dropCategories {return false}
  2808. if lhs.childPolicy != rhs.childPolicy {return false}
  2809. if lhs.telemetryLabels != rhs.telemetryLabels {return false}
  2810. if lhs.unknownFields != rhs.unknownFields {return false}
  2811. return true
  2812. }
  2813. }
  2814. extension Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2815. static let protoMessageName: String = Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.protoMessageName + ".DropCategory"
  2816. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2817. 1: .same(proto: "category"),
  2818. 2: .standard(proto: "requests_per_million"),
  2819. ]
  2820. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2821. while let fieldNumber = try decoder.nextFieldNumber() {
  2822. // The use of inline closures is to circumvent an issue where the compiler
  2823. // allocates stack space for every case branch when no optimizations are
  2824. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2825. switch fieldNumber {
  2826. case 1: try { try decoder.decodeSingularStringField(value: &self.category) }()
  2827. case 2: try { try decoder.decodeSingularUInt32Field(value: &self.requestsPerMillion) }()
  2828. default: break
  2829. }
  2830. }
  2831. }
  2832. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2833. if !self.category.isEmpty {
  2834. try visitor.visitSingularStringField(value: self.category, fieldNumber: 1)
  2835. }
  2836. if self.requestsPerMillion != 0 {
  2837. try visitor.visitSingularUInt32Field(value: self.requestsPerMillion, fieldNumber: 2)
  2838. }
  2839. try unknownFields.traverse(visitor: &visitor)
  2840. }
  2841. static func ==(lhs: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory, rhs: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory) -> Bool {
  2842. if lhs.category != rhs.category {return false}
  2843. if lhs.requestsPerMillion != rhs.requestsPerMillion {return false}
  2844. if lhs.unknownFields != rhs.unknownFields {return false}
  2845. return true
  2846. }
  2847. }
  2848. extension Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2849. static let protoMessageName: String = _protobuf_package + ".EdsLoadBalancingPolicyConfig"
  2850. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2851. 1: .same(proto: "cluster"),
  2852. 2: .standard(proto: "eds_service_name"),
  2853. 3: .standard(proto: "lrs_load_reporting_server_name"),
  2854. 4: .standard(proto: "locality_picking_policy"),
  2855. 5: .standard(proto: "endpoint_picking_policy"),
  2856. ]
  2857. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2858. while let fieldNumber = try decoder.nextFieldNumber() {
  2859. // The use of inline closures is to circumvent an issue where the compiler
  2860. // allocates stack space for every case branch when no optimizations are
  2861. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2862. switch fieldNumber {
  2863. case 1: try { try decoder.decodeSingularStringField(value: &self.cluster) }()
  2864. case 2: try { try decoder.decodeSingularStringField(value: &self.edsServiceName) }()
  2865. case 3: try { try decoder.decodeSingularMessageField(value: &self._lrsLoadReportingServerName) }()
  2866. case 4: try { try decoder.decodeRepeatedMessageField(value: &self.localityPickingPolicy) }()
  2867. case 5: try { try decoder.decodeRepeatedMessageField(value: &self.endpointPickingPolicy) }()
  2868. default: break
  2869. }
  2870. }
  2871. }
  2872. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2873. // The use of inline closures is to circumvent an issue where the compiler
  2874. // allocates stack space for every if/case branch local when no optimizations
  2875. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2876. // https://github.com/apple/swift-protobuf/issues/1182
  2877. if !self.cluster.isEmpty {
  2878. try visitor.visitSingularStringField(value: self.cluster, fieldNumber: 1)
  2879. }
  2880. if !self.edsServiceName.isEmpty {
  2881. try visitor.visitSingularStringField(value: self.edsServiceName, fieldNumber: 2)
  2882. }
  2883. try { if let v = self._lrsLoadReportingServerName {
  2884. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2885. } }()
  2886. if !self.localityPickingPolicy.isEmpty {
  2887. try visitor.visitRepeatedMessageField(value: self.localityPickingPolicy, fieldNumber: 4)
  2888. }
  2889. if !self.endpointPickingPolicy.isEmpty {
  2890. try visitor.visitRepeatedMessageField(value: self.endpointPickingPolicy, fieldNumber: 5)
  2891. }
  2892. try unknownFields.traverse(visitor: &visitor)
  2893. }
  2894. static func ==(lhs: Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig) -> Bool {
  2895. if lhs.cluster != rhs.cluster {return false}
  2896. if lhs.edsServiceName != rhs.edsServiceName {return false}
  2897. if lhs._lrsLoadReportingServerName != rhs._lrsLoadReportingServerName {return false}
  2898. if lhs.localityPickingPolicy != rhs.localityPickingPolicy {return false}
  2899. if lhs.endpointPickingPolicy != rhs.endpointPickingPolicy {return false}
  2900. if lhs.unknownFields != rhs.unknownFields {return false}
  2901. return true
  2902. }
  2903. }
  2904. extension Grpc_ServiceConfig_RingHashLoadBalancingConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2905. static let protoMessageName: String = _protobuf_package + ".RingHashLoadBalancingConfig"
  2906. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2907. 1: .standard(proto: "min_ring_size"),
  2908. 2: .standard(proto: "max_ring_size"),
  2909. ]
  2910. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2911. while let fieldNumber = try decoder.nextFieldNumber() {
  2912. // The use of inline closures is to circumvent an issue where the compiler
  2913. // allocates stack space for every case branch when no optimizations are
  2914. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2915. switch fieldNumber {
  2916. case 1: try { try decoder.decodeSingularUInt64Field(value: &self.minRingSize) }()
  2917. case 2: try { try decoder.decodeSingularUInt64Field(value: &self.maxRingSize) }()
  2918. default: break
  2919. }
  2920. }
  2921. }
  2922. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2923. if self.minRingSize != 0 {
  2924. try visitor.visitSingularUInt64Field(value: self.minRingSize, fieldNumber: 1)
  2925. }
  2926. if self.maxRingSize != 0 {
  2927. try visitor.visitSingularUInt64Field(value: self.maxRingSize, fieldNumber: 2)
  2928. }
  2929. try unknownFields.traverse(visitor: &visitor)
  2930. }
  2931. static func ==(lhs: Grpc_ServiceConfig_RingHashLoadBalancingConfig, rhs: Grpc_ServiceConfig_RingHashLoadBalancingConfig) -> Bool {
  2932. if lhs.minRingSize != rhs.minRingSize {return false}
  2933. if lhs.maxRingSize != rhs.maxRingSize {return false}
  2934. if lhs.unknownFields != rhs.unknownFields {return false}
  2935. return true
  2936. }
  2937. }
  2938. extension Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2939. static let protoMessageName: String = _protobuf_package + ".LrsLoadBalancingPolicyConfig"
  2940. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2941. 1: .standard(proto: "cluster_name"),
  2942. 2: .standard(proto: "eds_service_name"),
  2943. 3: .standard(proto: "lrs_load_reporting_server_name"),
  2944. 4: .same(proto: "locality"),
  2945. 5: .standard(proto: "child_policy"),
  2946. ]
  2947. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2948. while let fieldNumber = try decoder.nextFieldNumber() {
  2949. // The use of inline closures is to circumvent an issue where the compiler
  2950. // allocates stack space for every case branch when no optimizations are
  2951. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2952. switch fieldNumber {
  2953. case 1: try { try decoder.decodeSingularStringField(value: &self.clusterName) }()
  2954. case 2: try { try decoder.decodeSingularStringField(value: &self.edsServiceName) }()
  2955. case 3: try { try decoder.decodeSingularStringField(value: &self.lrsLoadReportingServerName) }()
  2956. case 4: try { try decoder.decodeSingularMessageField(value: &self._locality) }()
  2957. case 5: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2958. default: break
  2959. }
  2960. }
  2961. }
  2962. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2963. // The use of inline closures is to circumvent an issue where the compiler
  2964. // allocates stack space for every if/case branch local when no optimizations
  2965. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2966. // https://github.com/apple/swift-protobuf/issues/1182
  2967. if !self.clusterName.isEmpty {
  2968. try visitor.visitSingularStringField(value: self.clusterName, fieldNumber: 1)
  2969. }
  2970. if !self.edsServiceName.isEmpty {
  2971. try visitor.visitSingularStringField(value: self.edsServiceName, fieldNumber: 2)
  2972. }
  2973. if !self.lrsLoadReportingServerName.isEmpty {
  2974. try visitor.visitSingularStringField(value: self.lrsLoadReportingServerName, fieldNumber: 3)
  2975. }
  2976. try { if let v = self._locality {
  2977. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2978. } }()
  2979. if !self.childPolicy.isEmpty {
  2980. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 5)
  2981. }
  2982. try unknownFields.traverse(visitor: &visitor)
  2983. }
  2984. static func ==(lhs: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig) -> Bool {
  2985. if lhs.clusterName != rhs.clusterName {return false}
  2986. if lhs.edsServiceName != rhs.edsServiceName {return false}
  2987. if lhs.lrsLoadReportingServerName != rhs.lrsLoadReportingServerName {return false}
  2988. if lhs._locality != rhs._locality {return false}
  2989. if lhs.childPolicy != rhs.childPolicy {return false}
  2990. if lhs.unknownFields != rhs.unknownFields {return false}
  2991. return true
  2992. }
  2993. }
  2994. extension Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2995. static let protoMessageName: String = Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.protoMessageName + ".Locality"
  2996. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2997. 1: .same(proto: "region"),
  2998. 2: .same(proto: "zone"),
  2999. 3: .same(proto: "subzone"),
  3000. ]
  3001. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3002. while let fieldNumber = try decoder.nextFieldNumber() {
  3003. // The use of inline closures is to circumvent an issue where the compiler
  3004. // allocates stack space for every case branch when no optimizations are
  3005. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3006. switch fieldNumber {
  3007. case 1: try { try decoder.decodeSingularStringField(value: &self.region) }()
  3008. case 2: try { try decoder.decodeSingularStringField(value: &self.zone) }()
  3009. case 3: try { try decoder.decodeSingularStringField(value: &self.subzone) }()
  3010. default: break
  3011. }
  3012. }
  3013. }
  3014. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3015. if !self.region.isEmpty {
  3016. try visitor.visitSingularStringField(value: self.region, fieldNumber: 1)
  3017. }
  3018. if !self.zone.isEmpty {
  3019. try visitor.visitSingularStringField(value: self.zone, fieldNumber: 2)
  3020. }
  3021. if !self.subzone.isEmpty {
  3022. try visitor.visitSingularStringField(value: self.subzone, fieldNumber: 3)
  3023. }
  3024. try unknownFields.traverse(visitor: &visitor)
  3025. }
  3026. static func ==(lhs: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality, rhs: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality) -> Bool {
  3027. if lhs.region != rhs.region {return false}
  3028. if lhs.zone != rhs.zone {return false}
  3029. if lhs.subzone != rhs.subzone {return false}
  3030. if lhs.unknownFields != rhs.unknownFields {return false}
  3031. return true
  3032. }
  3033. }
  3034. extension Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3035. static let protoMessageName: String = _protobuf_package + ".XdsWrrLocalityLoadBalancingPolicyConfig"
  3036. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3037. 1: .standard(proto: "child_policy"),
  3038. ]
  3039. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3040. while let fieldNumber = try decoder.nextFieldNumber() {
  3041. // The use of inline closures is to circumvent an issue where the compiler
  3042. // allocates stack space for every case branch when no optimizations are
  3043. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3044. switch fieldNumber {
  3045. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  3046. default: break
  3047. }
  3048. }
  3049. }
  3050. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3051. if !self.childPolicy.isEmpty {
  3052. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 1)
  3053. }
  3054. try unknownFields.traverse(visitor: &visitor)
  3055. }
  3056. static func ==(lhs: Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig) -> Bool {
  3057. if lhs.childPolicy != rhs.childPolicy {return false}
  3058. if lhs.unknownFields != rhs.unknownFields {return false}
  3059. return true
  3060. }
  3061. }
  3062. extension Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3063. static let protoMessageName: String = _protobuf_package + ".LeastRequestLocalityLoadBalancingPolicyConfig"
  3064. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3065. 1: .standard(proto: "choice_count"),
  3066. ]
  3067. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3068. while let fieldNumber = try decoder.nextFieldNumber() {
  3069. // The use of inline closures is to circumvent an issue where the compiler
  3070. // allocates stack space for every case branch when no optimizations are
  3071. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3072. switch fieldNumber {
  3073. case 1: try { try decoder.decodeSingularUInt64Field(value: &self.choiceCount) }()
  3074. default: break
  3075. }
  3076. }
  3077. }
  3078. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3079. if self.choiceCount != 0 {
  3080. try visitor.visitSingularUInt64Field(value: self.choiceCount, fieldNumber: 1)
  3081. }
  3082. try unknownFields.traverse(visitor: &visitor)
  3083. }
  3084. static func ==(lhs: Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig) -> Bool {
  3085. if lhs.choiceCount != rhs.choiceCount {return false}
  3086. if lhs.unknownFields != rhs.unknownFields {return false}
  3087. return true
  3088. }
  3089. }
  3090. extension Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3091. static let protoMessageName: String = _protobuf_package + ".OverrideHostLoadBalancingPolicyConfig"
  3092. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3093. 1: .standard(proto: "override_host_status"),
  3094. 2: .standard(proto: "child_policy"),
  3095. ]
  3096. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3097. while let fieldNumber = try decoder.nextFieldNumber() {
  3098. // The use of inline closures is to circumvent an issue where the compiler
  3099. // allocates stack space for every case branch when no optimizations are
  3100. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3101. switch fieldNumber {
  3102. case 1: try { try decoder.decodeRepeatedEnumField(value: &self.overrideHostStatus) }()
  3103. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  3104. default: break
  3105. }
  3106. }
  3107. }
  3108. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3109. if !self.overrideHostStatus.isEmpty {
  3110. try visitor.visitPackedEnumField(value: self.overrideHostStatus, fieldNumber: 1)
  3111. }
  3112. if !self.childPolicy.isEmpty {
  3113. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 2)
  3114. }
  3115. try unknownFields.traverse(visitor: &visitor)
  3116. }
  3117. static func ==(lhs: Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig) -> Bool {
  3118. if lhs.overrideHostStatus != rhs.overrideHostStatus {return false}
  3119. if lhs.childPolicy != rhs.childPolicy {return false}
  3120. if lhs.unknownFields != rhs.unknownFields {return false}
  3121. return true
  3122. }
  3123. }
  3124. extension Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus: SwiftProtobuf._ProtoNameProviding {
  3125. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3126. 0: .same(proto: "UNKNOWN"),
  3127. 1: .same(proto: "HEALTHY"),
  3128. 3: .same(proto: "DRAINING"),
  3129. ]
  3130. }
  3131. extension Grpc_ServiceConfig_XdsConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3132. static let protoMessageName: String = _protobuf_package + ".XdsConfig"
  3133. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3134. 1: .standard(proto: "balancer_name"),
  3135. 2: .standard(proto: "child_policy"),
  3136. 3: .standard(proto: "fallback_policy"),
  3137. 4: .standard(proto: "eds_service_name"),
  3138. 5: .standard(proto: "lrs_load_reporting_server_name"),
  3139. ]
  3140. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3141. while let fieldNumber = try decoder.nextFieldNumber() {
  3142. // The use of inline closures is to circumvent an issue where the compiler
  3143. // allocates stack space for every case branch when no optimizations are
  3144. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3145. switch fieldNumber {
  3146. case 1: try { try decoder.decodeSingularStringField(value: &self.balancerName) }()
  3147. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  3148. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.fallbackPolicy) }()
  3149. case 4: try { try decoder.decodeSingularStringField(value: &self.edsServiceName) }()
  3150. case 5: try { try decoder.decodeSingularMessageField(value: &self._lrsLoadReportingServerName) }()
  3151. default: break
  3152. }
  3153. }
  3154. }
  3155. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3156. // The use of inline closures is to circumvent an issue where the compiler
  3157. // allocates stack space for every if/case branch local when no optimizations
  3158. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3159. // https://github.com/apple/swift-protobuf/issues/1182
  3160. if !self.balancerName.isEmpty {
  3161. try visitor.visitSingularStringField(value: self.balancerName, fieldNumber: 1)
  3162. }
  3163. if !self.childPolicy.isEmpty {
  3164. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 2)
  3165. }
  3166. if !self.fallbackPolicy.isEmpty {
  3167. try visitor.visitRepeatedMessageField(value: self.fallbackPolicy, fieldNumber: 3)
  3168. }
  3169. if !self.edsServiceName.isEmpty {
  3170. try visitor.visitSingularStringField(value: self.edsServiceName, fieldNumber: 4)
  3171. }
  3172. try { if let v = self._lrsLoadReportingServerName {
  3173. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  3174. } }()
  3175. try unknownFields.traverse(visitor: &visitor)
  3176. }
  3177. static func ==(lhs: Grpc_ServiceConfig_XdsConfig, rhs: Grpc_ServiceConfig_XdsConfig) -> Bool {
  3178. if lhs.balancerName != rhs.balancerName {return false}
  3179. if lhs.childPolicy != rhs.childPolicy {return false}
  3180. if lhs.fallbackPolicy != rhs.fallbackPolicy {return false}
  3181. if lhs.edsServiceName != rhs.edsServiceName {return false}
  3182. if lhs._lrsLoadReportingServerName != rhs._lrsLoadReportingServerName {return false}
  3183. if lhs.unknownFields != rhs.unknownFields {return false}
  3184. return true
  3185. }
  3186. }
  3187. extension Grpc_ServiceConfig_LoadBalancingConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3188. static let protoMessageName: String = _protobuf_package + ".LoadBalancingConfig"
  3189. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3190. 4: .same(proto: "pick_first"),
  3191. 1: .same(proto: "round_robin"),
  3192. 20: .same(proto: "weighted_round_robin"),
  3193. 3: .same(proto: "grpclb"),
  3194. 9: .same(proto: "priority_experimental"),
  3195. 10: .same(proto: "weighted_target_experimental"),
  3196. 15: .unique(proto: "outlier_detection", json: "outlier_detection_experimental"),
  3197. 19: .unique(proto: "rls", json: "rls_experimental"),
  3198. 14: .same(proto: "xds_cluster_manager_experimental"),
  3199. 6: .same(proto: "cds_experimental"),
  3200. 11: .same(proto: "xds_cluster_resolver_experimental"),
  3201. 12: .same(proto: "xds_cluster_impl_experimental"),
  3202. 18: .same(proto: "override_host_experimental"),
  3203. 16: .same(proto: "xds_wrr_locality_experimental"),
  3204. 13: .same(proto: "ring_hash_experimental"),
  3205. 17: .same(proto: "least_request_experimental"),
  3206. 8: .same(proto: "lrs_experimental"),
  3207. 7: .same(proto: "eds_experimental"),
  3208. 2: .same(proto: "xds"),
  3209. 5: .same(proto: "xds_experimental"),
  3210. ]
  3211. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3212. while let fieldNumber = try decoder.nextFieldNumber() {
  3213. // The use of inline closures is to circumvent an issue where the compiler
  3214. // allocates stack space for every case branch when no optimizations are
  3215. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3216. switch fieldNumber {
  3217. case 1: try {
  3218. var v: Grpc_ServiceConfig_RoundRobinConfig?
  3219. var hadOneofValue = false
  3220. if let current = self.policy {
  3221. hadOneofValue = true
  3222. if case .roundRobin(let m) = current {v = m}
  3223. }
  3224. try decoder.decodeSingularMessageField(value: &v)
  3225. if let v = v {
  3226. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3227. self.policy = .roundRobin(v)
  3228. }
  3229. }()
  3230. case 2: try {
  3231. var v: Grpc_ServiceConfig_XdsConfig?
  3232. var hadOneofValue = false
  3233. if let current = self.policy {
  3234. hadOneofValue = true
  3235. if case .xds(let m) = current {v = m}
  3236. }
  3237. try decoder.decodeSingularMessageField(value: &v)
  3238. if let v = v {
  3239. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3240. self.policy = .xds(v)
  3241. }
  3242. }()
  3243. case 3: try {
  3244. var v: Grpc_ServiceConfig_GrpcLbConfig?
  3245. var hadOneofValue = false
  3246. if let current = self.policy {
  3247. hadOneofValue = true
  3248. if case .grpclb(let m) = current {v = m}
  3249. }
  3250. try decoder.decodeSingularMessageField(value: &v)
  3251. if let v = v {
  3252. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3253. self.policy = .grpclb(v)
  3254. }
  3255. }()
  3256. case 4: try {
  3257. var v: Grpc_ServiceConfig_PickFirstConfig?
  3258. var hadOneofValue = false
  3259. if let current = self.policy {
  3260. hadOneofValue = true
  3261. if case .pickFirst(let m) = current {v = m}
  3262. }
  3263. try decoder.decodeSingularMessageField(value: &v)
  3264. if let v = v {
  3265. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3266. self.policy = .pickFirst(v)
  3267. }
  3268. }()
  3269. case 5: try {
  3270. var v: Grpc_ServiceConfig_XdsConfig?
  3271. var hadOneofValue = false
  3272. if let current = self.policy {
  3273. hadOneofValue = true
  3274. if case .xdsExperimental(let m) = current {v = m}
  3275. }
  3276. try decoder.decodeSingularMessageField(value: &v)
  3277. if let v = v {
  3278. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3279. self.policy = .xdsExperimental(v)
  3280. }
  3281. }()
  3282. case 6: try {
  3283. var v: Grpc_ServiceConfig_CdsConfig?
  3284. var hadOneofValue = false
  3285. if let current = self.policy {
  3286. hadOneofValue = true
  3287. if case .cdsExperimental(let m) = current {v = m}
  3288. }
  3289. try decoder.decodeSingularMessageField(value: &v)
  3290. if let v = v {
  3291. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3292. self.policy = .cdsExperimental(v)
  3293. }
  3294. }()
  3295. case 7: try {
  3296. var v: Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig?
  3297. var hadOneofValue = false
  3298. if let current = self.policy {
  3299. hadOneofValue = true
  3300. if case .edsExperimental(let m) = current {v = m}
  3301. }
  3302. try decoder.decodeSingularMessageField(value: &v)
  3303. if let v = v {
  3304. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3305. self.policy = .edsExperimental(v)
  3306. }
  3307. }()
  3308. case 8: try {
  3309. var v: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig?
  3310. var hadOneofValue = false
  3311. if let current = self.policy {
  3312. hadOneofValue = true
  3313. if case .lrsExperimental(let m) = current {v = m}
  3314. }
  3315. try decoder.decodeSingularMessageField(value: &v)
  3316. if let v = v {
  3317. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3318. self.policy = .lrsExperimental(v)
  3319. }
  3320. }()
  3321. case 9: try {
  3322. var v: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig?
  3323. var hadOneofValue = false
  3324. if let current = self.policy {
  3325. hadOneofValue = true
  3326. if case .priorityExperimental(let m) = current {v = m}
  3327. }
  3328. try decoder.decodeSingularMessageField(value: &v)
  3329. if let v = v {
  3330. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3331. self.policy = .priorityExperimental(v)
  3332. }
  3333. }()
  3334. case 10: try {
  3335. var v: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig?
  3336. var hadOneofValue = false
  3337. if let current = self.policy {
  3338. hadOneofValue = true
  3339. if case .weightedTargetExperimental(let m) = current {v = m}
  3340. }
  3341. try decoder.decodeSingularMessageField(value: &v)
  3342. if let v = v {
  3343. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3344. self.policy = .weightedTargetExperimental(v)
  3345. }
  3346. }()
  3347. case 11: try {
  3348. var v: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig?
  3349. var hadOneofValue = false
  3350. if let current = self.policy {
  3351. hadOneofValue = true
  3352. if case .xdsClusterResolverExperimental(let m) = current {v = m}
  3353. }
  3354. try decoder.decodeSingularMessageField(value: &v)
  3355. if let v = v {
  3356. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3357. self.policy = .xdsClusterResolverExperimental(v)
  3358. }
  3359. }()
  3360. case 12: try {
  3361. var v: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig?
  3362. var hadOneofValue = false
  3363. if let current = self.policy {
  3364. hadOneofValue = true
  3365. if case .xdsClusterImplExperimental(let m) = current {v = m}
  3366. }
  3367. try decoder.decodeSingularMessageField(value: &v)
  3368. if let v = v {
  3369. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3370. self.policy = .xdsClusterImplExperimental(v)
  3371. }
  3372. }()
  3373. case 13: try {
  3374. var v: Grpc_ServiceConfig_RingHashLoadBalancingConfig?
  3375. var hadOneofValue = false
  3376. if let current = self.policy {
  3377. hadOneofValue = true
  3378. if case .ringHashExperimental(let m) = current {v = m}
  3379. }
  3380. try decoder.decodeSingularMessageField(value: &v)
  3381. if let v = v {
  3382. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3383. self.policy = .ringHashExperimental(v)
  3384. }
  3385. }()
  3386. case 14: try {
  3387. var v: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig?
  3388. var hadOneofValue = false
  3389. if let current = self.policy {
  3390. hadOneofValue = true
  3391. if case .xdsClusterManagerExperimental(let m) = current {v = m}
  3392. }
  3393. try decoder.decodeSingularMessageField(value: &v)
  3394. if let v = v {
  3395. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3396. self.policy = .xdsClusterManagerExperimental(v)
  3397. }
  3398. }()
  3399. case 15: try {
  3400. var v: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig?
  3401. var hadOneofValue = false
  3402. if let current = self.policy {
  3403. hadOneofValue = true
  3404. if case .outlierDetection(let m) = current {v = m}
  3405. }
  3406. try decoder.decodeSingularMessageField(value: &v)
  3407. if let v = v {
  3408. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3409. self.policy = .outlierDetection(v)
  3410. }
  3411. }()
  3412. case 16: try {
  3413. var v: Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig?
  3414. var hadOneofValue = false
  3415. if let current = self.policy {
  3416. hadOneofValue = true
  3417. if case .xdsWrrLocalityExperimental(let m) = current {v = m}
  3418. }
  3419. try decoder.decodeSingularMessageField(value: &v)
  3420. if let v = v {
  3421. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3422. self.policy = .xdsWrrLocalityExperimental(v)
  3423. }
  3424. }()
  3425. case 17: try {
  3426. var v: Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig?
  3427. var hadOneofValue = false
  3428. if let current = self.policy {
  3429. hadOneofValue = true
  3430. if case .leastRequestExperimental(let m) = current {v = m}
  3431. }
  3432. try decoder.decodeSingularMessageField(value: &v)
  3433. if let v = v {
  3434. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3435. self.policy = .leastRequestExperimental(v)
  3436. }
  3437. }()
  3438. case 18: try {
  3439. var v: Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig?
  3440. var hadOneofValue = false
  3441. if let current = self.policy {
  3442. hadOneofValue = true
  3443. if case .overrideHostExperimental(let m) = current {v = m}
  3444. }
  3445. try decoder.decodeSingularMessageField(value: &v)
  3446. if let v = v {
  3447. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3448. self.policy = .overrideHostExperimental(v)
  3449. }
  3450. }()
  3451. case 19: try {
  3452. var v: Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig?
  3453. var hadOneofValue = false
  3454. if let current = self.policy {
  3455. hadOneofValue = true
  3456. if case .rls(let m) = current {v = m}
  3457. }
  3458. try decoder.decodeSingularMessageField(value: &v)
  3459. if let v = v {
  3460. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3461. self.policy = .rls(v)
  3462. }
  3463. }()
  3464. case 20: try {
  3465. var v: Grpc_ServiceConfig_WeightedRoundRobinLbConfig?
  3466. var hadOneofValue = false
  3467. if let current = self.policy {
  3468. hadOneofValue = true
  3469. if case .weightedRoundRobin(let m) = current {v = m}
  3470. }
  3471. try decoder.decodeSingularMessageField(value: &v)
  3472. if let v = v {
  3473. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3474. self.policy = .weightedRoundRobin(v)
  3475. }
  3476. }()
  3477. default: break
  3478. }
  3479. }
  3480. }
  3481. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3482. // The use of inline closures is to circumvent an issue where the compiler
  3483. // allocates stack space for every if/case branch local when no optimizations
  3484. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3485. // https://github.com/apple/swift-protobuf/issues/1182
  3486. switch self.policy {
  3487. case .roundRobin?: try {
  3488. guard case .roundRobin(let v)? = self.policy else { preconditionFailure() }
  3489. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3490. }()
  3491. case .xds?: try {
  3492. guard case .xds(let v)? = self.policy else { preconditionFailure() }
  3493. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  3494. }()
  3495. case .grpclb?: try {
  3496. guard case .grpclb(let v)? = self.policy else { preconditionFailure() }
  3497. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  3498. }()
  3499. case .pickFirst?: try {
  3500. guard case .pickFirst(let v)? = self.policy else { preconditionFailure() }
  3501. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  3502. }()
  3503. case .xdsExperimental?: try {
  3504. guard case .xdsExperimental(let v)? = self.policy else { preconditionFailure() }
  3505. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  3506. }()
  3507. case .cdsExperimental?: try {
  3508. guard case .cdsExperimental(let v)? = self.policy else { preconditionFailure() }
  3509. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  3510. }()
  3511. case .edsExperimental?: try {
  3512. guard case .edsExperimental(let v)? = self.policy else { preconditionFailure() }
  3513. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  3514. }()
  3515. case .lrsExperimental?: try {
  3516. guard case .lrsExperimental(let v)? = self.policy else { preconditionFailure() }
  3517. try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
  3518. }()
  3519. case .priorityExperimental?: try {
  3520. guard case .priorityExperimental(let v)? = self.policy else { preconditionFailure() }
  3521. try visitor.visitSingularMessageField(value: v, fieldNumber: 9)
  3522. }()
  3523. case .weightedTargetExperimental?: try {
  3524. guard case .weightedTargetExperimental(let v)? = self.policy else { preconditionFailure() }
  3525. try visitor.visitSingularMessageField(value: v, fieldNumber: 10)
  3526. }()
  3527. case .xdsClusterResolverExperimental?: try {
  3528. guard case .xdsClusterResolverExperimental(let v)? = self.policy else { preconditionFailure() }
  3529. try visitor.visitSingularMessageField(value: v, fieldNumber: 11)
  3530. }()
  3531. case .xdsClusterImplExperimental?: try {
  3532. guard case .xdsClusterImplExperimental(let v)? = self.policy else { preconditionFailure() }
  3533. try visitor.visitSingularMessageField(value: v, fieldNumber: 12)
  3534. }()
  3535. case .ringHashExperimental?: try {
  3536. guard case .ringHashExperimental(let v)? = self.policy else { preconditionFailure() }
  3537. try visitor.visitSingularMessageField(value: v, fieldNumber: 13)
  3538. }()
  3539. case .xdsClusterManagerExperimental?: try {
  3540. guard case .xdsClusterManagerExperimental(let v)? = self.policy else { preconditionFailure() }
  3541. try visitor.visitSingularMessageField(value: v, fieldNumber: 14)
  3542. }()
  3543. case .outlierDetection?: try {
  3544. guard case .outlierDetection(let v)? = self.policy else { preconditionFailure() }
  3545. try visitor.visitSingularMessageField(value: v, fieldNumber: 15)
  3546. }()
  3547. case .xdsWrrLocalityExperimental?: try {
  3548. guard case .xdsWrrLocalityExperimental(let v)? = self.policy else { preconditionFailure() }
  3549. try visitor.visitSingularMessageField(value: v, fieldNumber: 16)
  3550. }()
  3551. case .leastRequestExperimental?: try {
  3552. guard case .leastRequestExperimental(let v)? = self.policy else { preconditionFailure() }
  3553. try visitor.visitSingularMessageField(value: v, fieldNumber: 17)
  3554. }()
  3555. case .overrideHostExperimental?: try {
  3556. guard case .overrideHostExperimental(let v)? = self.policy else { preconditionFailure() }
  3557. try visitor.visitSingularMessageField(value: v, fieldNumber: 18)
  3558. }()
  3559. case .rls?: try {
  3560. guard case .rls(let v)? = self.policy else { preconditionFailure() }
  3561. try visitor.visitSingularMessageField(value: v, fieldNumber: 19)
  3562. }()
  3563. case .weightedRoundRobin?: try {
  3564. guard case .weightedRoundRobin(let v)? = self.policy else { preconditionFailure() }
  3565. try visitor.visitSingularMessageField(value: v, fieldNumber: 20)
  3566. }()
  3567. case nil: break
  3568. }
  3569. try unknownFields.traverse(visitor: &visitor)
  3570. }
  3571. static func ==(lhs: Grpc_ServiceConfig_LoadBalancingConfig, rhs: Grpc_ServiceConfig_LoadBalancingConfig) -> Bool {
  3572. if lhs.policy != rhs.policy {return false}
  3573. if lhs.unknownFields != rhs.unknownFields {return false}
  3574. return true
  3575. }
  3576. }
  3577. extension Grpc_ServiceConfig_ServiceConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3578. static let protoMessageName: String = _protobuf_package + ".ServiceConfig"
  3579. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3580. 1: .standard(proto: "load_balancing_policy"),
  3581. 4: .standard(proto: "load_balancing_config"),
  3582. 2: .standard(proto: "method_config"),
  3583. 3: .standard(proto: "retry_throttling"),
  3584. 5: .standard(proto: "health_check_config"),
  3585. ]
  3586. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3587. while let fieldNumber = try decoder.nextFieldNumber() {
  3588. // The use of inline closures is to circumvent an issue where the compiler
  3589. // allocates stack space for every case branch when no optimizations are
  3590. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3591. switch fieldNumber {
  3592. case 1: try { try decoder.decodeSingularEnumField(value: &self.loadBalancingPolicy) }()
  3593. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.methodConfig) }()
  3594. case 3: try { try decoder.decodeSingularMessageField(value: &self._retryThrottling) }()
  3595. case 4: try { try decoder.decodeRepeatedMessageField(value: &self.loadBalancingConfig) }()
  3596. case 5: try { try decoder.decodeSingularMessageField(value: &self._healthCheckConfig) }()
  3597. default: break
  3598. }
  3599. }
  3600. }
  3601. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3602. // The use of inline closures is to circumvent an issue where the compiler
  3603. // allocates stack space for every if/case branch local when no optimizations
  3604. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3605. // https://github.com/apple/swift-protobuf/issues/1182
  3606. if self.loadBalancingPolicy != .unspecified {
  3607. try visitor.visitSingularEnumField(value: self.loadBalancingPolicy, fieldNumber: 1)
  3608. }
  3609. if !self.methodConfig.isEmpty {
  3610. try visitor.visitRepeatedMessageField(value: self.methodConfig, fieldNumber: 2)
  3611. }
  3612. try { if let v = self._retryThrottling {
  3613. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  3614. } }()
  3615. if !self.loadBalancingConfig.isEmpty {
  3616. try visitor.visitRepeatedMessageField(value: self.loadBalancingConfig, fieldNumber: 4)
  3617. }
  3618. try { if let v = self._healthCheckConfig {
  3619. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  3620. } }()
  3621. try unknownFields.traverse(visitor: &visitor)
  3622. }
  3623. static func ==(lhs: Grpc_ServiceConfig_ServiceConfig, rhs: Grpc_ServiceConfig_ServiceConfig) -> Bool {
  3624. if lhs.loadBalancingPolicy != rhs.loadBalancingPolicy {return false}
  3625. if lhs.loadBalancingConfig != rhs.loadBalancingConfig {return false}
  3626. if lhs.methodConfig != rhs.methodConfig {return false}
  3627. if lhs._retryThrottling != rhs._retryThrottling {return false}
  3628. if lhs._healthCheckConfig != rhs._healthCheckConfig {return false}
  3629. if lhs.unknownFields != rhs.unknownFields {return false}
  3630. return true
  3631. }
  3632. }
  3633. extension Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy: SwiftProtobuf._ProtoNameProviding {
  3634. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3635. 0: .same(proto: "UNSPECIFIED"),
  3636. 1: .same(proto: "ROUND_ROBIN"),
  3637. ]
  3638. }
  3639. extension Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3640. static let protoMessageName: String = Grpc_ServiceConfig_ServiceConfig.protoMessageName + ".RetryThrottlingPolicy"
  3641. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3642. 1: .standard(proto: "max_tokens"),
  3643. 2: .standard(proto: "token_ratio"),
  3644. ]
  3645. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3646. while let fieldNumber = try decoder.nextFieldNumber() {
  3647. // The use of inline closures is to circumvent an issue where the compiler
  3648. // allocates stack space for every case branch when no optimizations are
  3649. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3650. switch fieldNumber {
  3651. case 1: try { try decoder.decodeSingularUInt32Field(value: &self.maxTokens) }()
  3652. case 2: try { try decoder.decodeSingularFloatField(value: &self.tokenRatio) }()
  3653. default: break
  3654. }
  3655. }
  3656. }
  3657. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3658. if self.maxTokens != 0 {
  3659. try visitor.visitSingularUInt32Field(value: self.maxTokens, fieldNumber: 1)
  3660. }
  3661. if self.tokenRatio != 0 {
  3662. try visitor.visitSingularFloatField(value: self.tokenRatio, fieldNumber: 2)
  3663. }
  3664. try unknownFields.traverse(visitor: &visitor)
  3665. }
  3666. static func ==(lhs: Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy, rhs: Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy) -> Bool {
  3667. if lhs.maxTokens != rhs.maxTokens {return false}
  3668. if lhs.tokenRatio != rhs.tokenRatio {return false}
  3669. if lhs.unknownFields != rhs.unknownFields {return false}
  3670. return true
  3671. }
  3672. }
  3673. extension Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3674. static let protoMessageName: String = Grpc_ServiceConfig_ServiceConfig.protoMessageName + ".HealthCheckConfig"
  3675. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3676. 1: .standard(proto: "service_name"),
  3677. ]
  3678. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3679. while let fieldNumber = try decoder.nextFieldNumber() {
  3680. // The use of inline closures is to circumvent an issue where the compiler
  3681. // allocates stack space for every case branch when no optimizations are
  3682. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3683. switch fieldNumber {
  3684. case 1: try { try decoder.decodeSingularMessageField(value: &self._serviceName) }()
  3685. default: break
  3686. }
  3687. }
  3688. }
  3689. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3690. // The use of inline closures is to circumvent an issue where the compiler
  3691. // allocates stack space for every if/case branch local when no optimizations
  3692. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3693. // https://github.com/apple/swift-protobuf/issues/1182
  3694. try { if let v = self._serviceName {
  3695. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3696. } }()
  3697. try unknownFields.traverse(visitor: &visitor)
  3698. }
  3699. static func ==(lhs: Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig, rhs: Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig) -> Bool {
  3700. if lhs._serviceName != rhs._serviceName {return false}
  3701. if lhs.unknownFields != rhs.unknownFields {return false}
  3702. return true
  3703. }
  3704. }