spirc.rs 148 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503
  1. // This file is generated by rust-protobuf 2.14.0. Do not edit
  2. // @generated
  3. // https://github.com/rust-lang/rust-clippy/issues/702
  4. #![allow(unknown_lints)]
  5. #![allow(clippy::all)]
  6. #![cfg_attr(rustfmt, rustfmt_skip)]
  7. #![allow(box_pointers)]
  8. #![allow(dead_code)]
  9. #![allow(missing_docs)]
  10. #![allow(non_camel_case_types)]
  11. #![allow(non_snake_case)]
  12. #![allow(non_upper_case_globals)]
  13. #![allow(trivial_casts)]
  14. #![allow(unsafe_code)]
  15. #![allow(unused_imports)]
  16. #![allow(unused_results)]
  17. //! Generated file from `spirc.proto`
  18. use protobuf::Message as Message_imported_for_functions;
  19. use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
  20. /// Generated files are compatible only with the same version
  21. /// of protobuf runtime.
  22. // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_14_0;
  23. #[derive(PartialEq, Clone, Default)]
  24. pub struct Frame {
  25. // message fields
  26. version: ::std::option::Option<u32>,
  27. ident: ::protobuf::SingularField<::std::string::String>,
  28. protocol_version: ::protobuf::SingularField<::std::string::String>,
  29. seq_nr: ::std::option::Option<u32>,
  30. typ: ::std::option::Option<MessageType>,
  31. device_state: ::protobuf::SingularPtrField<DeviceState>,
  32. goodbye: ::protobuf::SingularPtrField<Goodbye>,
  33. state: ::protobuf::SingularPtrField<State>,
  34. position: ::std::option::Option<u32>,
  35. volume: ::std::option::Option<u32>,
  36. state_update_id: ::std::option::Option<i64>,
  37. recipient: ::protobuf::RepeatedField<::std::string::String>,
  38. context_player_state: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  39. new_name: ::protobuf::SingularField<::std::string::String>,
  40. metadata: ::protobuf::SingularPtrField<Metadata>,
  41. // special fields
  42. pub unknown_fields: ::protobuf::UnknownFields,
  43. pub cached_size: ::protobuf::CachedSize,
  44. }
  45. impl<'a> ::std::default::Default for &'a Frame {
  46. fn default() -> &'a Frame {
  47. <Frame as ::protobuf::Message>::default_instance()
  48. }
  49. }
  50. impl Frame {
  51. pub fn new() -> Frame {
  52. ::std::default::Default::default()
  53. }
  54. // optional uint32 version = 1;
  55. pub fn get_version(&self) -> u32 {
  56. self.version.unwrap_or(0)
  57. }
  58. pub fn clear_version(&mut self) {
  59. self.version = ::std::option::Option::None;
  60. }
  61. pub fn has_version(&self) -> bool {
  62. self.version.is_some()
  63. }
  64. // Param is passed by value, moved
  65. pub fn set_version(&mut self, v: u32) {
  66. self.version = ::std::option::Option::Some(v);
  67. }
  68. // optional string ident = 2;
  69. pub fn get_ident(&self) -> &str {
  70. match self.ident.as_ref() {
  71. Some(v) => &v,
  72. None => "",
  73. }
  74. }
  75. pub fn clear_ident(&mut self) {
  76. self.ident.clear();
  77. }
  78. pub fn has_ident(&self) -> bool {
  79. self.ident.is_some()
  80. }
  81. // Param is passed by value, moved
  82. pub fn set_ident(&mut self, v: ::std::string::String) {
  83. self.ident = ::protobuf::SingularField::some(v);
  84. }
  85. // Mutable pointer to the field.
  86. // If field is not initialized, it is initialized with default value first.
  87. pub fn mut_ident(&mut self) -> &mut ::std::string::String {
  88. if self.ident.is_none() {
  89. self.ident.set_default();
  90. }
  91. self.ident.as_mut().unwrap()
  92. }
  93. // Take field
  94. pub fn take_ident(&mut self) -> ::std::string::String {
  95. self.ident
  96. .take()
  97. .unwrap_or_else(|| ::std::string::String::new())
  98. }
  99. // optional string protocol_version = 3;
  100. pub fn get_protocol_version(&self) -> &str {
  101. match self.protocol_version.as_ref() {
  102. Some(v) => &v,
  103. None => "",
  104. }
  105. }
  106. pub fn clear_protocol_version(&mut self) {
  107. self.protocol_version.clear();
  108. }
  109. pub fn has_protocol_version(&self) -> bool {
  110. self.protocol_version.is_some()
  111. }
  112. // Param is passed by value, moved
  113. pub fn set_protocol_version(&mut self, v: ::std::string::String) {
  114. self.protocol_version = ::protobuf::SingularField::some(v);
  115. }
  116. // Mutable pointer to the field.
  117. // If field is not initialized, it is initialized with default value first.
  118. pub fn mut_protocol_version(&mut self) -> &mut ::std::string::String {
  119. if self.protocol_version.is_none() {
  120. self.protocol_version.set_default();
  121. }
  122. self.protocol_version.as_mut().unwrap()
  123. }
  124. // Take field
  125. pub fn take_protocol_version(&mut self) -> ::std::string::String {
  126. self.protocol_version
  127. .take()
  128. .unwrap_or_else(|| ::std::string::String::new())
  129. }
  130. // optional uint32 seq_nr = 4;
  131. pub fn get_seq_nr(&self) -> u32 {
  132. self.seq_nr.unwrap_or(0)
  133. }
  134. pub fn clear_seq_nr(&mut self) {
  135. self.seq_nr = ::std::option::Option::None;
  136. }
  137. pub fn has_seq_nr(&self) -> bool {
  138. self.seq_nr.is_some()
  139. }
  140. // Param is passed by value, moved
  141. pub fn set_seq_nr(&mut self, v: u32) {
  142. self.seq_nr = ::std::option::Option::Some(v);
  143. }
  144. // optional .MessageType typ = 5;
  145. pub fn get_typ(&self) -> MessageType {
  146. self.typ.unwrap_or(MessageType::kMessageTypeHello)
  147. }
  148. pub fn clear_typ(&mut self) {
  149. self.typ = ::std::option::Option::None;
  150. }
  151. pub fn has_typ(&self) -> bool {
  152. self.typ.is_some()
  153. }
  154. // Param is passed by value, moved
  155. pub fn set_typ(&mut self, v: MessageType) {
  156. self.typ = ::std::option::Option::Some(v);
  157. }
  158. // optional .DeviceState device_state = 7;
  159. pub fn get_device_state(&self) -> &DeviceState {
  160. self.device_state
  161. .as_ref()
  162. .unwrap_or_else(|| DeviceState::default_instance())
  163. }
  164. pub fn clear_device_state(&mut self) {
  165. self.device_state.clear();
  166. }
  167. pub fn has_device_state(&self) -> bool {
  168. self.device_state.is_some()
  169. }
  170. // Param is passed by value, moved
  171. pub fn set_device_state(&mut self, v: DeviceState) {
  172. self.device_state = ::protobuf::SingularPtrField::some(v);
  173. }
  174. // Mutable pointer to the field.
  175. // If field is not initialized, it is initialized with default value first.
  176. pub fn mut_device_state(&mut self) -> &mut DeviceState {
  177. if self.device_state.is_none() {
  178. self.device_state.set_default();
  179. }
  180. self.device_state.as_mut().unwrap()
  181. }
  182. // Take field
  183. pub fn take_device_state(&mut self) -> DeviceState {
  184. self.device_state
  185. .take()
  186. .unwrap_or_else(|| DeviceState::new())
  187. }
  188. // optional .Goodbye goodbye = 11;
  189. pub fn get_goodbye(&self) -> &Goodbye {
  190. self.goodbye
  191. .as_ref()
  192. .unwrap_or_else(|| Goodbye::default_instance())
  193. }
  194. pub fn clear_goodbye(&mut self) {
  195. self.goodbye.clear();
  196. }
  197. pub fn has_goodbye(&self) -> bool {
  198. self.goodbye.is_some()
  199. }
  200. // Param is passed by value, moved
  201. pub fn set_goodbye(&mut self, v: Goodbye) {
  202. self.goodbye = ::protobuf::SingularPtrField::some(v);
  203. }
  204. // Mutable pointer to the field.
  205. // If field is not initialized, it is initialized with default value first.
  206. pub fn mut_goodbye(&mut self) -> &mut Goodbye {
  207. if self.goodbye.is_none() {
  208. self.goodbye.set_default();
  209. }
  210. self.goodbye.as_mut().unwrap()
  211. }
  212. // Take field
  213. pub fn take_goodbye(&mut self) -> Goodbye {
  214. self.goodbye.take().unwrap_or_else(|| Goodbye::new())
  215. }
  216. // optional .State state = 12;
  217. pub fn get_state(&self) -> &State {
  218. self.state
  219. .as_ref()
  220. .unwrap_or_else(|| State::default_instance())
  221. }
  222. pub fn clear_state(&mut self) {
  223. self.state.clear();
  224. }
  225. pub fn has_state(&self) -> bool {
  226. self.state.is_some()
  227. }
  228. // Param is passed by value, moved
  229. pub fn set_state(&mut self, v: State) {
  230. self.state = ::protobuf::SingularPtrField::some(v);
  231. }
  232. // Mutable pointer to the field.
  233. // If field is not initialized, it is initialized with default value first.
  234. pub fn mut_state(&mut self) -> &mut State {
  235. if self.state.is_none() {
  236. self.state.set_default();
  237. }
  238. self.state.as_mut().unwrap()
  239. }
  240. // Take field
  241. pub fn take_state(&mut self) -> State {
  242. self.state.take().unwrap_or_else(|| State::new())
  243. }
  244. // optional uint32 position = 13;
  245. pub fn get_position(&self) -> u32 {
  246. self.position.unwrap_or(0)
  247. }
  248. pub fn clear_position(&mut self) {
  249. self.position = ::std::option::Option::None;
  250. }
  251. pub fn has_position(&self) -> bool {
  252. self.position.is_some()
  253. }
  254. // Param is passed by value, moved
  255. pub fn set_position(&mut self, v: u32) {
  256. self.position = ::std::option::Option::Some(v);
  257. }
  258. // optional uint32 volume = 14;
  259. pub fn get_volume(&self) -> u32 {
  260. self.volume.unwrap_or(0)
  261. }
  262. pub fn clear_volume(&mut self) {
  263. self.volume = ::std::option::Option::None;
  264. }
  265. pub fn has_volume(&self) -> bool {
  266. self.volume.is_some()
  267. }
  268. // Param is passed by value, moved
  269. pub fn set_volume(&mut self, v: u32) {
  270. self.volume = ::std::option::Option::Some(v);
  271. }
  272. // optional int64 state_update_id = 17;
  273. pub fn get_state_update_id(&self) -> i64 {
  274. self.state_update_id.unwrap_or(0)
  275. }
  276. pub fn clear_state_update_id(&mut self) {
  277. self.state_update_id = ::std::option::Option::None;
  278. }
  279. pub fn has_state_update_id(&self) -> bool {
  280. self.state_update_id.is_some()
  281. }
  282. // Param is passed by value, moved
  283. pub fn set_state_update_id(&mut self, v: i64) {
  284. self.state_update_id = ::std::option::Option::Some(v);
  285. }
  286. // repeated string recipient = 18;
  287. pub fn get_recipient(&self) -> &[::std::string::String] {
  288. &self.recipient
  289. }
  290. pub fn clear_recipient(&mut self) {
  291. self.recipient.clear();
  292. }
  293. // Param is passed by value, moved
  294. pub fn set_recipient(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
  295. self.recipient = v;
  296. }
  297. // Mutable pointer to the field.
  298. pub fn mut_recipient(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
  299. &mut self.recipient
  300. }
  301. // Take field
  302. pub fn take_recipient(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
  303. ::std::mem::replace(&mut self.recipient, ::protobuf::RepeatedField::new())
  304. }
  305. // optional bytes context_player_state = 19;
  306. pub fn get_context_player_state(&self) -> &[u8] {
  307. match self.context_player_state.as_ref() {
  308. Some(v) => &v,
  309. None => &[],
  310. }
  311. }
  312. pub fn clear_context_player_state(&mut self) {
  313. self.context_player_state.clear();
  314. }
  315. pub fn has_context_player_state(&self) -> bool {
  316. self.context_player_state.is_some()
  317. }
  318. // Param is passed by value, moved
  319. pub fn set_context_player_state(&mut self, v: ::std::vec::Vec<u8>) {
  320. self.context_player_state = ::protobuf::SingularField::some(v);
  321. }
  322. // Mutable pointer to the field.
  323. // If field is not initialized, it is initialized with default value first.
  324. pub fn mut_context_player_state(&mut self) -> &mut ::std::vec::Vec<u8> {
  325. if self.context_player_state.is_none() {
  326. self.context_player_state.set_default();
  327. }
  328. self.context_player_state.as_mut().unwrap()
  329. }
  330. // Take field
  331. pub fn take_context_player_state(&mut self) -> ::std::vec::Vec<u8> {
  332. self.context_player_state
  333. .take()
  334. .unwrap_or_else(|| ::std::vec::Vec::new())
  335. }
  336. // optional string new_name = 20;
  337. pub fn get_new_name(&self) -> &str {
  338. match self.new_name.as_ref() {
  339. Some(v) => &v,
  340. None => "",
  341. }
  342. }
  343. pub fn clear_new_name(&mut self) {
  344. self.new_name.clear();
  345. }
  346. pub fn has_new_name(&self) -> bool {
  347. self.new_name.is_some()
  348. }
  349. // Param is passed by value, moved
  350. pub fn set_new_name(&mut self, v: ::std::string::String) {
  351. self.new_name = ::protobuf::SingularField::some(v);
  352. }
  353. // Mutable pointer to the field.
  354. // If field is not initialized, it is initialized with default value first.
  355. pub fn mut_new_name(&mut self) -> &mut ::std::string::String {
  356. if self.new_name.is_none() {
  357. self.new_name.set_default();
  358. }
  359. self.new_name.as_mut().unwrap()
  360. }
  361. // Take field
  362. pub fn take_new_name(&mut self) -> ::std::string::String {
  363. self.new_name
  364. .take()
  365. .unwrap_or_else(|| ::std::string::String::new())
  366. }
  367. // optional .Metadata metadata = 25;
  368. pub fn get_metadata(&self) -> &Metadata {
  369. self.metadata
  370. .as_ref()
  371. .unwrap_or_else(|| Metadata::default_instance())
  372. }
  373. pub fn clear_metadata(&mut self) {
  374. self.metadata.clear();
  375. }
  376. pub fn has_metadata(&self) -> bool {
  377. self.metadata.is_some()
  378. }
  379. // Param is passed by value, moved
  380. pub fn set_metadata(&mut self, v: Metadata) {
  381. self.metadata = ::protobuf::SingularPtrField::some(v);
  382. }
  383. // Mutable pointer to the field.
  384. // If field is not initialized, it is initialized with default value first.
  385. pub fn mut_metadata(&mut self) -> &mut Metadata {
  386. if self.metadata.is_none() {
  387. self.metadata.set_default();
  388. }
  389. self.metadata.as_mut().unwrap()
  390. }
  391. // Take field
  392. pub fn take_metadata(&mut self) -> Metadata {
  393. self.metadata.take().unwrap_or_else(|| Metadata::new())
  394. }
  395. }
  396. impl ::protobuf::Message for Frame {
  397. fn is_initialized(&self) -> bool {
  398. for v in &self.device_state {
  399. if !v.is_initialized() {
  400. return false;
  401. }
  402. }
  403. for v in &self.goodbye {
  404. if !v.is_initialized() {
  405. return false;
  406. }
  407. }
  408. for v in &self.state {
  409. if !v.is_initialized() {
  410. return false;
  411. }
  412. }
  413. for v in &self.metadata {
  414. if !v.is_initialized() {
  415. return false;
  416. }
  417. }
  418. true
  419. }
  420. fn merge_from(
  421. &mut self,
  422. is: &mut ::protobuf::CodedInputStream<'_>,
  423. ) -> ::protobuf::ProtobufResult<()> {
  424. while !is.eof()? {
  425. let (field_number, wire_type) = is.read_tag_unpack()?;
  426. match field_number {
  427. 1 => {
  428. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  429. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  430. wire_type,
  431. ));
  432. }
  433. let tmp = is.read_uint32()?;
  434. self.version = ::std::option::Option::Some(tmp);
  435. }
  436. 2 => {
  437. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.ident)?;
  438. }
  439. 3 => {
  440. ::protobuf::rt::read_singular_string_into(
  441. wire_type,
  442. is,
  443. &mut self.protocol_version,
  444. )?;
  445. }
  446. 4 => {
  447. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  448. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  449. wire_type,
  450. ));
  451. }
  452. let tmp = is.read_uint32()?;
  453. self.seq_nr = ::std::option::Option::Some(tmp);
  454. }
  455. 5 => ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(
  456. wire_type,
  457. is,
  458. &mut self.typ,
  459. 5,
  460. &mut self.unknown_fields,
  461. )?,
  462. 7 => {
  463. ::protobuf::rt::read_singular_message_into(
  464. wire_type,
  465. is,
  466. &mut self.device_state,
  467. )?;
  468. }
  469. 11 => {
  470. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.goodbye)?;
  471. }
  472. 12 => {
  473. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.state)?;
  474. }
  475. 13 => {
  476. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  477. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  478. wire_type,
  479. ));
  480. }
  481. let tmp = is.read_uint32()?;
  482. self.position = ::std::option::Option::Some(tmp);
  483. }
  484. 14 => {
  485. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  486. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  487. wire_type,
  488. ));
  489. }
  490. let tmp = is.read_uint32()?;
  491. self.volume = ::std::option::Option::Some(tmp);
  492. }
  493. 17 => {
  494. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  495. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  496. wire_type,
  497. ));
  498. }
  499. let tmp = is.read_int64()?;
  500. self.state_update_id = ::std::option::Option::Some(tmp);
  501. }
  502. 18 => {
  503. ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.recipient)?;
  504. }
  505. 19 => {
  506. ::protobuf::rt::read_singular_bytes_into(
  507. wire_type,
  508. is,
  509. &mut self.context_player_state,
  510. )?;
  511. }
  512. 20 => {
  513. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.new_name)?;
  514. }
  515. 25 => {
  516. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.metadata)?;
  517. }
  518. _ => {
  519. ::protobuf::rt::read_unknown_or_skip_group(
  520. field_number,
  521. wire_type,
  522. is,
  523. self.mut_unknown_fields(),
  524. )?;
  525. }
  526. };
  527. }
  528. ::std::result::Result::Ok(())
  529. }
  530. // Compute sizes of nested messages
  531. #[allow(unused_variables)]
  532. fn compute_size(&self) -> u32 {
  533. let mut my_size = 0;
  534. if let Some(v) = self.version {
  535. my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
  536. }
  537. if let Some(ref v) = self.ident.as_ref() {
  538. my_size += ::protobuf::rt::string_size(2, &v);
  539. }
  540. if let Some(ref v) = self.protocol_version.as_ref() {
  541. my_size += ::protobuf::rt::string_size(3, &v);
  542. }
  543. if let Some(v) = self.seq_nr {
  544. my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint);
  545. }
  546. if let Some(v) = self.typ {
  547. my_size += ::protobuf::rt::enum_size(5, v);
  548. }
  549. if let Some(ref v) = self.device_state.as_ref() {
  550. let len = v.compute_size();
  551. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  552. }
  553. if let Some(ref v) = self.goodbye.as_ref() {
  554. let len = v.compute_size();
  555. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  556. }
  557. if let Some(ref v) = self.state.as_ref() {
  558. let len = v.compute_size();
  559. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  560. }
  561. if let Some(v) = self.position {
  562. my_size += ::protobuf::rt::value_size(13, v, ::protobuf::wire_format::WireTypeVarint);
  563. }
  564. if let Some(v) = self.volume {
  565. my_size += ::protobuf::rt::value_size(14, v, ::protobuf::wire_format::WireTypeVarint);
  566. }
  567. if let Some(v) = self.state_update_id {
  568. my_size += ::protobuf::rt::value_size(17, v, ::protobuf::wire_format::WireTypeVarint);
  569. }
  570. for value in &self.recipient {
  571. my_size += ::protobuf::rt::string_size(18, &value);
  572. }
  573. if let Some(ref v) = self.context_player_state.as_ref() {
  574. my_size += ::protobuf::rt::bytes_size(19, &v);
  575. }
  576. if let Some(ref v) = self.new_name.as_ref() {
  577. my_size += ::protobuf::rt::string_size(20, &v);
  578. }
  579. if let Some(ref v) = self.metadata.as_ref() {
  580. let len = v.compute_size();
  581. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  582. }
  583. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  584. self.cached_size.set(my_size);
  585. my_size
  586. }
  587. fn write_to_with_cached_sizes(
  588. &self,
  589. os: &mut ::protobuf::CodedOutputStream<'_>,
  590. ) -> ::protobuf::ProtobufResult<()> {
  591. if let Some(v) = self.version {
  592. os.write_uint32(1, v)?;
  593. }
  594. if let Some(ref v) = self.ident.as_ref() {
  595. os.write_string(2, &v)?;
  596. }
  597. if let Some(ref v) = self.protocol_version.as_ref() {
  598. os.write_string(3, &v)?;
  599. }
  600. if let Some(v) = self.seq_nr {
  601. os.write_uint32(4, v)?;
  602. }
  603. if let Some(v) = self.typ {
  604. os.write_enum(5, v.value())?;
  605. }
  606. if let Some(ref v) = self.device_state.as_ref() {
  607. os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  608. os.write_raw_varint32(v.get_cached_size())?;
  609. v.write_to_with_cached_sizes(os)?;
  610. }
  611. if let Some(ref v) = self.goodbye.as_ref() {
  612. os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  613. os.write_raw_varint32(v.get_cached_size())?;
  614. v.write_to_with_cached_sizes(os)?;
  615. }
  616. if let Some(ref v) = self.state.as_ref() {
  617. os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  618. os.write_raw_varint32(v.get_cached_size())?;
  619. v.write_to_with_cached_sizes(os)?;
  620. }
  621. if let Some(v) = self.position {
  622. os.write_uint32(13, v)?;
  623. }
  624. if let Some(v) = self.volume {
  625. os.write_uint32(14, v)?;
  626. }
  627. if let Some(v) = self.state_update_id {
  628. os.write_int64(17, v)?;
  629. }
  630. for v in &self.recipient {
  631. os.write_string(18, &v)?;
  632. }
  633. if let Some(ref v) = self.context_player_state.as_ref() {
  634. os.write_bytes(19, &v)?;
  635. }
  636. if let Some(ref v) = self.new_name.as_ref() {
  637. os.write_string(20, &v)?;
  638. }
  639. if let Some(ref v) = self.metadata.as_ref() {
  640. os.write_tag(25, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  641. os.write_raw_varint32(v.get_cached_size())?;
  642. v.write_to_with_cached_sizes(os)?;
  643. }
  644. os.write_unknown_fields(self.get_unknown_fields())?;
  645. ::std::result::Result::Ok(())
  646. }
  647. fn get_cached_size(&self) -> u32 {
  648. self.cached_size.get()
  649. }
  650. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  651. &self.unknown_fields
  652. }
  653. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  654. &mut self.unknown_fields
  655. }
  656. fn as_any(&self) -> &dyn (::std::any::Any) {
  657. self as &dyn (::std::any::Any)
  658. }
  659. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  660. self as &mut dyn (::std::any::Any)
  661. }
  662. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  663. self
  664. }
  665. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  666. Self::descriptor_static()
  667. }
  668. fn new() -> Frame {
  669. Frame::new()
  670. }
  671. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  672. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> =
  673. ::protobuf::lazy::Lazy::INIT;
  674. unsafe {
  675. descriptor.get(|| {
  676. let mut fields = ::std::vec::Vec::new();
  677. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  678. _,
  679. ::protobuf::types::ProtobufTypeUint32,
  680. >(
  681. "version",
  682. |m: &Frame| &m.version,
  683. |m: &mut Frame| &mut m.version,
  684. ));
  685. fields.push(
  686. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  687. _,
  688. ::protobuf::types::ProtobufTypeString,
  689. >(
  690. "ident", |m: &Frame| &m.ident, |m: &mut Frame| &mut m.ident
  691. ),
  692. );
  693. fields.push(
  694. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  695. _,
  696. ::protobuf::types::ProtobufTypeString,
  697. >(
  698. "protocol_version",
  699. |m: &Frame| &m.protocol_version,
  700. |m: &mut Frame| &mut m.protocol_version,
  701. ),
  702. );
  703. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  704. _,
  705. ::protobuf::types::ProtobufTypeUint32,
  706. >(
  707. "seq_nr",
  708. |m: &Frame| &m.seq_nr,
  709. |m: &mut Frame| &mut m.seq_nr,
  710. ));
  711. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  712. _,
  713. ::protobuf::types::ProtobufTypeEnum<MessageType>,
  714. >(
  715. "typ", |m: &Frame| &m.typ, |m: &mut Frame| &mut m.typ
  716. ));
  717. fields.push(
  718. ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<
  719. _,
  720. ::protobuf::types::ProtobufTypeMessage<DeviceState>,
  721. >(
  722. "device_state",
  723. |m: &Frame| &m.device_state,
  724. |m: &mut Frame| &mut m.device_state,
  725. ),
  726. );
  727. fields.push(
  728. ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<
  729. _,
  730. ::protobuf::types::ProtobufTypeMessage<Goodbye>,
  731. >(
  732. "goodbye",
  733. |m: &Frame| &m.goodbye,
  734. |m: &mut Frame| &mut m.goodbye,
  735. ),
  736. );
  737. fields.push(
  738. ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<
  739. _,
  740. ::protobuf::types::ProtobufTypeMessage<State>,
  741. >(
  742. "state", |m: &Frame| &m.state, |m: &mut Frame| &mut m.state
  743. ),
  744. );
  745. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  746. _,
  747. ::protobuf::types::ProtobufTypeUint32,
  748. >(
  749. "position",
  750. |m: &Frame| &m.position,
  751. |m: &mut Frame| &mut m.position,
  752. ));
  753. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  754. _,
  755. ::protobuf::types::ProtobufTypeUint32,
  756. >(
  757. "volume",
  758. |m: &Frame| &m.volume,
  759. |m: &mut Frame| &mut m.volume,
  760. ));
  761. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  762. _,
  763. ::protobuf::types::ProtobufTypeInt64,
  764. >(
  765. "state_update_id",
  766. |m: &Frame| &m.state_update_id,
  767. |m: &mut Frame| &mut m.state_update_id,
  768. ));
  769. fields.push(
  770. ::protobuf::reflect::accessor::make_repeated_field_accessor::<
  771. _,
  772. ::protobuf::types::ProtobufTypeString,
  773. >(
  774. "recipient",
  775. |m: &Frame| &m.recipient,
  776. |m: &mut Frame| &mut m.recipient,
  777. ),
  778. );
  779. fields.push(
  780. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  781. _,
  782. ::protobuf::types::ProtobufTypeBytes,
  783. >(
  784. "context_player_state",
  785. |m: &Frame| &m.context_player_state,
  786. |m: &mut Frame| &mut m.context_player_state,
  787. ),
  788. );
  789. fields.push(
  790. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  791. _,
  792. ::protobuf::types::ProtobufTypeString,
  793. >(
  794. "new_name",
  795. |m: &Frame| &m.new_name,
  796. |m: &mut Frame| &mut m.new_name,
  797. ),
  798. );
  799. fields.push(
  800. ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<
  801. _,
  802. ::protobuf::types::ProtobufTypeMessage<Metadata>,
  803. >(
  804. "metadata",
  805. |m: &Frame| &m.metadata,
  806. |m: &mut Frame| &mut m.metadata,
  807. ),
  808. );
  809. ::protobuf::reflect::MessageDescriptor::new_pb_name::<Frame>(
  810. "Frame",
  811. fields,
  812. file_descriptor_proto(),
  813. )
  814. })
  815. }
  816. }
  817. fn default_instance() -> &'static Frame {
  818. static mut instance: ::protobuf::lazy::Lazy<Frame> = ::protobuf::lazy::Lazy::INIT;
  819. unsafe { instance.get(Frame::new) }
  820. }
  821. }
  822. impl ::protobuf::Clear for Frame {
  823. fn clear(&mut self) {
  824. self.version = ::std::option::Option::None;
  825. self.ident.clear();
  826. self.protocol_version.clear();
  827. self.seq_nr = ::std::option::Option::None;
  828. self.typ = ::std::option::Option::None;
  829. self.device_state.clear();
  830. self.goodbye.clear();
  831. self.state.clear();
  832. self.position = ::std::option::Option::None;
  833. self.volume = ::std::option::Option::None;
  834. self.state_update_id = ::std::option::Option::None;
  835. self.recipient.clear();
  836. self.context_player_state.clear();
  837. self.new_name.clear();
  838. self.metadata.clear();
  839. self.unknown_fields.clear();
  840. }
  841. }
  842. impl ::std::fmt::Debug for Frame {
  843. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  844. ::protobuf::text_format::fmt(self, f)
  845. }
  846. }
  847. impl ::protobuf::reflect::ProtobufValue for Frame {
  848. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  849. ::protobuf::reflect::ReflectValueRef::Message(self)
  850. }
  851. }
  852. #[derive(PartialEq, Clone, Default)]
  853. pub struct DeviceState {
  854. // message fields
  855. sw_version: ::protobuf::SingularField<::std::string::String>,
  856. is_active: ::std::option::Option<bool>,
  857. can_play: ::std::option::Option<bool>,
  858. volume: ::std::option::Option<u32>,
  859. name: ::protobuf::SingularField<::std::string::String>,
  860. error_code: ::std::option::Option<u32>,
  861. became_active_at: ::std::option::Option<i64>,
  862. error_message: ::protobuf::SingularField<::std::string::String>,
  863. capabilities: ::protobuf::RepeatedField<Capability>,
  864. context_player_error: ::protobuf::SingularField<::std::string::String>,
  865. metadata: ::protobuf::RepeatedField<Metadata>,
  866. // special fields
  867. pub unknown_fields: ::protobuf::UnknownFields,
  868. pub cached_size: ::protobuf::CachedSize,
  869. }
  870. impl<'a> ::std::default::Default for &'a DeviceState {
  871. fn default() -> &'a DeviceState {
  872. <DeviceState as ::protobuf::Message>::default_instance()
  873. }
  874. }
  875. impl DeviceState {
  876. pub fn new() -> DeviceState {
  877. ::std::default::Default::default()
  878. }
  879. // optional string sw_version = 1;
  880. pub fn get_sw_version(&self) -> &str {
  881. match self.sw_version.as_ref() {
  882. Some(v) => &v,
  883. None => "",
  884. }
  885. }
  886. pub fn clear_sw_version(&mut self) {
  887. self.sw_version.clear();
  888. }
  889. pub fn has_sw_version(&self) -> bool {
  890. self.sw_version.is_some()
  891. }
  892. // Param is passed by value, moved
  893. pub fn set_sw_version(&mut self, v: ::std::string::String) {
  894. self.sw_version = ::protobuf::SingularField::some(v);
  895. }
  896. // Mutable pointer to the field.
  897. // If field is not initialized, it is initialized with default value first.
  898. pub fn mut_sw_version(&mut self) -> &mut ::std::string::String {
  899. if self.sw_version.is_none() {
  900. self.sw_version.set_default();
  901. }
  902. self.sw_version.as_mut().unwrap()
  903. }
  904. // Take field
  905. pub fn take_sw_version(&mut self) -> ::std::string::String {
  906. self.sw_version
  907. .take()
  908. .unwrap_or_else(|| ::std::string::String::new())
  909. }
  910. // optional bool is_active = 10;
  911. pub fn get_is_active(&self) -> bool {
  912. self.is_active.unwrap_or(false)
  913. }
  914. pub fn clear_is_active(&mut self) {
  915. self.is_active = ::std::option::Option::None;
  916. }
  917. pub fn has_is_active(&self) -> bool {
  918. self.is_active.is_some()
  919. }
  920. // Param is passed by value, moved
  921. pub fn set_is_active(&mut self, v: bool) {
  922. self.is_active = ::std::option::Option::Some(v);
  923. }
  924. // optional bool can_play = 11;
  925. pub fn get_can_play(&self) -> bool {
  926. self.can_play.unwrap_or(false)
  927. }
  928. pub fn clear_can_play(&mut self) {
  929. self.can_play = ::std::option::Option::None;
  930. }
  931. pub fn has_can_play(&self) -> bool {
  932. self.can_play.is_some()
  933. }
  934. // Param is passed by value, moved
  935. pub fn set_can_play(&mut self, v: bool) {
  936. self.can_play = ::std::option::Option::Some(v);
  937. }
  938. // optional uint32 volume = 12;
  939. pub fn get_volume(&self) -> u32 {
  940. self.volume.unwrap_or(0)
  941. }
  942. pub fn clear_volume(&mut self) {
  943. self.volume = ::std::option::Option::None;
  944. }
  945. pub fn has_volume(&self) -> bool {
  946. self.volume.is_some()
  947. }
  948. // Param is passed by value, moved
  949. pub fn set_volume(&mut self, v: u32) {
  950. self.volume = ::std::option::Option::Some(v);
  951. }
  952. // optional string name = 13;
  953. pub fn get_name(&self) -> &str {
  954. match self.name.as_ref() {
  955. Some(v) => &v,
  956. None => "",
  957. }
  958. }
  959. pub fn clear_name(&mut self) {
  960. self.name.clear();
  961. }
  962. pub fn has_name(&self) -> bool {
  963. self.name.is_some()
  964. }
  965. // Param is passed by value, moved
  966. pub fn set_name(&mut self, v: ::std::string::String) {
  967. self.name = ::protobuf::SingularField::some(v);
  968. }
  969. // Mutable pointer to the field.
  970. // If field is not initialized, it is initialized with default value first.
  971. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  972. if self.name.is_none() {
  973. self.name.set_default();
  974. }
  975. self.name.as_mut().unwrap()
  976. }
  977. // Take field
  978. pub fn take_name(&mut self) -> ::std::string::String {
  979. self.name
  980. .take()
  981. .unwrap_or_else(|| ::std::string::String::new())
  982. }
  983. // optional uint32 error_code = 14;
  984. pub fn get_error_code(&self) -> u32 {
  985. self.error_code.unwrap_or(0)
  986. }
  987. pub fn clear_error_code(&mut self) {
  988. self.error_code = ::std::option::Option::None;
  989. }
  990. pub fn has_error_code(&self) -> bool {
  991. self.error_code.is_some()
  992. }
  993. // Param is passed by value, moved
  994. pub fn set_error_code(&mut self, v: u32) {
  995. self.error_code = ::std::option::Option::Some(v);
  996. }
  997. // optional int64 became_active_at = 15;
  998. pub fn get_became_active_at(&self) -> i64 {
  999. self.became_active_at.unwrap_or(0)
  1000. }
  1001. pub fn clear_became_active_at(&mut self) {
  1002. self.became_active_at = ::std::option::Option::None;
  1003. }
  1004. pub fn has_became_active_at(&self) -> bool {
  1005. self.became_active_at.is_some()
  1006. }
  1007. // Param is passed by value, moved
  1008. pub fn set_became_active_at(&mut self, v: i64) {
  1009. self.became_active_at = ::std::option::Option::Some(v);
  1010. }
  1011. // optional string error_message = 16;
  1012. pub fn get_error_message(&self) -> &str {
  1013. match self.error_message.as_ref() {
  1014. Some(v) => &v,
  1015. None => "",
  1016. }
  1017. }
  1018. pub fn clear_error_message(&mut self) {
  1019. self.error_message.clear();
  1020. }
  1021. pub fn has_error_message(&self) -> bool {
  1022. self.error_message.is_some()
  1023. }
  1024. // Param is passed by value, moved
  1025. pub fn set_error_message(&mut self, v: ::std::string::String) {
  1026. self.error_message = ::protobuf::SingularField::some(v);
  1027. }
  1028. // Mutable pointer to the field.
  1029. // If field is not initialized, it is initialized with default value first.
  1030. pub fn mut_error_message(&mut self) -> &mut ::std::string::String {
  1031. if self.error_message.is_none() {
  1032. self.error_message.set_default();
  1033. }
  1034. self.error_message.as_mut().unwrap()
  1035. }
  1036. // Take field
  1037. pub fn take_error_message(&mut self) -> ::std::string::String {
  1038. self.error_message
  1039. .take()
  1040. .unwrap_or_else(|| ::std::string::String::new())
  1041. }
  1042. // repeated .Capability capabilities = 17;
  1043. pub fn get_capabilities(&self) -> &[Capability] {
  1044. &self.capabilities
  1045. }
  1046. pub fn clear_capabilities(&mut self) {
  1047. self.capabilities.clear();
  1048. }
  1049. // Param is passed by value, moved
  1050. pub fn set_capabilities(&mut self, v: ::protobuf::RepeatedField<Capability>) {
  1051. self.capabilities = v;
  1052. }
  1053. // Mutable pointer to the field.
  1054. pub fn mut_capabilities(&mut self) -> &mut ::protobuf::RepeatedField<Capability> {
  1055. &mut self.capabilities
  1056. }
  1057. // Take field
  1058. pub fn take_capabilities(&mut self) -> ::protobuf::RepeatedField<Capability> {
  1059. ::std::mem::replace(&mut self.capabilities, ::protobuf::RepeatedField::new())
  1060. }
  1061. // optional string context_player_error = 20;
  1062. pub fn get_context_player_error(&self) -> &str {
  1063. match self.context_player_error.as_ref() {
  1064. Some(v) => &v,
  1065. None => "",
  1066. }
  1067. }
  1068. pub fn clear_context_player_error(&mut self) {
  1069. self.context_player_error.clear();
  1070. }
  1071. pub fn has_context_player_error(&self) -> bool {
  1072. self.context_player_error.is_some()
  1073. }
  1074. // Param is passed by value, moved
  1075. pub fn set_context_player_error(&mut self, v: ::std::string::String) {
  1076. self.context_player_error = ::protobuf::SingularField::some(v);
  1077. }
  1078. // Mutable pointer to the field.
  1079. // If field is not initialized, it is initialized with default value first.
  1080. pub fn mut_context_player_error(&mut self) -> &mut ::std::string::String {
  1081. if self.context_player_error.is_none() {
  1082. self.context_player_error.set_default();
  1083. }
  1084. self.context_player_error.as_mut().unwrap()
  1085. }
  1086. // Take field
  1087. pub fn take_context_player_error(&mut self) -> ::std::string::String {
  1088. self.context_player_error
  1089. .take()
  1090. .unwrap_or_else(|| ::std::string::String::new())
  1091. }
  1092. // repeated .Metadata metadata = 25;
  1093. pub fn get_metadata(&self) -> &[Metadata] {
  1094. &self.metadata
  1095. }
  1096. pub fn clear_metadata(&mut self) {
  1097. self.metadata.clear();
  1098. }
  1099. // Param is passed by value, moved
  1100. pub fn set_metadata(&mut self, v: ::protobuf::RepeatedField<Metadata>) {
  1101. self.metadata = v;
  1102. }
  1103. // Mutable pointer to the field.
  1104. pub fn mut_metadata(&mut self) -> &mut ::protobuf::RepeatedField<Metadata> {
  1105. &mut self.metadata
  1106. }
  1107. // Take field
  1108. pub fn take_metadata(&mut self) -> ::protobuf::RepeatedField<Metadata> {
  1109. ::std::mem::replace(&mut self.metadata, ::protobuf::RepeatedField::new())
  1110. }
  1111. }
  1112. impl ::protobuf::Message for DeviceState {
  1113. fn is_initialized(&self) -> bool {
  1114. for v in &self.capabilities {
  1115. if !v.is_initialized() {
  1116. return false;
  1117. }
  1118. }
  1119. for v in &self.metadata {
  1120. if !v.is_initialized() {
  1121. return false;
  1122. }
  1123. }
  1124. true
  1125. }
  1126. fn merge_from(
  1127. &mut self,
  1128. is: &mut ::protobuf::CodedInputStream<'_>,
  1129. ) -> ::protobuf::ProtobufResult<()> {
  1130. while !is.eof()? {
  1131. let (field_number, wire_type) = is.read_tag_unpack()?;
  1132. match field_number {
  1133. 1 => {
  1134. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.sw_version)?;
  1135. }
  1136. 10 => {
  1137. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1138. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  1139. wire_type,
  1140. ));
  1141. }
  1142. let tmp = is.read_bool()?;
  1143. self.is_active = ::std::option::Option::Some(tmp);
  1144. }
  1145. 11 => {
  1146. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1147. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  1148. wire_type,
  1149. ));
  1150. }
  1151. let tmp = is.read_bool()?;
  1152. self.can_play = ::std::option::Option::Some(tmp);
  1153. }
  1154. 12 => {
  1155. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1156. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  1157. wire_type,
  1158. ));
  1159. }
  1160. let tmp = is.read_uint32()?;
  1161. self.volume = ::std::option::Option::Some(tmp);
  1162. }
  1163. 13 => {
  1164. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?;
  1165. }
  1166. 14 => {
  1167. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1168. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  1169. wire_type,
  1170. ));
  1171. }
  1172. let tmp = is.read_uint32()?;
  1173. self.error_code = ::std::option::Option::Some(tmp);
  1174. }
  1175. 15 => {
  1176. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1177. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  1178. wire_type,
  1179. ));
  1180. }
  1181. let tmp = is.read_int64()?;
  1182. self.became_active_at = ::std::option::Option::Some(tmp);
  1183. }
  1184. 16 => {
  1185. ::protobuf::rt::read_singular_string_into(
  1186. wire_type,
  1187. is,
  1188. &mut self.error_message,
  1189. )?;
  1190. }
  1191. 17 => {
  1192. ::protobuf::rt::read_repeated_message_into(
  1193. wire_type,
  1194. is,
  1195. &mut self.capabilities,
  1196. )?;
  1197. }
  1198. 20 => {
  1199. ::protobuf::rt::read_singular_string_into(
  1200. wire_type,
  1201. is,
  1202. &mut self.context_player_error,
  1203. )?;
  1204. }
  1205. 25 => {
  1206. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.metadata)?;
  1207. }
  1208. _ => {
  1209. ::protobuf::rt::read_unknown_or_skip_group(
  1210. field_number,
  1211. wire_type,
  1212. is,
  1213. self.mut_unknown_fields(),
  1214. )?;
  1215. }
  1216. };
  1217. }
  1218. ::std::result::Result::Ok(())
  1219. }
  1220. // Compute sizes of nested messages
  1221. #[allow(unused_variables)]
  1222. fn compute_size(&self) -> u32 {
  1223. let mut my_size = 0;
  1224. if let Some(ref v) = self.sw_version.as_ref() {
  1225. my_size += ::protobuf::rt::string_size(1, &v);
  1226. }
  1227. if let Some(v) = self.is_active {
  1228. my_size += 2;
  1229. }
  1230. if let Some(v) = self.can_play {
  1231. my_size += 2;
  1232. }
  1233. if let Some(v) = self.volume {
  1234. my_size += ::protobuf::rt::value_size(12, v, ::protobuf::wire_format::WireTypeVarint);
  1235. }
  1236. if let Some(ref v) = self.name.as_ref() {
  1237. my_size += ::protobuf::rt::string_size(13, &v);
  1238. }
  1239. if let Some(v) = self.error_code {
  1240. my_size += ::protobuf::rt::value_size(14, v, ::protobuf::wire_format::WireTypeVarint);
  1241. }
  1242. if let Some(v) = self.became_active_at {
  1243. my_size += ::protobuf::rt::value_size(15, v, ::protobuf::wire_format::WireTypeVarint);
  1244. }
  1245. if let Some(ref v) = self.error_message.as_ref() {
  1246. my_size += ::protobuf::rt::string_size(16, &v);
  1247. }
  1248. for value in &self.capabilities {
  1249. let len = value.compute_size();
  1250. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1251. }
  1252. if let Some(ref v) = self.context_player_error.as_ref() {
  1253. my_size += ::protobuf::rt::string_size(20, &v);
  1254. }
  1255. for value in &self.metadata {
  1256. let len = value.compute_size();
  1257. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1258. }
  1259. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1260. self.cached_size.set(my_size);
  1261. my_size
  1262. }
  1263. fn write_to_with_cached_sizes(
  1264. &self,
  1265. os: &mut ::protobuf::CodedOutputStream<'_>,
  1266. ) -> ::protobuf::ProtobufResult<()> {
  1267. if let Some(ref v) = self.sw_version.as_ref() {
  1268. os.write_string(1, &v)?;
  1269. }
  1270. if let Some(v) = self.is_active {
  1271. os.write_bool(10, v)?;
  1272. }
  1273. if let Some(v) = self.can_play {
  1274. os.write_bool(11, v)?;
  1275. }
  1276. if let Some(v) = self.volume {
  1277. os.write_uint32(12, v)?;
  1278. }
  1279. if let Some(ref v) = self.name.as_ref() {
  1280. os.write_string(13, &v)?;
  1281. }
  1282. if let Some(v) = self.error_code {
  1283. os.write_uint32(14, v)?;
  1284. }
  1285. if let Some(v) = self.became_active_at {
  1286. os.write_int64(15, v)?;
  1287. }
  1288. if let Some(ref v) = self.error_message.as_ref() {
  1289. os.write_string(16, &v)?;
  1290. }
  1291. for v in &self.capabilities {
  1292. os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1293. os.write_raw_varint32(v.get_cached_size())?;
  1294. v.write_to_with_cached_sizes(os)?;
  1295. }
  1296. if let Some(ref v) = self.context_player_error.as_ref() {
  1297. os.write_string(20, &v)?;
  1298. }
  1299. for v in &self.metadata {
  1300. os.write_tag(25, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1301. os.write_raw_varint32(v.get_cached_size())?;
  1302. v.write_to_with_cached_sizes(os)?;
  1303. }
  1304. os.write_unknown_fields(self.get_unknown_fields())?;
  1305. ::std::result::Result::Ok(())
  1306. }
  1307. fn get_cached_size(&self) -> u32 {
  1308. self.cached_size.get()
  1309. }
  1310. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1311. &self.unknown_fields
  1312. }
  1313. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1314. &mut self.unknown_fields
  1315. }
  1316. fn as_any(&self) -> &dyn (::std::any::Any) {
  1317. self as &dyn (::std::any::Any)
  1318. }
  1319. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1320. self as &mut dyn (::std::any::Any)
  1321. }
  1322. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1323. self
  1324. }
  1325. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1326. Self::descriptor_static()
  1327. }
  1328. fn new() -> DeviceState {
  1329. DeviceState::new()
  1330. }
  1331. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1332. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> =
  1333. ::protobuf::lazy::Lazy::INIT;
  1334. unsafe {
  1335. descriptor.get(|| {
  1336. let mut fields = ::std::vec::Vec::new();
  1337. fields.push(
  1338. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  1339. _,
  1340. ::protobuf::types::ProtobufTypeString,
  1341. >(
  1342. "sw_version",
  1343. |m: &DeviceState| &m.sw_version,
  1344. |m: &mut DeviceState| &mut m.sw_version,
  1345. ),
  1346. );
  1347. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  1348. _,
  1349. ::protobuf::types::ProtobufTypeBool,
  1350. >(
  1351. "is_active",
  1352. |m: &DeviceState| &m.is_active,
  1353. |m: &mut DeviceState| &mut m.is_active,
  1354. ));
  1355. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  1356. _,
  1357. ::protobuf::types::ProtobufTypeBool,
  1358. >(
  1359. "can_play",
  1360. |m: &DeviceState| &m.can_play,
  1361. |m: &mut DeviceState| &mut m.can_play,
  1362. ));
  1363. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  1364. _,
  1365. ::protobuf::types::ProtobufTypeUint32,
  1366. >(
  1367. "volume",
  1368. |m: &DeviceState| &m.volume,
  1369. |m: &mut DeviceState| &mut m.volume,
  1370. ));
  1371. fields.push(
  1372. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  1373. _,
  1374. ::protobuf::types::ProtobufTypeString,
  1375. >(
  1376. "name",
  1377. |m: &DeviceState| &m.name,
  1378. |m: &mut DeviceState| &mut m.name,
  1379. ),
  1380. );
  1381. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  1382. _,
  1383. ::protobuf::types::ProtobufTypeUint32,
  1384. >(
  1385. "error_code",
  1386. |m: &DeviceState| &m.error_code,
  1387. |m: &mut DeviceState| &mut m.error_code,
  1388. ));
  1389. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  1390. _,
  1391. ::protobuf::types::ProtobufTypeInt64,
  1392. >(
  1393. "became_active_at",
  1394. |m: &DeviceState| &m.became_active_at,
  1395. |m: &mut DeviceState| &mut m.became_active_at,
  1396. ));
  1397. fields.push(
  1398. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  1399. _,
  1400. ::protobuf::types::ProtobufTypeString,
  1401. >(
  1402. "error_message",
  1403. |m: &DeviceState| &m.error_message,
  1404. |m: &mut DeviceState| &mut m.error_message,
  1405. ),
  1406. );
  1407. fields.push(
  1408. ::protobuf::reflect::accessor::make_repeated_field_accessor::<
  1409. _,
  1410. ::protobuf::types::ProtobufTypeMessage<Capability>,
  1411. >(
  1412. "capabilities",
  1413. |m: &DeviceState| &m.capabilities,
  1414. |m: &mut DeviceState| &mut m.capabilities,
  1415. ),
  1416. );
  1417. fields.push(
  1418. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  1419. _,
  1420. ::protobuf::types::ProtobufTypeString,
  1421. >(
  1422. "context_player_error",
  1423. |m: &DeviceState| &m.context_player_error,
  1424. |m: &mut DeviceState| &mut m.context_player_error,
  1425. ),
  1426. );
  1427. fields.push(
  1428. ::protobuf::reflect::accessor::make_repeated_field_accessor::<
  1429. _,
  1430. ::protobuf::types::ProtobufTypeMessage<Metadata>,
  1431. >(
  1432. "metadata",
  1433. |m: &DeviceState| &m.metadata,
  1434. |m: &mut DeviceState| &mut m.metadata,
  1435. ),
  1436. );
  1437. ::protobuf::reflect::MessageDescriptor::new_pb_name::<DeviceState>(
  1438. "DeviceState",
  1439. fields,
  1440. file_descriptor_proto(),
  1441. )
  1442. })
  1443. }
  1444. }
  1445. fn default_instance() -> &'static DeviceState {
  1446. static mut instance: ::protobuf::lazy::Lazy<DeviceState> = ::protobuf::lazy::Lazy::INIT;
  1447. unsafe { instance.get(DeviceState::new) }
  1448. }
  1449. }
  1450. impl ::protobuf::Clear for DeviceState {
  1451. fn clear(&mut self) {
  1452. self.sw_version.clear();
  1453. self.is_active = ::std::option::Option::None;
  1454. self.can_play = ::std::option::Option::None;
  1455. self.volume = ::std::option::Option::None;
  1456. self.name.clear();
  1457. self.error_code = ::std::option::Option::None;
  1458. self.became_active_at = ::std::option::Option::None;
  1459. self.error_message.clear();
  1460. self.capabilities.clear();
  1461. self.context_player_error.clear();
  1462. self.metadata.clear();
  1463. self.unknown_fields.clear();
  1464. }
  1465. }
  1466. impl ::std::fmt::Debug for DeviceState {
  1467. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1468. ::protobuf::text_format::fmt(self, f)
  1469. }
  1470. }
  1471. impl ::protobuf::reflect::ProtobufValue for DeviceState {
  1472. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1473. ::protobuf::reflect::ReflectValueRef::Message(self)
  1474. }
  1475. }
  1476. #[derive(PartialEq, Clone, Default)]
  1477. pub struct Capability {
  1478. // message fields
  1479. typ: ::std::option::Option<CapabilityType>,
  1480. intValue: ::std::vec::Vec<i64>,
  1481. stringValue: ::protobuf::RepeatedField<::std::string::String>,
  1482. // special fields
  1483. pub unknown_fields: ::protobuf::UnknownFields,
  1484. pub cached_size: ::protobuf::CachedSize,
  1485. }
  1486. impl<'a> ::std::default::Default for &'a Capability {
  1487. fn default() -> &'a Capability {
  1488. <Capability as ::protobuf::Message>::default_instance()
  1489. }
  1490. }
  1491. impl Capability {
  1492. pub fn new() -> Capability {
  1493. ::std::default::Default::default()
  1494. }
  1495. // optional .CapabilityType typ = 1;
  1496. pub fn get_typ(&self) -> CapabilityType {
  1497. self.typ.unwrap_or(CapabilityType::kSupportedContexts)
  1498. }
  1499. pub fn clear_typ(&mut self) {
  1500. self.typ = ::std::option::Option::None;
  1501. }
  1502. pub fn has_typ(&self) -> bool {
  1503. self.typ.is_some()
  1504. }
  1505. // Param is passed by value, moved
  1506. pub fn set_typ(&mut self, v: CapabilityType) {
  1507. self.typ = ::std::option::Option::Some(v);
  1508. }
  1509. // repeated int64 intValue = 2;
  1510. pub fn get_intValue(&self) -> &[i64] {
  1511. &self.intValue
  1512. }
  1513. pub fn clear_intValue(&mut self) {
  1514. self.intValue.clear();
  1515. }
  1516. // Param is passed by value, moved
  1517. pub fn set_intValue(&mut self, v: ::std::vec::Vec<i64>) {
  1518. self.intValue = v;
  1519. }
  1520. // Mutable pointer to the field.
  1521. pub fn mut_intValue(&mut self) -> &mut ::std::vec::Vec<i64> {
  1522. &mut self.intValue
  1523. }
  1524. // Take field
  1525. pub fn take_intValue(&mut self) -> ::std::vec::Vec<i64> {
  1526. ::std::mem::replace(&mut self.intValue, ::std::vec::Vec::new())
  1527. }
  1528. // repeated string stringValue = 3;
  1529. pub fn get_stringValue(&self) -> &[::std::string::String] {
  1530. &self.stringValue
  1531. }
  1532. pub fn clear_stringValue(&mut self) {
  1533. self.stringValue.clear();
  1534. }
  1535. // Param is passed by value, moved
  1536. pub fn set_stringValue(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
  1537. self.stringValue = v;
  1538. }
  1539. // Mutable pointer to the field.
  1540. pub fn mut_stringValue(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
  1541. &mut self.stringValue
  1542. }
  1543. // Take field
  1544. pub fn take_stringValue(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
  1545. ::std::mem::replace(&mut self.stringValue, ::protobuf::RepeatedField::new())
  1546. }
  1547. }
  1548. impl ::protobuf::Message for Capability {
  1549. fn is_initialized(&self) -> bool {
  1550. true
  1551. }
  1552. fn merge_from(
  1553. &mut self,
  1554. is: &mut ::protobuf::CodedInputStream<'_>,
  1555. ) -> ::protobuf::ProtobufResult<()> {
  1556. while !is.eof()? {
  1557. let (field_number, wire_type) = is.read_tag_unpack()?;
  1558. match field_number {
  1559. 1 => ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(
  1560. wire_type,
  1561. is,
  1562. &mut self.typ,
  1563. 1,
  1564. &mut self.unknown_fields,
  1565. )?,
  1566. 2 => {
  1567. ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.intValue)?;
  1568. }
  1569. 3 => {
  1570. ::protobuf::rt::read_repeated_string_into(
  1571. wire_type,
  1572. is,
  1573. &mut self.stringValue,
  1574. )?;
  1575. }
  1576. _ => {
  1577. ::protobuf::rt::read_unknown_or_skip_group(
  1578. field_number,
  1579. wire_type,
  1580. is,
  1581. self.mut_unknown_fields(),
  1582. )?;
  1583. }
  1584. };
  1585. }
  1586. ::std::result::Result::Ok(())
  1587. }
  1588. // Compute sizes of nested messages
  1589. #[allow(unused_variables)]
  1590. fn compute_size(&self) -> u32 {
  1591. let mut my_size = 0;
  1592. if let Some(v) = self.typ {
  1593. my_size += ::protobuf::rt::enum_size(1, v);
  1594. }
  1595. for value in &self.intValue {
  1596. my_size +=
  1597. ::protobuf::rt::value_size(2, *value, ::protobuf::wire_format::WireTypeVarint);
  1598. }
  1599. for value in &self.stringValue {
  1600. my_size += ::protobuf::rt::string_size(3, &value);
  1601. }
  1602. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1603. self.cached_size.set(my_size);
  1604. my_size
  1605. }
  1606. fn write_to_with_cached_sizes(
  1607. &self,
  1608. os: &mut ::protobuf::CodedOutputStream<'_>,
  1609. ) -> ::protobuf::ProtobufResult<()> {
  1610. if let Some(v) = self.typ {
  1611. os.write_enum(1, v.value())?;
  1612. }
  1613. for v in &self.intValue {
  1614. os.write_int64(2, *v)?;
  1615. }
  1616. for v in &self.stringValue {
  1617. os.write_string(3, &v)?;
  1618. }
  1619. os.write_unknown_fields(self.get_unknown_fields())?;
  1620. ::std::result::Result::Ok(())
  1621. }
  1622. fn get_cached_size(&self) -> u32 {
  1623. self.cached_size.get()
  1624. }
  1625. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1626. &self.unknown_fields
  1627. }
  1628. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1629. &mut self.unknown_fields
  1630. }
  1631. fn as_any(&self) -> &dyn (::std::any::Any) {
  1632. self as &dyn (::std::any::Any)
  1633. }
  1634. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1635. self as &mut dyn (::std::any::Any)
  1636. }
  1637. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1638. self
  1639. }
  1640. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1641. Self::descriptor_static()
  1642. }
  1643. fn new() -> Capability {
  1644. Capability::new()
  1645. }
  1646. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1647. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> =
  1648. ::protobuf::lazy::Lazy::INIT;
  1649. unsafe {
  1650. descriptor.get(|| {
  1651. let mut fields = ::std::vec::Vec::new();
  1652. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  1653. _,
  1654. ::protobuf::types::ProtobufTypeEnum<CapabilityType>,
  1655. >(
  1656. "typ",
  1657. |m: &Capability| &m.typ,
  1658. |m: &mut Capability| &mut m.typ,
  1659. ));
  1660. fields.push(::protobuf::reflect::accessor::make_vec_accessor::<
  1661. _,
  1662. ::protobuf::types::ProtobufTypeInt64,
  1663. >(
  1664. "intValue",
  1665. |m: &Capability| &m.intValue,
  1666. |m: &mut Capability| &mut m.intValue,
  1667. ));
  1668. fields.push(
  1669. ::protobuf::reflect::accessor::make_repeated_field_accessor::<
  1670. _,
  1671. ::protobuf::types::ProtobufTypeString,
  1672. >(
  1673. "stringValue",
  1674. |m: &Capability| &m.stringValue,
  1675. |m: &mut Capability| &mut m.stringValue,
  1676. ),
  1677. );
  1678. ::protobuf::reflect::MessageDescriptor::new_pb_name::<Capability>(
  1679. "Capability",
  1680. fields,
  1681. file_descriptor_proto(),
  1682. )
  1683. })
  1684. }
  1685. }
  1686. fn default_instance() -> &'static Capability {
  1687. static mut instance: ::protobuf::lazy::Lazy<Capability> = ::protobuf::lazy::Lazy::INIT;
  1688. unsafe { instance.get(Capability::new) }
  1689. }
  1690. }
  1691. impl ::protobuf::Clear for Capability {
  1692. fn clear(&mut self) {
  1693. self.typ = ::std::option::Option::None;
  1694. self.intValue.clear();
  1695. self.stringValue.clear();
  1696. self.unknown_fields.clear();
  1697. }
  1698. }
  1699. impl ::std::fmt::Debug for Capability {
  1700. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1701. ::protobuf::text_format::fmt(self, f)
  1702. }
  1703. }
  1704. impl ::protobuf::reflect::ProtobufValue for Capability {
  1705. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1706. ::protobuf::reflect::ReflectValueRef::Message(self)
  1707. }
  1708. }
  1709. #[derive(PartialEq, Clone, Default)]
  1710. pub struct Goodbye {
  1711. // message fields
  1712. reason: ::protobuf::SingularField<::std::string::String>,
  1713. // special fields
  1714. pub unknown_fields: ::protobuf::UnknownFields,
  1715. pub cached_size: ::protobuf::CachedSize,
  1716. }
  1717. impl<'a> ::std::default::Default for &'a Goodbye {
  1718. fn default() -> &'a Goodbye {
  1719. <Goodbye as ::protobuf::Message>::default_instance()
  1720. }
  1721. }
  1722. impl Goodbye {
  1723. pub fn new() -> Goodbye {
  1724. ::std::default::Default::default()
  1725. }
  1726. // optional string reason = 1;
  1727. pub fn get_reason(&self) -> &str {
  1728. match self.reason.as_ref() {
  1729. Some(v) => &v,
  1730. None => "",
  1731. }
  1732. }
  1733. pub fn clear_reason(&mut self) {
  1734. self.reason.clear();
  1735. }
  1736. pub fn has_reason(&self) -> bool {
  1737. self.reason.is_some()
  1738. }
  1739. // Param is passed by value, moved
  1740. pub fn set_reason(&mut self, v: ::std::string::String) {
  1741. self.reason = ::protobuf::SingularField::some(v);
  1742. }
  1743. // Mutable pointer to the field.
  1744. // If field is not initialized, it is initialized with default value first.
  1745. pub fn mut_reason(&mut self) -> &mut ::std::string::String {
  1746. if self.reason.is_none() {
  1747. self.reason.set_default();
  1748. }
  1749. self.reason.as_mut().unwrap()
  1750. }
  1751. // Take field
  1752. pub fn take_reason(&mut self) -> ::std::string::String {
  1753. self.reason
  1754. .take()
  1755. .unwrap_or_else(|| ::std::string::String::new())
  1756. }
  1757. }
  1758. impl ::protobuf::Message for Goodbye {
  1759. fn is_initialized(&self) -> bool {
  1760. true
  1761. }
  1762. fn merge_from(
  1763. &mut self,
  1764. is: &mut ::protobuf::CodedInputStream<'_>,
  1765. ) -> ::protobuf::ProtobufResult<()> {
  1766. while !is.eof()? {
  1767. let (field_number, wire_type) = is.read_tag_unpack()?;
  1768. match field_number {
  1769. 1 => {
  1770. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.reason)?;
  1771. }
  1772. _ => {
  1773. ::protobuf::rt::read_unknown_or_skip_group(
  1774. field_number,
  1775. wire_type,
  1776. is,
  1777. self.mut_unknown_fields(),
  1778. )?;
  1779. }
  1780. };
  1781. }
  1782. ::std::result::Result::Ok(())
  1783. }
  1784. // Compute sizes of nested messages
  1785. #[allow(unused_variables)]
  1786. fn compute_size(&self) -> u32 {
  1787. let mut my_size = 0;
  1788. if let Some(ref v) = self.reason.as_ref() {
  1789. my_size += ::protobuf::rt::string_size(1, &v);
  1790. }
  1791. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1792. self.cached_size.set(my_size);
  1793. my_size
  1794. }
  1795. fn write_to_with_cached_sizes(
  1796. &self,
  1797. os: &mut ::protobuf::CodedOutputStream<'_>,
  1798. ) -> ::protobuf::ProtobufResult<()> {
  1799. if let Some(ref v) = self.reason.as_ref() {
  1800. os.write_string(1, &v)?;
  1801. }
  1802. os.write_unknown_fields(self.get_unknown_fields())?;
  1803. ::std::result::Result::Ok(())
  1804. }
  1805. fn get_cached_size(&self) -> u32 {
  1806. self.cached_size.get()
  1807. }
  1808. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1809. &self.unknown_fields
  1810. }
  1811. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1812. &mut self.unknown_fields
  1813. }
  1814. fn as_any(&self) -> &dyn (::std::any::Any) {
  1815. self as &dyn (::std::any::Any)
  1816. }
  1817. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1818. self as &mut dyn (::std::any::Any)
  1819. }
  1820. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1821. self
  1822. }
  1823. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1824. Self::descriptor_static()
  1825. }
  1826. fn new() -> Goodbye {
  1827. Goodbye::new()
  1828. }
  1829. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1830. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> =
  1831. ::protobuf::lazy::Lazy::INIT;
  1832. unsafe {
  1833. descriptor.get(|| {
  1834. let mut fields = ::std::vec::Vec::new();
  1835. fields.push(
  1836. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  1837. _,
  1838. ::protobuf::types::ProtobufTypeString,
  1839. >(
  1840. "reason",
  1841. |m: &Goodbye| &m.reason,
  1842. |m: &mut Goodbye| &mut m.reason,
  1843. ),
  1844. );
  1845. ::protobuf::reflect::MessageDescriptor::new_pb_name::<Goodbye>(
  1846. "Goodbye",
  1847. fields,
  1848. file_descriptor_proto(),
  1849. )
  1850. })
  1851. }
  1852. }
  1853. fn default_instance() -> &'static Goodbye {
  1854. static mut instance: ::protobuf::lazy::Lazy<Goodbye> = ::protobuf::lazy::Lazy::INIT;
  1855. unsafe { instance.get(Goodbye::new) }
  1856. }
  1857. }
  1858. impl ::protobuf::Clear for Goodbye {
  1859. fn clear(&mut self) {
  1860. self.reason.clear();
  1861. self.unknown_fields.clear();
  1862. }
  1863. }
  1864. impl ::std::fmt::Debug for Goodbye {
  1865. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1866. ::protobuf::text_format::fmt(self, f)
  1867. }
  1868. }
  1869. impl ::protobuf::reflect::ProtobufValue for Goodbye {
  1870. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  1871. ::protobuf::reflect::ReflectValueRef::Message(self)
  1872. }
  1873. }
  1874. #[derive(PartialEq, Clone, Default)]
  1875. pub struct State {
  1876. // message fields
  1877. context_uri: ::protobuf::SingularField<::std::string::String>,
  1878. index: ::std::option::Option<u32>,
  1879. position_ms: ::std::option::Option<u32>,
  1880. status: ::std::option::Option<PlayStatus>,
  1881. position_measured_at: ::std::option::Option<u64>,
  1882. context_description: ::protobuf::SingularField<::std::string::String>,
  1883. shuffle: ::std::option::Option<bool>,
  1884. repeat: ::std::option::Option<bool>,
  1885. last_command_ident: ::protobuf::SingularField<::std::string::String>,
  1886. last_command_msgid: ::std::option::Option<u32>,
  1887. playing_from_fallback: ::std::option::Option<bool>,
  1888. row: ::std::option::Option<u32>,
  1889. playing_track_index: ::std::option::Option<u32>,
  1890. track: ::protobuf::RepeatedField<TrackRef>,
  1891. ad: ::protobuf::SingularPtrField<Ad>,
  1892. // special fields
  1893. pub unknown_fields: ::protobuf::UnknownFields,
  1894. pub cached_size: ::protobuf::CachedSize,
  1895. }
  1896. impl<'a> ::std::default::Default for &'a State {
  1897. fn default() -> &'a State {
  1898. <State as ::protobuf::Message>::default_instance()
  1899. }
  1900. }
  1901. impl State {
  1902. pub fn new() -> State {
  1903. ::std::default::Default::default()
  1904. }
  1905. // optional string context_uri = 2;
  1906. pub fn get_context_uri(&self) -> &str {
  1907. match self.context_uri.as_ref() {
  1908. Some(v) => &v,
  1909. None => "",
  1910. }
  1911. }
  1912. pub fn clear_context_uri(&mut self) {
  1913. self.context_uri.clear();
  1914. }
  1915. pub fn has_context_uri(&self) -> bool {
  1916. self.context_uri.is_some()
  1917. }
  1918. // Param is passed by value, moved
  1919. pub fn set_context_uri(&mut self, v: ::std::string::String) {
  1920. self.context_uri = ::protobuf::SingularField::some(v);
  1921. }
  1922. // Mutable pointer to the field.
  1923. // If field is not initialized, it is initialized with default value first.
  1924. pub fn mut_context_uri(&mut self) -> &mut ::std::string::String {
  1925. if self.context_uri.is_none() {
  1926. self.context_uri.set_default();
  1927. }
  1928. self.context_uri.as_mut().unwrap()
  1929. }
  1930. // Take field
  1931. pub fn take_context_uri(&mut self) -> ::std::string::String {
  1932. self.context_uri
  1933. .take()
  1934. .unwrap_or_else(|| ::std::string::String::new())
  1935. }
  1936. // optional uint32 index = 3;
  1937. pub fn get_index(&self) -> u32 {
  1938. self.index.unwrap_or(0)
  1939. }
  1940. pub fn clear_index(&mut self) {
  1941. self.index = ::std::option::Option::None;
  1942. }
  1943. pub fn has_index(&self) -> bool {
  1944. self.index.is_some()
  1945. }
  1946. // Param is passed by value, moved
  1947. pub fn set_index(&mut self, v: u32) {
  1948. self.index = ::std::option::Option::Some(v);
  1949. }
  1950. // optional uint32 position_ms = 4;
  1951. pub fn get_position_ms(&self) -> u32 {
  1952. self.position_ms.unwrap_or(0)
  1953. }
  1954. pub fn clear_position_ms(&mut self) {
  1955. self.position_ms = ::std::option::Option::None;
  1956. }
  1957. pub fn has_position_ms(&self) -> bool {
  1958. self.position_ms.is_some()
  1959. }
  1960. // Param is passed by value, moved
  1961. pub fn set_position_ms(&mut self, v: u32) {
  1962. self.position_ms = ::std::option::Option::Some(v);
  1963. }
  1964. // optional .PlayStatus status = 5;
  1965. pub fn get_status(&self) -> PlayStatus {
  1966. self.status.unwrap_or(PlayStatus::kPlayStatusStop)
  1967. }
  1968. pub fn clear_status(&mut self) {
  1969. self.status = ::std::option::Option::None;
  1970. }
  1971. pub fn has_status(&self) -> bool {
  1972. self.status.is_some()
  1973. }
  1974. // Param is passed by value, moved
  1975. pub fn set_status(&mut self, v: PlayStatus) {
  1976. self.status = ::std::option::Option::Some(v);
  1977. }
  1978. // optional uint64 position_measured_at = 7;
  1979. pub fn get_position_measured_at(&self) -> u64 {
  1980. self.position_measured_at.unwrap_or(0)
  1981. }
  1982. pub fn clear_position_measured_at(&mut self) {
  1983. self.position_measured_at = ::std::option::Option::None;
  1984. }
  1985. pub fn has_position_measured_at(&self) -> bool {
  1986. self.position_measured_at.is_some()
  1987. }
  1988. // Param is passed by value, moved
  1989. pub fn set_position_measured_at(&mut self, v: u64) {
  1990. self.position_measured_at = ::std::option::Option::Some(v);
  1991. }
  1992. // optional string context_description = 8;
  1993. pub fn get_context_description(&self) -> &str {
  1994. match self.context_description.as_ref() {
  1995. Some(v) => &v,
  1996. None => "",
  1997. }
  1998. }
  1999. pub fn clear_context_description(&mut self) {
  2000. self.context_description.clear();
  2001. }
  2002. pub fn has_context_description(&self) -> bool {
  2003. self.context_description.is_some()
  2004. }
  2005. // Param is passed by value, moved
  2006. pub fn set_context_description(&mut self, v: ::std::string::String) {
  2007. self.context_description = ::protobuf::SingularField::some(v);
  2008. }
  2009. // Mutable pointer to the field.
  2010. // If field is not initialized, it is initialized with default value first.
  2011. pub fn mut_context_description(&mut self) -> &mut ::std::string::String {
  2012. if self.context_description.is_none() {
  2013. self.context_description.set_default();
  2014. }
  2015. self.context_description.as_mut().unwrap()
  2016. }
  2017. // Take field
  2018. pub fn take_context_description(&mut self) -> ::std::string::String {
  2019. self.context_description
  2020. .take()
  2021. .unwrap_or_else(|| ::std::string::String::new())
  2022. }
  2023. // optional bool shuffle = 13;
  2024. pub fn get_shuffle(&self) -> bool {
  2025. self.shuffle.unwrap_or(false)
  2026. }
  2027. pub fn clear_shuffle(&mut self) {
  2028. self.shuffle = ::std::option::Option::None;
  2029. }
  2030. pub fn has_shuffle(&self) -> bool {
  2031. self.shuffle.is_some()
  2032. }
  2033. // Param is passed by value, moved
  2034. pub fn set_shuffle(&mut self, v: bool) {
  2035. self.shuffle = ::std::option::Option::Some(v);
  2036. }
  2037. // optional bool repeat = 14;
  2038. pub fn get_repeat(&self) -> bool {
  2039. self.repeat.unwrap_or(false)
  2040. }
  2041. pub fn clear_repeat(&mut self) {
  2042. self.repeat = ::std::option::Option::None;
  2043. }
  2044. pub fn has_repeat(&self) -> bool {
  2045. self.repeat.is_some()
  2046. }
  2047. // Param is passed by value, moved
  2048. pub fn set_repeat(&mut self, v: bool) {
  2049. self.repeat = ::std::option::Option::Some(v);
  2050. }
  2051. // optional string last_command_ident = 20;
  2052. pub fn get_last_command_ident(&self) -> &str {
  2053. match self.last_command_ident.as_ref() {
  2054. Some(v) => &v,
  2055. None => "",
  2056. }
  2057. }
  2058. pub fn clear_last_command_ident(&mut self) {
  2059. self.last_command_ident.clear();
  2060. }
  2061. pub fn has_last_command_ident(&self) -> bool {
  2062. self.last_command_ident.is_some()
  2063. }
  2064. // Param is passed by value, moved
  2065. pub fn set_last_command_ident(&mut self, v: ::std::string::String) {
  2066. self.last_command_ident = ::protobuf::SingularField::some(v);
  2067. }
  2068. // Mutable pointer to the field.
  2069. // If field is not initialized, it is initialized with default value first.
  2070. pub fn mut_last_command_ident(&mut self) -> &mut ::std::string::String {
  2071. if self.last_command_ident.is_none() {
  2072. self.last_command_ident.set_default();
  2073. }
  2074. self.last_command_ident.as_mut().unwrap()
  2075. }
  2076. // Take field
  2077. pub fn take_last_command_ident(&mut self) -> ::std::string::String {
  2078. self.last_command_ident
  2079. .take()
  2080. .unwrap_or_else(|| ::std::string::String::new())
  2081. }
  2082. // optional uint32 last_command_msgid = 21;
  2083. pub fn get_last_command_msgid(&self) -> u32 {
  2084. self.last_command_msgid.unwrap_or(0)
  2085. }
  2086. pub fn clear_last_command_msgid(&mut self) {
  2087. self.last_command_msgid = ::std::option::Option::None;
  2088. }
  2089. pub fn has_last_command_msgid(&self) -> bool {
  2090. self.last_command_msgid.is_some()
  2091. }
  2092. // Param is passed by value, moved
  2093. pub fn set_last_command_msgid(&mut self, v: u32) {
  2094. self.last_command_msgid = ::std::option::Option::Some(v);
  2095. }
  2096. // optional bool playing_from_fallback = 24;
  2097. pub fn get_playing_from_fallback(&self) -> bool {
  2098. self.playing_from_fallback.unwrap_or(false)
  2099. }
  2100. pub fn clear_playing_from_fallback(&mut self) {
  2101. self.playing_from_fallback = ::std::option::Option::None;
  2102. }
  2103. pub fn has_playing_from_fallback(&self) -> bool {
  2104. self.playing_from_fallback.is_some()
  2105. }
  2106. // Param is passed by value, moved
  2107. pub fn set_playing_from_fallback(&mut self, v: bool) {
  2108. self.playing_from_fallback = ::std::option::Option::Some(v);
  2109. }
  2110. // optional uint32 row = 25;
  2111. pub fn get_row(&self) -> u32 {
  2112. self.row.unwrap_or(0)
  2113. }
  2114. pub fn clear_row(&mut self) {
  2115. self.row = ::std::option::Option::None;
  2116. }
  2117. pub fn has_row(&self) -> bool {
  2118. self.row.is_some()
  2119. }
  2120. // Param is passed by value, moved
  2121. pub fn set_row(&mut self, v: u32) {
  2122. self.row = ::std::option::Option::Some(v);
  2123. }
  2124. // optional uint32 playing_track_index = 26;
  2125. pub fn get_playing_track_index(&self) -> u32 {
  2126. self.playing_track_index.unwrap_or(0)
  2127. }
  2128. pub fn clear_playing_track_index(&mut self) {
  2129. self.playing_track_index = ::std::option::Option::None;
  2130. }
  2131. pub fn has_playing_track_index(&self) -> bool {
  2132. self.playing_track_index.is_some()
  2133. }
  2134. // Param is passed by value, moved
  2135. pub fn set_playing_track_index(&mut self, v: u32) {
  2136. self.playing_track_index = ::std::option::Option::Some(v);
  2137. }
  2138. // repeated .TrackRef track = 27;
  2139. pub fn get_track(&self) -> &[TrackRef] {
  2140. &self.track
  2141. }
  2142. pub fn clear_track(&mut self) {
  2143. self.track.clear();
  2144. }
  2145. // Param is passed by value, moved
  2146. pub fn set_track(&mut self, v: ::protobuf::RepeatedField<TrackRef>) {
  2147. self.track = v;
  2148. }
  2149. // Mutable pointer to the field.
  2150. pub fn mut_track(&mut self) -> &mut ::protobuf::RepeatedField<TrackRef> {
  2151. &mut self.track
  2152. }
  2153. // Take field
  2154. pub fn take_track(&mut self) -> ::protobuf::RepeatedField<TrackRef> {
  2155. ::std::mem::replace(&mut self.track, ::protobuf::RepeatedField::new())
  2156. }
  2157. // optional .Ad ad = 28;
  2158. pub fn get_ad(&self) -> &Ad {
  2159. self.ad.as_ref().unwrap_or_else(|| Ad::default_instance())
  2160. }
  2161. pub fn clear_ad(&mut self) {
  2162. self.ad.clear();
  2163. }
  2164. pub fn has_ad(&self) -> bool {
  2165. self.ad.is_some()
  2166. }
  2167. // Param is passed by value, moved
  2168. pub fn set_ad(&mut self, v: Ad) {
  2169. self.ad = ::protobuf::SingularPtrField::some(v);
  2170. }
  2171. // Mutable pointer to the field.
  2172. // If field is not initialized, it is initialized with default value first.
  2173. pub fn mut_ad(&mut self) -> &mut Ad {
  2174. if self.ad.is_none() {
  2175. self.ad.set_default();
  2176. }
  2177. self.ad.as_mut().unwrap()
  2178. }
  2179. // Take field
  2180. pub fn take_ad(&mut self) -> Ad {
  2181. self.ad.take().unwrap_or_else(|| Ad::new())
  2182. }
  2183. }
  2184. impl ::protobuf::Message for State {
  2185. fn is_initialized(&self) -> bool {
  2186. for v in &self.track {
  2187. if !v.is_initialized() {
  2188. return false;
  2189. }
  2190. }
  2191. for v in &self.ad {
  2192. if !v.is_initialized() {
  2193. return false;
  2194. }
  2195. }
  2196. true
  2197. }
  2198. fn merge_from(
  2199. &mut self,
  2200. is: &mut ::protobuf::CodedInputStream<'_>,
  2201. ) -> ::protobuf::ProtobufResult<()> {
  2202. while !is.eof()? {
  2203. let (field_number, wire_type) = is.read_tag_unpack()?;
  2204. match field_number {
  2205. 2 => {
  2206. ::protobuf::rt::read_singular_string_into(
  2207. wire_type,
  2208. is,
  2209. &mut self.context_uri,
  2210. )?;
  2211. }
  2212. 3 => {
  2213. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2214. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2215. wire_type,
  2216. ));
  2217. }
  2218. let tmp = is.read_uint32()?;
  2219. self.index = ::std::option::Option::Some(tmp);
  2220. }
  2221. 4 => {
  2222. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2223. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2224. wire_type,
  2225. ));
  2226. }
  2227. let tmp = is.read_uint32()?;
  2228. self.position_ms = ::std::option::Option::Some(tmp);
  2229. }
  2230. 5 => ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(
  2231. wire_type,
  2232. is,
  2233. &mut self.status,
  2234. 5,
  2235. &mut self.unknown_fields,
  2236. )?,
  2237. 7 => {
  2238. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2239. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2240. wire_type,
  2241. ));
  2242. }
  2243. let tmp = is.read_uint64()?;
  2244. self.position_measured_at = ::std::option::Option::Some(tmp);
  2245. }
  2246. 8 => {
  2247. ::protobuf::rt::read_singular_string_into(
  2248. wire_type,
  2249. is,
  2250. &mut self.context_description,
  2251. )?;
  2252. }
  2253. 13 => {
  2254. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2255. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2256. wire_type,
  2257. ));
  2258. }
  2259. let tmp = is.read_bool()?;
  2260. self.shuffle = ::std::option::Option::Some(tmp);
  2261. }
  2262. 14 => {
  2263. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2264. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2265. wire_type,
  2266. ));
  2267. }
  2268. let tmp = is.read_bool()?;
  2269. self.repeat = ::std::option::Option::Some(tmp);
  2270. }
  2271. 20 => {
  2272. ::protobuf::rt::read_singular_string_into(
  2273. wire_type,
  2274. is,
  2275. &mut self.last_command_ident,
  2276. )?;
  2277. }
  2278. 21 => {
  2279. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2280. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2281. wire_type,
  2282. ));
  2283. }
  2284. let tmp = is.read_uint32()?;
  2285. self.last_command_msgid = ::std::option::Option::Some(tmp);
  2286. }
  2287. 24 => {
  2288. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2289. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2290. wire_type,
  2291. ));
  2292. }
  2293. let tmp = is.read_bool()?;
  2294. self.playing_from_fallback = ::std::option::Option::Some(tmp);
  2295. }
  2296. 25 => {
  2297. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2298. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2299. wire_type,
  2300. ));
  2301. }
  2302. let tmp = is.read_uint32()?;
  2303. self.row = ::std::option::Option::Some(tmp);
  2304. }
  2305. 26 => {
  2306. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2307. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2308. wire_type,
  2309. ));
  2310. }
  2311. let tmp = is.read_uint32()?;
  2312. self.playing_track_index = ::std::option::Option::Some(tmp);
  2313. }
  2314. 27 => {
  2315. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.track)?;
  2316. }
  2317. 28 => {
  2318. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.ad)?;
  2319. }
  2320. _ => {
  2321. ::protobuf::rt::read_unknown_or_skip_group(
  2322. field_number,
  2323. wire_type,
  2324. is,
  2325. self.mut_unknown_fields(),
  2326. )?;
  2327. }
  2328. };
  2329. }
  2330. ::std::result::Result::Ok(())
  2331. }
  2332. // Compute sizes of nested messages
  2333. #[allow(unused_variables)]
  2334. fn compute_size(&self) -> u32 {
  2335. let mut my_size = 0;
  2336. if let Some(ref v) = self.context_uri.as_ref() {
  2337. my_size += ::protobuf::rt::string_size(2, &v);
  2338. }
  2339. if let Some(v) = self.index {
  2340. my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint);
  2341. }
  2342. if let Some(v) = self.position_ms {
  2343. my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint);
  2344. }
  2345. if let Some(v) = self.status {
  2346. my_size += ::protobuf::rt::enum_size(5, v);
  2347. }
  2348. if let Some(v) = self.position_measured_at {
  2349. my_size += ::protobuf::rt::value_size(7, v, ::protobuf::wire_format::WireTypeVarint);
  2350. }
  2351. if let Some(ref v) = self.context_description.as_ref() {
  2352. my_size += ::protobuf::rt::string_size(8, &v);
  2353. }
  2354. if let Some(v) = self.shuffle {
  2355. my_size += 2;
  2356. }
  2357. if let Some(v) = self.repeat {
  2358. my_size += 2;
  2359. }
  2360. if let Some(ref v) = self.last_command_ident.as_ref() {
  2361. my_size += ::protobuf::rt::string_size(20, &v);
  2362. }
  2363. if let Some(v) = self.last_command_msgid {
  2364. my_size += ::protobuf::rt::value_size(21, v, ::protobuf::wire_format::WireTypeVarint);
  2365. }
  2366. if let Some(v) = self.playing_from_fallback {
  2367. my_size += 3;
  2368. }
  2369. if let Some(v) = self.row {
  2370. my_size += ::protobuf::rt::value_size(25, v, ::protobuf::wire_format::WireTypeVarint);
  2371. }
  2372. if let Some(v) = self.playing_track_index {
  2373. my_size += ::protobuf::rt::value_size(26, v, ::protobuf::wire_format::WireTypeVarint);
  2374. }
  2375. for value in &self.track {
  2376. let len = value.compute_size();
  2377. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  2378. }
  2379. if let Some(ref v) = self.ad.as_ref() {
  2380. let len = v.compute_size();
  2381. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  2382. }
  2383. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2384. self.cached_size.set(my_size);
  2385. my_size
  2386. }
  2387. fn write_to_with_cached_sizes(
  2388. &self,
  2389. os: &mut ::protobuf::CodedOutputStream<'_>,
  2390. ) -> ::protobuf::ProtobufResult<()> {
  2391. if let Some(ref v) = self.context_uri.as_ref() {
  2392. os.write_string(2, &v)?;
  2393. }
  2394. if let Some(v) = self.index {
  2395. os.write_uint32(3, v)?;
  2396. }
  2397. if let Some(v) = self.position_ms {
  2398. os.write_uint32(4, v)?;
  2399. }
  2400. if let Some(v) = self.status {
  2401. os.write_enum(5, v.value())?;
  2402. }
  2403. if let Some(v) = self.position_measured_at {
  2404. os.write_uint64(7, v)?;
  2405. }
  2406. if let Some(ref v) = self.context_description.as_ref() {
  2407. os.write_string(8, &v)?;
  2408. }
  2409. if let Some(v) = self.shuffle {
  2410. os.write_bool(13, v)?;
  2411. }
  2412. if let Some(v) = self.repeat {
  2413. os.write_bool(14, v)?;
  2414. }
  2415. if let Some(ref v) = self.last_command_ident.as_ref() {
  2416. os.write_string(20, &v)?;
  2417. }
  2418. if let Some(v) = self.last_command_msgid {
  2419. os.write_uint32(21, v)?;
  2420. }
  2421. if let Some(v) = self.playing_from_fallback {
  2422. os.write_bool(24, v)?;
  2423. }
  2424. if let Some(v) = self.row {
  2425. os.write_uint32(25, v)?;
  2426. }
  2427. if let Some(v) = self.playing_track_index {
  2428. os.write_uint32(26, v)?;
  2429. }
  2430. for v in &self.track {
  2431. os.write_tag(27, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  2432. os.write_raw_varint32(v.get_cached_size())?;
  2433. v.write_to_with_cached_sizes(os)?;
  2434. }
  2435. if let Some(ref v) = self.ad.as_ref() {
  2436. os.write_tag(28, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  2437. os.write_raw_varint32(v.get_cached_size())?;
  2438. v.write_to_with_cached_sizes(os)?;
  2439. }
  2440. os.write_unknown_fields(self.get_unknown_fields())?;
  2441. ::std::result::Result::Ok(())
  2442. }
  2443. fn get_cached_size(&self) -> u32 {
  2444. self.cached_size.get()
  2445. }
  2446. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2447. &self.unknown_fields
  2448. }
  2449. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2450. &mut self.unknown_fields
  2451. }
  2452. fn as_any(&self) -> &dyn (::std::any::Any) {
  2453. self as &dyn (::std::any::Any)
  2454. }
  2455. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  2456. self as &mut dyn (::std::any::Any)
  2457. }
  2458. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  2459. self
  2460. }
  2461. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2462. Self::descriptor_static()
  2463. }
  2464. fn new() -> State {
  2465. State::new()
  2466. }
  2467. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2468. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> =
  2469. ::protobuf::lazy::Lazy::INIT;
  2470. unsafe {
  2471. descriptor.get(|| {
  2472. let mut fields = ::std::vec::Vec::new();
  2473. fields.push(
  2474. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  2475. _,
  2476. ::protobuf::types::ProtobufTypeString,
  2477. >(
  2478. "context_uri",
  2479. |m: &State| &m.context_uri,
  2480. |m: &mut State| &mut m.context_uri,
  2481. ),
  2482. );
  2483. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2484. _,
  2485. ::protobuf::types::ProtobufTypeUint32,
  2486. >(
  2487. "index",
  2488. |m: &State| &m.index,
  2489. |m: &mut State| &mut m.index,
  2490. ));
  2491. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2492. _,
  2493. ::protobuf::types::ProtobufTypeUint32,
  2494. >(
  2495. "position_ms",
  2496. |m: &State| &m.position_ms,
  2497. |m: &mut State| &mut m.position_ms,
  2498. ));
  2499. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2500. _,
  2501. ::protobuf::types::ProtobufTypeEnum<PlayStatus>,
  2502. >(
  2503. "status",
  2504. |m: &State| &m.status,
  2505. |m: &mut State| &mut m.status,
  2506. ));
  2507. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2508. _,
  2509. ::protobuf::types::ProtobufTypeUint64,
  2510. >(
  2511. "position_measured_at",
  2512. |m: &State| &m.position_measured_at,
  2513. |m: &mut State| &mut m.position_measured_at,
  2514. ));
  2515. fields.push(
  2516. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  2517. _,
  2518. ::protobuf::types::ProtobufTypeString,
  2519. >(
  2520. "context_description",
  2521. |m: &State| &m.context_description,
  2522. |m: &mut State| &mut m.context_description,
  2523. ),
  2524. );
  2525. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2526. _,
  2527. ::protobuf::types::ProtobufTypeBool,
  2528. >(
  2529. "shuffle",
  2530. |m: &State| &m.shuffle,
  2531. |m: &mut State| &mut m.shuffle,
  2532. ));
  2533. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2534. _,
  2535. ::protobuf::types::ProtobufTypeBool,
  2536. >(
  2537. "repeat",
  2538. |m: &State| &m.repeat,
  2539. |m: &mut State| &mut m.repeat,
  2540. ));
  2541. fields.push(
  2542. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  2543. _,
  2544. ::protobuf::types::ProtobufTypeString,
  2545. >(
  2546. "last_command_ident",
  2547. |m: &State| &m.last_command_ident,
  2548. |m: &mut State| &mut m.last_command_ident,
  2549. ),
  2550. );
  2551. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2552. _,
  2553. ::protobuf::types::ProtobufTypeUint32,
  2554. >(
  2555. "last_command_msgid",
  2556. |m: &State| &m.last_command_msgid,
  2557. |m: &mut State| &mut m.last_command_msgid,
  2558. ));
  2559. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2560. _,
  2561. ::protobuf::types::ProtobufTypeBool,
  2562. >(
  2563. "playing_from_fallback",
  2564. |m: &State| &m.playing_from_fallback,
  2565. |m: &mut State| &mut m.playing_from_fallback,
  2566. ));
  2567. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2568. _,
  2569. ::protobuf::types::ProtobufTypeUint32,
  2570. >(
  2571. "row", |m: &State| &m.row, |m: &mut State| &mut m.row
  2572. ));
  2573. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2574. _,
  2575. ::protobuf::types::ProtobufTypeUint32,
  2576. >(
  2577. "playing_track_index",
  2578. |m: &State| &m.playing_track_index,
  2579. |m: &mut State| &mut m.playing_track_index,
  2580. ));
  2581. fields.push(
  2582. ::protobuf::reflect::accessor::make_repeated_field_accessor::<
  2583. _,
  2584. ::protobuf::types::ProtobufTypeMessage<TrackRef>,
  2585. >(
  2586. "track", |m: &State| &m.track, |m: &mut State| &mut m.track
  2587. ),
  2588. );
  2589. fields.push(
  2590. ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<
  2591. _,
  2592. ::protobuf::types::ProtobufTypeMessage<Ad>,
  2593. >("ad", |m: &State| &m.ad, |m: &mut State| &mut m.ad),
  2594. );
  2595. ::protobuf::reflect::MessageDescriptor::new_pb_name::<State>(
  2596. "State",
  2597. fields,
  2598. file_descriptor_proto(),
  2599. )
  2600. })
  2601. }
  2602. }
  2603. fn default_instance() -> &'static State {
  2604. static mut instance: ::protobuf::lazy::Lazy<State> = ::protobuf::lazy::Lazy::INIT;
  2605. unsafe { instance.get(State::new) }
  2606. }
  2607. }
  2608. impl ::protobuf::Clear for State {
  2609. fn clear(&mut self) {
  2610. self.context_uri.clear();
  2611. self.index = ::std::option::Option::None;
  2612. self.position_ms = ::std::option::Option::None;
  2613. self.status = ::std::option::Option::None;
  2614. self.position_measured_at = ::std::option::Option::None;
  2615. self.context_description.clear();
  2616. self.shuffle = ::std::option::Option::None;
  2617. self.repeat = ::std::option::Option::None;
  2618. self.last_command_ident.clear();
  2619. self.last_command_msgid = ::std::option::Option::None;
  2620. self.playing_from_fallback = ::std::option::Option::None;
  2621. self.row = ::std::option::Option::None;
  2622. self.playing_track_index = ::std::option::Option::None;
  2623. self.track.clear();
  2624. self.ad.clear();
  2625. self.unknown_fields.clear();
  2626. }
  2627. }
  2628. impl ::std::fmt::Debug for State {
  2629. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  2630. ::protobuf::text_format::fmt(self, f)
  2631. }
  2632. }
  2633. impl ::protobuf::reflect::ProtobufValue for State {
  2634. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  2635. ::protobuf::reflect::ReflectValueRef::Message(self)
  2636. }
  2637. }
  2638. #[derive(PartialEq, Clone, Default)]
  2639. pub struct TrackRef {
  2640. // message fields
  2641. gid: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2642. uri: ::protobuf::SingularField<::std::string::String>,
  2643. queued: ::std::option::Option<bool>,
  2644. context: ::protobuf::SingularField<::std::string::String>,
  2645. // special fields
  2646. pub unknown_fields: ::protobuf::UnknownFields,
  2647. pub cached_size: ::protobuf::CachedSize,
  2648. }
  2649. impl<'a> ::std::default::Default for &'a TrackRef {
  2650. fn default() -> &'a TrackRef {
  2651. <TrackRef as ::protobuf::Message>::default_instance()
  2652. }
  2653. }
  2654. impl TrackRef {
  2655. pub fn new() -> TrackRef {
  2656. ::std::default::Default::default()
  2657. }
  2658. // optional bytes gid = 1;
  2659. pub fn get_gid(&self) -> &[u8] {
  2660. match self.gid.as_ref() {
  2661. Some(v) => &v,
  2662. None => &[],
  2663. }
  2664. }
  2665. pub fn clear_gid(&mut self) {
  2666. self.gid.clear();
  2667. }
  2668. pub fn has_gid(&self) -> bool {
  2669. self.gid.is_some()
  2670. }
  2671. // Param is passed by value, moved
  2672. pub fn set_gid(&mut self, v: ::std::vec::Vec<u8>) {
  2673. self.gid = ::protobuf::SingularField::some(v);
  2674. }
  2675. // Mutable pointer to the field.
  2676. // If field is not initialized, it is initialized with default value first.
  2677. pub fn mut_gid(&mut self) -> &mut ::std::vec::Vec<u8> {
  2678. if self.gid.is_none() {
  2679. self.gid.set_default();
  2680. }
  2681. self.gid.as_mut().unwrap()
  2682. }
  2683. // Take field
  2684. pub fn take_gid(&mut self) -> ::std::vec::Vec<u8> {
  2685. self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2686. }
  2687. // optional string uri = 2;
  2688. pub fn get_uri(&self) -> &str {
  2689. match self.uri.as_ref() {
  2690. Some(v) => &v,
  2691. None => "",
  2692. }
  2693. }
  2694. pub fn clear_uri(&mut self) {
  2695. self.uri.clear();
  2696. }
  2697. pub fn has_uri(&self) -> bool {
  2698. self.uri.is_some()
  2699. }
  2700. // Param is passed by value, moved
  2701. pub fn set_uri(&mut self, v: ::std::string::String) {
  2702. self.uri = ::protobuf::SingularField::some(v);
  2703. }
  2704. // Mutable pointer to the field.
  2705. // If field is not initialized, it is initialized with default value first.
  2706. pub fn mut_uri(&mut self) -> &mut ::std::string::String {
  2707. if self.uri.is_none() {
  2708. self.uri.set_default();
  2709. }
  2710. self.uri.as_mut().unwrap()
  2711. }
  2712. // Take field
  2713. pub fn take_uri(&mut self) -> ::std::string::String {
  2714. self.uri
  2715. .take()
  2716. .unwrap_or_else(|| ::std::string::String::new())
  2717. }
  2718. // optional bool queued = 3;
  2719. pub fn get_queued(&self) -> bool {
  2720. self.queued.unwrap_or(false)
  2721. }
  2722. pub fn clear_queued(&mut self) {
  2723. self.queued = ::std::option::Option::None;
  2724. }
  2725. pub fn has_queued(&self) -> bool {
  2726. self.queued.is_some()
  2727. }
  2728. // Param is passed by value, moved
  2729. pub fn set_queued(&mut self, v: bool) {
  2730. self.queued = ::std::option::Option::Some(v);
  2731. }
  2732. // optional string context = 4;
  2733. pub fn get_context(&self) -> &str {
  2734. match self.context.as_ref() {
  2735. Some(v) => &v,
  2736. None => "",
  2737. }
  2738. }
  2739. pub fn clear_context(&mut self) {
  2740. self.context.clear();
  2741. }
  2742. pub fn has_context(&self) -> bool {
  2743. self.context.is_some()
  2744. }
  2745. // Param is passed by value, moved
  2746. pub fn set_context(&mut self, v: ::std::string::String) {
  2747. self.context = ::protobuf::SingularField::some(v);
  2748. }
  2749. // Mutable pointer to the field.
  2750. // If field is not initialized, it is initialized with default value first.
  2751. pub fn mut_context(&mut self) -> &mut ::std::string::String {
  2752. if self.context.is_none() {
  2753. self.context.set_default();
  2754. }
  2755. self.context.as_mut().unwrap()
  2756. }
  2757. // Take field
  2758. pub fn take_context(&mut self) -> ::std::string::String {
  2759. self.context
  2760. .take()
  2761. .unwrap_or_else(|| ::std::string::String::new())
  2762. }
  2763. }
  2764. impl ::protobuf::Message for TrackRef {
  2765. fn is_initialized(&self) -> bool {
  2766. true
  2767. }
  2768. fn merge_from(
  2769. &mut self,
  2770. is: &mut ::protobuf::CodedInputStream<'_>,
  2771. ) -> ::protobuf::ProtobufResult<()> {
  2772. while !is.eof()? {
  2773. let (field_number, wire_type) = is.read_tag_unpack()?;
  2774. match field_number {
  2775. 1 => {
  2776. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?;
  2777. }
  2778. 2 => {
  2779. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?;
  2780. }
  2781. 3 => {
  2782. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2783. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  2784. wire_type,
  2785. ));
  2786. }
  2787. let tmp = is.read_bool()?;
  2788. self.queued = ::std::option::Option::Some(tmp);
  2789. }
  2790. 4 => {
  2791. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context)?;
  2792. }
  2793. _ => {
  2794. ::protobuf::rt::read_unknown_or_skip_group(
  2795. field_number,
  2796. wire_type,
  2797. is,
  2798. self.mut_unknown_fields(),
  2799. )?;
  2800. }
  2801. };
  2802. }
  2803. ::std::result::Result::Ok(())
  2804. }
  2805. // Compute sizes of nested messages
  2806. #[allow(unused_variables)]
  2807. fn compute_size(&self) -> u32 {
  2808. let mut my_size = 0;
  2809. if let Some(ref v) = self.gid.as_ref() {
  2810. my_size += ::protobuf::rt::bytes_size(1, &v);
  2811. }
  2812. if let Some(ref v) = self.uri.as_ref() {
  2813. my_size += ::protobuf::rt::string_size(2, &v);
  2814. }
  2815. if let Some(v) = self.queued {
  2816. my_size += 2;
  2817. }
  2818. if let Some(ref v) = self.context.as_ref() {
  2819. my_size += ::protobuf::rt::string_size(4, &v);
  2820. }
  2821. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2822. self.cached_size.set(my_size);
  2823. my_size
  2824. }
  2825. fn write_to_with_cached_sizes(
  2826. &self,
  2827. os: &mut ::protobuf::CodedOutputStream<'_>,
  2828. ) -> ::protobuf::ProtobufResult<()> {
  2829. if let Some(ref v) = self.gid.as_ref() {
  2830. os.write_bytes(1, &v)?;
  2831. }
  2832. if let Some(ref v) = self.uri.as_ref() {
  2833. os.write_string(2, &v)?;
  2834. }
  2835. if let Some(v) = self.queued {
  2836. os.write_bool(3, v)?;
  2837. }
  2838. if let Some(ref v) = self.context.as_ref() {
  2839. os.write_string(4, &v)?;
  2840. }
  2841. os.write_unknown_fields(self.get_unknown_fields())?;
  2842. ::std::result::Result::Ok(())
  2843. }
  2844. fn get_cached_size(&self) -> u32 {
  2845. self.cached_size.get()
  2846. }
  2847. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2848. &self.unknown_fields
  2849. }
  2850. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2851. &mut self.unknown_fields
  2852. }
  2853. fn as_any(&self) -> &dyn (::std::any::Any) {
  2854. self as &dyn (::std::any::Any)
  2855. }
  2856. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  2857. self as &mut dyn (::std::any::Any)
  2858. }
  2859. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  2860. self
  2861. }
  2862. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2863. Self::descriptor_static()
  2864. }
  2865. fn new() -> TrackRef {
  2866. TrackRef::new()
  2867. }
  2868. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2869. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> =
  2870. ::protobuf::lazy::Lazy::INIT;
  2871. unsafe {
  2872. descriptor.get(|| {
  2873. let mut fields = ::std::vec::Vec::new();
  2874. fields.push(
  2875. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  2876. _,
  2877. ::protobuf::types::ProtobufTypeBytes,
  2878. >(
  2879. "gid", |m: &TrackRef| &m.gid, |m: &mut TrackRef| &mut m.gid
  2880. ),
  2881. );
  2882. fields.push(
  2883. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  2884. _,
  2885. ::protobuf::types::ProtobufTypeString,
  2886. >(
  2887. "uri", |m: &TrackRef| &m.uri, |m: &mut TrackRef| &mut m.uri
  2888. ),
  2889. );
  2890. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  2891. _,
  2892. ::protobuf::types::ProtobufTypeBool,
  2893. >(
  2894. "queued",
  2895. |m: &TrackRef| &m.queued,
  2896. |m: &mut TrackRef| &mut m.queued,
  2897. ));
  2898. fields.push(
  2899. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  2900. _,
  2901. ::protobuf::types::ProtobufTypeString,
  2902. >(
  2903. "context",
  2904. |m: &TrackRef| &m.context,
  2905. |m: &mut TrackRef| &mut m.context,
  2906. ),
  2907. );
  2908. ::protobuf::reflect::MessageDescriptor::new_pb_name::<TrackRef>(
  2909. "TrackRef",
  2910. fields,
  2911. file_descriptor_proto(),
  2912. )
  2913. })
  2914. }
  2915. }
  2916. fn default_instance() -> &'static TrackRef {
  2917. static mut instance: ::protobuf::lazy::Lazy<TrackRef> = ::protobuf::lazy::Lazy::INIT;
  2918. unsafe { instance.get(TrackRef::new) }
  2919. }
  2920. }
  2921. impl ::protobuf::Clear for TrackRef {
  2922. fn clear(&mut self) {
  2923. self.gid.clear();
  2924. self.uri.clear();
  2925. self.queued = ::std::option::Option::None;
  2926. self.context.clear();
  2927. self.unknown_fields.clear();
  2928. }
  2929. }
  2930. impl ::std::fmt::Debug for TrackRef {
  2931. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  2932. ::protobuf::text_format::fmt(self, f)
  2933. }
  2934. }
  2935. impl ::protobuf::reflect::ProtobufValue for TrackRef {
  2936. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  2937. ::protobuf::reflect::ReflectValueRef::Message(self)
  2938. }
  2939. }
  2940. #[derive(PartialEq, Clone, Default)]
  2941. pub struct Ad {
  2942. // message fields
  2943. next: ::std::option::Option<i32>,
  2944. ogg_fid: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2945. image_fid: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2946. duration: ::std::option::Option<i32>,
  2947. click_url: ::protobuf::SingularField<::std::string::String>,
  2948. impression_url: ::protobuf::SingularField<::std::string::String>,
  2949. product: ::protobuf::SingularField<::std::string::String>,
  2950. advertiser: ::protobuf::SingularField<::std::string::String>,
  2951. gid: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2952. // special fields
  2953. pub unknown_fields: ::protobuf::UnknownFields,
  2954. pub cached_size: ::protobuf::CachedSize,
  2955. }
  2956. impl<'a> ::std::default::Default for &'a Ad {
  2957. fn default() -> &'a Ad {
  2958. <Ad as ::protobuf::Message>::default_instance()
  2959. }
  2960. }
  2961. impl Ad {
  2962. pub fn new() -> Ad {
  2963. ::std::default::Default::default()
  2964. }
  2965. // optional int32 next = 1;
  2966. pub fn get_next(&self) -> i32 {
  2967. self.next.unwrap_or(0)
  2968. }
  2969. pub fn clear_next(&mut self) {
  2970. self.next = ::std::option::Option::None;
  2971. }
  2972. pub fn has_next(&self) -> bool {
  2973. self.next.is_some()
  2974. }
  2975. // Param is passed by value, moved
  2976. pub fn set_next(&mut self, v: i32) {
  2977. self.next = ::std::option::Option::Some(v);
  2978. }
  2979. // optional bytes ogg_fid = 2;
  2980. pub fn get_ogg_fid(&self) -> &[u8] {
  2981. match self.ogg_fid.as_ref() {
  2982. Some(v) => &v,
  2983. None => &[],
  2984. }
  2985. }
  2986. pub fn clear_ogg_fid(&mut self) {
  2987. self.ogg_fid.clear();
  2988. }
  2989. pub fn has_ogg_fid(&self) -> bool {
  2990. self.ogg_fid.is_some()
  2991. }
  2992. // Param is passed by value, moved
  2993. pub fn set_ogg_fid(&mut self, v: ::std::vec::Vec<u8>) {
  2994. self.ogg_fid = ::protobuf::SingularField::some(v);
  2995. }
  2996. // Mutable pointer to the field.
  2997. // If field is not initialized, it is initialized with default value first.
  2998. pub fn mut_ogg_fid(&mut self) -> &mut ::std::vec::Vec<u8> {
  2999. if self.ogg_fid.is_none() {
  3000. self.ogg_fid.set_default();
  3001. }
  3002. self.ogg_fid.as_mut().unwrap()
  3003. }
  3004. // Take field
  3005. pub fn take_ogg_fid(&mut self) -> ::std::vec::Vec<u8> {
  3006. self.ogg_fid
  3007. .take()
  3008. .unwrap_or_else(|| ::std::vec::Vec::new())
  3009. }
  3010. // optional bytes image_fid = 3;
  3011. pub fn get_image_fid(&self) -> &[u8] {
  3012. match self.image_fid.as_ref() {
  3013. Some(v) => &v,
  3014. None => &[],
  3015. }
  3016. }
  3017. pub fn clear_image_fid(&mut self) {
  3018. self.image_fid.clear();
  3019. }
  3020. pub fn has_image_fid(&self) -> bool {
  3021. self.image_fid.is_some()
  3022. }
  3023. // Param is passed by value, moved
  3024. pub fn set_image_fid(&mut self, v: ::std::vec::Vec<u8>) {
  3025. self.image_fid = ::protobuf::SingularField::some(v);
  3026. }
  3027. // Mutable pointer to the field.
  3028. // If field is not initialized, it is initialized with default value first.
  3029. pub fn mut_image_fid(&mut self) -> &mut ::std::vec::Vec<u8> {
  3030. if self.image_fid.is_none() {
  3031. self.image_fid.set_default();
  3032. }
  3033. self.image_fid.as_mut().unwrap()
  3034. }
  3035. // Take field
  3036. pub fn take_image_fid(&mut self) -> ::std::vec::Vec<u8> {
  3037. self.image_fid
  3038. .take()
  3039. .unwrap_or_else(|| ::std::vec::Vec::new())
  3040. }
  3041. // optional int32 duration = 4;
  3042. pub fn get_duration(&self) -> i32 {
  3043. self.duration.unwrap_or(0)
  3044. }
  3045. pub fn clear_duration(&mut self) {
  3046. self.duration = ::std::option::Option::None;
  3047. }
  3048. pub fn has_duration(&self) -> bool {
  3049. self.duration.is_some()
  3050. }
  3051. // Param is passed by value, moved
  3052. pub fn set_duration(&mut self, v: i32) {
  3053. self.duration = ::std::option::Option::Some(v);
  3054. }
  3055. // optional string click_url = 5;
  3056. pub fn get_click_url(&self) -> &str {
  3057. match self.click_url.as_ref() {
  3058. Some(v) => &v,
  3059. None => "",
  3060. }
  3061. }
  3062. pub fn clear_click_url(&mut self) {
  3063. self.click_url.clear();
  3064. }
  3065. pub fn has_click_url(&self) -> bool {
  3066. self.click_url.is_some()
  3067. }
  3068. // Param is passed by value, moved
  3069. pub fn set_click_url(&mut self, v: ::std::string::String) {
  3070. self.click_url = ::protobuf::SingularField::some(v);
  3071. }
  3072. // Mutable pointer to the field.
  3073. // If field is not initialized, it is initialized with default value first.
  3074. pub fn mut_click_url(&mut self) -> &mut ::std::string::String {
  3075. if self.click_url.is_none() {
  3076. self.click_url.set_default();
  3077. }
  3078. self.click_url.as_mut().unwrap()
  3079. }
  3080. // Take field
  3081. pub fn take_click_url(&mut self) -> ::std::string::String {
  3082. self.click_url
  3083. .take()
  3084. .unwrap_or_else(|| ::std::string::String::new())
  3085. }
  3086. // optional string impression_url = 6;
  3087. pub fn get_impression_url(&self) -> &str {
  3088. match self.impression_url.as_ref() {
  3089. Some(v) => &v,
  3090. None => "",
  3091. }
  3092. }
  3093. pub fn clear_impression_url(&mut self) {
  3094. self.impression_url.clear();
  3095. }
  3096. pub fn has_impression_url(&self) -> bool {
  3097. self.impression_url.is_some()
  3098. }
  3099. // Param is passed by value, moved
  3100. pub fn set_impression_url(&mut self, v: ::std::string::String) {
  3101. self.impression_url = ::protobuf::SingularField::some(v);
  3102. }
  3103. // Mutable pointer to the field.
  3104. // If field is not initialized, it is initialized with default value first.
  3105. pub fn mut_impression_url(&mut self) -> &mut ::std::string::String {
  3106. if self.impression_url.is_none() {
  3107. self.impression_url.set_default();
  3108. }
  3109. self.impression_url.as_mut().unwrap()
  3110. }
  3111. // Take field
  3112. pub fn take_impression_url(&mut self) -> ::std::string::String {
  3113. self.impression_url
  3114. .take()
  3115. .unwrap_or_else(|| ::std::string::String::new())
  3116. }
  3117. // optional string product = 7;
  3118. pub fn get_product(&self) -> &str {
  3119. match self.product.as_ref() {
  3120. Some(v) => &v,
  3121. None => "",
  3122. }
  3123. }
  3124. pub fn clear_product(&mut self) {
  3125. self.product.clear();
  3126. }
  3127. pub fn has_product(&self) -> bool {
  3128. self.product.is_some()
  3129. }
  3130. // Param is passed by value, moved
  3131. pub fn set_product(&mut self, v: ::std::string::String) {
  3132. self.product = ::protobuf::SingularField::some(v);
  3133. }
  3134. // Mutable pointer to the field.
  3135. // If field is not initialized, it is initialized with default value first.
  3136. pub fn mut_product(&mut self) -> &mut ::std::string::String {
  3137. if self.product.is_none() {
  3138. self.product.set_default();
  3139. }
  3140. self.product.as_mut().unwrap()
  3141. }
  3142. // Take field
  3143. pub fn take_product(&mut self) -> ::std::string::String {
  3144. self.product
  3145. .take()
  3146. .unwrap_or_else(|| ::std::string::String::new())
  3147. }
  3148. // optional string advertiser = 8;
  3149. pub fn get_advertiser(&self) -> &str {
  3150. match self.advertiser.as_ref() {
  3151. Some(v) => &v,
  3152. None => "",
  3153. }
  3154. }
  3155. pub fn clear_advertiser(&mut self) {
  3156. self.advertiser.clear();
  3157. }
  3158. pub fn has_advertiser(&self) -> bool {
  3159. self.advertiser.is_some()
  3160. }
  3161. // Param is passed by value, moved
  3162. pub fn set_advertiser(&mut self, v: ::std::string::String) {
  3163. self.advertiser = ::protobuf::SingularField::some(v);
  3164. }
  3165. // Mutable pointer to the field.
  3166. // If field is not initialized, it is initialized with default value first.
  3167. pub fn mut_advertiser(&mut self) -> &mut ::std::string::String {
  3168. if self.advertiser.is_none() {
  3169. self.advertiser.set_default();
  3170. }
  3171. self.advertiser.as_mut().unwrap()
  3172. }
  3173. // Take field
  3174. pub fn take_advertiser(&mut self) -> ::std::string::String {
  3175. self.advertiser
  3176. .take()
  3177. .unwrap_or_else(|| ::std::string::String::new())
  3178. }
  3179. // optional bytes gid = 9;
  3180. pub fn get_gid(&self) -> &[u8] {
  3181. match self.gid.as_ref() {
  3182. Some(v) => &v,
  3183. None => &[],
  3184. }
  3185. }
  3186. pub fn clear_gid(&mut self) {
  3187. self.gid.clear();
  3188. }
  3189. pub fn has_gid(&self) -> bool {
  3190. self.gid.is_some()
  3191. }
  3192. // Param is passed by value, moved
  3193. pub fn set_gid(&mut self, v: ::std::vec::Vec<u8>) {
  3194. self.gid = ::protobuf::SingularField::some(v);
  3195. }
  3196. // Mutable pointer to the field.
  3197. // If field is not initialized, it is initialized with default value first.
  3198. pub fn mut_gid(&mut self) -> &mut ::std::vec::Vec<u8> {
  3199. if self.gid.is_none() {
  3200. self.gid.set_default();
  3201. }
  3202. self.gid.as_mut().unwrap()
  3203. }
  3204. // Take field
  3205. pub fn take_gid(&mut self) -> ::std::vec::Vec<u8> {
  3206. self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new())
  3207. }
  3208. }
  3209. impl ::protobuf::Message for Ad {
  3210. fn is_initialized(&self) -> bool {
  3211. true
  3212. }
  3213. fn merge_from(
  3214. &mut self,
  3215. is: &mut ::protobuf::CodedInputStream<'_>,
  3216. ) -> ::protobuf::ProtobufResult<()> {
  3217. while !is.eof()? {
  3218. let (field_number, wire_type) = is.read_tag_unpack()?;
  3219. match field_number {
  3220. 1 => {
  3221. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  3222. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  3223. wire_type,
  3224. ));
  3225. }
  3226. let tmp = is.read_int32()?;
  3227. self.next = ::std::option::Option::Some(tmp);
  3228. }
  3229. 2 => {
  3230. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.ogg_fid)?;
  3231. }
  3232. 3 => {
  3233. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.image_fid)?;
  3234. }
  3235. 4 => {
  3236. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  3237. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(
  3238. wire_type,
  3239. ));
  3240. }
  3241. let tmp = is.read_int32()?;
  3242. self.duration = ::std::option::Option::Some(tmp);
  3243. }
  3244. 5 => {
  3245. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.click_url)?;
  3246. }
  3247. 6 => {
  3248. ::protobuf::rt::read_singular_string_into(
  3249. wire_type,
  3250. is,
  3251. &mut self.impression_url,
  3252. )?;
  3253. }
  3254. 7 => {
  3255. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.product)?;
  3256. }
  3257. 8 => {
  3258. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.advertiser)?;
  3259. }
  3260. 9 => {
  3261. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?;
  3262. }
  3263. _ => {
  3264. ::protobuf::rt::read_unknown_or_skip_group(
  3265. field_number,
  3266. wire_type,
  3267. is,
  3268. self.mut_unknown_fields(),
  3269. )?;
  3270. }
  3271. };
  3272. }
  3273. ::std::result::Result::Ok(())
  3274. }
  3275. // Compute sizes of nested messages
  3276. #[allow(unused_variables)]
  3277. fn compute_size(&self) -> u32 {
  3278. let mut my_size = 0;
  3279. if let Some(v) = self.next {
  3280. my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
  3281. }
  3282. if let Some(ref v) = self.ogg_fid.as_ref() {
  3283. my_size += ::protobuf::rt::bytes_size(2, &v);
  3284. }
  3285. if let Some(ref v) = self.image_fid.as_ref() {
  3286. my_size += ::protobuf::rt::bytes_size(3, &v);
  3287. }
  3288. if let Some(v) = self.duration {
  3289. my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint);
  3290. }
  3291. if let Some(ref v) = self.click_url.as_ref() {
  3292. my_size += ::protobuf::rt::string_size(5, &v);
  3293. }
  3294. if let Some(ref v) = self.impression_url.as_ref() {
  3295. my_size += ::protobuf::rt::string_size(6, &v);
  3296. }
  3297. if let Some(ref v) = self.product.as_ref() {
  3298. my_size += ::protobuf::rt::string_size(7, &v);
  3299. }
  3300. if let Some(ref v) = self.advertiser.as_ref() {
  3301. my_size += ::protobuf::rt::string_size(8, &v);
  3302. }
  3303. if let Some(ref v) = self.gid.as_ref() {
  3304. my_size += ::protobuf::rt::bytes_size(9, &v);
  3305. }
  3306. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  3307. self.cached_size.set(my_size);
  3308. my_size
  3309. }
  3310. fn write_to_with_cached_sizes(
  3311. &self,
  3312. os: &mut ::protobuf::CodedOutputStream<'_>,
  3313. ) -> ::protobuf::ProtobufResult<()> {
  3314. if let Some(v) = self.next {
  3315. os.write_int32(1, v)?;
  3316. }
  3317. if let Some(ref v) = self.ogg_fid.as_ref() {
  3318. os.write_bytes(2, &v)?;
  3319. }
  3320. if let Some(ref v) = self.image_fid.as_ref() {
  3321. os.write_bytes(3, &v)?;
  3322. }
  3323. if let Some(v) = self.duration {
  3324. os.write_int32(4, v)?;
  3325. }
  3326. if let Some(ref v) = self.click_url.as_ref() {
  3327. os.write_string(5, &v)?;
  3328. }
  3329. if let Some(ref v) = self.impression_url.as_ref() {
  3330. os.write_string(6, &v)?;
  3331. }
  3332. if let Some(ref v) = self.product.as_ref() {
  3333. os.write_string(7, &v)?;
  3334. }
  3335. if let Some(ref v) = self.advertiser.as_ref() {
  3336. os.write_string(8, &v)?;
  3337. }
  3338. if let Some(ref v) = self.gid.as_ref() {
  3339. os.write_bytes(9, &v)?;
  3340. }
  3341. os.write_unknown_fields(self.get_unknown_fields())?;
  3342. ::std::result::Result::Ok(())
  3343. }
  3344. fn get_cached_size(&self) -> u32 {
  3345. self.cached_size.get()
  3346. }
  3347. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  3348. &self.unknown_fields
  3349. }
  3350. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  3351. &mut self.unknown_fields
  3352. }
  3353. fn as_any(&self) -> &dyn (::std::any::Any) {
  3354. self as &dyn (::std::any::Any)
  3355. }
  3356. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  3357. self as &mut dyn (::std::any::Any)
  3358. }
  3359. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  3360. self
  3361. }
  3362. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  3363. Self::descriptor_static()
  3364. }
  3365. fn new() -> Ad {
  3366. Ad::new()
  3367. }
  3368. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  3369. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> =
  3370. ::protobuf::lazy::Lazy::INIT;
  3371. unsafe {
  3372. descriptor.get(|| {
  3373. let mut fields = ::std::vec::Vec::new();
  3374. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  3375. _,
  3376. ::protobuf::types::ProtobufTypeInt32,
  3377. >(
  3378. "next", |m: &Ad| &m.next, |m: &mut Ad| &mut m.next
  3379. ));
  3380. fields.push(
  3381. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  3382. _,
  3383. ::protobuf::types::ProtobufTypeBytes,
  3384. >(
  3385. "ogg_fid", |m: &Ad| &m.ogg_fid, |m: &mut Ad| &mut m.ogg_fid
  3386. ),
  3387. );
  3388. fields.push(
  3389. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  3390. _,
  3391. ::protobuf::types::ProtobufTypeBytes,
  3392. >(
  3393. "image_fid",
  3394. |m: &Ad| &m.image_fid,
  3395. |m: &mut Ad| &mut m.image_fid,
  3396. ),
  3397. );
  3398. fields.push(::protobuf::reflect::accessor::make_option_accessor::<
  3399. _,
  3400. ::protobuf::types::ProtobufTypeInt32,
  3401. >(
  3402. "duration",
  3403. |m: &Ad| &m.duration,
  3404. |m: &mut Ad| &mut m.duration,
  3405. ));
  3406. fields.push(
  3407. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  3408. _,
  3409. ::protobuf::types::ProtobufTypeString,
  3410. >(
  3411. "click_url",
  3412. |m: &Ad| &m.click_url,
  3413. |m: &mut Ad| &mut m.click_url,
  3414. ),
  3415. );
  3416. fields.push(
  3417. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  3418. _,
  3419. ::protobuf::types::ProtobufTypeString,
  3420. >(
  3421. "impression_url",
  3422. |m: &Ad| &m.impression_url,
  3423. |m: &mut Ad| &mut m.impression_url,
  3424. ),
  3425. );
  3426. fields.push(
  3427. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  3428. _,
  3429. ::protobuf::types::ProtobufTypeString,
  3430. >(
  3431. "product", |m: &Ad| &m.product, |m: &mut Ad| &mut m.product
  3432. ),
  3433. );
  3434. fields.push(
  3435. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  3436. _,
  3437. ::protobuf::types::ProtobufTypeString,
  3438. >(
  3439. "advertiser",
  3440. |m: &Ad| &m.advertiser,
  3441. |m: &mut Ad| &mut m.advertiser,
  3442. ),
  3443. );
  3444. fields.push(
  3445. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  3446. _,
  3447. ::protobuf::types::ProtobufTypeBytes,
  3448. >("gid", |m: &Ad| &m.gid, |m: &mut Ad| &mut m.gid),
  3449. );
  3450. ::protobuf::reflect::MessageDescriptor::new_pb_name::<Ad>(
  3451. "Ad",
  3452. fields,
  3453. file_descriptor_proto(),
  3454. )
  3455. })
  3456. }
  3457. }
  3458. fn default_instance() -> &'static Ad {
  3459. static mut instance: ::protobuf::lazy::Lazy<Ad> = ::protobuf::lazy::Lazy::INIT;
  3460. unsafe { instance.get(Ad::new) }
  3461. }
  3462. }
  3463. impl ::protobuf::Clear for Ad {
  3464. fn clear(&mut self) {
  3465. self.next = ::std::option::Option::None;
  3466. self.ogg_fid.clear();
  3467. self.image_fid.clear();
  3468. self.duration = ::std::option::Option::None;
  3469. self.click_url.clear();
  3470. self.impression_url.clear();
  3471. self.product.clear();
  3472. self.advertiser.clear();
  3473. self.gid.clear();
  3474. self.unknown_fields.clear();
  3475. }
  3476. }
  3477. impl ::std::fmt::Debug for Ad {
  3478. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  3479. ::protobuf::text_format::fmt(self, f)
  3480. }
  3481. }
  3482. impl ::protobuf::reflect::ProtobufValue for Ad {
  3483. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  3484. ::protobuf::reflect::ReflectValueRef::Message(self)
  3485. }
  3486. }
  3487. #[derive(PartialEq, Clone, Default)]
  3488. pub struct Metadata {
  3489. // message fields
  3490. field_type: ::protobuf::SingularField<::std::string::String>,
  3491. metadata: ::protobuf::SingularField<::std::string::String>,
  3492. // special fields
  3493. pub unknown_fields: ::protobuf::UnknownFields,
  3494. pub cached_size: ::protobuf::CachedSize,
  3495. }
  3496. impl<'a> ::std::default::Default for &'a Metadata {
  3497. fn default() -> &'a Metadata {
  3498. <Metadata as ::protobuf::Message>::default_instance()
  3499. }
  3500. }
  3501. impl Metadata {
  3502. pub fn new() -> Metadata {
  3503. ::std::default::Default::default()
  3504. }
  3505. // optional string type = 1;
  3506. pub fn get_field_type(&self) -> &str {
  3507. match self.field_type.as_ref() {
  3508. Some(v) => &v,
  3509. None => "",
  3510. }
  3511. }
  3512. pub fn clear_field_type(&mut self) {
  3513. self.field_type.clear();
  3514. }
  3515. pub fn has_field_type(&self) -> bool {
  3516. self.field_type.is_some()
  3517. }
  3518. // Param is passed by value, moved
  3519. pub fn set_field_type(&mut self, v: ::std::string::String) {
  3520. self.field_type = ::protobuf::SingularField::some(v);
  3521. }
  3522. // Mutable pointer to the field.
  3523. // If field is not initialized, it is initialized with default value first.
  3524. pub fn mut_field_type(&mut self) -> &mut ::std::string::String {
  3525. if self.field_type.is_none() {
  3526. self.field_type.set_default();
  3527. }
  3528. self.field_type.as_mut().unwrap()
  3529. }
  3530. // Take field
  3531. pub fn take_field_type(&mut self) -> ::std::string::String {
  3532. self.field_type
  3533. .take()
  3534. .unwrap_or_else(|| ::std::string::String::new())
  3535. }
  3536. // optional string metadata = 2;
  3537. pub fn get_metadata(&self) -> &str {
  3538. match self.metadata.as_ref() {
  3539. Some(v) => &v,
  3540. None => "",
  3541. }
  3542. }
  3543. pub fn clear_metadata(&mut self) {
  3544. self.metadata.clear();
  3545. }
  3546. pub fn has_metadata(&self) -> bool {
  3547. self.metadata.is_some()
  3548. }
  3549. // Param is passed by value, moved
  3550. pub fn set_metadata(&mut self, v: ::std::string::String) {
  3551. self.metadata = ::protobuf::SingularField::some(v);
  3552. }
  3553. // Mutable pointer to the field.
  3554. // If field is not initialized, it is initialized with default value first.
  3555. pub fn mut_metadata(&mut self) -> &mut ::std::string::String {
  3556. if self.metadata.is_none() {
  3557. self.metadata.set_default();
  3558. }
  3559. self.metadata.as_mut().unwrap()
  3560. }
  3561. // Take field
  3562. pub fn take_metadata(&mut self) -> ::std::string::String {
  3563. self.metadata
  3564. .take()
  3565. .unwrap_or_else(|| ::std::string::String::new())
  3566. }
  3567. }
  3568. impl ::protobuf::Message for Metadata {
  3569. fn is_initialized(&self) -> bool {
  3570. true
  3571. }
  3572. fn merge_from(
  3573. &mut self,
  3574. is: &mut ::protobuf::CodedInputStream<'_>,
  3575. ) -> ::protobuf::ProtobufResult<()> {
  3576. while !is.eof()? {
  3577. let (field_number, wire_type) = is.read_tag_unpack()?;
  3578. match field_number {
  3579. 1 => {
  3580. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.field_type)?;
  3581. }
  3582. 2 => {
  3583. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.metadata)?;
  3584. }
  3585. _ => {
  3586. ::protobuf::rt::read_unknown_or_skip_group(
  3587. field_number,
  3588. wire_type,
  3589. is,
  3590. self.mut_unknown_fields(),
  3591. )?;
  3592. }
  3593. };
  3594. }
  3595. ::std::result::Result::Ok(())
  3596. }
  3597. // Compute sizes of nested messages
  3598. #[allow(unused_variables)]
  3599. fn compute_size(&self) -> u32 {
  3600. let mut my_size = 0;
  3601. if let Some(ref v) = self.field_type.as_ref() {
  3602. my_size += ::protobuf::rt::string_size(1, &v);
  3603. }
  3604. if let Some(ref v) = self.metadata.as_ref() {
  3605. my_size += ::protobuf::rt::string_size(2, &v);
  3606. }
  3607. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  3608. self.cached_size.set(my_size);
  3609. my_size
  3610. }
  3611. fn write_to_with_cached_sizes(
  3612. &self,
  3613. os: &mut ::protobuf::CodedOutputStream<'_>,
  3614. ) -> ::protobuf::ProtobufResult<()> {
  3615. if let Some(ref v) = self.field_type.as_ref() {
  3616. os.write_string(1, &v)?;
  3617. }
  3618. if let Some(ref v) = self.metadata.as_ref() {
  3619. os.write_string(2, &v)?;
  3620. }
  3621. os.write_unknown_fields(self.get_unknown_fields())?;
  3622. ::std::result::Result::Ok(())
  3623. }
  3624. fn get_cached_size(&self) -> u32 {
  3625. self.cached_size.get()
  3626. }
  3627. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  3628. &self.unknown_fields
  3629. }
  3630. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  3631. &mut self.unknown_fields
  3632. }
  3633. fn as_any(&self) -> &dyn (::std::any::Any) {
  3634. self as &dyn (::std::any::Any)
  3635. }
  3636. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  3637. self as &mut dyn (::std::any::Any)
  3638. }
  3639. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  3640. self
  3641. }
  3642. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  3643. Self::descriptor_static()
  3644. }
  3645. fn new() -> Metadata {
  3646. Metadata::new()
  3647. }
  3648. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  3649. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> =
  3650. ::protobuf::lazy::Lazy::INIT;
  3651. unsafe {
  3652. descriptor.get(|| {
  3653. let mut fields = ::std::vec::Vec::new();
  3654. fields.push(
  3655. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  3656. _,
  3657. ::protobuf::types::ProtobufTypeString,
  3658. >(
  3659. "type",
  3660. |m: &Metadata| &m.field_type,
  3661. |m: &mut Metadata| &mut m.field_type,
  3662. ),
  3663. );
  3664. fields.push(
  3665. ::protobuf::reflect::accessor::make_singular_field_accessor::<
  3666. _,
  3667. ::protobuf::types::ProtobufTypeString,
  3668. >(
  3669. "metadata",
  3670. |m: &Metadata| &m.metadata,
  3671. |m: &mut Metadata| &mut m.metadata,
  3672. ),
  3673. );
  3674. ::protobuf::reflect::MessageDescriptor::new_pb_name::<Metadata>(
  3675. "Metadata",
  3676. fields,
  3677. file_descriptor_proto(),
  3678. )
  3679. })
  3680. }
  3681. }
  3682. fn default_instance() -> &'static Metadata {
  3683. static mut instance: ::protobuf::lazy::Lazy<Metadata> = ::protobuf::lazy::Lazy::INIT;
  3684. unsafe { instance.get(Metadata::new) }
  3685. }
  3686. }
  3687. impl ::protobuf::Clear for Metadata {
  3688. fn clear(&mut self) {
  3689. self.field_type.clear();
  3690. self.metadata.clear();
  3691. self.unknown_fields.clear();
  3692. }
  3693. }
  3694. impl ::std::fmt::Debug for Metadata {
  3695. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  3696. ::protobuf::text_format::fmt(self, f)
  3697. }
  3698. }
  3699. impl ::protobuf::reflect::ProtobufValue for Metadata {
  3700. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  3701. ::protobuf::reflect::ReflectValueRef::Message(self)
  3702. }
  3703. }
  3704. #[derive(Clone, PartialEq, Eq, Debug, Hash)]
  3705. pub enum MessageType {
  3706. kMessageTypeHello = 1,
  3707. kMessageTypeGoodbye = 2,
  3708. kMessageTypeProbe = 3,
  3709. kMessageTypeNotify = 10,
  3710. kMessageTypeLoad = 20,
  3711. kMessageTypePlay = 21,
  3712. kMessageTypePause = 22,
  3713. kMessageTypePlayPause = 23,
  3714. kMessageTypeSeek = 24,
  3715. kMessageTypePrev = 25,
  3716. kMessageTypeNext = 26,
  3717. kMessageTypeVolume = 27,
  3718. kMessageTypeShuffle = 28,
  3719. kMessageTypeRepeat = 29,
  3720. kMessageTypeVolumeDown = 31,
  3721. kMessageTypeVolumeUp = 32,
  3722. kMessageTypeReplace = 33,
  3723. kMessageTypeLogout = 34,
  3724. kMessageTypeAction = 35,
  3725. kMessageTypeRename = 36,
  3726. kMessageTypeUpdateMetadata = 128,
  3727. }
  3728. impl ::protobuf::ProtobufEnum for MessageType {
  3729. fn value(&self) -> i32 {
  3730. *self as i32
  3731. }
  3732. fn from_i32(value: i32) -> ::std::option::Option<MessageType> {
  3733. match value {
  3734. 1 => ::std::option::Option::Some(MessageType::kMessageTypeHello),
  3735. 2 => ::std::option::Option::Some(MessageType::kMessageTypeGoodbye),
  3736. 3 => ::std::option::Option::Some(MessageType::kMessageTypeProbe),
  3737. 10 => ::std::option::Option::Some(MessageType::kMessageTypeNotify),
  3738. 20 => ::std::option::Option::Some(MessageType::kMessageTypeLoad),
  3739. 21 => ::std::option::Option::Some(MessageType::kMessageTypePlay),
  3740. 22 => ::std::option::Option::Some(MessageType::kMessageTypePause),
  3741. 23 => ::std::option::Option::Some(MessageType::kMessageTypePlayPause),
  3742. 24 => ::std::option::Option::Some(MessageType::kMessageTypeSeek),
  3743. 25 => ::std::option::Option::Some(MessageType::kMessageTypePrev),
  3744. 26 => ::std::option::Option::Some(MessageType::kMessageTypeNext),
  3745. 27 => ::std::option::Option::Some(MessageType::kMessageTypeVolume),
  3746. 28 => ::std::option::Option::Some(MessageType::kMessageTypeShuffle),
  3747. 29 => ::std::option::Option::Some(MessageType::kMessageTypeRepeat),
  3748. 31 => ::std::option::Option::Some(MessageType::kMessageTypeVolumeDown),
  3749. 32 => ::std::option::Option::Some(MessageType::kMessageTypeVolumeUp),
  3750. 33 => ::std::option::Option::Some(MessageType::kMessageTypeReplace),
  3751. 34 => ::std::option::Option::Some(MessageType::kMessageTypeLogout),
  3752. 35 => ::std::option::Option::Some(MessageType::kMessageTypeAction),
  3753. 36 => ::std::option::Option::Some(MessageType::kMessageTypeRename),
  3754. 128 => ::std::option::Option::Some(MessageType::kMessageTypeUpdateMetadata),
  3755. _ => ::std::option::Option::None,
  3756. }
  3757. }
  3758. fn values() -> &'static [Self] {
  3759. static values: &'static [MessageType] = &[
  3760. MessageType::kMessageTypeHello,
  3761. MessageType::kMessageTypeGoodbye,
  3762. MessageType::kMessageTypeProbe,
  3763. MessageType::kMessageTypeNotify,
  3764. MessageType::kMessageTypeLoad,
  3765. MessageType::kMessageTypePlay,
  3766. MessageType::kMessageTypePause,
  3767. MessageType::kMessageTypePlayPause,
  3768. MessageType::kMessageTypeSeek,
  3769. MessageType::kMessageTypePrev,
  3770. MessageType::kMessageTypeNext,
  3771. MessageType::kMessageTypeVolume,
  3772. MessageType::kMessageTypeShuffle,
  3773. MessageType::kMessageTypeRepeat,
  3774. MessageType::kMessageTypeVolumeDown,
  3775. MessageType::kMessageTypeVolumeUp,
  3776. MessageType::kMessageTypeReplace,
  3777. MessageType::kMessageTypeLogout,
  3778. MessageType::kMessageTypeAction,
  3779. MessageType::kMessageTypeRename,
  3780. MessageType::kMessageTypeUpdateMetadata,
  3781. ];
  3782. values
  3783. }
  3784. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  3785. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> =
  3786. ::protobuf::lazy::Lazy::INIT;
  3787. unsafe {
  3788. descriptor.get(|| {
  3789. ::protobuf::reflect::EnumDescriptor::new_pb_name::<MessageType>(
  3790. "MessageType",
  3791. file_descriptor_proto(),
  3792. )
  3793. })
  3794. }
  3795. }
  3796. }
  3797. impl ::std::marker::Copy for MessageType {}
  3798. // Note, `Default` is implemented although default value is not 0
  3799. impl ::std::default::Default for MessageType {
  3800. fn default() -> Self {
  3801. MessageType::kMessageTypeHello
  3802. }
  3803. }
  3804. impl ::protobuf::reflect::ProtobufValue for MessageType {
  3805. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  3806. ::protobuf::reflect::ReflectValueRef::Enum(self.descriptor())
  3807. }
  3808. }
  3809. #[derive(Clone, PartialEq, Eq, Debug, Hash)]
  3810. pub enum CapabilityType {
  3811. kSupportedContexts = 1,
  3812. kCanBePlayer = 2,
  3813. kRestrictToLocal = 3,
  3814. kDeviceType = 4,
  3815. kGaiaEqConnectId = 5,
  3816. kSupportsLogout = 6,
  3817. kIsObservable = 7,
  3818. kVolumeSteps = 8,
  3819. kSupportedTypes = 9,
  3820. kCommandAcks = 10,
  3821. kSupportsRename = 11,
  3822. kHidden = 12,
  3823. kSupportsPlaylistV2 = 13,
  3824. kSupportsExternalEpisodes = 14,
  3825. }
  3826. impl ::protobuf::ProtobufEnum for CapabilityType {
  3827. fn value(&self) -> i32 {
  3828. *self as i32
  3829. }
  3830. fn from_i32(value: i32) -> ::std::option::Option<CapabilityType> {
  3831. match value {
  3832. 1 => ::std::option::Option::Some(CapabilityType::kSupportedContexts),
  3833. 2 => ::std::option::Option::Some(CapabilityType::kCanBePlayer),
  3834. 3 => ::std::option::Option::Some(CapabilityType::kRestrictToLocal),
  3835. 4 => ::std::option::Option::Some(CapabilityType::kDeviceType),
  3836. 5 => ::std::option::Option::Some(CapabilityType::kGaiaEqConnectId),
  3837. 6 => ::std::option::Option::Some(CapabilityType::kSupportsLogout),
  3838. 7 => ::std::option::Option::Some(CapabilityType::kIsObservable),
  3839. 8 => ::std::option::Option::Some(CapabilityType::kVolumeSteps),
  3840. 9 => ::std::option::Option::Some(CapabilityType::kSupportedTypes),
  3841. 10 => ::std::option::Option::Some(CapabilityType::kCommandAcks),
  3842. 11 => ::std::option::Option::Some(CapabilityType::kSupportsRename),
  3843. 12 => ::std::option::Option::Some(CapabilityType::kHidden),
  3844. 13 => ::std::option::Option::Some(CapabilityType::kSupportsPlaylistV2),
  3845. 14 => ::std::option::Option::Some(CapabilityType::kSupportsExternalEpisodes),
  3846. _ => ::std::option::Option::None,
  3847. }
  3848. }
  3849. fn values() -> &'static [Self] {
  3850. static values: &'static [CapabilityType] = &[
  3851. CapabilityType::kSupportedContexts,
  3852. CapabilityType::kCanBePlayer,
  3853. CapabilityType::kRestrictToLocal,
  3854. CapabilityType::kDeviceType,
  3855. CapabilityType::kGaiaEqConnectId,
  3856. CapabilityType::kSupportsLogout,
  3857. CapabilityType::kIsObservable,
  3858. CapabilityType::kVolumeSteps,
  3859. CapabilityType::kSupportedTypes,
  3860. CapabilityType::kCommandAcks,
  3861. CapabilityType::kSupportsRename,
  3862. CapabilityType::kHidden,
  3863. CapabilityType::kSupportsPlaylistV2,
  3864. CapabilityType::kSupportsExternalEpisodes,
  3865. ];
  3866. values
  3867. }
  3868. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  3869. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> =
  3870. ::protobuf::lazy::Lazy::INIT;
  3871. unsafe {
  3872. descriptor.get(|| {
  3873. ::protobuf::reflect::EnumDescriptor::new_pb_name::<CapabilityType>(
  3874. "CapabilityType",
  3875. file_descriptor_proto(),
  3876. )
  3877. })
  3878. }
  3879. }
  3880. }
  3881. impl ::std::marker::Copy for CapabilityType {}
  3882. // Note, `Default` is implemented although default value is not 0
  3883. impl ::std::default::Default for CapabilityType {
  3884. fn default() -> Self {
  3885. CapabilityType::kSupportedContexts
  3886. }
  3887. }
  3888. impl ::protobuf::reflect::ProtobufValue for CapabilityType {
  3889. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  3890. ::protobuf::reflect::ReflectValueRef::Enum(self.descriptor())
  3891. }
  3892. }
  3893. #[derive(Clone, PartialEq, Eq, Debug, Hash)]
  3894. pub enum PlayStatus {
  3895. kPlayStatusStop = 0,
  3896. kPlayStatusPlay = 1,
  3897. kPlayStatusPause = 2,
  3898. kPlayStatusLoading = 3,
  3899. }
  3900. impl ::protobuf::ProtobufEnum for PlayStatus {
  3901. fn value(&self) -> i32 {
  3902. *self as i32
  3903. }
  3904. fn from_i32(value: i32) -> ::std::option::Option<PlayStatus> {
  3905. match value {
  3906. 0 => ::std::option::Option::Some(PlayStatus::kPlayStatusStop),
  3907. 1 => ::std::option::Option::Some(PlayStatus::kPlayStatusPlay),
  3908. 2 => ::std::option::Option::Some(PlayStatus::kPlayStatusPause),
  3909. 3 => ::std::option::Option::Some(PlayStatus::kPlayStatusLoading),
  3910. _ => ::std::option::Option::None,
  3911. }
  3912. }
  3913. fn values() -> &'static [Self] {
  3914. static values: &'static [PlayStatus] = &[
  3915. PlayStatus::kPlayStatusStop,
  3916. PlayStatus::kPlayStatusPlay,
  3917. PlayStatus::kPlayStatusPause,
  3918. PlayStatus::kPlayStatusLoading,
  3919. ];
  3920. values
  3921. }
  3922. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  3923. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> =
  3924. ::protobuf::lazy::Lazy::INIT;
  3925. unsafe {
  3926. descriptor.get(|| {
  3927. ::protobuf::reflect::EnumDescriptor::new_pb_name::<PlayStatus>(
  3928. "PlayStatus",
  3929. file_descriptor_proto(),
  3930. )
  3931. })
  3932. }
  3933. }
  3934. }
  3935. impl ::std::marker::Copy for PlayStatus {}
  3936. impl ::std::default::Default for PlayStatus {
  3937. fn default() -> Self {
  3938. PlayStatus::kPlayStatusStop
  3939. }
  3940. }
  3941. impl ::protobuf::reflect::ProtobufValue for PlayStatus {
  3942. fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
  3943. ::protobuf::reflect::ReflectValueRef::Enum(self.descriptor())
  3944. }
  3945. }
  3946. static file_descriptor_proto_data: &'static [u8] = b"\
  3947. \n\x0bspirc.proto\x12\0\"\xfd\x02\n\x05Frame\x12\x11\n\x07version\x18\
  3948. \x01\x20\x01(\rB\0\x12\x0f\n\x05ident\x18\x02\x20\x01(\tB\0\x12\x1a\n\
  3949. \x10protocol_version\x18\x03\x20\x01(\tB\0\x12\x10\n\x06seq_nr\x18\x04\
  3950. \x20\x01(\rB\0\x12\x1b\n\x03typ\x18\x05\x20\x01(\x0e2\x0c.MessageTypeB\0\
  3951. \x12$\n\x0cdevice_state\x18\x07\x20\x01(\x0b2\x0c.DeviceStateB\0\x12\x1b\
  3952. \n\x07goodbye\x18\x0b\x20\x01(\x0b2\x08.GoodbyeB\0\x12\x17\n\x05state\
  3953. \x18\x0c\x20\x01(\x0b2\x06.StateB\0\x12\x12\n\x08position\x18\r\x20\x01(\
  3954. \rB\0\x12\x10\n\x06volume\x18\x0e\x20\x01(\rB\0\x12\x19\n\x0fstate_updat\
  3955. e_id\x18\x11\x20\x01(\x03B\0\x12\x13\n\trecipient\x18\x12\x20\x03(\tB\0\
  3956. \x12\x1e\n\x14context_player_state\x18\x13\x20\x01(\x0cB\0\x12\x12\n\x08\
  3957. new_name\x18\x14\x20\x01(\tB\0\x12\x1d\n\x08metadata\x18\x19\x20\x01(\
  3958. \x0b2\t.MetadataB\0:\0\"\x9f\x02\n\x0bDeviceState\x12\x14\n\nsw_version\
  3959. \x18\x01\x20\x01(\tB\0\x12\x13\n\tis_active\x18\n\x20\x01(\x08B\0\x12\
  3960. \x12\n\x08can_play\x18\x0b\x20\x01(\x08B\0\x12\x10\n\x06volume\x18\x0c\
  3961. \x20\x01(\rB\0\x12\x0e\n\x04name\x18\r\x20\x01(\tB\0\x12\x14\n\nerror_co\
  3962. de\x18\x0e\x20\x01(\rB\0\x12\x1a\n\x10became_active_at\x18\x0f\x20\x01(\
  3963. \x03B\0\x12\x17\n\rerror_message\x18\x10\x20\x01(\tB\0\x12#\n\x0ccapabil\
  3964. ities\x18\x11\x20\x03(\x0b2\x0b.CapabilityB\0\x12\x1e\n\x14context_playe\
  3965. r_error\x18\x14\x20\x01(\tB\0\x12\x1d\n\x08metadata\x18\x19\x20\x03(\x0b\
  3966. 2\t.MetadataB\0:\0\"Y\n\nCapability\x12\x1e\n\x03typ\x18\x01\x20\x01(\
  3967. \x0e2\x0f.CapabilityTypeB\0\x12\x12\n\x08intValue\x18\x02\x20\x03(\x03B\
  3968. \0\x12\x15\n\x0bstringValue\x18\x03\x20\x03(\tB\0:\0\"\x1d\n\x07Goodbye\
  3969. \x12\x10\n\x06reason\x18\x01\x20\x01(\tB\0:\0\"\x85\x03\n\x05State\x12\
  3970. \x15\n\x0bcontext_uri\x18\x02\x20\x01(\tB\0\x12\x0f\n\x05index\x18\x03\
  3971. \x20\x01(\rB\0\x12\x15\n\x0bposition_ms\x18\x04\x20\x01(\rB\0\x12\x1d\n\
  3972. \x06status\x18\x05\x20\x01(\x0e2\x0b.PlayStatusB\0\x12\x1e\n\x14position\
  3973. _measured_at\x18\x07\x20\x01(\x04B\0\x12\x1d\n\x13context_description\
  3974. \x18\x08\x20\x01(\tB\0\x12\x11\n\x07shuffle\x18\r\x20\x01(\x08B\0\x12\
  3975. \x10\n\x06repeat\x18\x0e\x20\x01(\x08B\0\x12\x1c\n\x12last_command_ident\
  3976. \x18\x14\x20\x01(\tB\0\x12\x1c\n\x12last_command_msgid\x18\x15\x20\x01(\
  3977. \rB\0\x12\x1f\n\x15playing_from_fallback\x18\x18\x20\x01(\x08B\0\x12\r\n\
  3978. \x03row\x18\x19\x20\x01(\rB\0\x12\x1d\n\x13playing_track_index\x18\x1a\
  3979. \x20\x01(\rB\0\x12\x1a\n\x05track\x18\x1b\x20\x03(\x0b2\t.TrackRefB\0\
  3980. \x12\x11\n\x02ad\x18\x1c\x20\x01(\x0b2\x03.AdB\0:\0\"O\n\x08TrackRef\x12\
  3981. \r\n\x03gid\x18\x01\x20\x01(\x0cB\0\x12\r\n\x03uri\x18\x02\x20\x01(\tB\0\
  3982. \x12\x10\n\x06queued\x18\x03\x20\x01(\x08B\0\x12\x11\n\x07context\x18\
  3983. \x04\x20\x01(\tB\0:\0\"\xb9\x01\n\x02Ad\x12\x0e\n\x04next\x18\x01\x20\
  3984. \x01(\x05B\0\x12\x11\n\x07ogg_fid\x18\x02\x20\x01(\x0cB\0\x12\x13\n\tima\
  3985. ge_fid\x18\x03\x20\x01(\x0cB\0\x12\x12\n\x08duration\x18\x04\x20\x01(\
  3986. \x05B\0\x12\x13\n\tclick_url\x18\x05\x20\x01(\tB\0\x12\x18\n\x0eimpressi\
  3987. on_url\x18\x06\x20\x01(\tB\0\x12\x11\n\x07product\x18\x07\x20\x01(\tB\0\
  3988. \x12\x14\n\nadvertiser\x18\x08\x20\x01(\tB\0\x12\r\n\x03gid\x18\t\x20\
  3989. \x01(\x0cB\0:\0\"0\n\x08Metadata\x12\x0e\n\x04type\x18\x01\x20\x01(\tB\0\
  3990. \x12\x12\n\x08metadata\x18\x02\x20\x01(\tB\0:\0*\x8f\x04\n\x0bMessageTyp\
  3991. e\x12\x15\n\x11kMessageTypeHello\x10\x01\x12\x17\n\x13kMessageTypeGoodby\
  3992. e\x10\x02\x12\x15\n\x11kMessageTypeProbe\x10\x03\x12\x16\n\x12kMessageTy\
  3993. peNotify\x10\n\x12\x14\n\x10kMessageTypeLoad\x10\x14\x12\x14\n\x10kMessa\
  3994. geTypePlay\x10\x15\x12\x15\n\x11kMessageTypePause\x10\x16\x12\x19\n\x15k\
  3995. MessageTypePlayPause\x10\x17\x12\x14\n\x10kMessageTypeSeek\x10\x18\x12\
  3996. \x14\n\x10kMessageTypePrev\x10\x19\x12\x14\n\x10kMessageTypeNext\x10\x1a\
  3997. \x12\x16\n\x12kMessageTypeVolume\x10\x1b\x12\x17\n\x13kMessageTypeShuffl\
  3998. e\x10\x1c\x12\x16\n\x12kMessageTypeRepeat\x10\x1d\x12\x1a\n\x16kMessageT\
  3999. ypeVolumeDown\x10\x1f\x12\x18\n\x14kMessageTypeVolumeUp\x10\x20\x12\x17\
  4000. \n\x13kMessageTypeReplace\x10!\x12\x16\n\x12kMessageTypeLogout\x10\"\x12\
  4001. \x16\n\x12kMessageTypeAction\x10#\x12\x16\n\x12kMessageTypeRename\x10$\
  4002. \x12\x1f\n\x1akMessageTypeUpdateMetadata\x10\x80\x01\x1a\0*\xb4\x02\n\
  4003. \x0eCapabilityType\x12\x16\n\x12kSupportedContexts\x10\x01\x12\x10\n\x0c\
  4004. kCanBePlayer\x10\x02\x12\x14\n\x10kRestrictToLocal\x10\x03\x12\x0f\n\x0b\
  4005. kDeviceType\x10\x04\x12\x14\n\x10kGaiaEqConnectId\x10\x05\x12\x13\n\x0fk\
  4006. SupportsLogout\x10\x06\x12\x11\n\rkIsObservable\x10\x07\x12\x10\n\x0ckVo\
  4007. lumeSteps\x10\x08\x12\x13\n\x0fkSupportedTypes\x10\t\x12\x10\n\x0ckComma\
  4008. ndAcks\x10\n\x12\x13\n\x0fkSupportsRename\x10\x0b\x12\x0b\n\x07kHidden\
  4009. \x10\x0c\x12\x17\n\x13kSupportsPlaylistV2\x10\r\x12\x1d\n\x19kSupportsEx\
  4010. ternalEpisodes\x10\x0e\x1a\0*f\n\nPlayStatus\x12\x13\n\x0fkPlayStatusSto\
  4011. p\x10\0\x12\x13\n\x0fkPlayStatusPlay\x10\x01\x12\x14\n\x10kPlayStatusPau\
  4012. se\x10\x02\x12\x16\n\x12kPlayStatusLoading\x10\x03\x1a\0B\0b\x06proto2\
  4013. ";
  4014. static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<
  4015. ::protobuf::descriptor::FileDescriptorProto,
  4016. > = ::protobuf::lazy::Lazy::INIT;
  4017. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  4018. ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
  4019. }
  4020. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  4021. unsafe { file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) }
  4022. }