service_config.pb.swift 183 KB

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