service_config.pb.swift 189 KB

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