service_config.pb.swift 183 KB

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