service_config.pb.swift 191 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187
  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. /// If true, a dynamic subscription will be started for the cluster.
  733. var isDynamic: Bool = false
  734. var unknownFields = SwiftProtobuf.UnknownStorage()
  735. init() {}
  736. }
  737. /// Configuration for xds_cluster_impl LB policy.
  738. struct Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig {
  739. // SwiftProtobuf.Message conformance is added in an extension below. See the
  740. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  741. // methods supported on all messages.
  742. /// Cluster name. Required.
  743. var cluster: String = String()
  744. /// Child policy.
  745. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  746. /// EDS service name.
  747. /// Not set if cluster is not an EDS cluster or if it does not
  748. /// specify an EDS service name.
  749. var edsServiceName: String = String()
  750. /// Server to send load reports to.
  751. /// If unset, no load reporting is done.
  752. /// If set to empty string, load reporting will be sent to the same
  753. /// server as we are getting xds data from.
  754. /// DEPRECATED: Use new lrs_load_reporting_server field instead.
  755. var lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue {
  756. get {return _lrsLoadReportingServerName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  757. set {_lrsLoadReportingServerName = newValue}
  758. }
  759. /// Returns true if `lrsLoadReportingServerName` has been explicitly set.
  760. var hasLrsLoadReportingServerName: Bool {return self._lrsLoadReportingServerName != nil}
  761. /// Clears the value of `lrsLoadReportingServerName`. Subsequent reads from it will return its default value.
  762. mutating func clearLrsLoadReportingServerName() {self._lrsLoadReportingServerName = nil}
  763. /// LRS server to send load reports to.
  764. /// If not present, load reporting will be disabled.
  765. /// Supercedes lrs_load_reporting_server_name field.
  766. var lrsLoadReportingServer: Grpc_ServiceConfig_XdsServer {
  767. get {return _lrsLoadReportingServer ?? Grpc_ServiceConfig_XdsServer()}
  768. set {_lrsLoadReportingServer = newValue}
  769. }
  770. /// Returns true if `lrsLoadReportingServer` has been explicitly set.
  771. var hasLrsLoadReportingServer: Bool {return self._lrsLoadReportingServer != nil}
  772. /// Clears the value of `lrsLoadReportingServer`. Subsequent reads from it will return its default value.
  773. mutating func clearLrsLoadReportingServer() {self._lrsLoadReportingServer = nil}
  774. /// Maximum number of outstanding requests can be made to the upstream cluster.
  775. /// Default is 1024.
  776. var maxConcurrentRequests: SwiftProtobuf.Google_Protobuf_UInt32Value {
  777. get {return _maxConcurrentRequests ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  778. set {_maxConcurrentRequests = newValue}
  779. }
  780. /// Returns true if `maxConcurrentRequests` has been explicitly set.
  781. var hasMaxConcurrentRequests: Bool {return self._maxConcurrentRequests != nil}
  782. /// Clears the value of `maxConcurrentRequests`. Subsequent reads from it will return its default value.
  783. mutating func clearMaxConcurrentRequests() {self._maxConcurrentRequests = nil}
  784. var dropCategories: [Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory] = []
  785. /// Telemetry labels associated with this cluster
  786. var telemetryLabels: Dictionary<String,String> = [:]
  787. var unknownFields = SwiftProtobuf.UnknownStorage()
  788. /// Drop configuration.
  789. struct DropCategory {
  790. // SwiftProtobuf.Message conformance is added in an extension below. See the
  791. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  792. // methods supported on all messages.
  793. var category: String = String()
  794. var requestsPerMillion: UInt32 = 0
  795. var unknownFields = SwiftProtobuf.UnknownStorage()
  796. init() {}
  797. }
  798. init() {}
  799. fileprivate var _lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  800. fileprivate var _lrsLoadReportingServer: Grpc_ServiceConfig_XdsServer? = nil
  801. fileprivate var _maxConcurrentRequests: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  802. }
  803. /// Configuration for ring_hash LB policy.
  804. struct Grpc_ServiceConfig_RingHashLoadBalancingConfig {
  805. // SwiftProtobuf.Message conformance is added in an extension below. See the
  806. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  807. // methods supported on all messages.
  808. /// A client-side option will cap these values to 4096. If either of these
  809. /// values are greater than the client-side cap, they will be treated
  810. /// as the client-side cap value.
  811. var minRingSize: UInt64 = 0
  812. /// Optional, defaults to 4096, max 8M.
  813. var maxRingSize: UInt64 = 0
  814. var unknownFields = SwiftProtobuf.UnknownStorage()
  815. init() {}
  816. }
  817. /// Configuration for the xds_wrr_locality load balancing policy.
  818. struct Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig {
  819. // SwiftProtobuf.Message conformance is added in an extension below. See the
  820. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  821. // methods supported on all messages.
  822. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  823. var unknownFields = SwiftProtobuf.UnknownStorage()
  824. init() {}
  825. }
  826. /// Configuration for the least_request LB policy.
  827. struct Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig {
  828. // SwiftProtobuf.Message conformance is added in an extension below. See the
  829. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  830. // methods supported on all messages.
  831. var choiceCount: UInt64 = 0
  832. var unknownFields = SwiftProtobuf.UnknownStorage()
  833. init() {}
  834. }
  835. /// Configuration for the xds_override_host LB policy.
  836. struct Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig {
  837. // SwiftProtobuf.Message conformance is added in an extension below. See the
  838. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  839. // methods supported on all messages.
  840. var clusterName: String = String()
  841. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  842. /// valid health status for hosts that are considered when using
  843. /// xds_override_host_experimental policy.
  844. /// Default is [UNKNOWN, HEALTHY]
  845. var overrideHostStatus: [Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus] = []
  846. var unknownFields = SwiftProtobuf.UnknownStorage()
  847. enum HealthStatus: SwiftProtobuf.Enum {
  848. typealias RawValue = Int
  849. case unknown // = 0
  850. case healthy // = 1
  851. case draining // = 3
  852. case UNRECOGNIZED(Int)
  853. init() {
  854. self = .unknown
  855. }
  856. init?(rawValue: Int) {
  857. switch rawValue {
  858. case 0: self = .unknown
  859. case 1: self = .healthy
  860. case 3: self = .draining
  861. default: self = .UNRECOGNIZED(rawValue)
  862. }
  863. }
  864. var rawValue: Int {
  865. switch self {
  866. case .unknown: return 0
  867. case .healthy: return 1
  868. case .draining: return 3
  869. case .UNRECOGNIZED(let i): return i
  870. }
  871. }
  872. }
  873. init() {}
  874. }
  875. #if swift(>=4.2)
  876. extension Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus: CaseIterable {
  877. // The compiler won't synthesize support with the UNRECOGNIZED case.
  878. static let allCases: [Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus] = [
  879. .unknown,
  880. .healthy,
  881. .draining,
  882. ]
  883. }
  884. #endif // swift(>=4.2)
  885. /// Selects LB policy and provides corresponding configuration.
  886. ///
  887. /// In general, all instances of this field should be repeated. Clients will
  888. /// iterate through the list in order and stop at the first policy that they
  889. /// support. This allows the service config to specify custom policies that may
  890. /// not be known to all clients.
  891. ///
  892. /// - If the config for the first supported policy is invalid, the whole service
  893. /// config is invalid.
  894. /// - If the list doesn't contain any supported policy, the whole service config
  895. /// is invalid.
  896. struct Grpc_ServiceConfig_LoadBalancingConfig {
  897. // SwiftProtobuf.Message conformance is added in an extension below. See the
  898. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  899. // methods supported on all messages.
  900. /// Exactly one LB policy may be configured.
  901. var policy: Grpc_ServiceConfig_LoadBalancingConfig.OneOf_Policy? = nil
  902. var pickFirst: Grpc_ServiceConfig_PickFirstConfig {
  903. get {
  904. if case .pickFirst(let v)? = policy {return v}
  905. return Grpc_ServiceConfig_PickFirstConfig()
  906. }
  907. set {policy = .pickFirst(newValue)}
  908. }
  909. var roundRobin: Grpc_ServiceConfig_RoundRobinConfig {
  910. get {
  911. if case .roundRobin(let v)? = policy {return v}
  912. return Grpc_ServiceConfig_RoundRobinConfig()
  913. }
  914. set {policy = .roundRobin(newValue)}
  915. }
  916. var weightedRoundRobin: Grpc_ServiceConfig_WeightedRoundRobinLbConfig {
  917. get {
  918. if case .weightedRoundRobin(let v)? = policy {return v}
  919. return Grpc_ServiceConfig_WeightedRoundRobinLbConfig()
  920. }
  921. set {policy = .weightedRoundRobin(newValue)}
  922. }
  923. /// gRPC lookaside load balancing.
  924. /// This will eventually be deprecated by the new xDS-based local
  925. /// balancing policy.
  926. var grpclb: Grpc_ServiceConfig_GrpcLbConfig {
  927. get {
  928. if case .grpclb(let v)? = policy {return v}
  929. return Grpc_ServiceConfig_GrpcLbConfig()
  930. }
  931. set {policy = .grpclb(newValue)}
  932. }
  933. var priorityExperimental: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig {
  934. get {
  935. if case .priorityExperimental(let v)? = policy {return v}
  936. return Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig()
  937. }
  938. set {policy = .priorityExperimental(newValue)}
  939. }
  940. var weightedTargetExperimental: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig {
  941. get {
  942. if case .weightedTargetExperimental(let v)? = policy {return v}
  943. return Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig()
  944. }
  945. set {policy = .weightedTargetExperimental(newValue)}
  946. }
  947. var outlierDetection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig {
  948. get {
  949. if case .outlierDetection(let v)? = policy {return v}
  950. return Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig()
  951. }
  952. set {policy = .outlierDetection(newValue)}
  953. }
  954. var rls: Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig {
  955. get {
  956. if case .rls(let v)? = policy {return v}
  957. return Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig()
  958. }
  959. set {policy = .rls(newValue)}
  960. }
  961. /// xDS-based load balancing.
  962. var xdsClusterManagerExperimental: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig {
  963. get {
  964. if case .xdsClusterManagerExperimental(let v)? = policy {return v}
  965. return Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig()
  966. }
  967. set {policy = .xdsClusterManagerExperimental(newValue)}
  968. }
  969. var cdsExperimental: Grpc_ServiceConfig_CdsConfig {
  970. get {
  971. if case .cdsExperimental(let v)? = policy {return v}
  972. return Grpc_ServiceConfig_CdsConfig()
  973. }
  974. set {policy = .cdsExperimental(newValue)}
  975. }
  976. var xdsClusterImplExperimental: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig {
  977. get {
  978. if case .xdsClusterImplExperimental(let v)? = policy {return v}
  979. return Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig()
  980. }
  981. set {policy = .xdsClusterImplExperimental(newValue)}
  982. }
  983. var overrideHostExperimental: Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig {
  984. get {
  985. if case .overrideHostExperimental(let v)? = policy {return v}
  986. return Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig()
  987. }
  988. set {policy = .overrideHostExperimental(newValue)}
  989. }
  990. var xdsWrrLocalityExperimental: Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig {
  991. get {
  992. if case .xdsWrrLocalityExperimental(let v)? = policy {return v}
  993. return Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig()
  994. }
  995. set {policy = .xdsWrrLocalityExperimental(newValue)}
  996. }
  997. var ringHashExperimental: Grpc_ServiceConfig_RingHashLoadBalancingConfig {
  998. get {
  999. if case .ringHashExperimental(let v)? = policy {return v}
  1000. return Grpc_ServiceConfig_RingHashLoadBalancingConfig()
  1001. }
  1002. set {policy = .ringHashExperimental(newValue)}
  1003. }
  1004. var leastRequestExperimental: Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig {
  1005. get {
  1006. if case .leastRequestExperimental(let v)? = policy {return v}
  1007. return Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig()
  1008. }
  1009. set {policy = .leastRequestExperimental(newValue)}
  1010. }
  1011. /// Deprecated xDS-related policies.
  1012. var xdsClusterResolverExperimental: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig {
  1013. get {
  1014. if case .xdsClusterResolverExperimental(let v)? = policy {return v}
  1015. return Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig()
  1016. }
  1017. set {policy = .xdsClusterResolverExperimental(newValue)}
  1018. }
  1019. var lrsExperimental: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig {
  1020. get {
  1021. if case .lrsExperimental(let v)? = policy {return v}
  1022. return Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig()
  1023. }
  1024. set {policy = .lrsExperimental(newValue)}
  1025. }
  1026. var edsExperimental: Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig {
  1027. get {
  1028. if case .edsExperimental(let v)? = policy {return v}
  1029. return Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig()
  1030. }
  1031. set {policy = .edsExperimental(newValue)}
  1032. }
  1033. var xds: Grpc_ServiceConfig_XdsConfig {
  1034. get {
  1035. if case .xds(let v)? = policy {return v}
  1036. return Grpc_ServiceConfig_XdsConfig()
  1037. }
  1038. set {policy = .xds(newValue)}
  1039. }
  1040. var xdsExperimental: Grpc_ServiceConfig_XdsConfig {
  1041. get {
  1042. if case .xdsExperimental(let v)? = policy {return v}
  1043. return Grpc_ServiceConfig_XdsConfig()
  1044. }
  1045. set {policy = .xdsExperimental(newValue)}
  1046. }
  1047. var unknownFields = SwiftProtobuf.UnknownStorage()
  1048. /// Exactly one LB policy may be configured.
  1049. enum OneOf_Policy: Equatable {
  1050. case pickFirst(Grpc_ServiceConfig_PickFirstConfig)
  1051. case roundRobin(Grpc_ServiceConfig_RoundRobinConfig)
  1052. case weightedRoundRobin(Grpc_ServiceConfig_WeightedRoundRobinLbConfig)
  1053. /// gRPC lookaside load balancing.
  1054. /// This will eventually be deprecated by the new xDS-based local
  1055. /// balancing policy.
  1056. case grpclb(Grpc_ServiceConfig_GrpcLbConfig)
  1057. case priorityExperimental(Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig)
  1058. case weightedTargetExperimental(Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig)
  1059. case outlierDetection(Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig)
  1060. case rls(Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig)
  1061. /// xDS-based load balancing.
  1062. case xdsClusterManagerExperimental(Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig)
  1063. case cdsExperimental(Grpc_ServiceConfig_CdsConfig)
  1064. case xdsClusterImplExperimental(Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig)
  1065. case overrideHostExperimental(Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig)
  1066. case xdsWrrLocalityExperimental(Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig)
  1067. case ringHashExperimental(Grpc_ServiceConfig_RingHashLoadBalancingConfig)
  1068. case leastRequestExperimental(Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig)
  1069. /// Deprecated xDS-related policies.
  1070. case xdsClusterResolverExperimental(Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig)
  1071. case lrsExperimental(Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig)
  1072. case edsExperimental(Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig)
  1073. case xds(Grpc_ServiceConfig_XdsConfig)
  1074. case xdsExperimental(Grpc_ServiceConfig_XdsConfig)
  1075. #if !swift(>=4.1)
  1076. static func ==(lhs: Grpc_ServiceConfig_LoadBalancingConfig.OneOf_Policy, rhs: Grpc_ServiceConfig_LoadBalancingConfig.OneOf_Policy) -> Bool {
  1077. // The use of inline closures is to circumvent an issue where the compiler
  1078. // allocates stack space for every case branch when no optimizations are
  1079. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1080. switch (lhs, rhs) {
  1081. case (.pickFirst, .pickFirst): return {
  1082. guard case .pickFirst(let l) = lhs, case .pickFirst(let r) = rhs else { preconditionFailure() }
  1083. return l == r
  1084. }()
  1085. case (.roundRobin, .roundRobin): return {
  1086. guard case .roundRobin(let l) = lhs, case .roundRobin(let r) = rhs else { preconditionFailure() }
  1087. return l == r
  1088. }()
  1089. case (.weightedRoundRobin, .weightedRoundRobin): return {
  1090. guard case .weightedRoundRobin(let l) = lhs, case .weightedRoundRobin(let r) = rhs else { preconditionFailure() }
  1091. return l == r
  1092. }()
  1093. case (.grpclb, .grpclb): return {
  1094. guard case .grpclb(let l) = lhs, case .grpclb(let r) = rhs else { preconditionFailure() }
  1095. return l == r
  1096. }()
  1097. case (.priorityExperimental, .priorityExperimental): return {
  1098. guard case .priorityExperimental(let l) = lhs, case .priorityExperimental(let r) = rhs else { preconditionFailure() }
  1099. return l == r
  1100. }()
  1101. case (.weightedTargetExperimental, .weightedTargetExperimental): return {
  1102. guard case .weightedTargetExperimental(let l) = lhs, case .weightedTargetExperimental(let r) = rhs else { preconditionFailure() }
  1103. return l == r
  1104. }()
  1105. case (.outlierDetection, .outlierDetection): return {
  1106. guard case .outlierDetection(let l) = lhs, case .outlierDetection(let r) = rhs else { preconditionFailure() }
  1107. return l == r
  1108. }()
  1109. case (.rls, .rls): return {
  1110. guard case .rls(let l) = lhs, case .rls(let r) = rhs else { preconditionFailure() }
  1111. return l == r
  1112. }()
  1113. case (.xdsClusterManagerExperimental, .xdsClusterManagerExperimental): return {
  1114. guard case .xdsClusterManagerExperimental(let l) = lhs, case .xdsClusterManagerExperimental(let r) = rhs else { preconditionFailure() }
  1115. return l == r
  1116. }()
  1117. case (.cdsExperimental, .cdsExperimental): return {
  1118. guard case .cdsExperimental(let l) = lhs, case .cdsExperimental(let r) = rhs else { preconditionFailure() }
  1119. return l == r
  1120. }()
  1121. case (.xdsClusterImplExperimental, .xdsClusterImplExperimental): return {
  1122. guard case .xdsClusterImplExperimental(let l) = lhs, case .xdsClusterImplExperimental(let r) = rhs else { preconditionFailure() }
  1123. return l == r
  1124. }()
  1125. case (.overrideHostExperimental, .overrideHostExperimental): return {
  1126. guard case .overrideHostExperimental(let l) = lhs, case .overrideHostExperimental(let r) = rhs else { preconditionFailure() }
  1127. return l == r
  1128. }()
  1129. case (.xdsWrrLocalityExperimental, .xdsWrrLocalityExperimental): return {
  1130. guard case .xdsWrrLocalityExperimental(let l) = lhs, case .xdsWrrLocalityExperimental(let r) = rhs else { preconditionFailure() }
  1131. return l == r
  1132. }()
  1133. case (.ringHashExperimental, .ringHashExperimental): return {
  1134. guard case .ringHashExperimental(let l) = lhs, case .ringHashExperimental(let r) = rhs else { preconditionFailure() }
  1135. return l == r
  1136. }()
  1137. case (.leastRequestExperimental, .leastRequestExperimental): return {
  1138. guard case .leastRequestExperimental(let l) = lhs, case .leastRequestExperimental(let r) = rhs else { preconditionFailure() }
  1139. return l == r
  1140. }()
  1141. case (.xdsClusterResolverExperimental, .xdsClusterResolverExperimental): return {
  1142. guard case .xdsClusterResolverExperimental(let l) = lhs, case .xdsClusterResolverExperimental(let r) = rhs else { preconditionFailure() }
  1143. return l == r
  1144. }()
  1145. case (.lrsExperimental, .lrsExperimental): return {
  1146. guard case .lrsExperimental(let l) = lhs, case .lrsExperimental(let r) = rhs else { preconditionFailure() }
  1147. return l == r
  1148. }()
  1149. case (.edsExperimental, .edsExperimental): return {
  1150. guard case .edsExperimental(let l) = lhs, case .edsExperimental(let r) = rhs else { preconditionFailure() }
  1151. return l == r
  1152. }()
  1153. case (.xds, .xds): return {
  1154. guard case .xds(let l) = lhs, case .xds(let r) = rhs else { preconditionFailure() }
  1155. return l == r
  1156. }()
  1157. case (.xdsExperimental, .xdsExperimental): return {
  1158. guard case .xdsExperimental(let l) = lhs, case .xdsExperimental(let r) = rhs else { preconditionFailure() }
  1159. return l == r
  1160. }()
  1161. default: return false
  1162. }
  1163. }
  1164. #endif
  1165. }
  1166. init() {}
  1167. }
  1168. /// A ServiceConfig represents information about a service but is not specific to
  1169. /// any name resolver.
  1170. struct Grpc_ServiceConfig_ServiceConfig {
  1171. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1172. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1173. // methods supported on all messages.
  1174. var loadBalancingPolicy: Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy = .unspecified
  1175. /// Multiple LB policies can be specified; clients will iterate through
  1176. /// the list in order and stop at the first policy that they support. If none
  1177. /// are supported, the service config is considered invalid.
  1178. var loadBalancingConfig: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1179. /// Per-method configuration.
  1180. var methodConfig: [Grpc_ServiceConfig_MethodConfig] = []
  1181. var retryThrottling: Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy {
  1182. get {return _retryThrottling ?? Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy()}
  1183. set {_retryThrottling = newValue}
  1184. }
  1185. /// Returns true if `retryThrottling` has been explicitly set.
  1186. var hasRetryThrottling: Bool {return self._retryThrottling != nil}
  1187. /// Clears the value of `retryThrottling`. Subsequent reads from it will return its default value.
  1188. mutating func clearRetryThrottling() {self._retryThrottling = nil}
  1189. var healthCheckConfig: Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig {
  1190. get {return _healthCheckConfig ?? Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig()}
  1191. set {_healthCheckConfig = newValue}
  1192. }
  1193. /// Returns true if `healthCheckConfig` has been explicitly set.
  1194. var hasHealthCheckConfig: Bool {return self._healthCheckConfig != nil}
  1195. /// Clears the value of `healthCheckConfig`. Subsequent reads from it will return its default value.
  1196. mutating func clearHealthCheckConfig() {self._healthCheckConfig = nil}
  1197. var unknownFields = SwiftProtobuf.UnknownStorage()
  1198. /// Load balancing policy.
  1199. ///
  1200. /// Note that load_balancing_policy is deprecated in favor of
  1201. /// load_balancing_config; the former will be used only if the latter
  1202. /// is unset.
  1203. ///
  1204. /// If no LB policy is configured here, then the default is pick_first.
  1205. /// If the policy name is set via the client API, that value overrides
  1206. /// the value specified here.
  1207. ///
  1208. /// If the deprecated load_balancing_policy field is used, note that if the
  1209. /// resolver returns at least one balancer address (as opposed to backend
  1210. /// addresses), gRPC will use grpclb (see
  1211. /// https://github.com/grpc/grpc/blob/master/doc/load-balancing.md),
  1212. /// regardless of what policy is configured here. However, if the resolver
  1213. /// returns at least one backend address in addition to the balancer
  1214. /// address(es), the client may fall back to the requested policy if it
  1215. /// is unable to reach any of the grpclb load balancers.
  1216. enum LoadBalancingPolicy: SwiftProtobuf.Enum {
  1217. typealias RawValue = Int
  1218. case unspecified // = 0
  1219. case roundRobin // = 1
  1220. case UNRECOGNIZED(Int)
  1221. init() {
  1222. self = .unspecified
  1223. }
  1224. init?(rawValue: Int) {
  1225. switch rawValue {
  1226. case 0: self = .unspecified
  1227. case 1: self = .roundRobin
  1228. default: self = .UNRECOGNIZED(rawValue)
  1229. }
  1230. }
  1231. var rawValue: Int {
  1232. switch self {
  1233. case .unspecified: return 0
  1234. case .roundRobin: return 1
  1235. case .UNRECOGNIZED(let i): return i
  1236. }
  1237. }
  1238. }
  1239. /// If a RetryThrottlingPolicy is provided, gRPC will automatically throttle
  1240. /// retry attempts and hedged RPCs when the client's ratio of failures to
  1241. /// successes exceeds a threshold.
  1242. ///
  1243. /// For each server name, the gRPC client will maintain a token_count which is
  1244. /// initially set to max_tokens. Every outgoing RPC (regardless of service or
  1245. /// method invoked) will change token_count as follows:
  1246. ///
  1247. /// - Every failed RPC will decrement the token_count by 1.
  1248. /// - Every successful RPC will increment the token_count by token_ratio.
  1249. ///
  1250. /// If token_count is less than or equal to max_tokens / 2, then RPCs will not
  1251. /// be retried and hedged RPCs will not be sent.
  1252. struct RetryThrottlingPolicy {
  1253. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1254. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1255. // methods supported on all messages.
  1256. /// The number of tokens starts at max_tokens. The token_count will always be
  1257. /// between 0 and max_tokens.
  1258. ///
  1259. /// This field is required and must be greater than zero.
  1260. var maxTokens: UInt32 = 0
  1261. /// The amount of tokens to add on each successful RPC. Typically this will
  1262. /// be some number between 0 and 1, e.g., 0.1.
  1263. ///
  1264. /// This field is required and must be greater than zero. Up to 3 decimal
  1265. /// places are supported.
  1266. var tokenRatio: Float = 0
  1267. var unknownFields = SwiftProtobuf.UnknownStorage()
  1268. init() {}
  1269. }
  1270. struct HealthCheckConfig {
  1271. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1272. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1273. // methods supported on all messages.
  1274. /// Service name to use in the health-checking request.
  1275. var serviceName: SwiftProtobuf.Google_Protobuf_StringValue {
  1276. get {return _serviceName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  1277. set {_serviceName = newValue}
  1278. }
  1279. /// Returns true if `serviceName` has been explicitly set.
  1280. var hasServiceName: Bool {return self._serviceName != nil}
  1281. /// Clears the value of `serviceName`. Subsequent reads from it will return its default value.
  1282. mutating func clearServiceName() {self._serviceName = nil}
  1283. var unknownFields = SwiftProtobuf.UnknownStorage()
  1284. init() {}
  1285. fileprivate var _serviceName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  1286. }
  1287. init() {}
  1288. fileprivate var _retryThrottling: Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy? = nil
  1289. fileprivate var _healthCheckConfig: Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig? = nil
  1290. }
  1291. #if swift(>=4.2)
  1292. extension Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy: CaseIterable {
  1293. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1294. static let allCases: [Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy] = [
  1295. .unspecified,
  1296. .roundRobin,
  1297. ]
  1298. }
  1299. #endif // swift(>=4.2)
  1300. /// Represents an xDS server.
  1301. /// Deprecated.
  1302. struct Grpc_ServiceConfig_XdsServer {
  1303. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1304. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1305. // methods supported on all messages.
  1306. /// Required.
  1307. var serverUri: String = String()
  1308. /// A list of channel creds to use. The first supported type will be used.
  1309. var channelCreds: [Grpc_ServiceConfig_XdsServer.ChannelCredentials] = []
  1310. /// A repeated list of server features.
  1311. var serverFeatures: [SwiftProtobuf.Google_Protobuf_Value] = []
  1312. var unknownFields = SwiftProtobuf.UnknownStorage()
  1313. struct ChannelCredentials {
  1314. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1315. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1316. // methods supported on all messages.
  1317. /// Required.
  1318. var type: String = String()
  1319. /// Optional JSON config.
  1320. var config: SwiftProtobuf.Google_Protobuf_Struct {
  1321. get {return _config ?? SwiftProtobuf.Google_Protobuf_Struct()}
  1322. set {_config = newValue}
  1323. }
  1324. /// Returns true if `config` has been explicitly set.
  1325. var hasConfig: Bool {return self._config != nil}
  1326. /// Clears the value of `config`. Subsequent reads from it will return its default value.
  1327. mutating func clearConfig() {self._config = nil}
  1328. var unknownFields = SwiftProtobuf.UnknownStorage()
  1329. init() {}
  1330. fileprivate var _config: SwiftProtobuf.Google_Protobuf_Struct? = nil
  1331. }
  1332. init() {}
  1333. }
  1334. /// Configuration for xds_cluster_resolver LB policy.
  1335. /// Deprecated.
  1336. struct Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig {
  1337. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1338. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1339. // methods supported on all messages.
  1340. /// Ordered list of discovery mechanisms.
  1341. /// Must have at least one element.
  1342. /// Results from each discovery mechanism are concatenated together in
  1343. /// successive priorities.
  1344. var discoveryMechanisms: [Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism] = []
  1345. /// xDS LB policy. Will be used as the child config of the xds_cluster_impl LB policy.
  1346. var xdsLbPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1347. var unknownFields = SwiftProtobuf.UnknownStorage()
  1348. /// Describes a discovery mechanism instance.
  1349. /// For EDS or LOGICAL_DNS clusters, there will be exactly one
  1350. /// DiscoveryMechanism, which will describe the cluster of the parent
  1351. /// CDS policy.
  1352. /// For aggregate clusters, there will be one DiscoveryMechanism for each
  1353. /// underlying cluster.
  1354. struct DiscoveryMechanism {
  1355. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1356. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1357. // methods supported on all messages.
  1358. /// Cluster name.
  1359. var cluster: String {
  1360. get {return _storage._cluster}
  1361. set {_uniqueStorage()._cluster = newValue}
  1362. }
  1363. /// LRS server to send load reports to.
  1364. /// If not present, load reporting will be disabled.
  1365. /// If set to the empty string, load reporting will be sent to the same
  1366. /// server that we obtained CDS data from.
  1367. /// DEPRECATED: Use new lrs_load_reporting_server field instead.
  1368. var lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue {
  1369. get {return _storage._lrsLoadReportingServerName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  1370. set {_uniqueStorage()._lrsLoadReportingServerName = newValue}
  1371. }
  1372. /// Returns true if `lrsLoadReportingServerName` has been explicitly set.
  1373. var hasLrsLoadReportingServerName: Bool {return _storage._lrsLoadReportingServerName != nil}
  1374. /// Clears the value of `lrsLoadReportingServerName`. Subsequent reads from it will return its default value.
  1375. mutating func clearLrsLoadReportingServerName() {_uniqueStorage()._lrsLoadReportingServerName = nil}
  1376. /// LRS server to send load reports to.
  1377. /// If not present, load reporting will be disabled.
  1378. /// Supercedes lrs_load_reporting_server_name field.
  1379. var lrsLoadReportingServer: Grpc_ServiceConfig_XdsServer {
  1380. get {return _storage._lrsLoadReportingServer ?? Grpc_ServiceConfig_XdsServer()}
  1381. set {_uniqueStorage()._lrsLoadReportingServer = newValue}
  1382. }
  1383. /// Returns true if `lrsLoadReportingServer` has been explicitly set.
  1384. var hasLrsLoadReportingServer: Bool {return _storage._lrsLoadReportingServer != nil}
  1385. /// Clears the value of `lrsLoadReportingServer`. Subsequent reads from it will return its default value.
  1386. mutating func clearLrsLoadReportingServer() {_uniqueStorage()._lrsLoadReportingServer = nil}
  1387. /// Maximum number of outstanding requests can be made to the upstream
  1388. /// cluster. Default is 1024.
  1389. var maxConcurrentRequests: SwiftProtobuf.Google_Protobuf_UInt32Value {
  1390. get {return _storage._maxConcurrentRequests ?? SwiftProtobuf.Google_Protobuf_UInt32Value()}
  1391. set {_uniqueStorage()._maxConcurrentRequests = newValue}
  1392. }
  1393. /// Returns true if `maxConcurrentRequests` has been explicitly set.
  1394. var hasMaxConcurrentRequests: Bool {return _storage._maxConcurrentRequests != nil}
  1395. /// Clears the value of `maxConcurrentRequests`. Subsequent reads from it will return its default value.
  1396. mutating func clearMaxConcurrentRequests() {_uniqueStorage()._maxConcurrentRequests = nil}
  1397. var type: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum {
  1398. get {return _storage._type}
  1399. set {_uniqueStorage()._type = newValue}
  1400. }
  1401. /// For type EDS only.
  1402. /// EDS service name, as returned in CDS.
  1403. /// May be unset if not specified in CDS.
  1404. var edsServiceName: String {
  1405. get {return _storage._edsServiceName}
  1406. set {_uniqueStorage()._edsServiceName = newValue}
  1407. }
  1408. /// For type LOGICAL_DNS only.
  1409. /// DNS name to resolve in "host:port" form.
  1410. var dnsHostname: String {
  1411. get {return _storage._dnsHostname}
  1412. set {_uniqueStorage()._dnsHostname = newValue}
  1413. }
  1414. /// The configuration for outlier_detection child policies
  1415. /// Within this message, the child_policy field will be ignored
  1416. var outlierDetection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig {
  1417. get {return _storage._outlierDetection ?? Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig()}
  1418. set {_uniqueStorage()._outlierDetection = newValue}
  1419. }
  1420. /// Returns true if `outlierDetection` has been explicitly set.
  1421. var hasOutlierDetection: Bool {return _storage._outlierDetection != nil}
  1422. /// Clears the value of `outlierDetection`. Subsequent reads from it will return its default value.
  1423. mutating func clearOutlierDetection() {_uniqueStorage()._outlierDetection = nil}
  1424. /// The configuration for xds_override_host child policy
  1425. var overrideHostStatus: [Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus] {
  1426. get {return _storage._overrideHostStatus}
  1427. set {_uniqueStorage()._overrideHostStatus = newValue}
  1428. }
  1429. /// Telemetry labels associated with this cluster
  1430. var telemetryLabels: Dictionary<String,String> {
  1431. get {return _storage._telemetryLabels}
  1432. set {_uniqueStorage()._telemetryLabels = newValue}
  1433. }
  1434. var unknownFields = SwiftProtobuf.UnknownStorage()
  1435. enum TypeEnum: SwiftProtobuf.Enum {
  1436. typealias RawValue = Int
  1437. case unknown // = 0
  1438. case eds // = 1
  1439. case logicalDns // = 2
  1440. case UNRECOGNIZED(Int)
  1441. init() {
  1442. self = .unknown
  1443. }
  1444. init?(rawValue: Int) {
  1445. switch rawValue {
  1446. case 0: self = .unknown
  1447. case 1: self = .eds
  1448. case 2: self = .logicalDns
  1449. default: self = .UNRECOGNIZED(rawValue)
  1450. }
  1451. }
  1452. var rawValue: Int {
  1453. switch self {
  1454. case .unknown: return 0
  1455. case .eds: return 1
  1456. case .logicalDns: return 2
  1457. case .UNRECOGNIZED(let i): return i
  1458. }
  1459. }
  1460. }
  1461. init() {}
  1462. fileprivate var _storage = _StorageClass.defaultInstance
  1463. }
  1464. init() {}
  1465. }
  1466. #if swift(>=4.2)
  1467. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum: CaseIterable {
  1468. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1469. static let allCases: [Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum] = [
  1470. .unknown,
  1471. .eds,
  1472. .logicalDns,
  1473. ]
  1474. }
  1475. #endif // swift(>=4.2)
  1476. /// Configuration for lrs LB policy.
  1477. /// Deprecated.
  1478. struct Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig {
  1479. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1480. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1481. // methods supported on all messages.
  1482. /// Cluster name. Required.
  1483. var clusterName: String = String()
  1484. /// EDS service name, as returned in CDS.
  1485. /// May be unset if not specified in CDS.
  1486. var edsServiceName: String = String()
  1487. /// Server to send load reports to. Required.
  1488. /// If set to empty string, load reporting will be sent to the same
  1489. /// server as we are getting xds data from.
  1490. var lrsLoadReportingServerName: String = String()
  1491. var locality: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality {
  1492. get {return _locality ?? Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality()}
  1493. set {_locality = newValue}
  1494. }
  1495. /// Returns true if `locality` has been explicitly set.
  1496. var hasLocality: Bool {return self._locality != nil}
  1497. /// Clears the value of `locality`. Subsequent reads from it will return its default value.
  1498. mutating func clearLocality() {self._locality = nil}
  1499. /// Endpoint-picking policy.
  1500. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1501. var unknownFields = SwiftProtobuf.UnknownStorage()
  1502. /// The locality for which this policy will report load. Required.
  1503. struct Locality {
  1504. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1505. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1506. // methods supported on all messages.
  1507. var region: String = String()
  1508. var zone: String = String()
  1509. var subzone: String = String()
  1510. var unknownFields = SwiftProtobuf.UnknownStorage()
  1511. init() {}
  1512. }
  1513. init() {}
  1514. fileprivate var _locality: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality? = nil
  1515. }
  1516. /// Configuration for eds LB policy.
  1517. /// Deprecated.
  1518. struct Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig {
  1519. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1520. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1521. // methods supported on all messages.
  1522. /// Cluster name. Required.
  1523. var cluster: String = String()
  1524. /// EDS service name, as returned in CDS.
  1525. /// May be unset if not specified in CDS.
  1526. var edsServiceName: String = String()
  1527. /// Server to send load reports to.
  1528. /// If unset, no load reporting is done.
  1529. /// If set to empty string, load reporting will be sent to the same
  1530. /// server as we are getting xds data from.
  1531. var lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue {
  1532. get {return _lrsLoadReportingServerName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  1533. set {_lrsLoadReportingServerName = newValue}
  1534. }
  1535. /// Returns true if `lrsLoadReportingServerName` has been explicitly set.
  1536. var hasLrsLoadReportingServerName: Bool {return self._lrsLoadReportingServerName != nil}
  1537. /// Clears the value of `lrsLoadReportingServerName`. Subsequent reads from it will return its default value.
  1538. mutating func clearLrsLoadReportingServerName() {self._lrsLoadReportingServerName = nil}
  1539. /// Locality-picking policy.
  1540. /// This policy's config is expected to be in the format used
  1541. /// by the weighted_target policy. Note that the config should include
  1542. /// an empty value for the "targets" field; that empty value will be
  1543. /// replaced by one that is dynamically generated based on the EDS data.
  1544. /// Optional; defaults to "weighted_target".
  1545. var localityPickingPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1546. /// Endpoint-picking policy.
  1547. /// This will be configured as the policy for each child in the
  1548. /// locality-policy's config.
  1549. /// Optional; defaults to "round_robin".
  1550. var endpointPickingPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1551. var unknownFields = SwiftProtobuf.UnknownStorage()
  1552. init() {}
  1553. fileprivate var _lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  1554. }
  1555. /// Configuration for xds LB policy.
  1556. /// Deprecated.
  1557. struct Grpc_ServiceConfig_XdsConfig {
  1558. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1559. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1560. // methods supported on all messages.
  1561. /// Name of balancer to connect to.
  1562. var balancerName: String = String()
  1563. /// Optional. What LB policy to use for intra-locality routing.
  1564. /// If unset, will use whatever algorithm is specified by the balancer.
  1565. /// Multiple LB policies can be specified; clients will iterate through
  1566. /// the list in order and stop at the first policy that they support.
  1567. var childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1568. /// Optional. What LB policy to use in fallback mode. If not
  1569. /// specified, defaults to round_robin.
  1570. /// Multiple LB policies can be specified; clients will iterate through
  1571. /// the list in order and stop at the first policy that they support.
  1572. var fallbackPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  1573. /// Optional. Name to use in EDS query. If not present, defaults to
  1574. /// the server name from the target URI.
  1575. var edsServiceName: String = String()
  1576. /// LRS server to send load reports to.
  1577. /// If not present, load reporting will be disabled.
  1578. /// If set to the empty string, load reporting will be sent to the same
  1579. /// server that we obtained CDS data from.
  1580. var lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue {
  1581. get {return _lrsLoadReportingServerName ?? SwiftProtobuf.Google_Protobuf_StringValue()}
  1582. set {_lrsLoadReportingServerName = newValue}
  1583. }
  1584. /// Returns true if `lrsLoadReportingServerName` has been explicitly set.
  1585. var hasLrsLoadReportingServerName: Bool {return self._lrsLoadReportingServerName != nil}
  1586. /// Clears the value of `lrsLoadReportingServerName`. Subsequent reads from it will return its default value.
  1587. mutating func clearLrsLoadReportingServerName() {self._lrsLoadReportingServerName = nil}
  1588. var unknownFields = SwiftProtobuf.UnknownStorage()
  1589. init() {}
  1590. fileprivate var _lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  1591. }
  1592. #if swift(>=5.5) && canImport(_Concurrency)
  1593. extension Grpc_ServiceConfig_MethodConfig: @unchecked Sendable {}
  1594. extension Grpc_ServiceConfig_MethodConfig.OneOf_RetryOrHedgingPolicy: @unchecked Sendable {}
  1595. extension Grpc_ServiceConfig_MethodConfig.Name: @unchecked Sendable {}
  1596. extension Grpc_ServiceConfig_MethodConfig.RetryPolicy: @unchecked Sendable {}
  1597. extension Grpc_ServiceConfig_MethodConfig.HedgingPolicy: @unchecked Sendable {}
  1598. extension Grpc_ServiceConfig_PickFirstConfig: @unchecked Sendable {}
  1599. extension Grpc_ServiceConfig_RoundRobinConfig: @unchecked Sendable {}
  1600. extension Grpc_ServiceConfig_WeightedRoundRobinLbConfig: @unchecked Sendable {}
  1601. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig: @unchecked Sendable {}
  1602. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection: @unchecked Sendable {}
  1603. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection: @unchecked Sendable {}
  1604. extension Grpc_ServiceConfig_GrpcLbConfig: @unchecked Sendable {}
  1605. extension Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig: @unchecked Sendable {}
  1606. extension Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child: @unchecked Sendable {}
  1607. extension Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig: @unchecked Sendable {}
  1608. extension Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target: @unchecked Sendable {}
  1609. extension Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig: @unchecked Sendable {}
  1610. extension Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig: @unchecked Sendable {}
  1611. extension Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child: @unchecked Sendable {}
  1612. extension Grpc_ServiceConfig_CdsConfig: @unchecked Sendable {}
  1613. extension Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig: @unchecked Sendable {}
  1614. extension Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory: @unchecked Sendable {}
  1615. extension Grpc_ServiceConfig_RingHashLoadBalancingConfig: @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_LoadBalancingConfig: @unchecked Sendable {}
  1621. extension Grpc_ServiceConfig_LoadBalancingConfig.OneOf_Policy: @unchecked Sendable {}
  1622. extension Grpc_ServiceConfig_ServiceConfig: @unchecked Sendable {}
  1623. extension Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy: @unchecked Sendable {}
  1624. extension Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy: @unchecked Sendable {}
  1625. extension Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig: @unchecked Sendable {}
  1626. extension Grpc_ServiceConfig_XdsServer: @unchecked Sendable {}
  1627. extension Grpc_ServiceConfig_XdsServer.ChannelCredentials: @unchecked Sendable {}
  1628. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig: @unchecked Sendable {}
  1629. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism: @unchecked Sendable {}
  1630. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum: @unchecked Sendable {}
  1631. extension Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig: @unchecked Sendable {}
  1632. extension Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality: @unchecked Sendable {}
  1633. extension Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig: @unchecked Sendable {}
  1634. extension Grpc_ServiceConfig_XdsConfig: @unchecked Sendable {}
  1635. #endif // swift(>=5.5) && canImport(_Concurrency)
  1636. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  1637. fileprivate let _protobuf_package = "grpc.service_config"
  1638. extension Grpc_ServiceConfig_MethodConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1639. static let protoMessageName: String = _protobuf_package + ".MethodConfig"
  1640. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1641. 1: .same(proto: "name"),
  1642. 2: .standard(proto: "wait_for_ready"),
  1643. 3: .same(proto: "timeout"),
  1644. 4: .standard(proto: "max_request_message_bytes"),
  1645. 5: .standard(proto: "max_response_message_bytes"),
  1646. 6: .standard(proto: "retry_policy"),
  1647. 7: .standard(proto: "hedging_policy"),
  1648. ]
  1649. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1650. while let fieldNumber = try decoder.nextFieldNumber() {
  1651. // The use of inline closures is to circumvent an issue where the compiler
  1652. // allocates stack space for every case branch when no optimizations are
  1653. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1654. switch fieldNumber {
  1655. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.name) }()
  1656. case 2: try { try decoder.decodeSingularMessageField(value: &self._waitForReady) }()
  1657. case 3: try { try decoder.decodeSingularMessageField(value: &self._timeout) }()
  1658. case 4: try { try decoder.decodeSingularMessageField(value: &self._maxRequestMessageBytes) }()
  1659. case 5: try { try decoder.decodeSingularMessageField(value: &self._maxResponseMessageBytes) }()
  1660. case 6: try {
  1661. var v: Grpc_ServiceConfig_MethodConfig.RetryPolicy?
  1662. var hadOneofValue = false
  1663. if let current = self.retryOrHedgingPolicy {
  1664. hadOneofValue = true
  1665. if case .retryPolicy(let m) = current {v = m}
  1666. }
  1667. try decoder.decodeSingularMessageField(value: &v)
  1668. if let v = v {
  1669. if hadOneofValue {try decoder.handleConflictingOneOf()}
  1670. self.retryOrHedgingPolicy = .retryPolicy(v)
  1671. }
  1672. }()
  1673. case 7: try {
  1674. var v: Grpc_ServiceConfig_MethodConfig.HedgingPolicy?
  1675. var hadOneofValue = false
  1676. if let current = self.retryOrHedgingPolicy {
  1677. hadOneofValue = true
  1678. if case .hedgingPolicy(let m) = current {v = m}
  1679. }
  1680. try decoder.decodeSingularMessageField(value: &v)
  1681. if let v = v {
  1682. if hadOneofValue {try decoder.handleConflictingOneOf()}
  1683. self.retryOrHedgingPolicy = .hedgingPolicy(v)
  1684. }
  1685. }()
  1686. default: break
  1687. }
  1688. }
  1689. }
  1690. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1691. // The use of inline closures is to circumvent an issue where the compiler
  1692. // allocates stack space for every if/case branch local when no optimizations
  1693. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1694. // https://github.com/apple/swift-protobuf/issues/1182
  1695. if !self.name.isEmpty {
  1696. try visitor.visitRepeatedMessageField(value: self.name, fieldNumber: 1)
  1697. }
  1698. try { if let v = self._waitForReady {
  1699. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  1700. } }()
  1701. try { if let v = self._timeout {
  1702. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  1703. } }()
  1704. try { if let v = self._maxRequestMessageBytes {
  1705. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  1706. } }()
  1707. try { if let v = self._maxResponseMessageBytes {
  1708. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  1709. } }()
  1710. switch self.retryOrHedgingPolicy {
  1711. case .retryPolicy?: try {
  1712. guard case .retryPolicy(let v)? = self.retryOrHedgingPolicy else { preconditionFailure() }
  1713. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  1714. }()
  1715. case .hedgingPolicy?: try {
  1716. guard case .hedgingPolicy(let v)? = self.retryOrHedgingPolicy else { preconditionFailure() }
  1717. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  1718. }()
  1719. case nil: break
  1720. }
  1721. try unknownFields.traverse(visitor: &visitor)
  1722. }
  1723. static func ==(lhs: Grpc_ServiceConfig_MethodConfig, rhs: Grpc_ServiceConfig_MethodConfig) -> Bool {
  1724. if lhs.name != rhs.name {return false}
  1725. if lhs._waitForReady != rhs._waitForReady {return false}
  1726. if lhs._timeout != rhs._timeout {return false}
  1727. if lhs._maxRequestMessageBytes != rhs._maxRequestMessageBytes {return false}
  1728. if lhs._maxResponseMessageBytes != rhs._maxResponseMessageBytes {return false}
  1729. if lhs.retryOrHedgingPolicy != rhs.retryOrHedgingPolicy {return false}
  1730. if lhs.unknownFields != rhs.unknownFields {return false}
  1731. return true
  1732. }
  1733. }
  1734. extension Grpc_ServiceConfig_MethodConfig.Name: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1735. static let protoMessageName: String = Grpc_ServiceConfig_MethodConfig.protoMessageName + ".Name"
  1736. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1737. 1: .same(proto: "service"),
  1738. 2: .same(proto: "method"),
  1739. ]
  1740. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1741. while let fieldNumber = try decoder.nextFieldNumber() {
  1742. // The use of inline closures is to circumvent an issue where the compiler
  1743. // allocates stack space for every case branch when no optimizations are
  1744. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1745. switch fieldNumber {
  1746. case 1: try { try decoder.decodeSingularStringField(value: &self.service) }()
  1747. case 2: try { try decoder.decodeSingularStringField(value: &self.method) }()
  1748. default: break
  1749. }
  1750. }
  1751. }
  1752. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1753. if !self.service.isEmpty {
  1754. try visitor.visitSingularStringField(value: self.service, fieldNumber: 1)
  1755. }
  1756. if !self.method.isEmpty {
  1757. try visitor.visitSingularStringField(value: self.method, fieldNumber: 2)
  1758. }
  1759. try unknownFields.traverse(visitor: &visitor)
  1760. }
  1761. static func ==(lhs: Grpc_ServiceConfig_MethodConfig.Name, rhs: Grpc_ServiceConfig_MethodConfig.Name) -> Bool {
  1762. if lhs.service != rhs.service {return false}
  1763. if lhs.method != rhs.method {return false}
  1764. if lhs.unknownFields != rhs.unknownFields {return false}
  1765. return true
  1766. }
  1767. }
  1768. extension Grpc_ServiceConfig_MethodConfig.RetryPolicy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1769. static let protoMessageName: String = Grpc_ServiceConfig_MethodConfig.protoMessageName + ".RetryPolicy"
  1770. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1771. 1: .standard(proto: "max_attempts"),
  1772. 2: .standard(proto: "initial_backoff"),
  1773. 3: .standard(proto: "max_backoff"),
  1774. 4: .standard(proto: "backoff_multiplier"),
  1775. 5: .standard(proto: "retryable_status_codes"),
  1776. ]
  1777. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1778. while let fieldNumber = try decoder.nextFieldNumber() {
  1779. // The use of inline closures is to circumvent an issue where the compiler
  1780. // allocates stack space for every case branch when no optimizations are
  1781. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1782. switch fieldNumber {
  1783. case 1: try { try decoder.decodeSingularUInt32Field(value: &self.maxAttempts) }()
  1784. case 2: try { try decoder.decodeSingularMessageField(value: &self._initialBackoff) }()
  1785. case 3: try { try decoder.decodeSingularMessageField(value: &self._maxBackoff) }()
  1786. case 4: try { try decoder.decodeSingularFloatField(value: &self.backoffMultiplier) }()
  1787. case 5: try { try decoder.decodeRepeatedEnumField(value: &self.retryableStatusCodes) }()
  1788. default: break
  1789. }
  1790. }
  1791. }
  1792. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1793. // The use of inline closures is to circumvent an issue where the compiler
  1794. // allocates stack space for every if/case branch local when no optimizations
  1795. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1796. // https://github.com/apple/swift-protobuf/issues/1182
  1797. if self.maxAttempts != 0 {
  1798. try visitor.visitSingularUInt32Field(value: self.maxAttempts, fieldNumber: 1)
  1799. }
  1800. try { if let v = self._initialBackoff {
  1801. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  1802. } }()
  1803. try { if let v = self._maxBackoff {
  1804. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  1805. } }()
  1806. if self.backoffMultiplier != 0 {
  1807. try visitor.visitSingularFloatField(value: self.backoffMultiplier, fieldNumber: 4)
  1808. }
  1809. if !self.retryableStatusCodes.isEmpty {
  1810. try visitor.visitPackedEnumField(value: self.retryableStatusCodes, fieldNumber: 5)
  1811. }
  1812. try unknownFields.traverse(visitor: &visitor)
  1813. }
  1814. static func ==(lhs: Grpc_ServiceConfig_MethodConfig.RetryPolicy, rhs: Grpc_ServiceConfig_MethodConfig.RetryPolicy) -> Bool {
  1815. if lhs.maxAttempts != rhs.maxAttempts {return false}
  1816. if lhs._initialBackoff != rhs._initialBackoff {return false}
  1817. if lhs._maxBackoff != rhs._maxBackoff {return false}
  1818. if lhs.backoffMultiplier != rhs.backoffMultiplier {return false}
  1819. if lhs.retryableStatusCodes != rhs.retryableStatusCodes {return false}
  1820. if lhs.unknownFields != rhs.unknownFields {return false}
  1821. return true
  1822. }
  1823. }
  1824. extension Grpc_ServiceConfig_MethodConfig.HedgingPolicy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1825. static let protoMessageName: String = Grpc_ServiceConfig_MethodConfig.protoMessageName + ".HedgingPolicy"
  1826. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1827. 1: .standard(proto: "max_attempts"),
  1828. 2: .standard(proto: "hedging_delay"),
  1829. 3: .standard(proto: "non_fatal_status_codes"),
  1830. ]
  1831. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1832. while let fieldNumber = try decoder.nextFieldNumber() {
  1833. // The use of inline closures is to circumvent an issue where the compiler
  1834. // allocates stack space for every case branch when no optimizations are
  1835. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1836. switch fieldNumber {
  1837. case 1: try { try decoder.decodeSingularUInt32Field(value: &self.maxAttempts) }()
  1838. case 2: try { try decoder.decodeSingularMessageField(value: &self._hedgingDelay) }()
  1839. case 3: try { try decoder.decodeRepeatedEnumField(value: &self.nonFatalStatusCodes) }()
  1840. default: break
  1841. }
  1842. }
  1843. }
  1844. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1845. // The use of inline closures is to circumvent an issue where the compiler
  1846. // allocates stack space for every if/case branch local when no optimizations
  1847. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1848. // https://github.com/apple/swift-protobuf/issues/1182
  1849. if self.maxAttempts != 0 {
  1850. try visitor.visitSingularUInt32Field(value: self.maxAttempts, fieldNumber: 1)
  1851. }
  1852. try { if let v = self._hedgingDelay {
  1853. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  1854. } }()
  1855. if !self.nonFatalStatusCodes.isEmpty {
  1856. try visitor.visitPackedEnumField(value: self.nonFatalStatusCodes, fieldNumber: 3)
  1857. }
  1858. try unknownFields.traverse(visitor: &visitor)
  1859. }
  1860. static func ==(lhs: Grpc_ServiceConfig_MethodConfig.HedgingPolicy, rhs: Grpc_ServiceConfig_MethodConfig.HedgingPolicy) -> Bool {
  1861. if lhs.maxAttempts != rhs.maxAttempts {return false}
  1862. if lhs._hedgingDelay != rhs._hedgingDelay {return false}
  1863. if lhs.nonFatalStatusCodes != rhs.nonFatalStatusCodes {return false}
  1864. if lhs.unknownFields != rhs.unknownFields {return false}
  1865. return true
  1866. }
  1867. }
  1868. extension Grpc_ServiceConfig_PickFirstConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1869. static let protoMessageName: String = _protobuf_package + ".PickFirstConfig"
  1870. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1871. 1: .standard(proto: "shuffle_address_list"),
  1872. ]
  1873. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1874. while let fieldNumber = try decoder.nextFieldNumber() {
  1875. // The use of inline closures is to circumvent an issue where the compiler
  1876. // allocates stack space for every case branch when no optimizations are
  1877. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1878. switch fieldNumber {
  1879. case 1: try { try decoder.decodeSingularBoolField(value: &self.shuffleAddressList) }()
  1880. default: break
  1881. }
  1882. }
  1883. }
  1884. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1885. if self.shuffleAddressList != false {
  1886. try visitor.visitSingularBoolField(value: self.shuffleAddressList, fieldNumber: 1)
  1887. }
  1888. try unknownFields.traverse(visitor: &visitor)
  1889. }
  1890. static func ==(lhs: Grpc_ServiceConfig_PickFirstConfig, rhs: Grpc_ServiceConfig_PickFirstConfig) -> Bool {
  1891. if lhs.shuffleAddressList != rhs.shuffleAddressList {return false}
  1892. if lhs.unknownFields != rhs.unknownFields {return false}
  1893. return true
  1894. }
  1895. }
  1896. extension Grpc_ServiceConfig_RoundRobinConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1897. static let protoMessageName: String = _protobuf_package + ".RoundRobinConfig"
  1898. static let _protobuf_nameMap = SwiftProtobuf._NameMap()
  1899. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1900. while let _ = try decoder.nextFieldNumber() {
  1901. }
  1902. }
  1903. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1904. try unknownFields.traverse(visitor: &visitor)
  1905. }
  1906. static func ==(lhs: Grpc_ServiceConfig_RoundRobinConfig, rhs: Grpc_ServiceConfig_RoundRobinConfig) -> Bool {
  1907. if lhs.unknownFields != rhs.unknownFields {return false}
  1908. return true
  1909. }
  1910. }
  1911. extension Grpc_ServiceConfig_WeightedRoundRobinLbConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1912. static let protoMessageName: String = _protobuf_package + ".WeightedRoundRobinLbConfig"
  1913. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1914. 1: .standard(proto: "enable_oob_load_report"),
  1915. 2: .standard(proto: "oob_reporting_period"),
  1916. 3: .standard(proto: "blackout_period"),
  1917. 4: .standard(proto: "weight_expiration_period"),
  1918. 5: .standard(proto: "weight_update_period"),
  1919. 6: .standard(proto: "error_utilization_penalty"),
  1920. ]
  1921. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1922. while let fieldNumber = try decoder.nextFieldNumber() {
  1923. // The use of inline closures is to circumvent an issue where the compiler
  1924. // allocates stack space for every case branch when no optimizations are
  1925. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1926. switch fieldNumber {
  1927. case 1: try { try decoder.decodeSingularMessageField(value: &self._enableOobLoadReport) }()
  1928. case 2: try { try decoder.decodeSingularMessageField(value: &self._oobReportingPeriod) }()
  1929. case 3: try { try decoder.decodeSingularMessageField(value: &self._blackoutPeriod) }()
  1930. case 4: try { try decoder.decodeSingularMessageField(value: &self._weightExpirationPeriod) }()
  1931. case 5: try { try decoder.decodeSingularMessageField(value: &self._weightUpdatePeriod) }()
  1932. case 6: try { try decoder.decodeSingularMessageField(value: &self._errorUtilizationPenalty) }()
  1933. default: break
  1934. }
  1935. }
  1936. }
  1937. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1938. // The use of inline closures is to circumvent an issue where the compiler
  1939. // allocates stack space for every if/case branch local when no optimizations
  1940. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1941. // https://github.com/apple/swift-protobuf/issues/1182
  1942. try { if let v = self._enableOobLoadReport {
  1943. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  1944. } }()
  1945. try { if let v = self._oobReportingPeriod {
  1946. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  1947. } }()
  1948. try { if let v = self._blackoutPeriod {
  1949. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  1950. } }()
  1951. try { if let v = self._weightExpirationPeriod {
  1952. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  1953. } }()
  1954. try { if let v = self._weightUpdatePeriod {
  1955. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  1956. } }()
  1957. try { if let v = self._errorUtilizationPenalty {
  1958. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  1959. } }()
  1960. try unknownFields.traverse(visitor: &visitor)
  1961. }
  1962. static func ==(lhs: Grpc_ServiceConfig_WeightedRoundRobinLbConfig, rhs: Grpc_ServiceConfig_WeightedRoundRobinLbConfig) -> Bool {
  1963. if lhs._enableOobLoadReport != rhs._enableOobLoadReport {return false}
  1964. if lhs._oobReportingPeriod != rhs._oobReportingPeriod {return false}
  1965. if lhs._blackoutPeriod != rhs._blackoutPeriod {return false}
  1966. if lhs._weightExpirationPeriod != rhs._weightExpirationPeriod {return false}
  1967. if lhs._weightUpdatePeriod != rhs._weightUpdatePeriod {return false}
  1968. if lhs._errorUtilizationPenalty != rhs._errorUtilizationPenalty {return false}
  1969. if lhs.unknownFields != rhs.unknownFields {return false}
  1970. return true
  1971. }
  1972. }
  1973. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1974. static let protoMessageName: String = _protobuf_package + ".OutlierDetectionLoadBalancingConfig"
  1975. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1976. 1: .same(proto: "interval"),
  1977. 2: .standard(proto: "base_ejection_time"),
  1978. 3: .standard(proto: "max_ejection_time"),
  1979. 4: .standard(proto: "max_ejection_percent"),
  1980. 5: .standard(proto: "success_rate_ejection"),
  1981. 6: .standard(proto: "failure_percentage_ejection"),
  1982. 13: .standard(proto: "child_policy"),
  1983. ]
  1984. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1985. while let fieldNumber = try decoder.nextFieldNumber() {
  1986. // The use of inline closures is to circumvent an issue where the compiler
  1987. // allocates stack space for every case branch when no optimizations are
  1988. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1989. switch fieldNumber {
  1990. case 1: try { try decoder.decodeSingularMessageField(value: &self._interval) }()
  1991. case 2: try { try decoder.decodeSingularMessageField(value: &self._baseEjectionTime) }()
  1992. case 3: try { try decoder.decodeSingularMessageField(value: &self._maxEjectionTime) }()
  1993. case 4: try { try decoder.decodeSingularMessageField(value: &self._maxEjectionPercent) }()
  1994. case 5: try { try decoder.decodeSingularMessageField(value: &self._successRateEjection) }()
  1995. case 6: try { try decoder.decodeSingularMessageField(value: &self._failurePercentageEjection) }()
  1996. case 13: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  1997. default: break
  1998. }
  1999. }
  2000. }
  2001. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2002. // The use of inline closures is to circumvent an issue where the compiler
  2003. // allocates stack space for every if/case branch local when no optimizations
  2004. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2005. // https://github.com/apple/swift-protobuf/issues/1182
  2006. try { if let v = self._interval {
  2007. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2008. } }()
  2009. try { if let v = self._baseEjectionTime {
  2010. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2011. } }()
  2012. try { if let v = self._maxEjectionTime {
  2013. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2014. } }()
  2015. try { if let v = self._maxEjectionPercent {
  2016. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2017. } }()
  2018. try { if let v = self._successRateEjection {
  2019. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  2020. } }()
  2021. try { if let v = self._failurePercentageEjection {
  2022. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  2023. } }()
  2024. if !self.childPolicy.isEmpty {
  2025. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 13)
  2026. }
  2027. try unknownFields.traverse(visitor: &visitor)
  2028. }
  2029. static func ==(lhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig, rhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig) -> Bool {
  2030. if lhs._interval != rhs._interval {return false}
  2031. if lhs._baseEjectionTime != rhs._baseEjectionTime {return false}
  2032. if lhs._maxEjectionTime != rhs._maxEjectionTime {return false}
  2033. if lhs._maxEjectionPercent != rhs._maxEjectionPercent {return false}
  2034. if lhs._successRateEjection != rhs._successRateEjection {return false}
  2035. if lhs._failurePercentageEjection != rhs._failurePercentageEjection {return false}
  2036. if lhs.childPolicy != rhs.childPolicy {return false}
  2037. if lhs.unknownFields != rhs.unknownFields {return false}
  2038. return true
  2039. }
  2040. }
  2041. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2042. static let protoMessageName: String = Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.protoMessageName + ".SuccessRateEjection"
  2043. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2044. 1: .standard(proto: "stdev_factor"),
  2045. 2: .standard(proto: "enforcement_percentage"),
  2046. 3: .standard(proto: "minimum_hosts"),
  2047. 4: .standard(proto: "request_volume"),
  2048. ]
  2049. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2050. while let fieldNumber = try decoder.nextFieldNumber() {
  2051. // The use of inline closures is to circumvent an issue where the compiler
  2052. // allocates stack space for every case branch when no optimizations are
  2053. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2054. switch fieldNumber {
  2055. case 1: try { try decoder.decodeSingularMessageField(value: &self._stdevFactor) }()
  2056. case 2: try { try decoder.decodeSingularMessageField(value: &self._enforcementPercentage) }()
  2057. case 3: try { try decoder.decodeSingularMessageField(value: &self._minimumHosts) }()
  2058. case 4: try { try decoder.decodeSingularMessageField(value: &self._requestVolume) }()
  2059. default: break
  2060. }
  2061. }
  2062. }
  2063. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2064. // The use of inline closures is to circumvent an issue where the compiler
  2065. // allocates stack space for every if/case branch local when no optimizations
  2066. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2067. // https://github.com/apple/swift-protobuf/issues/1182
  2068. try { if let v = self._stdevFactor {
  2069. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2070. } }()
  2071. try { if let v = self._enforcementPercentage {
  2072. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2073. } }()
  2074. try { if let v = self._minimumHosts {
  2075. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2076. } }()
  2077. try { if let v = self._requestVolume {
  2078. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2079. } }()
  2080. try unknownFields.traverse(visitor: &visitor)
  2081. }
  2082. static func ==(lhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection, rhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.SuccessRateEjection) -> Bool {
  2083. if lhs._stdevFactor != rhs._stdevFactor {return false}
  2084. if lhs._enforcementPercentage != rhs._enforcementPercentage {return false}
  2085. if lhs._minimumHosts != rhs._minimumHosts {return false}
  2086. if lhs._requestVolume != rhs._requestVolume {return false}
  2087. if lhs.unknownFields != rhs.unknownFields {return false}
  2088. return true
  2089. }
  2090. }
  2091. extension Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2092. static let protoMessageName: String = Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.protoMessageName + ".FailurePercentageEjection"
  2093. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2094. 1: .same(proto: "threshold"),
  2095. 2: .standard(proto: "enforcement_percentage"),
  2096. 3: .standard(proto: "minimum_hosts"),
  2097. 4: .standard(proto: "request_volume"),
  2098. ]
  2099. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2100. while let fieldNumber = try decoder.nextFieldNumber() {
  2101. // The use of inline closures is to circumvent an issue where the compiler
  2102. // allocates stack space for every case branch when no optimizations are
  2103. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2104. switch fieldNumber {
  2105. case 1: try { try decoder.decodeSingularMessageField(value: &self._threshold) }()
  2106. case 2: try { try decoder.decodeSingularMessageField(value: &self._enforcementPercentage) }()
  2107. case 3: try { try decoder.decodeSingularMessageField(value: &self._minimumHosts) }()
  2108. case 4: try { try decoder.decodeSingularMessageField(value: &self._requestVolume) }()
  2109. default: break
  2110. }
  2111. }
  2112. }
  2113. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2114. // The use of inline closures is to circumvent an issue where the compiler
  2115. // allocates stack space for every if/case branch local when no optimizations
  2116. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2117. // https://github.com/apple/swift-protobuf/issues/1182
  2118. try { if let v = self._threshold {
  2119. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2120. } }()
  2121. try { if let v = self._enforcementPercentage {
  2122. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2123. } }()
  2124. try { if let v = self._minimumHosts {
  2125. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2126. } }()
  2127. try { if let v = self._requestVolume {
  2128. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2129. } }()
  2130. try unknownFields.traverse(visitor: &visitor)
  2131. }
  2132. static func ==(lhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection, rhs: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig.FailurePercentageEjection) -> Bool {
  2133. if lhs._threshold != rhs._threshold {return false}
  2134. if lhs._enforcementPercentage != rhs._enforcementPercentage {return false}
  2135. if lhs._minimumHosts != rhs._minimumHosts {return false}
  2136. if lhs._requestVolume != rhs._requestVolume {return false}
  2137. if lhs.unknownFields != rhs.unknownFields {return false}
  2138. return true
  2139. }
  2140. }
  2141. extension Grpc_ServiceConfig_GrpcLbConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2142. static let protoMessageName: String = _protobuf_package + ".GrpcLbConfig"
  2143. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2144. 1: .standard(proto: "child_policy"),
  2145. 2: .standard(proto: "service_name"),
  2146. 3: .standard(proto: "initial_fallback_timeout"),
  2147. ]
  2148. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2149. while let fieldNumber = try decoder.nextFieldNumber() {
  2150. // The use of inline closures is to circumvent an issue where the compiler
  2151. // allocates stack space for every case branch when no optimizations are
  2152. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2153. switch fieldNumber {
  2154. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2155. case 2: try { try decoder.decodeSingularStringField(value: &self.serviceName) }()
  2156. case 3: try { try decoder.decodeSingularMessageField(value: &self._initialFallbackTimeout) }()
  2157. default: break
  2158. }
  2159. }
  2160. }
  2161. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2162. // The use of inline closures is to circumvent an issue where the compiler
  2163. // allocates stack space for every if/case branch local when no optimizations
  2164. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2165. // https://github.com/apple/swift-protobuf/issues/1182
  2166. if !self.childPolicy.isEmpty {
  2167. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 1)
  2168. }
  2169. if !self.serviceName.isEmpty {
  2170. try visitor.visitSingularStringField(value: self.serviceName, fieldNumber: 2)
  2171. }
  2172. try { if let v = self._initialFallbackTimeout {
  2173. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2174. } }()
  2175. try unknownFields.traverse(visitor: &visitor)
  2176. }
  2177. static func ==(lhs: Grpc_ServiceConfig_GrpcLbConfig, rhs: Grpc_ServiceConfig_GrpcLbConfig) -> Bool {
  2178. if lhs.childPolicy != rhs.childPolicy {return false}
  2179. if lhs.serviceName != rhs.serviceName {return false}
  2180. if lhs._initialFallbackTimeout != rhs._initialFallbackTimeout {return false}
  2181. if lhs.unknownFields != rhs.unknownFields {return false}
  2182. return true
  2183. }
  2184. }
  2185. extension Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2186. static let protoMessageName: String = _protobuf_package + ".PriorityLoadBalancingPolicyConfig"
  2187. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2188. 1: .same(proto: "children"),
  2189. 2: .same(proto: "priorities"),
  2190. ]
  2191. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2192. while let fieldNumber = try decoder.nextFieldNumber() {
  2193. // The use of inline closures is to circumvent an issue where the compiler
  2194. // allocates stack space for every case branch when no optimizations are
  2195. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2196. switch fieldNumber {
  2197. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child>.self, value: &self.children) }()
  2198. case 2: try { try decoder.decodeRepeatedStringField(value: &self.priorities) }()
  2199. default: break
  2200. }
  2201. }
  2202. }
  2203. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2204. if !self.children.isEmpty {
  2205. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child>.self, value: self.children, fieldNumber: 1)
  2206. }
  2207. if !self.priorities.isEmpty {
  2208. try visitor.visitRepeatedStringField(value: self.priorities, fieldNumber: 2)
  2209. }
  2210. try unknownFields.traverse(visitor: &visitor)
  2211. }
  2212. static func ==(lhs: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig) -> Bool {
  2213. if lhs.children != rhs.children {return false}
  2214. if lhs.priorities != rhs.priorities {return false}
  2215. if lhs.unknownFields != rhs.unknownFields {return false}
  2216. return true
  2217. }
  2218. }
  2219. extension Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2220. static let protoMessageName: String = Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.protoMessageName + ".Child"
  2221. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2222. 1: .same(proto: "config"),
  2223. 2: .standard(proto: "ignore_reresolution_requests"),
  2224. ]
  2225. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2226. while let fieldNumber = try decoder.nextFieldNumber() {
  2227. // The use of inline closures is to circumvent an issue where the compiler
  2228. // allocates stack space for every case branch when no optimizations are
  2229. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2230. switch fieldNumber {
  2231. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.config) }()
  2232. case 2: try { try decoder.decodeSingularBoolField(value: &self.ignoreReresolutionRequests) }()
  2233. default: break
  2234. }
  2235. }
  2236. }
  2237. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2238. if !self.config.isEmpty {
  2239. try visitor.visitRepeatedMessageField(value: self.config, fieldNumber: 1)
  2240. }
  2241. if self.ignoreReresolutionRequests != false {
  2242. try visitor.visitSingularBoolField(value: self.ignoreReresolutionRequests, fieldNumber: 2)
  2243. }
  2244. try unknownFields.traverse(visitor: &visitor)
  2245. }
  2246. static func ==(lhs: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child, rhs: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig.Child) -> Bool {
  2247. if lhs.config != rhs.config {return false}
  2248. if lhs.ignoreReresolutionRequests != rhs.ignoreReresolutionRequests {return false}
  2249. if lhs.unknownFields != rhs.unknownFields {return false}
  2250. return true
  2251. }
  2252. }
  2253. extension Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2254. static let protoMessageName: String = _protobuf_package + ".WeightedTargetLoadBalancingPolicyConfig"
  2255. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2256. 1: .same(proto: "targets"),
  2257. ]
  2258. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2259. while let fieldNumber = try decoder.nextFieldNumber() {
  2260. // The use of inline closures is to circumvent an issue where the compiler
  2261. // allocates stack space for every case branch when no optimizations are
  2262. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2263. switch fieldNumber {
  2264. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target>.self, value: &self.targets) }()
  2265. default: break
  2266. }
  2267. }
  2268. }
  2269. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2270. if !self.targets.isEmpty {
  2271. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target>.self, value: self.targets, fieldNumber: 1)
  2272. }
  2273. try unknownFields.traverse(visitor: &visitor)
  2274. }
  2275. static func ==(lhs: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig) -> Bool {
  2276. if lhs.targets != rhs.targets {return false}
  2277. if lhs.unknownFields != rhs.unknownFields {return false}
  2278. return true
  2279. }
  2280. }
  2281. extension Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2282. static let protoMessageName: String = Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.protoMessageName + ".Target"
  2283. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2284. 1: .same(proto: "weight"),
  2285. 2: .standard(proto: "child_policy"),
  2286. ]
  2287. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2288. while let fieldNumber = try decoder.nextFieldNumber() {
  2289. // The use of inline closures is to circumvent an issue where the compiler
  2290. // allocates stack space for every case branch when no optimizations are
  2291. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2292. switch fieldNumber {
  2293. case 1: try { try decoder.decodeSingularUInt32Field(value: &self.weight) }()
  2294. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2295. default: break
  2296. }
  2297. }
  2298. }
  2299. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2300. if self.weight != 0 {
  2301. try visitor.visitSingularUInt32Field(value: self.weight, fieldNumber: 1)
  2302. }
  2303. if !self.childPolicy.isEmpty {
  2304. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 2)
  2305. }
  2306. try unknownFields.traverse(visitor: &visitor)
  2307. }
  2308. static func ==(lhs: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target, rhs: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig.Target) -> Bool {
  2309. if lhs.weight != rhs.weight {return false}
  2310. if lhs.childPolicy != rhs.childPolicy {return false}
  2311. if lhs.unknownFields != rhs.unknownFields {return false}
  2312. return true
  2313. }
  2314. }
  2315. extension Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2316. static let protoMessageName: String = _protobuf_package + ".RlsLoadBalancingPolicyConfig"
  2317. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2318. 1: .standard(proto: "route_lookup_config"),
  2319. 2: .standard(proto: "route_lookup_channel_service_config"),
  2320. 3: .standard(proto: "child_policy"),
  2321. 4: .standard(proto: "child_policy_config_target_field_name"),
  2322. ]
  2323. fileprivate class _StorageClass {
  2324. var _routeLookupConfig: Grpc_Lookup_V1_RouteLookupConfig? = nil
  2325. var _routeLookupChannelServiceConfig: Grpc_ServiceConfig_ServiceConfig? = nil
  2326. var _childPolicy: [Grpc_ServiceConfig_LoadBalancingConfig] = []
  2327. var _childPolicyConfigTargetFieldName: String = String()
  2328. #if swift(>=5.10)
  2329. // This property is used as the initial default value for new instances of the type.
  2330. // The type itself is protecting the reference to its storage via CoW semantics.
  2331. // This will force a copy to be made of this reference when the first mutation occurs;
  2332. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  2333. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  2334. #else
  2335. static let defaultInstance = _StorageClass()
  2336. #endif
  2337. private init() {}
  2338. init(copying source: _StorageClass) {
  2339. _routeLookupConfig = source._routeLookupConfig
  2340. _routeLookupChannelServiceConfig = source._routeLookupChannelServiceConfig
  2341. _childPolicy = source._childPolicy
  2342. _childPolicyConfigTargetFieldName = source._childPolicyConfigTargetFieldName
  2343. }
  2344. }
  2345. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  2346. if !isKnownUniquelyReferenced(&_storage) {
  2347. _storage = _StorageClass(copying: _storage)
  2348. }
  2349. return _storage
  2350. }
  2351. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2352. _ = _uniqueStorage()
  2353. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2354. while let fieldNumber = try decoder.nextFieldNumber() {
  2355. // The use of inline closures is to circumvent an issue where the compiler
  2356. // allocates stack space for every case branch when no optimizations are
  2357. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2358. switch fieldNumber {
  2359. case 1: try { try decoder.decodeSingularMessageField(value: &_storage._routeLookupConfig) }()
  2360. case 2: try { try decoder.decodeSingularMessageField(value: &_storage._routeLookupChannelServiceConfig) }()
  2361. case 3: try { try decoder.decodeRepeatedMessageField(value: &_storage._childPolicy) }()
  2362. case 4: try { try decoder.decodeSingularStringField(value: &_storage._childPolicyConfigTargetFieldName) }()
  2363. default: break
  2364. }
  2365. }
  2366. }
  2367. }
  2368. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2369. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2370. // The use of inline closures is to circumvent an issue where the compiler
  2371. // allocates stack space for every if/case branch local when no optimizations
  2372. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2373. // https://github.com/apple/swift-protobuf/issues/1182
  2374. try { if let v = _storage._routeLookupConfig {
  2375. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2376. } }()
  2377. try { if let v = _storage._routeLookupChannelServiceConfig {
  2378. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2379. } }()
  2380. if !_storage._childPolicy.isEmpty {
  2381. try visitor.visitRepeatedMessageField(value: _storage._childPolicy, fieldNumber: 3)
  2382. }
  2383. if !_storage._childPolicyConfigTargetFieldName.isEmpty {
  2384. try visitor.visitSingularStringField(value: _storage._childPolicyConfigTargetFieldName, fieldNumber: 4)
  2385. }
  2386. }
  2387. try unknownFields.traverse(visitor: &visitor)
  2388. }
  2389. static func ==(lhs: Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig) -> Bool {
  2390. if lhs._storage !== rhs._storage {
  2391. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  2392. let _storage = _args.0
  2393. let rhs_storage = _args.1
  2394. if _storage._routeLookupConfig != rhs_storage._routeLookupConfig {return false}
  2395. if _storage._routeLookupChannelServiceConfig != rhs_storage._routeLookupChannelServiceConfig {return false}
  2396. if _storage._childPolicy != rhs_storage._childPolicy {return false}
  2397. if _storage._childPolicyConfigTargetFieldName != rhs_storage._childPolicyConfigTargetFieldName {return false}
  2398. return true
  2399. }
  2400. if !storagesAreEqual {return false}
  2401. }
  2402. if lhs.unknownFields != rhs.unknownFields {return false}
  2403. return true
  2404. }
  2405. }
  2406. extension Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2407. static let protoMessageName: String = _protobuf_package + ".XdsClusterManagerLoadBalancingPolicyConfig"
  2408. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2409. 1: .same(proto: "children"),
  2410. ]
  2411. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2412. while let fieldNumber = try decoder.nextFieldNumber() {
  2413. // The use of inline closures is to circumvent an issue where the compiler
  2414. // allocates stack space for every case branch when no optimizations are
  2415. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2416. switch fieldNumber {
  2417. case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child>.self, value: &self.children) }()
  2418. default: break
  2419. }
  2420. }
  2421. }
  2422. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2423. if !self.children.isEmpty {
  2424. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child>.self, value: self.children, fieldNumber: 1)
  2425. }
  2426. try unknownFields.traverse(visitor: &visitor)
  2427. }
  2428. static func ==(lhs: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig) -> Bool {
  2429. if lhs.children != rhs.children {return false}
  2430. if lhs.unknownFields != rhs.unknownFields {return false}
  2431. return true
  2432. }
  2433. }
  2434. extension Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2435. static let protoMessageName: String = Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.protoMessageName + ".Child"
  2436. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2437. 1: .standard(proto: "child_policy"),
  2438. ]
  2439. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2440. while let fieldNumber = try decoder.nextFieldNumber() {
  2441. // The use of inline closures is to circumvent an issue where the compiler
  2442. // allocates stack space for every case branch when no optimizations are
  2443. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2444. switch fieldNumber {
  2445. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2446. default: break
  2447. }
  2448. }
  2449. }
  2450. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2451. if !self.childPolicy.isEmpty {
  2452. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 1)
  2453. }
  2454. try unknownFields.traverse(visitor: &visitor)
  2455. }
  2456. static func ==(lhs: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child, rhs: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig.Child) -> Bool {
  2457. if lhs.childPolicy != rhs.childPolicy {return false}
  2458. if lhs.unknownFields != rhs.unknownFields {return false}
  2459. return true
  2460. }
  2461. }
  2462. extension Grpc_ServiceConfig_CdsConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2463. static let protoMessageName: String = _protobuf_package + ".CdsConfig"
  2464. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2465. 1: .same(proto: "cluster"),
  2466. 2: .standard(proto: "is_dynamic"),
  2467. ]
  2468. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2469. while let fieldNumber = try decoder.nextFieldNumber() {
  2470. // The use of inline closures is to circumvent an issue where the compiler
  2471. // allocates stack space for every case branch when no optimizations are
  2472. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2473. switch fieldNumber {
  2474. case 1: try { try decoder.decodeSingularStringField(value: &self.cluster) }()
  2475. case 2: try { try decoder.decodeSingularBoolField(value: &self.isDynamic) }()
  2476. default: break
  2477. }
  2478. }
  2479. }
  2480. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2481. if !self.cluster.isEmpty {
  2482. try visitor.visitSingularStringField(value: self.cluster, fieldNumber: 1)
  2483. }
  2484. if self.isDynamic != false {
  2485. try visitor.visitSingularBoolField(value: self.isDynamic, fieldNumber: 2)
  2486. }
  2487. try unknownFields.traverse(visitor: &visitor)
  2488. }
  2489. static func ==(lhs: Grpc_ServiceConfig_CdsConfig, rhs: Grpc_ServiceConfig_CdsConfig) -> Bool {
  2490. if lhs.cluster != rhs.cluster {return false}
  2491. if lhs.isDynamic != rhs.isDynamic {return false}
  2492. if lhs.unknownFields != rhs.unknownFields {return false}
  2493. return true
  2494. }
  2495. }
  2496. extension Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2497. static let protoMessageName: String = _protobuf_package + ".XdsClusterImplLoadBalancingPolicyConfig"
  2498. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2499. 1: .same(proto: "cluster"),
  2500. 6: .standard(proto: "child_policy"),
  2501. 2: .standard(proto: "eds_service_name"),
  2502. 3: .standard(proto: "lrs_load_reporting_server_name"),
  2503. 7: .standard(proto: "lrs_load_reporting_server"),
  2504. 4: .standard(proto: "max_concurrent_requests"),
  2505. 5: .standard(proto: "drop_categories"),
  2506. 8: .standard(proto: "telemetry_labels"),
  2507. ]
  2508. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2509. while let fieldNumber = try decoder.nextFieldNumber() {
  2510. // The use of inline closures is to circumvent an issue where the compiler
  2511. // allocates stack space for every case branch when no optimizations are
  2512. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2513. switch fieldNumber {
  2514. case 1: try { try decoder.decodeSingularStringField(value: &self.cluster) }()
  2515. case 2: try { try decoder.decodeSingularStringField(value: &self.edsServiceName) }()
  2516. case 3: try { try decoder.decodeSingularMessageField(value: &self._lrsLoadReportingServerName) }()
  2517. case 4: try { try decoder.decodeSingularMessageField(value: &self._maxConcurrentRequests) }()
  2518. case 5: try { try decoder.decodeRepeatedMessageField(value: &self.dropCategories) }()
  2519. case 6: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2520. case 7: try { try decoder.decodeSingularMessageField(value: &self._lrsLoadReportingServer) }()
  2521. case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.telemetryLabels) }()
  2522. default: break
  2523. }
  2524. }
  2525. }
  2526. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2527. // The use of inline closures is to circumvent an issue where the compiler
  2528. // allocates stack space for every if/case branch local when no optimizations
  2529. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2530. // https://github.com/apple/swift-protobuf/issues/1182
  2531. if !self.cluster.isEmpty {
  2532. try visitor.visitSingularStringField(value: self.cluster, fieldNumber: 1)
  2533. }
  2534. if !self.edsServiceName.isEmpty {
  2535. try visitor.visitSingularStringField(value: self.edsServiceName, fieldNumber: 2)
  2536. }
  2537. try { if let v = self._lrsLoadReportingServerName {
  2538. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2539. } }()
  2540. try { if let v = self._maxConcurrentRequests {
  2541. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2542. } }()
  2543. if !self.dropCategories.isEmpty {
  2544. try visitor.visitRepeatedMessageField(value: self.dropCategories, fieldNumber: 5)
  2545. }
  2546. if !self.childPolicy.isEmpty {
  2547. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 6)
  2548. }
  2549. try { if let v = self._lrsLoadReportingServer {
  2550. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  2551. } }()
  2552. if !self.telemetryLabels.isEmpty {
  2553. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.telemetryLabels, fieldNumber: 8)
  2554. }
  2555. try unknownFields.traverse(visitor: &visitor)
  2556. }
  2557. static func ==(lhs: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig) -> Bool {
  2558. if lhs.cluster != rhs.cluster {return false}
  2559. if lhs.childPolicy != rhs.childPolicy {return false}
  2560. if lhs.edsServiceName != rhs.edsServiceName {return false}
  2561. if lhs._lrsLoadReportingServerName != rhs._lrsLoadReportingServerName {return false}
  2562. if lhs._lrsLoadReportingServer != rhs._lrsLoadReportingServer {return false}
  2563. if lhs._maxConcurrentRequests != rhs._maxConcurrentRequests {return false}
  2564. if lhs.dropCategories != rhs.dropCategories {return false}
  2565. if lhs.telemetryLabels != rhs.telemetryLabels {return false}
  2566. if lhs.unknownFields != rhs.unknownFields {return false}
  2567. return true
  2568. }
  2569. }
  2570. extension Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2571. static let protoMessageName: String = Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.protoMessageName + ".DropCategory"
  2572. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2573. 1: .same(proto: "category"),
  2574. 2: .standard(proto: "requests_per_million"),
  2575. ]
  2576. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2577. while let fieldNumber = try decoder.nextFieldNumber() {
  2578. // The use of inline closures is to circumvent an issue where the compiler
  2579. // allocates stack space for every case branch when no optimizations are
  2580. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2581. switch fieldNumber {
  2582. case 1: try { try decoder.decodeSingularStringField(value: &self.category) }()
  2583. case 2: try { try decoder.decodeSingularUInt32Field(value: &self.requestsPerMillion) }()
  2584. default: break
  2585. }
  2586. }
  2587. }
  2588. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2589. if !self.category.isEmpty {
  2590. try visitor.visitSingularStringField(value: self.category, fieldNumber: 1)
  2591. }
  2592. if self.requestsPerMillion != 0 {
  2593. try visitor.visitSingularUInt32Field(value: self.requestsPerMillion, fieldNumber: 2)
  2594. }
  2595. try unknownFields.traverse(visitor: &visitor)
  2596. }
  2597. static func ==(lhs: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory, rhs: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig.DropCategory) -> Bool {
  2598. if lhs.category != rhs.category {return false}
  2599. if lhs.requestsPerMillion != rhs.requestsPerMillion {return false}
  2600. if lhs.unknownFields != rhs.unknownFields {return false}
  2601. return true
  2602. }
  2603. }
  2604. extension Grpc_ServiceConfig_RingHashLoadBalancingConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2605. static let protoMessageName: String = _protobuf_package + ".RingHashLoadBalancingConfig"
  2606. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2607. 1: .standard(proto: "min_ring_size"),
  2608. 2: .standard(proto: "max_ring_size"),
  2609. ]
  2610. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2611. while let fieldNumber = try decoder.nextFieldNumber() {
  2612. // The use of inline closures is to circumvent an issue where the compiler
  2613. // allocates stack space for every case branch when no optimizations are
  2614. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2615. switch fieldNumber {
  2616. case 1: try { try decoder.decodeSingularUInt64Field(value: &self.minRingSize) }()
  2617. case 2: try { try decoder.decodeSingularUInt64Field(value: &self.maxRingSize) }()
  2618. default: break
  2619. }
  2620. }
  2621. }
  2622. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2623. if self.minRingSize != 0 {
  2624. try visitor.visitSingularUInt64Field(value: self.minRingSize, fieldNumber: 1)
  2625. }
  2626. if self.maxRingSize != 0 {
  2627. try visitor.visitSingularUInt64Field(value: self.maxRingSize, fieldNumber: 2)
  2628. }
  2629. try unknownFields.traverse(visitor: &visitor)
  2630. }
  2631. static func ==(lhs: Grpc_ServiceConfig_RingHashLoadBalancingConfig, rhs: Grpc_ServiceConfig_RingHashLoadBalancingConfig) -> Bool {
  2632. if lhs.minRingSize != rhs.minRingSize {return false}
  2633. if lhs.maxRingSize != rhs.maxRingSize {return false}
  2634. if lhs.unknownFields != rhs.unknownFields {return false}
  2635. return true
  2636. }
  2637. }
  2638. extension Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2639. static let protoMessageName: String = _protobuf_package + ".XdsWrrLocalityLoadBalancingPolicyConfig"
  2640. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2641. 1: .standard(proto: "child_policy"),
  2642. ]
  2643. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2644. while let fieldNumber = try decoder.nextFieldNumber() {
  2645. // The use of inline closures is to circumvent an issue where the compiler
  2646. // allocates stack space for every case branch when no optimizations are
  2647. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2648. switch fieldNumber {
  2649. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2650. default: break
  2651. }
  2652. }
  2653. }
  2654. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2655. if !self.childPolicy.isEmpty {
  2656. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 1)
  2657. }
  2658. try unknownFields.traverse(visitor: &visitor)
  2659. }
  2660. static func ==(lhs: Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig) -> Bool {
  2661. if lhs.childPolicy != rhs.childPolicy {return false}
  2662. if lhs.unknownFields != rhs.unknownFields {return false}
  2663. return true
  2664. }
  2665. }
  2666. extension Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2667. static let protoMessageName: String = _protobuf_package + ".LeastRequestLocalityLoadBalancingPolicyConfig"
  2668. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2669. 1: .standard(proto: "choice_count"),
  2670. ]
  2671. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2672. while let fieldNumber = try decoder.nextFieldNumber() {
  2673. // The use of inline closures is to circumvent an issue where the compiler
  2674. // allocates stack space for every case branch when no optimizations are
  2675. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2676. switch fieldNumber {
  2677. case 1: try { try decoder.decodeSingularUInt64Field(value: &self.choiceCount) }()
  2678. default: break
  2679. }
  2680. }
  2681. }
  2682. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2683. if self.choiceCount != 0 {
  2684. try visitor.visitSingularUInt64Field(value: self.choiceCount, fieldNumber: 1)
  2685. }
  2686. try unknownFields.traverse(visitor: &visitor)
  2687. }
  2688. static func ==(lhs: Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig) -> Bool {
  2689. if lhs.choiceCount != rhs.choiceCount {return false}
  2690. if lhs.unknownFields != rhs.unknownFields {return false}
  2691. return true
  2692. }
  2693. }
  2694. extension Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2695. static let protoMessageName: String = _protobuf_package + ".OverrideHostLoadBalancingPolicyConfig"
  2696. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2697. 3: .standard(proto: "cluster_name"),
  2698. 2: .standard(proto: "child_policy"),
  2699. 1: .standard(proto: "override_host_status"),
  2700. ]
  2701. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2702. while let fieldNumber = try decoder.nextFieldNumber() {
  2703. // The use of inline closures is to circumvent an issue where the compiler
  2704. // allocates stack space for every case branch when no optimizations are
  2705. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2706. switch fieldNumber {
  2707. case 1: try { try decoder.decodeRepeatedEnumField(value: &self.overrideHostStatus) }()
  2708. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  2709. case 3: try { try decoder.decodeSingularStringField(value: &self.clusterName) }()
  2710. default: break
  2711. }
  2712. }
  2713. }
  2714. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2715. if !self.overrideHostStatus.isEmpty {
  2716. try visitor.visitPackedEnumField(value: self.overrideHostStatus, fieldNumber: 1)
  2717. }
  2718. if !self.childPolicy.isEmpty {
  2719. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 2)
  2720. }
  2721. if !self.clusterName.isEmpty {
  2722. try visitor.visitSingularStringField(value: self.clusterName, fieldNumber: 3)
  2723. }
  2724. try unknownFields.traverse(visitor: &visitor)
  2725. }
  2726. static func ==(lhs: Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig) -> Bool {
  2727. if lhs.clusterName != rhs.clusterName {return false}
  2728. if lhs.childPolicy != rhs.childPolicy {return false}
  2729. if lhs.overrideHostStatus != rhs.overrideHostStatus {return false}
  2730. if lhs.unknownFields != rhs.unknownFields {return false}
  2731. return true
  2732. }
  2733. }
  2734. extension Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus: SwiftProtobuf._ProtoNameProviding {
  2735. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2736. 0: .same(proto: "UNKNOWN"),
  2737. 1: .same(proto: "HEALTHY"),
  2738. 3: .same(proto: "DRAINING"),
  2739. ]
  2740. }
  2741. extension Grpc_ServiceConfig_LoadBalancingConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2742. static let protoMessageName: String = _protobuf_package + ".LoadBalancingConfig"
  2743. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2744. 4: .same(proto: "pick_first"),
  2745. 1: .same(proto: "round_robin"),
  2746. 20: .same(proto: "weighted_round_robin"),
  2747. 3: .same(proto: "grpclb"),
  2748. 9: .same(proto: "priority_experimental"),
  2749. 10: .same(proto: "weighted_target_experimental"),
  2750. 15: .unique(proto: "outlier_detection", json: "outlier_detection_experimental"),
  2751. 19: .unique(proto: "rls", json: "rls_experimental"),
  2752. 14: .same(proto: "xds_cluster_manager_experimental"),
  2753. 6: .same(proto: "cds_experimental"),
  2754. 12: .same(proto: "xds_cluster_impl_experimental"),
  2755. 18: .same(proto: "override_host_experimental"),
  2756. 16: .same(proto: "xds_wrr_locality_experimental"),
  2757. 13: .same(proto: "ring_hash_experimental"),
  2758. 17: .same(proto: "least_request_experimental"),
  2759. 11: .same(proto: "xds_cluster_resolver_experimental"),
  2760. 8: .same(proto: "lrs_experimental"),
  2761. 7: .same(proto: "eds_experimental"),
  2762. 2: .same(proto: "xds"),
  2763. 5: .same(proto: "xds_experimental"),
  2764. ]
  2765. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2766. while let fieldNumber = try decoder.nextFieldNumber() {
  2767. // The use of inline closures is to circumvent an issue where the compiler
  2768. // allocates stack space for every case branch when no optimizations are
  2769. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2770. switch fieldNumber {
  2771. case 1: try {
  2772. var v: Grpc_ServiceConfig_RoundRobinConfig?
  2773. var hadOneofValue = false
  2774. if let current = self.policy {
  2775. hadOneofValue = true
  2776. if case .roundRobin(let m) = current {v = m}
  2777. }
  2778. try decoder.decodeSingularMessageField(value: &v)
  2779. if let v = v {
  2780. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2781. self.policy = .roundRobin(v)
  2782. }
  2783. }()
  2784. case 2: try {
  2785. var v: Grpc_ServiceConfig_XdsConfig?
  2786. var hadOneofValue = false
  2787. if let current = self.policy {
  2788. hadOneofValue = true
  2789. if case .xds(let m) = current {v = m}
  2790. }
  2791. try decoder.decodeSingularMessageField(value: &v)
  2792. if let v = v {
  2793. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2794. self.policy = .xds(v)
  2795. }
  2796. }()
  2797. case 3: try {
  2798. var v: Grpc_ServiceConfig_GrpcLbConfig?
  2799. var hadOneofValue = false
  2800. if let current = self.policy {
  2801. hadOneofValue = true
  2802. if case .grpclb(let m) = current {v = m}
  2803. }
  2804. try decoder.decodeSingularMessageField(value: &v)
  2805. if let v = v {
  2806. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2807. self.policy = .grpclb(v)
  2808. }
  2809. }()
  2810. case 4: try {
  2811. var v: Grpc_ServiceConfig_PickFirstConfig?
  2812. var hadOneofValue = false
  2813. if let current = self.policy {
  2814. hadOneofValue = true
  2815. if case .pickFirst(let m) = current {v = m}
  2816. }
  2817. try decoder.decodeSingularMessageField(value: &v)
  2818. if let v = v {
  2819. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2820. self.policy = .pickFirst(v)
  2821. }
  2822. }()
  2823. case 5: try {
  2824. var v: Grpc_ServiceConfig_XdsConfig?
  2825. var hadOneofValue = false
  2826. if let current = self.policy {
  2827. hadOneofValue = true
  2828. if case .xdsExperimental(let m) = current {v = m}
  2829. }
  2830. try decoder.decodeSingularMessageField(value: &v)
  2831. if let v = v {
  2832. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2833. self.policy = .xdsExperimental(v)
  2834. }
  2835. }()
  2836. case 6: try {
  2837. var v: Grpc_ServiceConfig_CdsConfig?
  2838. var hadOneofValue = false
  2839. if let current = self.policy {
  2840. hadOneofValue = true
  2841. if case .cdsExperimental(let m) = current {v = m}
  2842. }
  2843. try decoder.decodeSingularMessageField(value: &v)
  2844. if let v = v {
  2845. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2846. self.policy = .cdsExperimental(v)
  2847. }
  2848. }()
  2849. case 7: try {
  2850. var v: Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig?
  2851. var hadOneofValue = false
  2852. if let current = self.policy {
  2853. hadOneofValue = true
  2854. if case .edsExperimental(let m) = current {v = m}
  2855. }
  2856. try decoder.decodeSingularMessageField(value: &v)
  2857. if let v = v {
  2858. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2859. self.policy = .edsExperimental(v)
  2860. }
  2861. }()
  2862. case 8: try {
  2863. var v: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig?
  2864. var hadOneofValue = false
  2865. if let current = self.policy {
  2866. hadOneofValue = true
  2867. if case .lrsExperimental(let m) = current {v = m}
  2868. }
  2869. try decoder.decodeSingularMessageField(value: &v)
  2870. if let v = v {
  2871. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2872. self.policy = .lrsExperimental(v)
  2873. }
  2874. }()
  2875. case 9: try {
  2876. var v: Grpc_ServiceConfig_PriorityLoadBalancingPolicyConfig?
  2877. var hadOneofValue = false
  2878. if let current = self.policy {
  2879. hadOneofValue = true
  2880. if case .priorityExperimental(let m) = current {v = m}
  2881. }
  2882. try decoder.decodeSingularMessageField(value: &v)
  2883. if let v = v {
  2884. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2885. self.policy = .priorityExperimental(v)
  2886. }
  2887. }()
  2888. case 10: try {
  2889. var v: Grpc_ServiceConfig_WeightedTargetLoadBalancingPolicyConfig?
  2890. var hadOneofValue = false
  2891. if let current = self.policy {
  2892. hadOneofValue = true
  2893. if case .weightedTargetExperimental(let m) = current {v = m}
  2894. }
  2895. try decoder.decodeSingularMessageField(value: &v)
  2896. if let v = v {
  2897. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2898. self.policy = .weightedTargetExperimental(v)
  2899. }
  2900. }()
  2901. case 11: try {
  2902. var v: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig?
  2903. var hadOneofValue = false
  2904. if let current = self.policy {
  2905. hadOneofValue = true
  2906. if case .xdsClusterResolverExperimental(let m) = current {v = m}
  2907. }
  2908. try decoder.decodeSingularMessageField(value: &v)
  2909. if let v = v {
  2910. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2911. self.policy = .xdsClusterResolverExperimental(v)
  2912. }
  2913. }()
  2914. case 12: try {
  2915. var v: Grpc_ServiceConfig_XdsClusterImplLoadBalancingPolicyConfig?
  2916. var hadOneofValue = false
  2917. if let current = self.policy {
  2918. hadOneofValue = true
  2919. if case .xdsClusterImplExperimental(let m) = current {v = m}
  2920. }
  2921. try decoder.decodeSingularMessageField(value: &v)
  2922. if let v = v {
  2923. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2924. self.policy = .xdsClusterImplExperimental(v)
  2925. }
  2926. }()
  2927. case 13: try {
  2928. var v: Grpc_ServiceConfig_RingHashLoadBalancingConfig?
  2929. var hadOneofValue = false
  2930. if let current = self.policy {
  2931. hadOneofValue = true
  2932. if case .ringHashExperimental(let m) = current {v = m}
  2933. }
  2934. try decoder.decodeSingularMessageField(value: &v)
  2935. if let v = v {
  2936. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2937. self.policy = .ringHashExperimental(v)
  2938. }
  2939. }()
  2940. case 14: try {
  2941. var v: Grpc_ServiceConfig_XdsClusterManagerLoadBalancingPolicyConfig?
  2942. var hadOneofValue = false
  2943. if let current = self.policy {
  2944. hadOneofValue = true
  2945. if case .xdsClusterManagerExperimental(let m) = current {v = m}
  2946. }
  2947. try decoder.decodeSingularMessageField(value: &v)
  2948. if let v = v {
  2949. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2950. self.policy = .xdsClusterManagerExperimental(v)
  2951. }
  2952. }()
  2953. case 15: try {
  2954. var v: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig?
  2955. var hadOneofValue = false
  2956. if let current = self.policy {
  2957. hadOneofValue = true
  2958. if case .outlierDetection(let m) = current {v = m}
  2959. }
  2960. try decoder.decodeSingularMessageField(value: &v)
  2961. if let v = v {
  2962. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2963. self.policy = .outlierDetection(v)
  2964. }
  2965. }()
  2966. case 16: try {
  2967. var v: Grpc_ServiceConfig_XdsWrrLocalityLoadBalancingPolicyConfig?
  2968. var hadOneofValue = false
  2969. if let current = self.policy {
  2970. hadOneofValue = true
  2971. if case .xdsWrrLocalityExperimental(let m) = current {v = m}
  2972. }
  2973. try decoder.decodeSingularMessageField(value: &v)
  2974. if let v = v {
  2975. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2976. self.policy = .xdsWrrLocalityExperimental(v)
  2977. }
  2978. }()
  2979. case 17: try {
  2980. var v: Grpc_ServiceConfig_LeastRequestLocalityLoadBalancingPolicyConfig?
  2981. var hadOneofValue = false
  2982. if let current = self.policy {
  2983. hadOneofValue = true
  2984. if case .leastRequestExperimental(let m) = current {v = m}
  2985. }
  2986. try decoder.decodeSingularMessageField(value: &v)
  2987. if let v = v {
  2988. if hadOneofValue {try decoder.handleConflictingOneOf()}
  2989. self.policy = .leastRequestExperimental(v)
  2990. }
  2991. }()
  2992. case 18: try {
  2993. var v: Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig?
  2994. var hadOneofValue = false
  2995. if let current = self.policy {
  2996. hadOneofValue = true
  2997. if case .overrideHostExperimental(let m) = current {v = m}
  2998. }
  2999. try decoder.decodeSingularMessageField(value: &v)
  3000. if let v = v {
  3001. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3002. self.policy = .overrideHostExperimental(v)
  3003. }
  3004. }()
  3005. case 19: try {
  3006. var v: Grpc_ServiceConfig_RlsLoadBalancingPolicyConfig?
  3007. var hadOneofValue = false
  3008. if let current = self.policy {
  3009. hadOneofValue = true
  3010. if case .rls(let m) = current {v = m}
  3011. }
  3012. try decoder.decodeSingularMessageField(value: &v)
  3013. if let v = v {
  3014. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3015. self.policy = .rls(v)
  3016. }
  3017. }()
  3018. case 20: try {
  3019. var v: Grpc_ServiceConfig_WeightedRoundRobinLbConfig?
  3020. var hadOneofValue = false
  3021. if let current = self.policy {
  3022. hadOneofValue = true
  3023. if case .weightedRoundRobin(let m) = current {v = m}
  3024. }
  3025. try decoder.decodeSingularMessageField(value: &v)
  3026. if let v = v {
  3027. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3028. self.policy = .weightedRoundRobin(v)
  3029. }
  3030. }()
  3031. default: break
  3032. }
  3033. }
  3034. }
  3035. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3036. // The use of inline closures is to circumvent an issue where the compiler
  3037. // allocates stack space for every if/case branch local when no optimizations
  3038. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3039. // https://github.com/apple/swift-protobuf/issues/1182
  3040. switch self.policy {
  3041. case .roundRobin?: try {
  3042. guard case .roundRobin(let v)? = self.policy else { preconditionFailure() }
  3043. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3044. }()
  3045. case .xds?: try {
  3046. guard case .xds(let v)? = self.policy else { preconditionFailure() }
  3047. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  3048. }()
  3049. case .grpclb?: try {
  3050. guard case .grpclb(let v)? = self.policy else { preconditionFailure() }
  3051. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  3052. }()
  3053. case .pickFirst?: try {
  3054. guard case .pickFirst(let v)? = self.policy else { preconditionFailure() }
  3055. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  3056. }()
  3057. case .xdsExperimental?: try {
  3058. guard case .xdsExperimental(let v)? = self.policy else { preconditionFailure() }
  3059. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  3060. }()
  3061. case .cdsExperimental?: try {
  3062. guard case .cdsExperimental(let v)? = self.policy else { preconditionFailure() }
  3063. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  3064. }()
  3065. case .edsExperimental?: try {
  3066. guard case .edsExperimental(let v)? = self.policy else { preconditionFailure() }
  3067. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  3068. }()
  3069. case .lrsExperimental?: try {
  3070. guard case .lrsExperimental(let v)? = self.policy else { preconditionFailure() }
  3071. try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
  3072. }()
  3073. case .priorityExperimental?: try {
  3074. guard case .priorityExperimental(let v)? = self.policy else { preconditionFailure() }
  3075. try visitor.visitSingularMessageField(value: v, fieldNumber: 9)
  3076. }()
  3077. case .weightedTargetExperimental?: try {
  3078. guard case .weightedTargetExperimental(let v)? = self.policy else { preconditionFailure() }
  3079. try visitor.visitSingularMessageField(value: v, fieldNumber: 10)
  3080. }()
  3081. case .xdsClusterResolverExperimental?: try {
  3082. guard case .xdsClusterResolverExperimental(let v)? = self.policy else { preconditionFailure() }
  3083. try visitor.visitSingularMessageField(value: v, fieldNumber: 11)
  3084. }()
  3085. case .xdsClusterImplExperimental?: try {
  3086. guard case .xdsClusterImplExperimental(let v)? = self.policy else { preconditionFailure() }
  3087. try visitor.visitSingularMessageField(value: v, fieldNumber: 12)
  3088. }()
  3089. case .ringHashExperimental?: try {
  3090. guard case .ringHashExperimental(let v)? = self.policy else { preconditionFailure() }
  3091. try visitor.visitSingularMessageField(value: v, fieldNumber: 13)
  3092. }()
  3093. case .xdsClusterManagerExperimental?: try {
  3094. guard case .xdsClusterManagerExperimental(let v)? = self.policy else { preconditionFailure() }
  3095. try visitor.visitSingularMessageField(value: v, fieldNumber: 14)
  3096. }()
  3097. case .outlierDetection?: try {
  3098. guard case .outlierDetection(let v)? = self.policy else { preconditionFailure() }
  3099. try visitor.visitSingularMessageField(value: v, fieldNumber: 15)
  3100. }()
  3101. case .xdsWrrLocalityExperimental?: try {
  3102. guard case .xdsWrrLocalityExperimental(let v)? = self.policy else { preconditionFailure() }
  3103. try visitor.visitSingularMessageField(value: v, fieldNumber: 16)
  3104. }()
  3105. case .leastRequestExperimental?: try {
  3106. guard case .leastRequestExperimental(let v)? = self.policy else { preconditionFailure() }
  3107. try visitor.visitSingularMessageField(value: v, fieldNumber: 17)
  3108. }()
  3109. case .overrideHostExperimental?: try {
  3110. guard case .overrideHostExperimental(let v)? = self.policy else { preconditionFailure() }
  3111. try visitor.visitSingularMessageField(value: v, fieldNumber: 18)
  3112. }()
  3113. case .rls?: try {
  3114. guard case .rls(let v)? = self.policy else { preconditionFailure() }
  3115. try visitor.visitSingularMessageField(value: v, fieldNumber: 19)
  3116. }()
  3117. case .weightedRoundRobin?: try {
  3118. guard case .weightedRoundRobin(let v)? = self.policy else { preconditionFailure() }
  3119. try visitor.visitSingularMessageField(value: v, fieldNumber: 20)
  3120. }()
  3121. case nil: break
  3122. }
  3123. try unknownFields.traverse(visitor: &visitor)
  3124. }
  3125. static func ==(lhs: Grpc_ServiceConfig_LoadBalancingConfig, rhs: Grpc_ServiceConfig_LoadBalancingConfig) -> Bool {
  3126. if lhs.policy != rhs.policy {return false}
  3127. if lhs.unknownFields != rhs.unknownFields {return false}
  3128. return true
  3129. }
  3130. }
  3131. extension Grpc_ServiceConfig_ServiceConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3132. static let protoMessageName: String = _protobuf_package + ".ServiceConfig"
  3133. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3134. 1: .standard(proto: "load_balancing_policy"),
  3135. 4: .standard(proto: "load_balancing_config"),
  3136. 2: .standard(proto: "method_config"),
  3137. 3: .standard(proto: "retry_throttling"),
  3138. 5: .standard(proto: "health_check_config"),
  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.decodeSingularEnumField(value: &self.loadBalancingPolicy) }()
  3147. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.methodConfig) }()
  3148. case 3: try { try decoder.decodeSingularMessageField(value: &self._retryThrottling) }()
  3149. case 4: try { try decoder.decodeRepeatedMessageField(value: &self.loadBalancingConfig) }()
  3150. case 5: try { try decoder.decodeSingularMessageField(value: &self._healthCheckConfig) }()
  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.loadBalancingPolicy != .unspecified {
  3161. try visitor.visitSingularEnumField(value: self.loadBalancingPolicy, fieldNumber: 1)
  3162. }
  3163. if !self.methodConfig.isEmpty {
  3164. try visitor.visitRepeatedMessageField(value: self.methodConfig, fieldNumber: 2)
  3165. }
  3166. try { if let v = self._retryThrottling {
  3167. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  3168. } }()
  3169. if !self.loadBalancingConfig.isEmpty {
  3170. try visitor.visitRepeatedMessageField(value: self.loadBalancingConfig, fieldNumber: 4)
  3171. }
  3172. try { if let v = self._healthCheckConfig {
  3173. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  3174. } }()
  3175. try unknownFields.traverse(visitor: &visitor)
  3176. }
  3177. static func ==(lhs: Grpc_ServiceConfig_ServiceConfig, rhs: Grpc_ServiceConfig_ServiceConfig) -> Bool {
  3178. if lhs.loadBalancingPolicy != rhs.loadBalancingPolicy {return false}
  3179. if lhs.loadBalancingConfig != rhs.loadBalancingConfig {return false}
  3180. if lhs.methodConfig != rhs.methodConfig {return false}
  3181. if lhs._retryThrottling != rhs._retryThrottling {return false}
  3182. if lhs._healthCheckConfig != rhs._healthCheckConfig {return false}
  3183. if lhs.unknownFields != rhs.unknownFields {return false}
  3184. return true
  3185. }
  3186. }
  3187. extension Grpc_ServiceConfig_ServiceConfig.LoadBalancingPolicy: SwiftProtobuf._ProtoNameProviding {
  3188. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3189. 0: .same(proto: "UNSPECIFIED"),
  3190. 1: .same(proto: "ROUND_ROBIN"),
  3191. ]
  3192. }
  3193. extension Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3194. static let protoMessageName: String = Grpc_ServiceConfig_ServiceConfig.protoMessageName + ".RetryThrottlingPolicy"
  3195. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3196. 1: .standard(proto: "max_tokens"),
  3197. 2: .standard(proto: "token_ratio"),
  3198. ]
  3199. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3200. while let fieldNumber = try decoder.nextFieldNumber() {
  3201. // The use of inline closures is to circumvent an issue where the compiler
  3202. // allocates stack space for every case branch when no optimizations are
  3203. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3204. switch fieldNumber {
  3205. case 1: try { try decoder.decodeSingularUInt32Field(value: &self.maxTokens) }()
  3206. case 2: try { try decoder.decodeSingularFloatField(value: &self.tokenRatio) }()
  3207. default: break
  3208. }
  3209. }
  3210. }
  3211. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3212. if self.maxTokens != 0 {
  3213. try visitor.visitSingularUInt32Field(value: self.maxTokens, fieldNumber: 1)
  3214. }
  3215. if self.tokenRatio != 0 {
  3216. try visitor.visitSingularFloatField(value: self.tokenRatio, fieldNumber: 2)
  3217. }
  3218. try unknownFields.traverse(visitor: &visitor)
  3219. }
  3220. static func ==(lhs: Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy, rhs: Grpc_ServiceConfig_ServiceConfig.RetryThrottlingPolicy) -> Bool {
  3221. if lhs.maxTokens != rhs.maxTokens {return false}
  3222. if lhs.tokenRatio != rhs.tokenRatio {return false}
  3223. if lhs.unknownFields != rhs.unknownFields {return false}
  3224. return true
  3225. }
  3226. }
  3227. extension Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3228. static let protoMessageName: String = Grpc_ServiceConfig_ServiceConfig.protoMessageName + ".HealthCheckConfig"
  3229. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3230. 1: .standard(proto: "service_name"),
  3231. ]
  3232. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3233. while let fieldNumber = try decoder.nextFieldNumber() {
  3234. // The use of inline closures is to circumvent an issue where the compiler
  3235. // allocates stack space for every case branch when no optimizations are
  3236. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3237. switch fieldNumber {
  3238. case 1: try { try decoder.decodeSingularMessageField(value: &self._serviceName) }()
  3239. default: break
  3240. }
  3241. }
  3242. }
  3243. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3244. // The use of inline closures is to circumvent an issue where the compiler
  3245. // allocates stack space for every if/case branch local when no optimizations
  3246. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3247. // https://github.com/apple/swift-protobuf/issues/1182
  3248. try { if let v = self._serviceName {
  3249. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3250. } }()
  3251. try unknownFields.traverse(visitor: &visitor)
  3252. }
  3253. static func ==(lhs: Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig, rhs: Grpc_ServiceConfig_ServiceConfig.HealthCheckConfig) -> Bool {
  3254. if lhs._serviceName != rhs._serviceName {return false}
  3255. if lhs.unknownFields != rhs.unknownFields {return false}
  3256. return true
  3257. }
  3258. }
  3259. extension Grpc_ServiceConfig_XdsServer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3260. static let protoMessageName: String = _protobuf_package + ".XdsServer"
  3261. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3262. 1: .same(proto: "server_uri"),
  3263. 2: .same(proto: "channel_creds"),
  3264. 3: .same(proto: "server_features"),
  3265. ]
  3266. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3267. while let fieldNumber = try decoder.nextFieldNumber() {
  3268. // The use of inline closures is to circumvent an issue where the compiler
  3269. // allocates stack space for every case branch when no optimizations are
  3270. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3271. switch fieldNumber {
  3272. case 1: try { try decoder.decodeSingularStringField(value: &self.serverUri) }()
  3273. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.channelCreds) }()
  3274. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.serverFeatures) }()
  3275. default: break
  3276. }
  3277. }
  3278. }
  3279. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3280. if !self.serverUri.isEmpty {
  3281. try visitor.visitSingularStringField(value: self.serverUri, fieldNumber: 1)
  3282. }
  3283. if !self.channelCreds.isEmpty {
  3284. try visitor.visitRepeatedMessageField(value: self.channelCreds, fieldNumber: 2)
  3285. }
  3286. if !self.serverFeatures.isEmpty {
  3287. try visitor.visitRepeatedMessageField(value: self.serverFeatures, fieldNumber: 3)
  3288. }
  3289. try unknownFields.traverse(visitor: &visitor)
  3290. }
  3291. static func ==(lhs: Grpc_ServiceConfig_XdsServer, rhs: Grpc_ServiceConfig_XdsServer) -> Bool {
  3292. if lhs.serverUri != rhs.serverUri {return false}
  3293. if lhs.channelCreds != rhs.channelCreds {return false}
  3294. if lhs.serverFeatures != rhs.serverFeatures {return false}
  3295. if lhs.unknownFields != rhs.unknownFields {return false}
  3296. return true
  3297. }
  3298. }
  3299. extension Grpc_ServiceConfig_XdsServer.ChannelCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3300. static let protoMessageName: String = Grpc_ServiceConfig_XdsServer.protoMessageName + ".ChannelCredentials"
  3301. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3302. 1: .same(proto: "type"),
  3303. 2: .same(proto: "config"),
  3304. ]
  3305. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3306. while let fieldNumber = try decoder.nextFieldNumber() {
  3307. // The use of inline closures is to circumvent an issue where the compiler
  3308. // allocates stack space for every case branch when no optimizations are
  3309. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3310. switch fieldNumber {
  3311. case 1: try { try decoder.decodeSingularStringField(value: &self.type) }()
  3312. case 2: try { try decoder.decodeSingularMessageField(value: &self._config) }()
  3313. default: break
  3314. }
  3315. }
  3316. }
  3317. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3318. // The use of inline closures is to circumvent an issue where the compiler
  3319. // allocates stack space for every if/case branch local when no optimizations
  3320. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3321. // https://github.com/apple/swift-protobuf/issues/1182
  3322. if !self.type.isEmpty {
  3323. try visitor.visitSingularStringField(value: self.type, fieldNumber: 1)
  3324. }
  3325. try { if let v = self._config {
  3326. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  3327. } }()
  3328. try unknownFields.traverse(visitor: &visitor)
  3329. }
  3330. static func ==(lhs: Grpc_ServiceConfig_XdsServer.ChannelCredentials, rhs: Grpc_ServiceConfig_XdsServer.ChannelCredentials) -> Bool {
  3331. if lhs.type != rhs.type {return false}
  3332. if lhs._config != rhs._config {return false}
  3333. if lhs.unknownFields != rhs.unknownFields {return false}
  3334. return true
  3335. }
  3336. }
  3337. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3338. static let protoMessageName: String = _protobuf_package + ".XdsClusterResolverLoadBalancingPolicyConfig"
  3339. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3340. 1: .standard(proto: "discovery_mechanisms"),
  3341. 2: .standard(proto: "xds_lb_policy"),
  3342. ]
  3343. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3344. while let fieldNumber = try decoder.nextFieldNumber() {
  3345. // The use of inline closures is to circumvent an issue where the compiler
  3346. // allocates stack space for every case branch when no optimizations are
  3347. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3348. switch fieldNumber {
  3349. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.discoveryMechanisms) }()
  3350. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.xdsLbPolicy) }()
  3351. default: break
  3352. }
  3353. }
  3354. }
  3355. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3356. if !self.discoveryMechanisms.isEmpty {
  3357. try visitor.visitRepeatedMessageField(value: self.discoveryMechanisms, fieldNumber: 1)
  3358. }
  3359. if !self.xdsLbPolicy.isEmpty {
  3360. try visitor.visitRepeatedMessageField(value: self.xdsLbPolicy, fieldNumber: 2)
  3361. }
  3362. try unknownFields.traverse(visitor: &visitor)
  3363. }
  3364. static func ==(lhs: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig) -> Bool {
  3365. if lhs.discoveryMechanisms != rhs.discoveryMechanisms {return false}
  3366. if lhs.xdsLbPolicy != rhs.xdsLbPolicy {return false}
  3367. if lhs.unknownFields != rhs.unknownFields {return false}
  3368. return true
  3369. }
  3370. }
  3371. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3372. static let protoMessageName: String = Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.protoMessageName + ".DiscoveryMechanism"
  3373. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3374. 1: .same(proto: "cluster"),
  3375. 2: .standard(proto: "lrs_load_reporting_server_name"),
  3376. 7: .standard(proto: "lrs_load_reporting_server"),
  3377. 3: .standard(proto: "max_concurrent_requests"),
  3378. 4: .same(proto: "type"),
  3379. 5: .standard(proto: "eds_service_name"),
  3380. 6: .standard(proto: "dns_hostname"),
  3381. 8: .standard(proto: "outlier_detection"),
  3382. 9: .standard(proto: "override_host_status"),
  3383. 10: .standard(proto: "telemetry_labels"),
  3384. ]
  3385. fileprivate class _StorageClass {
  3386. var _cluster: String = String()
  3387. var _lrsLoadReportingServerName: SwiftProtobuf.Google_Protobuf_StringValue? = nil
  3388. var _lrsLoadReportingServer: Grpc_ServiceConfig_XdsServer? = nil
  3389. var _maxConcurrentRequests: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil
  3390. var _type: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum = .unknown
  3391. var _edsServiceName: String = String()
  3392. var _dnsHostname: String = String()
  3393. var _outlierDetection: Grpc_ServiceConfig_OutlierDetectionLoadBalancingConfig? = nil
  3394. var _overrideHostStatus: [Grpc_ServiceConfig_OverrideHostLoadBalancingPolicyConfig.HealthStatus] = []
  3395. var _telemetryLabels: Dictionary<String,String> = [:]
  3396. #if swift(>=5.10)
  3397. // This property is used as the initial default value for new instances of the type.
  3398. // The type itself is protecting the reference to its storage via CoW semantics.
  3399. // This will force a copy to be made of this reference when the first mutation occurs;
  3400. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  3401. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  3402. #else
  3403. static let defaultInstance = _StorageClass()
  3404. #endif
  3405. private init() {}
  3406. init(copying source: _StorageClass) {
  3407. _cluster = source._cluster
  3408. _lrsLoadReportingServerName = source._lrsLoadReportingServerName
  3409. _lrsLoadReportingServer = source._lrsLoadReportingServer
  3410. _maxConcurrentRequests = source._maxConcurrentRequests
  3411. _type = source._type
  3412. _edsServiceName = source._edsServiceName
  3413. _dnsHostname = source._dnsHostname
  3414. _outlierDetection = source._outlierDetection
  3415. _overrideHostStatus = source._overrideHostStatus
  3416. _telemetryLabels = source._telemetryLabels
  3417. }
  3418. }
  3419. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  3420. if !isKnownUniquelyReferenced(&_storage) {
  3421. _storage = _StorageClass(copying: _storage)
  3422. }
  3423. return _storage
  3424. }
  3425. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3426. _ = _uniqueStorage()
  3427. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  3428. while let fieldNumber = try decoder.nextFieldNumber() {
  3429. // The use of inline closures is to circumvent an issue where the compiler
  3430. // allocates stack space for every case branch when no optimizations are
  3431. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3432. switch fieldNumber {
  3433. case 1: try { try decoder.decodeSingularStringField(value: &_storage._cluster) }()
  3434. case 2: try { try decoder.decodeSingularMessageField(value: &_storage._lrsLoadReportingServerName) }()
  3435. case 3: try { try decoder.decodeSingularMessageField(value: &_storage._maxConcurrentRequests) }()
  3436. case 4: try { try decoder.decodeSingularEnumField(value: &_storage._type) }()
  3437. case 5: try { try decoder.decodeSingularStringField(value: &_storage._edsServiceName) }()
  3438. case 6: try { try decoder.decodeSingularStringField(value: &_storage._dnsHostname) }()
  3439. case 7: try { try decoder.decodeSingularMessageField(value: &_storage._lrsLoadReportingServer) }()
  3440. case 8: try { try decoder.decodeSingularMessageField(value: &_storage._outlierDetection) }()
  3441. case 9: try { try decoder.decodeRepeatedEnumField(value: &_storage._overrideHostStatus) }()
  3442. case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._telemetryLabels) }()
  3443. default: break
  3444. }
  3445. }
  3446. }
  3447. }
  3448. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3449. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  3450. // The use of inline closures is to circumvent an issue where the compiler
  3451. // allocates stack space for every if/case branch local when no optimizations
  3452. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3453. // https://github.com/apple/swift-protobuf/issues/1182
  3454. if !_storage._cluster.isEmpty {
  3455. try visitor.visitSingularStringField(value: _storage._cluster, fieldNumber: 1)
  3456. }
  3457. try { if let v = _storage._lrsLoadReportingServerName {
  3458. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  3459. } }()
  3460. try { if let v = _storage._maxConcurrentRequests {
  3461. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  3462. } }()
  3463. if _storage._type != .unknown {
  3464. try visitor.visitSingularEnumField(value: _storage._type, fieldNumber: 4)
  3465. }
  3466. if !_storage._edsServiceName.isEmpty {
  3467. try visitor.visitSingularStringField(value: _storage._edsServiceName, fieldNumber: 5)
  3468. }
  3469. if !_storage._dnsHostname.isEmpty {
  3470. try visitor.visitSingularStringField(value: _storage._dnsHostname, fieldNumber: 6)
  3471. }
  3472. try { if let v = _storage._lrsLoadReportingServer {
  3473. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  3474. } }()
  3475. try { if let v = _storage._outlierDetection {
  3476. try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
  3477. } }()
  3478. if !_storage._overrideHostStatus.isEmpty {
  3479. try visitor.visitPackedEnumField(value: _storage._overrideHostStatus, fieldNumber: 9)
  3480. }
  3481. if !_storage._telemetryLabels.isEmpty {
  3482. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._telemetryLabels, fieldNumber: 10)
  3483. }
  3484. }
  3485. try unknownFields.traverse(visitor: &visitor)
  3486. }
  3487. static func ==(lhs: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism, rhs: Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism) -> Bool {
  3488. if lhs._storage !== rhs._storage {
  3489. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  3490. let _storage = _args.0
  3491. let rhs_storage = _args.1
  3492. if _storage._cluster != rhs_storage._cluster {return false}
  3493. if _storage._lrsLoadReportingServerName != rhs_storage._lrsLoadReportingServerName {return false}
  3494. if _storage._lrsLoadReportingServer != rhs_storage._lrsLoadReportingServer {return false}
  3495. if _storage._maxConcurrentRequests != rhs_storage._maxConcurrentRequests {return false}
  3496. if _storage._type != rhs_storage._type {return false}
  3497. if _storage._edsServiceName != rhs_storage._edsServiceName {return false}
  3498. if _storage._dnsHostname != rhs_storage._dnsHostname {return false}
  3499. if _storage._outlierDetection != rhs_storage._outlierDetection {return false}
  3500. if _storage._overrideHostStatus != rhs_storage._overrideHostStatus {return false}
  3501. if _storage._telemetryLabels != rhs_storage._telemetryLabels {return false}
  3502. return true
  3503. }
  3504. if !storagesAreEqual {return false}
  3505. }
  3506. if lhs.unknownFields != rhs.unknownFields {return false}
  3507. return true
  3508. }
  3509. }
  3510. extension Grpc_ServiceConfig_XdsClusterResolverLoadBalancingPolicyConfig.DiscoveryMechanism.TypeEnum: SwiftProtobuf._ProtoNameProviding {
  3511. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3512. 0: .same(proto: "UNKNOWN"),
  3513. 1: .same(proto: "EDS"),
  3514. 2: .same(proto: "LOGICAL_DNS"),
  3515. ]
  3516. }
  3517. extension Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3518. static let protoMessageName: String = _protobuf_package + ".LrsLoadBalancingPolicyConfig"
  3519. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3520. 1: .standard(proto: "cluster_name"),
  3521. 2: .standard(proto: "eds_service_name"),
  3522. 3: .standard(proto: "lrs_load_reporting_server_name"),
  3523. 4: .same(proto: "locality"),
  3524. 5: .standard(proto: "child_policy"),
  3525. ]
  3526. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3527. while let fieldNumber = try decoder.nextFieldNumber() {
  3528. // The use of inline closures is to circumvent an issue where the compiler
  3529. // allocates stack space for every case branch when no optimizations are
  3530. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3531. switch fieldNumber {
  3532. case 1: try { try decoder.decodeSingularStringField(value: &self.clusterName) }()
  3533. case 2: try { try decoder.decodeSingularStringField(value: &self.edsServiceName) }()
  3534. case 3: try { try decoder.decodeSingularStringField(value: &self.lrsLoadReportingServerName) }()
  3535. case 4: try { try decoder.decodeSingularMessageField(value: &self._locality) }()
  3536. case 5: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  3537. default: break
  3538. }
  3539. }
  3540. }
  3541. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3542. // The use of inline closures is to circumvent an issue where the compiler
  3543. // allocates stack space for every if/case branch local when no optimizations
  3544. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3545. // https://github.com/apple/swift-protobuf/issues/1182
  3546. if !self.clusterName.isEmpty {
  3547. try visitor.visitSingularStringField(value: self.clusterName, fieldNumber: 1)
  3548. }
  3549. if !self.edsServiceName.isEmpty {
  3550. try visitor.visitSingularStringField(value: self.edsServiceName, fieldNumber: 2)
  3551. }
  3552. if !self.lrsLoadReportingServerName.isEmpty {
  3553. try visitor.visitSingularStringField(value: self.lrsLoadReportingServerName, fieldNumber: 3)
  3554. }
  3555. try { if let v = self._locality {
  3556. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  3557. } }()
  3558. if !self.childPolicy.isEmpty {
  3559. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 5)
  3560. }
  3561. try unknownFields.traverse(visitor: &visitor)
  3562. }
  3563. static func ==(lhs: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig) -> Bool {
  3564. if lhs.clusterName != rhs.clusterName {return false}
  3565. if lhs.edsServiceName != rhs.edsServiceName {return false}
  3566. if lhs.lrsLoadReportingServerName != rhs.lrsLoadReportingServerName {return false}
  3567. if lhs._locality != rhs._locality {return false}
  3568. if lhs.childPolicy != rhs.childPolicy {return false}
  3569. if lhs.unknownFields != rhs.unknownFields {return false}
  3570. return true
  3571. }
  3572. }
  3573. extension Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3574. static let protoMessageName: String = Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.protoMessageName + ".Locality"
  3575. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3576. 1: .same(proto: "region"),
  3577. 2: .same(proto: "zone"),
  3578. 3: .same(proto: "subzone"),
  3579. ]
  3580. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3581. while let fieldNumber = try decoder.nextFieldNumber() {
  3582. // The use of inline closures is to circumvent an issue where the compiler
  3583. // allocates stack space for every case branch when no optimizations are
  3584. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3585. switch fieldNumber {
  3586. case 1: try { try decoder.decodeSingularStringField(value: &self.region) }()
  3587. case 2: try { try decoder.decodeSingularStringField(value: &self.zone) }()
  3588. case 3: try { try decoder.decodeSingularStringField(value: &self.subzone) }()
  3589. default: break
  3590. }
  3591. }
  3592. }
  3593. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3594. if !self.region.isEmpty {
  3595. try visitor.visitSingularStringField(value: self.region, fieldNumber: 1)
  3596. }
  3597. if !self.zone.isEmpty {
  3598. try visitor.visitSingularStringField(value: self.zone, fieldNumber: 2)
  3599. }
  3600. if !self.subzone.isEmpty {
  3601. try visitor.visitSingularStringField(value: self.subzone, fieldNumber: 3)
  3602. }
  3603. try unknownFields.traverse(visitor: &visitor)
  3604. }
  3605. static func ==(lhs: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality, rhs: Grpc_ServiceConfig_LrsLoadBalancingPolicyConfig.Locality) -> Bool {
  3606. if lhs.region != rhs.region {return false}
  3607. if lhs.zone != rhs.zone {return false}
  3608. if lhs.subzone != rhs.subzone {return false}
  3609. if lhs.unknownFields != rhs.unknownFields {return false}
  3610. return true
  3611. }
  3612. }
  3613. extension Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3614. static let protoMessageName: String = _protobuf_package + ".EdsLoadBalancingPolicyConfig"
  3615. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3616. 1: .same(proto: "cluster"),
  3617. 2: .standard(proto: "eds_service_name"),
  3618. 3: .standard(proto: "lrs_load_reporting_server_name"),
  3619. 4: .standard(proto: "locality_picking_policy"),
  3620. 5: .standard(proto: "endpoint_picking_policy"),
  3621. ]
  3622. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3623. while let fieldNumber = try decoder.nextFieldNumber() {
  3624. // The use of inline closures is to circumvent an issue where the compiler
  3625. // allocates stack space for every case branch when no optimizations are
  3626. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3627. switch fieldNumber {
  3628. case 1: try { try decoder.decodeSingularStringField(value: &self.cluster) }()
  3629. case 2: try { try decoder.decodeSingularStringField(value: &self.edsServiceName) }()
  3630. case 3: try { try decoder.decodeSingularMessageField(value: &self._lrsLoadReportingServerName) }()
  3631. case 4: try { try decoder.decodeRepeatedMessageField(value: &self.localityPickingPolicy) }()
  3632. case 5: try { try decoder.decodeRepeatedMessageField(value: &self.endpointPickingPolicy) }()
  3633. default: break
  3634. }
  3635. }
  3636. }
  3637. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3638. // The use of inline closures is to circumvent an issue where the compiler
  3639. // allocates stack space for every if/case branch local when no optimizations
  3640. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3641. // https://github.com/apple/swift-protobuf/issues/1182
  3642. if !self.cluster.isEmpty {
  3643. try visitor.visitSingularStringField(value: self.cluster, fieldNumber: 1)
  3644. }
  3645. if !self.edsServiceName.isEmpty {
  3646. try visitor.visitSingularStringField(value: self.edsServiceName, fieldNumber: 2)
  3647. }
  3648. try { if let v = self._lrsLoadReportingServerName {
  3649. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  3650. } }()
  3651. if !self.localityPickingPolicy.isEmpty {
  3652. try visitor.visitRepeatedMessageField(value: self.localityPickingPolicy, fieldNumber: 4)
  3653. }
  3654. if !self.endpointPickingPolicy.isEmpty {
  3655. try visitor.visitRepeatedMessageField(value: self.endpointPickingPolicy, fieldNumber: 5)
  3656. }
  3657. try unknownFields.traverse(visitor: &visitor)
  3658. }
  3659. static func ==(lhs: Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig, rhs: Grpc_ServiceConfig_EdsLoadBalancingPolicyConfig) -> Bool {
  3660. if lhs.cluster != rhs.cluster {return false}
  3661. if lhs.edsServiceName != rhs.edsServiceName {return false}
  3662. if lhs._lrsLoadReportingServerName != rhs._lrsLoadReportingServerName {return false}
  3663. if lhs.localityPickingPolicy != rhs.localityPickingPolicy {return false}
  3664. if lhs.endpointPickingPolicy != rhs.endpointPickingPolicy {return false}
  3665. if lhs.unknownFields != rhs.unknownFields {return false}
  3666. return true
  3667. }
  3668. }
  3669. extension Grpc_ServiceConfig_XdsConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3670. static let protoMessageName: String = _protobuf_package + ".XdsConfig"
  3671. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3672. 1: .standard(proto: "balancer_name"),
  3673. 2: .standard(proto: "child_policy"),
  3674. 3: .standard(proto: "fallback_policy"),
  3675. 4: .standard(proto: "eds_service_name"),
  3676. 5: .standard(proto: "lrs_load_reporting_server_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.decodeSingularStringField(value: &self.balancerName) }()
  3685. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.childPolicy) }()
  3686. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.fallbackPolicy) }()
  3687. case 4: try { try decoder.decodeSingularStringField(value: &self.edsServiceName) }()
  3688. case 5: try { try decoder.decodeSingularMessageField(value: &self._lrsLoadReportingServerName) }()
  3689. default: break
  3690. }
  3691. }
  3692. }
  3693. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3694. // The use of inline closures is to circumvent an issue where the compiler
  3695. // allocates stack space for every if/case branch local when no optimizations
  3696. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3697. // https://github.com/apple/swift-protobuf/issues/1182
  3698. if !self.balancerName.isEmpty {
  3699. try visitor.visitSingularStringField(value: self.balancerName, fieldNumber: 1)
  3700. }
  3701. if !self.childPolicy.isEmpty {
  3702. try visitor.visitRepeatedMessageField(value: self.childPolicy, fieldNumber: 2)
  3703. }
  3704. if !self.fallbackPolicy.isEmpty {
  3705. try visitor.visitRepeatedMessageField(value: self.fallbackPolicy, fieldNumber: 3)
  3706. }
  3707. if !self.edsServiceName.isEmpty {
  3708. try visitor.visitSingularStringField(value: self.edsServiceName, fieldNumber: 4)
  3709. }
  3710. try { if let v = self._lrsLoadReportingServerName {
  3711. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  3712. } }()
  3713. try unknownFields.traverse(visitor: &visitor)
  3714. }
  3715. static func ==(lhs: Grpc_ServiceConfig_XdsConfig, rhs: Grpc_ServiceConfig_XdsConfig) -> Bool {
  3716. if lhs.balancerName != rhs.balancerName {return false}
  3717. if lhs.childPolicy != rhs.childPolicy {return false}
  3718. if lhs.fallbackPolicy != rhs.fallbackPolicy {return false}
  3719. if lhs.edsServiceName != rhs.edsServiceName {return false}
  3720. if lhs._lrsLoadReportingServerName != rhs._lrsLoadReportingServerName {return false}
  3721. if lhs.unknownFields != rhs.unknownFields {return false}
  3722. return true
  3723. }
  3724. }