index.js 253 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357
  1. /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
  2. "use strict";
  3. var $protobuf = require("protobufjs/minimal");
  4. // Common aliases
  5. var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
  6. // Exported root namespace
  7. var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
  8. $root.ChannelMetadata = (function() {
  9. /**
  10. * Properties of a ChannelMetadata.
  11. * @exports IChannelMetadata
  12. * @interface IChannelMetadata
  13. * @property {string|null} [title] ChannelMetadata title
  14. * @property {string|null} [description] ChannelMetadata description
  15. * @property {boolean|null} [isPublic] ChannelMetadata isPublic
  16. * @property {string|null} [language] ChannelMetadata language
  17. * @property {number|null} [coverPhoto] ChannelMetadata coverPhoto
  18. * @property {number|null} [avatarPhoto] ChannelMetadata avatarPhoto
  19. * @property {Long|null} [category] ChannelMetadata category
  20. */
  21. /**
  22. * Constructs a new ChannelMetadata.
  23. * @exports ChannelMetadata
  24. * @classdesc Represents a ChannelMetadata.
  25. * @implements IChannelMetadata
  26. * @constructor
  27. * @param {IChannelMetadata=} [properties] Properties to set
  28. */
  29. function ChannelMetadata(properties) {
  30. if (properties)
  31. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  32. if (properties[keys[i]] != null)
  33. this[keys[i]] = properties[keys[i]];
  34. }
  35. /**
  36. * ChannelMetadata title.
  37. * @member {string} title
  38. * @memberof ChannelMetadata
  39. * @instance
  40. */
  41. ChannelMetadata.prototype.title = "";
  42. /**
  43. * ChannelMetadata description.
  44. * @member {string} description
  45. * @memberof ChannelMetadata
  46. * @instance
  47. */
  48. ChannelMetadata.prototype.description = "";
  49. /**
  50. * ChannelMetadata isPublic.
  51. * @member {boolean} isPublic
  52. * @memberof ChannelMetadata
  53. * @instance
  54. */
  55. ChannelMetadata.prototype.isPublic = false;
  56. /**
  57. * ChannelMetadata language.
  58. * @member {string} language
  59. * @memberof ChannelMetadata
  60. * @instance
  61. */
  62. ChannelMetadata.prototype.language = "";
  63. /**
  64. * ChannelMetadata coverPhoto.
  65. * @member {number} coverPhoto
  66. * @memberof ChannelMetadata
  67. * @instance
  68. */
  69. ChannelMetadata.prototype.coverPhoto = 0;
  70. /**
  71. * ChannelMetadata avatarPhoto.
  72. * @member {number} avatarPhoto
  73. * @memberof ChannelMetadata
  74. * @instance
  75. */
  76. ChannelMetadata.prototype.avatarPhoto = 0;
  77. /**
  78. * ChannelMetadata category.
  79. * @member {Long} category
  80. * @memberof ChannelMetadata
  81. * @instance
  82. */
  83. ChannelMetadata.prototype.category = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
  84. /**
  85. * Creates a new ChannelMetadata instance using the specified properties.
  86. * @function create
  87. * @memberof ChannelMetadata
  88. * @static
  89. * @param {IChannelMetadata=} [properties] Properties to set
  90. * @returns {ChannelMetadata} ChannelMetadata instance
  91. */
  92. ChannelMetadata.create = function create(properties) {
  93. return new ChannelMetadata(properties);
  94. };
  95. /**
  96. * Encodes the specified ChannelMetadata message. Does not implicitly {@link ChannelMetadata.verify|verify} messages.
  97. * @function encode
  98. * @memberof ChannelMetadata
  99. * @static
  100. * @param {IChannelMetadata} message ChannelMetadata message or plain object to encode
  101. * @param {$protobuf.Writer} [writer] Writer to encode to
  102. * @returns {$protobuf.Writer} Writer
  103. */
  104. ChannelMetadata.encode = function encode(message, writer) {
  105. if (!writer)
  106. writer = $Writer.create();
  107. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  108. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  109. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  110. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  111. if (message.isPublic != null && Object.hasOwnProperty.call(message, "isPublic"))
  112. writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isPublic);
  113. if (message.language != null && Object.hasOwnProperty.call(message, "language"))
  114. writer.uint32(/* id 4, wireType 2 =*/34).string(message.language);
  115. if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
  116. writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.coverPhoto);
  117. if (message.avatarPhoto != null && Object.hasOwnProperty.call(message, "avatarPhoto"))
  118. writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.avatarPhoto);
  119. if (message.category != null && Object.hasOwnProperty.call(message, "category"))
  120. writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.category);
  121. return writer;
  122. };
  123. /**
  124. * Encodes the specified ChannelMetadata message, length delimited. Does not implicitly {@link ChannelMetadata.verify|verify} messages.
  125. * @function encodeDelimited
  126. * @memberof ChannelMetadata
  127. * @static
  128. * @param {IChannelMetadata} message ChannelMetadata message or plain object to encode
  129. * @param {$protobuf.Writer} [writer] Writer to encode to
  130. * @returns {$protobuf.Writer} Writer
  131. */
  132. ChannelMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  133. return this.encode(message, writer).ldelim();
  134. };
  135. /**
  136. * Decodes a ChannelMetadata message from the specified reader or buffer.
  137. * @function decode
  138. * @memberof ChannelMetadata
  139. * @static
  140. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  141. * @param {number} [length] Message length if known beforehand
  142. * @returns {ChannelMetadata} ChannelMetadata
  143. * @throws {Error} If the payload is not a reader or valid buffer
  144. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  145. */
  146. ChannelMetadata.decode = function decode(reader, length) {
  147. if (!(reader instanceof $Reader))
  148. reader = $Reader.create(reader);
  149. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ChannelMetadata();
  150. while (reader.pos < end) {
  151. var tag = reader.uint32();
  152. switch (tag >>> 3) {
  153. case 1:
  154. message.title = reader.string();
  155. break;
  156. case 2:
  157. message.description = reader.string();
  158. break;
  159. case 3:
  160. message.isPublic = reader.bool();
  161. break;
  162. case 4:
  163. message.language = reader.string();
  164. break;
  165. case 5:
  166. message.coverPhoto = reader.uint32();
  167. break;
  168. case 6:
  169. message.avatarPhoto = reader.uint32();
  170. break;
  171. case 7:
  172. message.category = reader.uint64();
  173. break;
  174. default:
  175. reader.skipType(tag & 7);
  176. break;
  177. }
  178. }
  179. return message;
  180. };
  181. /**
  182. * Decodes a ChannelMetadata message from the specified reader or buffer, length delimited.
  183. * @function decodeDelimited
  184. * @memberof ChannelMetadata
  185. * @static
  186. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  187. * @returns {ChannelMetadata} ChannelMetadata
  188. * @throws {Error} If the payload is not a reader or valid buffer
  189. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  190. */
  191. ChannelMetadata.decodeDelimited = function decodeDelimited(reader) {
  192. if (!(reader instanceof $Reader))
  193. reader = new $Reader(reader);
  194. return this.decode(reader, reader.uint32());
  195. };
  196. /**
  197. * Verifies a ChannelMetadata message.
  198. * @function verify
  199. * @memberof ChannelMetadata
  200. * @static
  201. * @param {Object.<string,*>} message Plain object to verify
  202. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  203. */
  204. ChannelMetadata.verify = function verify(message) {
  205. if (typeof message !== "object" || message === null)
  206. return "object expected";
  207. if (message.title != null && message.hasOwnProperty("title"))
  208. if (!$util.isString(message.title))
  209. return "title: string expected";
  210. if (message.description != null && message.hasOwnProperty("description"))
  211. if (!$util.isString(message.description))
  212. return "description: string expected";
  213. if (message.isPublic != null && message.hasOwnProperty("isPublic"))
  214. if (typeof message.isPublic !== "boolean")
  215. return "isPublic: boolean expected";
  216. if (message.language != null && message.hasOwnProperty("language"))
  217. if (!$util.isString(message.language))
  218. return "language: string expected";
  219. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  220. if (!$util.isInteger(message.coverPhoto))
  221. return "coverPhoto: integer expected";
  222. if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
  223. if (!$util.isInteger(message.avatarPhoto))
  224. return "avatarPhoto: integer expected";
  225. if (message.category != null && message.hasOwnProperty("category"))
  226. if (!$util.isInteger(message.category) && !(message.category && $util.isInteger(message.category.low) && $util.isInteger(message.category.high)))
  227. return "category: integer|Long expected";
  228. return null;
  229. };
  230. /**
  231. * Creates a ChannelMetadata message from a plain object. Also converts values to their respective internal types.
  232. * @function fromObject
  233. * @memberof ChannelMetadata
  234. * @static
  235. * @param {Object.<string,*>} object Plain object
  236. * @returns {ChannelMetadata} ChannelMetadata
  237. */
  238. ChannelMetadata.fromObject = function fromObject(object) {
  239. if (object instanceof $root.ChannelMetadata)
  240. return object;
  241. var message = new $root.ChannelMetadata();
  242. if (object.title != null)
  243. message.title = String(object.title);
  244. if (object.description != null)
  245. message.description = String(object.description);
  246. if (object.isPublic != null)
  247. message.isPublic = Boolean(object.isPublic);
  248. if (object.language != null)
  249. message.language = String(object.language);
  250. if (object.coverPhoto != null)
  251. message.coverPhoto = object.coverPhoto >>> 0;
  252. if (object.avatarPhoto != null)
  253. message.avatarPhoto = object.avatarPhoto >>> 0;
  254. if (object.category != null)
  255. if ($util.Long)
  256. (message.category = $util.Long.fromValue(object.category)).unsigned = true;
  257. else if (typeof object.category === "string")
  258. message.category = parseInt(object.category, 10);
  259. else if (typeof object.category === "number")
  260. message.category = object.category;
  261. else if (typeof object.category === "object")
  262. message.category = new $util.LongBits(object.category.low >>> 0, object.category.high >>> 0).toNumber(true);
  263. return message;
  264. };
  265. /**
  266. * Creates a plain object from a ChannelMetadata message. Also converts values to other types if specified.
  267. * @function toObject
  268. * @memberof ChannelMetadata
  269. * @static
  270. * @param {ChannelMetadata} message ChannelMetadata
  271. * @param {$protobuf.IConversionOptions} [options] Conversion options
  272. * @returns {Object.<string,*>} Plain object
  273. */
  274. ChannelMetadata.toObject = function toObject(message, options) {
  275. if (!options)
  276. options = {};
  277. var object = {};
  278. if (options.defaults) {
  279. object.title = "";
  280. object.description = "";
  281. object.isPublic = false;
  282. object.language = "";
  283. object.coverPhoto = 0;
  284. object.avatarPhoto = 0;
  285. if ($util.Long) {
  286. var long = new $util.Long(0, 0, true);
  287. object.category = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  288. } else
  289. object.category = options.longs === String ? "0" : 0;
  290. }
  291. if (message.title != null && message.hasOwnProperty("title"))
  292. object.title = message.title;
  293. if (message.description != null && message.hasOwnProperty("description"))
  294. object.description = message.description;
  295. if (message.isPublic != null && message.hasOwnProperty("isPublic"))
  296. object.isPublic = message.isPublic;
  297. if (message.language != null && message.hasOwnProperty("language"))
  298. object.language = message.language;
  299. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  300. object.coverPhoto = message.coverPhoto;
  301. if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
  302. object.avatarPhoto = message.avatarPhoto;
  303. if (message.category != null && message.hasOwnProperty("category"))
  304. if (typeof message.category === "number")
  305. object.category = options.longs === String ? String(message.category) : message.category;
  306. else
  307. object.category = options.longs === String ? $util.Long.prototype.toString.call(message.category) : options.longs === Number ? new $util.LongBits(message.category.low >>> 0, message.category.high >>> 0).toNumber(true) : message.category;
  308. return object;
  309. };
  310. /**
  311. * Converts this ChannelMetadata to JSON.
  312. * @function toJSON
  313. * @memberof ChannelMetadata
  314. * @instance
  315. * @returns {Object.<string,*>} JSON object
  316. */
  317. ChannelMetadata.prototype.toJSON = function toJSON() {
  318. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  319. };
  320. return ChannelMetadata;
  321. })();
  322. $root.ChannelCategoryMetadata = (function() {
  323. /**
  324. * Properties of a ChannelCategoryMetadata.
  325. * @exports IChannelCategoryMetadata
  326. * @interface IChannelCategoryMetadata
  327. * @property {string|null} [name] ChannelCategoryMetadata name
  328. */
  329. /**
  330. * Constructs a new ChannelCategoryMetadata.
  331. * @exports ChannelCategoryMetadata
  332. * @classdesc Represents a ChannelCategoryMetadata.
  333. * @implements IChannelCategoryMetadata
  334. * @constructor
  335. * @param {IChannelCategoryMetadata=} [properties] Properties to set
  336. */
  337. function ChannelCategoryMetadata(properties) {
  338. if (properties)
  339. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  340. if (properties[keys[i]] != null)
  341. this[keys[i]] = properties[keys[i]];
  342. }
  343. /**
  344. * ChannelCategoryMetadata name.
  345. * @member {string} name
  346. * @memberof ChannelCategoryMetadata
  347. * @instance
  348. */
  349. ChannelCategoryMetadata.prototype.name = "";
  350. /**
  351. * Creates a new ChannelCategoryMetadata instance using the specified properties.
  352. * @function create
  353. * @memberof ChannelCategoryMetadata
  354. * @static
  355. * @param {IChannelCategoryMetadata=} [properties] Properties to set
  356. * @returns {ChannelCategoryMetadata} ChannelCategoryMetadata instance
  357. */
  358. ChannelCategoryMetadata.create = function create(properties) {
  359. return new ChannelCategoryMetadata(properties);
  360. };
  361. /**
  362. * Encodes the specified ChannelCategoryMetadata message. Does not implicitly {@link ChannelCategoryMetadata.verify|verify} messages.
  363. * @function encode
  364. * @memberof ChannelCategoryMetadata
  365. * @static
  366. * @param {IChannelCategoryMetadata} message ChannelCategoryMetadata message or plain object to encode
  367. * @param {$protobuf.Writer} [writer] Writer to encode to
  368. * @returns {$protobuf.Writer} Writer
  369. */
  370. ChannelCategoryMetadata.encode = function encode(message, writer) {
  371. if (!writer)
  372. writer = $Writer.create();
  373. if (message.name != null && Object.hasOwnProperty.call(message, "name"))
  374. writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
  375. return writer;
  376. };
  377. /**
  378. * Encodes the specified ChannelCategoryMetadata message, length delimited. Does not implicitly {@link ChannelCategoryMetadata.verify|verify} messages.
  379. * @function encodeDelimited
  380. * @memberof ChannelCategoryMetadata
  381. * @static
  382. * @param {IChannelCategoryMetadata} message ChannelCategoryMetadata message or plain object to encode
  383. * @param {$protobuf.Writer} [writer] Writer to encode to
  384. * @returns {$protobuf.Writer} Writer
  385. */
  386. ChannelCategoryMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  387. return this.encode(message, writer).ldelim();
  388. };
  389. /**
  390. * Decodes a ChannelCategoryMetadata message from the specified reader or buffer.
  391. * @function decode
  392. * @memberof ChannelCategoryMetadata
  393. * @static
  394. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  395. * @param {number} [length] Message length if known beforehand
  396. * @returns {ChannelCategoryMetadata} ChannelCategoryMetadata
  397. * @throws {Error} If the payload is not a reader or valid buffer
  398. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  399. */
  400. ChannelCategoryMetadata.decode = function decode(reader, length) {
  401. if (!(reader instanceof $Reader))
  402. reader = $Reader.create(reader);
  403. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ChannelCategoryMetadata();
  404. while (reader.pos < end) {
  405. var tag = reader.uint32();
  406. switch (tag >>> 3) {
  407. case 1:
  408. message.name = reader.string();
  409. break;
  410. default:
  411. reader.skipType(tag & 7);
  412. break;
  413. }
  414. }
  415. return message;
  416. };
  417. /**
  418. * Decodes a ChannelCategoryMetadata message from the specified reader or buffer, length delimited.
  419. * @function decodeDelimited
  420. * @memberof ChannelCategoryMetadata
  421. * @static
  422. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  423. * @returns {ChannelCategoryMetadata} ChannelCategoryMetadata
  424. * @throws {Error} If the payload is not a reader or valid buffer
  425. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  426. */
  427. ChannelCategoryMetadata.decodeDelimited = function decodeDelimited(reader) {
  428. if (!(reader instanceof $Reader))
  429. reader = new $Reader(reader);
  430. return this.decode(reader, reader.uint32());
  431. };
  432. /**
  433. * Verifies a ChannelCategoryMetadata message.
  434. * @function verify
  435. * @memberof ChannelCategoryMetadata
  436. * @static
  437. * @param {Object.<string,*>} message Plain object to verify
  438. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  439. */
  440. ChannelCategoryMetadata.verify = function verify(message) {
  441. if (typeof message !== "object" || message === null)
  442. return "object expected";
  443. if (message.name != null && message.hasOwnProperty("name"))
  444. if (!$util.isString(message.name))
  445. return "name: string expected";
  446. return null;
  447. };
  448. /**
  449. * Creates a ChannelCategoryMetadata message from a plain object. Also converts values to their respective internal types.
  450. * @function fromObject
  451. * @memberof ChannelCategoryMetadata
  452. * @static
  453. * @param {Object.<string,*>} object Plain object
  454. * @returns {ChannelCategoryMetadata} ChannelCategoryMetadata
  455. */
  456. ChannelCategoryMetadata.fromObject = function fromObject(object) {
  457. if (object instanceof $root.ChannelCategoryMetadata)
  458. return object;
  459. var message = new $root.ChannelCategoryMetadata();
  460. if (object.name != null)
  461. message.name = String(object.name);
  462. return message;
  463. };
  464. /**
  465. * Creates a plain object from a ChannelCategoryMetadata message. Also converts values to other types if specified.
  466. * @function toObject
  467. * @memberof ChannelCategoryMetadata
  468. * @static
  469. * @param {ChannelCategoryMetadata} message ChannelCategoryMetadata
  470. * @param {$protobuf.IConversionOptions} [options] Conversion options
  471. * @returns {Object.<string,*>} Plain object
  472. */
  473. ChannelCategoryMetadata.toObject = function toObject(message, options) {
  474. if (!options)
  475. options = {};
  476. var object = {};
  477. if (options.defaults)
  478. object.name = "";
  479. if (message.name != null && message.hasOwnProperty("name"))
  480. object.name = message.name;
  481. return object;
  482. };
  483. /**
  484. * Converts this ChannelCategoryMetadata to JSON.
  485. * @function toJSON
  486. * @memberof ChannelCategoryMetadata
  487. * @instance
  488. * @returns {Object.<string,*>} JSON object
  489. */
  490. ChannelCategoryMetadata.prototype.toJSON = function toJSON() {
  491. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  492. };
  493. return ChannelCategoryMetadata;
  494. })();
  495. $root.CouncilCandidacyNoteMetadata = (function() {
  496. /**
  497. * Properties of a CouncilCandidacyNoteMetadata.
  498. * @exports ICouncilCandidacyNoteMetadata
  499. * @interface ICouncilCandidacyNoteMetadata
  500. * @property {string|null} [header] CouncilCandidacyNoteMetadata header
  501. * @property {Array.<string>|null} [bulletPoints] CouncilCandidacyNoteMetadata bulletPoints
  502. * @property {string|null} [bannerImageUri] CouncilCandidacyNoteMetadata bannerImageUri
  503. * @property {string|null} [description] CouncilCandidacyNoteMetadata description
  504. */
  505. /**
  506. * Constructs a new CouncilCandidacyNoteMetadata.
  507. * @exports CouncilCandidacyNoteMetadata
  508. * @classdesc Represents a CouncilCandidacyNoteMetadata.
  509. * @implements ICouncilCandidacyNoteMetadata
  510. * @constructor
  511. * @param {ICouncilCandidacyNoteMetadata=} [properties] Properties to set
  512. */
  513. function CouncilCandidacyNoteMetadata(properties) {
  514. this.bulletPoints = [];
  515. if (properties)
  516. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  517. if (properties[keys[i]] != null)
  518. this[keys[i]] = properties[keys[i]];
  519. }
  520. /**
  521. * CouncilCandidacyNoteMetadata header.
  522. * @member {string} header
  523. * @memberof CouncilCandidacyNoteMetadata
  524. * @instance
  525. */
  526. CouncilCandidacyNoteMetadata.prototype.header = "";
  527. /**
  528. * CouncilCandidacyNoteMetadata bulletPoints.
  529. * @member {Array.<string>} bulletPoints
  530. * @memberof CouncilCandidacyNoteMetadata
  531. * @instance
  532. */
  533. CouncilCandidacyNoteMetadata.prototype.bulletPoints = $util.emptyArray;
  534. /**
  535. * CouncilCandidacyNoteMetadata bannerImageUri.
  536. * @member {string} bannerImageUri
  537. * @memberof CouncilCandidacyNoteMetadata
  538. * @instance
  539. */
  540. CouncilCandidacyNoteMetadata.prototype.bannerImageUri = "";
  541. /**
  542. * CouncilCandidacyNoteMetadata description.
  543. * @member {string} description
  544. * @memberof CouncilCandidacyNoteMetadata
  545. * @instance
  546. */
  547. CouncilCandidacyNoteMetadata.prototype.description = "";
  548. /**
  549. * Creates a new CouncilCandidacyNoteMetadata instance using the specified properties.
  550. * @function create
  551. * @memberof CouncilCandidacyNoteMetadata
  552. * @static
  553. * @param {ICouncilCandidacyNoteMetadata=} [properties] Properties to set
  554. * @returns {CouncilCandidacyNoteMetadata} CouncilCandidacyNoteMetadata instance
  555. */
  556. CouncilCandidacyNoteMetadata.create = function create(properties) {
  557. return new CouncilCandidacyNoteMetadata(properties);
  558. };
  559. /**
  560. * Encodes the specified CouncilCandidacyNoteMetadata message. Does not implicitly {@link CouncilCandidacyNoteMetadata.verify|verify} messages.
  561. * @function encode
  562. * @memberof CouncilCandidacyNoteMetadata
  563. * @static
  564. * @param {ICouncilCandidacyNoteMetadata} message CouncilCandidacyNoteMetadata message or plain object to encode
  565. * @param {$protobuf.Writer} [writer] Writer to encode to
  566. * @returns {$protobuf.Writer} Writer
  567. */
  568. CouncilCandidacyNoteMetadata.encode = function encode(message, writer) {
  569. if (!writer)
  570. writer = $Writer.create();
  571. if (message.header != null && Object.hasOwnProperty.call(message, "header"))
  572. writer.uint32(/* id 1, wireType 2 =*/10).string(message.header);
  573. if (message.bulletPoints != null && message.bulletPoints.length)
  574. for (var i = 0; i < message.bulletPoints.length; ++i)
  575. writer.uint32(/* id 2, wireType 2 =*/18).string(message.bulletPoints[i]);
  576. if (message.bannerImageUri != null && Object.hasOwnProperty.call(message, "bannerImageUri"))
  577. writer.uint32(/* id 3, wireType 2 =*/26).string(message.bannerImageUri);
  578. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  579. writer.uint32(/* id 4, wireType 2 =*/34).string(message.description);
  580. return writer;
  581. };
  582. /**
  583. * Encodes the specified CouncilCandidacyNoteMetadata message, length delimited. Does not implicitly {@link CouncilCandidacyNoteMetadata.verify|verify} messages.
  584. * @function encodeDelimited
  585. * @memberof CouncilCandidacyNoteMetadata
  586. * @static
  587. * @param {ICouncilCandidacyNoteMetadata} message CouncilCandidacyNoteMetadata message or plain object to encode
  588. * @param {$protobuf.Writer} [writer] Writer to encode to
  589. * @returns {$protobuf.Writer} Writer
  590. */
  591. CouncilCandidacyNoteMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  592. return this.encode(message, writer).ldelim();
  593. };
  594. /**
  595. * Decodes a CouncilCandidacyNoteMetadata message from the specified reader or buffer.
  596. * @function decode
  597. * @memberof CouncilCandidacyNoteMetadata
  598. * @static
  599. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  600. * @param {number} [length] Message length if known beforehand
  601. * @returns {CouncilCandidacyNoteMetadata} CouncilCandidacyNoteMetadata
  602. * @throws {Error} If the payload is not a reader or valid buffer
  603. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  604. */
  605. CouncilCandidacyNoteMetadata.decode = function decode(reader, length) {
  606. if (!(reader instanceof $Reader))
  607. reader = $Reader.create(reader);
  608. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CouncilCandidacyNoteMetadata();
  609. while (reader.pos < end) {
  610. var tag = reader.uint32();
  611. switch (tag >>> 3) {
  612. case 1:
  613. message.header = reader.string();
  614. break;
  615. case 2:
  616. if (!(message.bulletPoints && message.bulletPoints.length))
  617. message.bulletPoints = [];
  618. message.bulletPoints.push(reader.string());
  619. break;
  620. case 3:
  621. message.bannerImageUri = reader.string();
  622. break;
  623. case 4:
  624. message.description = reader.string();
  625. break;
  626. default:
  627. reader.skipType(tag & 7);
  628. break;
  629. }
  630. }
  631. return message;
  632. };
  633. /**
  634. * Decodes a CouncilCandidacyNoteMetadata message from the specified reader or buffer, length delimited.
  635. * @function decodeDelimited
  636. * @memberof CouncilCandidacyNoteMetadata
  637. * @static
  638. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  639. * @returns {CouncilCandidacyNoteMetadata} CouncilCandidacyNoteMetadata
  640. * @throws {Error} If the payload is not a reader or valid buffer
  641. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  642. */
  643. CouncilCandidacyNoteMetadata.decodeDelimited = function decodeDelimited(reader) {
  644. if (!(reader instanceof $Reader))
  645. reader = new $Reader(reader);
  646. return this.decode(reader, reader.uint32());
  647. };
  648. /**
  649. * Verifies a CouncilCandidacyNoteMetadata message.
  650. * @function verify
  651. * @memberof CouncilCandidacyNoteMetadata
  652. * @static
  653. * @param {Object.<string,*>} message Plain object to verify
  654. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  655. */
  656. CouncilCandidacyNoteMetadata.verify = function verify(message) {
  657. if (typeof message !== "object" || message === null)
  658. return "object expected";
  659. if (message.header != null && message.hasOwnProperty("header"))
  660. if (!$util.isString(message.header))
  661. return "header: string expected";
  662. if (message.bulletPoints != null && message.hasOwnProperty("bulletPoints")) {
  663. if (!Array.isArray(message.bulletPoints))
  664. return "bulletPoints: array expected";
  665. for (var i = 0; i < message.bulletPoints.length; ++i)
  666. if (!$util.isString(message.bulletPoints[i]))
  667. return "bulletPoints: string[] expected";
  668. }
  669. if (message.bannerImageUri != null && message.hasOwnProperty("bannerImageUri"))
  670. if (!$util.isString(message.bannerImageUri))
  671. return "bannerImageUri: string expected";
  672. if (message.description != null && message.hasOwnProperty("description"))
  673. if (!$util.isString(message.description))
  674. return "description: string expected";
  675. return null;
  676. };
  677. /**
  678. * Creates a CouncilCandidacyNoteMetadata message from a plain object. Also converts values to their respective internal types.
  679. * @function fromObject
  680. * @memberof CouncilCandidacyNoteMetadata
  681. * @static
  682. * @param {Object.<string,*>} object Plain object
  683. * @returns {CouncilCandidacyNoteMetadata} CouncilCandidacyNoteMetadata
  684. */
  685. CouncilCandidacyNoteMetadata.fromObject = function fromObject(object) {
  686. if (object instanceof $root.CouncilCandidacyNoteMetadata)
  687. return object;
  688. var message = new $root.CouncilCandidacyNoteMetadata();
  689. if (object.header != null)
  690. message.header = String(object.header);
  691. if (object.bulletPoints) {
  692. if (!Array.isArray(object.bulletPoints))
  693. throw TypeError(".CouncilCandidacyNoteMetadata.bulletPoints: array expected");
  694. message.bulletPoints = [];
  695. for (var i = 0; i < object.bulletPoints.length; ++i)
  696. message.bulletPoints[i] = String(object.bulletPoints[i]);
  697. }
  698. if (object.bannerImageUri != null)
  699. message.bannerImageUri = String(object.bannerImageUri);
  700. if (object.description != null)
  701. message.description = String(object.description);
  702. return message;
  703. };
  704. /**
  705. * Creates a plain object from a CouncilCandidacyNoteMetadata message. Also converts values to other types if specified.
  706. * @function toObject
  707. * @memberof CouncilCandidacyNoteMetadata
  708. * @static
  709. * @param {CouncilCandidacyNoteMetadata} message CouncilCandidacyNoteMetadata
  710. * @param {$protobuf.IConversionOptions} [options] Conversion options
  711. * @returns {Object.<string,*>} Plain object
  712. */
  713. CouncilCandidacyNoteMetadata.toObject = function toObject(message, options) {
  714. if (!options)
  715. options = {};
  716. var object = {};
  717. if (options.arrays || options.defaults)
  718. object.bulletPoints = [];
  719. if (options.defaults) {
  720. object.header = "";
  721. object.bannerImageUri = "";
  722. object.description = "";
  723. }
  724. if (message.header != null && message.hasOwnProperty("header"))
  725. object.header = message.header;
  726. if (message.bulletPoints && message.bulletPoints.length) {
  727. object.bulletPoints = [];
  728. for (var j = 0; j < message.bulletPoints.length; ++j)
  729. object.bulletPoints[j] = message.bulletPoints[j];
  730. }
  731. if (message.bannerImageUri != null && message.hasOwnProperty("bannerImageUri"))
  732. object.bannerImageUri = message.bannerImageUri;
  733. if (message.description != null && message.hasOwnProperty("description"))
  734. object.description = message.description;
  735. return object;
  736. };
  737. /**
  738. * Converts this CouncilCandidacyNoteMetadata to JSON.
  739. * @function toJSON
  740. * @memberof CouncilCandidacyNoteMetadata
  741. * @instance
  742. * @returns {Object.<string,*>} JSON object
  743. */
  744. CouncilCandidacyNoteMetadata.prototype.toJSON = function toJSON() {
  745. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  746. };
  747. return CouncilCandidacyNoteMetadata;
  748. })();
  749. $root.ForumPostReaction = (function() {
  750. /**
  751. * Properties of a ForumPostReaction.
  752. * @exports IForumPostReaction
  753. * @interface IForumPostReaction
  754. */
  755. /**
  756. * Constructs a new ForumPostReaction.
  757. * @exports ForumPostReaction
  758. * @classdesc Represents a ForumPostReaction.
  759. * @implements IForumPostReaction
  760. * @constructor
  761. * @param {IForumPostReaction=} [properties] Properties to set
  762. */
  763. function ForumPostReaction(properties) {
  764. if (properties)
  765. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  766. if (properties[keys[i]] != null)
  767. this[keys[i]] = properties[keys[i]];
  768. }
  769. /**
  770. * Creates a new ForumPostReaction instance using the specified properties.
  771. * @function create
  772. * @memberof ForumPostReaction
  773. * @static
  774. * @param {IForumPostReaction=} [properties] Properties to set
  775. * @returns {ForumPostReaction} ForumPostReaction instance
  776. */
  777. ForumPostReaction.create = function create(properties) {
  778. return new ForumPostReaction(properties);
  779. };
  780. /**
  781. * Encodes the specified ForumPostReaction message. Does not implicitly {@link ForumPostReaction.verify|verify} messages.
  782. * @function encode
  783. * @memberof ForumPostReaction
  784. * @static
  785. * @param {IForumPostReaction} message ForumPostReaction message or plain object to encode
  786. * @param {$protobuf.Writer} [writer] Writer to encode to
  787. * @returns {$protobuf.Writer} Writer
  788. */
  789. ForumPostReaction.encode = function encode(message, writer) {
  790. if (!writer)
  791. writer = $Writer.create();
  792. return writer;
  793. };
  794. /**
  795. * Encodes the specified ForumPostReaction message, length delimited. Does not implicitly {@link ForumPostReaction.verify|verify} messages.
  796. * @function encodeDelimited
  797. * @memberof ForumPostReaction
  798. * @static
  799. * @param {IForumPostReaction} message ForumPostReaction message or plain object to encode
  800. * @param {$protobuf.Writer} [writer] Writer to encode to
  801. * @returns {$protobuf.Writer} Writer
  802. */
  803. ForumPostReaction.encodeDelimited = function encodeDelimited(message, writer) {
  804. return this.encode(message, writer).ldelim();
  805. };
  806. /**
  807. * Decodes a ForumPostReaction message from the specified reader or buffer.
  808. * @function decode
  809. * @memberof ForumPostReaction
  810. * @static
  811. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  812. * @param {number} [length] Message length if known beforehand
  813. * @returns {ForumPostReaction} ForumPostReaction
  814. * @throws {Error} If the payload is not a reader or valid buffer
  815. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  816. */
  817. ForumPostReaction.decode = function decode(reader, length) {
  818. if (!(reader instanceof $Reader))
  819. reader = $Reader.create(reader);
  820. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ForumPostReaction();
  821. while (reader.pos < end) {
  822. var tag = reader.uint32();
  823. switch (tag >>> 3) {
  824. default:
  825. reader.skipType(tag & 7);
  826. break;
  827. }
  828. }
  829. return message;
  830. };
  831. /**
  832. * Decodes a ForumPostReaction message from the specified reader or buffer, length delimited.
  833. * @function decodeDelimited
  834. * @memberof ForumPostReaction
  835. * @static
  836. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  837. * @returns {ForumPostReaction} ForumPostReaction
  838. * @throws {Error} If the payload is not a reader or valid buffer
  839. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  840. */
  841. ForumPostReaction.decodeDelimited = function decodeDelimited(reader) {
  842. if (!(reader instanceof $Reader))
  843. reader = new $Reader(reader);
  844. return this.decode(reader, reader.uint32());
  845. };
  846. /**
  847. * Verifies a ForumPostReaction message.
  848. * @function verify
  849. * @memberof ForumPostReaction
  850. * @static
  851. * @param {Object.<string,*>} message Plain object to verify
  852. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  853. */
  854. ForumPostReaction.verify = function verify(message) {
  855. if (typeof message !== "object" || message === null)
  856. return "object expected";
  857. return null;
  858. };
  859. /**
  860. * Creates a ForumPostReaction message from a plain object. Also converts values to their respective internal types.
  861. * @function fromObject
  862. * @memberof ForumPostReaction
  863. * @static
  864. * @param {Object.<string,*>} object Plain object
  865. * @returns {ForumPostReaction} ForumPostReaction
  866. */
  867. ForumPostReaction.fromObject = function fromObject(object) {
  868. if (object instanceof $root.ForumPostReaction)
  869. return object;
  870. return new $root.ForumPostReaction();
  871. };
  872. /**
  873. * Creates a plain object from a ForumPostReaction message. Also converts values to other types if specified.
  874. * @function toObject
  875. * @memberof ForumPostReaction
  876. * @static
  877. * @param {ForumPostReaction} message ForumPostReaction
  878. * @param {$protobuf.IConversionOptions} [options] Conversion options
  879. * @returns {Object.<string,*>} Plain object
  880. */
  881. ForumPostReaction.toObject = function toObject() {
  882. return {};
  883. };
  884. /**
  885. * Converts this ForumPostReaction to JSON.
  886. * @function toJSON
  887. * @memberof ForumPostReaction
  888. * @instance
  889. * @returns {Object.<string,*>} JSON object
  890. */
  891. ForumPostReaction.prototype.toJSON = function toJSON() {
  892. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  893. };
  894. /**
  895. * Reaction enum.
  896. * @name ForumPostReaction.Reaction
  897. * @enum {number}
  898. * @property {number} CANCEL=0 CANCEL value
  899. * @property {number} LIKE=1 LIKE value
  900. */
  901. ForumPostReaction.Reaction = (function() {
  902. var valuesById = {}, values = Object.create(valuesById);
  903. values[valuesById[0] = "CANCEL"] = 0;
  904. values[valuesById[1] = "LIKE"] = 1;
  905. return values;
  906. })();
  907. return ForumPostReaction;
  908. })();
  909. $root.ForumPostMetadata = (function() {
  910. /**
  911. * Properties of a ForumPostMetadata.
  912. * @exports IForumPostMetadata
  913. * @interface IForumPostMetadata
  914. * @property {string|null} [text] ForumPostMetadata text
  915. * @property {number|null} [repliesTo] ForumPostMetadata repliesTo
  916. */
  917. /**
  918. * Constructs a new ForumPostMetadata.
  919. * @exports ForumPostMetadata
  920. * @classdesc Represents a ForumPostMetadata.
  921. * @implements IForumPostMetadata
  922. * @constructor
  923. * @param {IForumPostMetadata=} [properties] Properties to set
  924. */
  925. function ForumPostMetadata(properties) {
  926. if (properties)
  927. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  928. if (properties[keys[i]] != null)
  929. this[keys[i]] = properties[keys[i]];
  930. }
  931. /**
  932. * ForumPostMetadata text.
  933. * @member {string} text
  934. * @memberof ForumPostMetadata
  935. * @instance
  936. */
  937. ForumPostMetadata.prototype.text = "";
  938. /**
  939. * ForumPostMetadata repliesTo.
  940. * @member {number} repliesTo
  941. * @memberof ForumPostMetadata
  942. * @instance
  943. */
  944. ForumPostMetadata.prototype.repliesTo = 0;
  945. /**
  946. * Creates a new ForumPostMetadata instance using the specified properties.
  947. * @function create
  948. * @memberof ForumPostMetadata
  949. * @static
  950. * @param {IForumPostMetadata=} [properties] Properties to set
  951. * @returns {ForumPostMetadata} ForumPostMetadata instance
  952. */
  953. ForumPostMetadata.create = function create(properties) {
  954. return new ForumPostMetadata(properties);
  955. };
  956. /**
  957. * Encodes the specified ForumPostMetadata message. Does not implicitly {@link ForumPostMetadata.verify|verify} messages.
  958. * @function encode
  959. * @memberof ForumPostMetadata
  960. * @static
  961. * @param {IForumPostMetadata} message ForumPostMetadata message or plain object to encode
  962. * @param {$protobuf.Writer} [writer] Writer to encode to
  963. * @returns {$protobuf.Writer} Writer
  964. */
  965. ForumPostMetadata.encode = function encode(message, writer) {
  966. if (!writer)
  967. writer = $Writer.create();
  968. if (message.text != null && Object.hasOwnProperty.call(message, "text"))
  969. writer.uint32(/* id 1, wireType 2 =*/10).string(message.text);
  970. if (message.repliesTo != null && Object.hasOwnProperty.call(message, "repliesTo"))
  971. writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.repliesTo);
  972. return writer;
  973. };
  974. /**
  975. * Encodes the specified ForumPostMetadata message, length delimited. Does not implicitly {@link ForumPostMetadata.verify|verify} messages.
  976. * @function encodeDelimited
  977. * @memberof ForumPostMetadata
  978. * @static
  979. * @param {IForumPostMetadata} message ForumPostMetadata message or plain object to encode
  980. * @param {$protobuf.Writer} [writer] Writer to encode to
  981. * @returns {$protobuf.Writer} Writer
  982. */
  983. ForumPostMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  984. return this.encode(message, writer).ldelim();
  985. };
  986. /**
  987. * Decodes a ForumPostMetadata message from the specified reader or buffer.
  988. * @function decode
  989. * @memberof ForumPostMetadata
  990. * @static
  991. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  992. * @param {number} [length] Message length if known beforehand
  993. * @returns {ForumPostMetadata} ForumPostMetadata
  994. * @throws {Error} If the payload is not a reader or valid buffer
  995. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  996. */
  997. ForumPostMetadata.decode = function decode(reader, length) {
  998. if (!(reader instanceof $Reader))
  999. reader = $Reader.create(reader);
  1000. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ForumPostMetadata();
  1001. while (reader.pos < end) {
  1002. var tag = reader.uint32();
  1003. switch (tag >>> 3) {
  1004. case 1:
  1005. message.text = reader.string();
  1006. break;
  1007. case 2:
  1008. message.repliesTo = reader.uint32();
  1009. break;
  1010. default:
  1011. reader.skipType(tag & 7);
  1012. break;
  1013. }
  1014. }
  1015. return message;
  1016. };
  1017. /**
  1018. * Decodes a ForumPostMetadata message from the specified reader or buffer, length delimited.
  1019. * @function decodeDelimited
  1020. * @memberof ForumPostMetadata
  1021. * @static
  1022. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1023. * @returns {ForumPostMetadata} ForumPostMetadata
  1024. * @throws {Error} If the payload is not a reader or valid buffer
  1025. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1026. */
  1027. ForumPostMetadata.decodeDelimited = function decodeDelimited(reader) {
  1028. if (!(reader instanceof $Reader))
  1029. reader = new $Reader(reader);
  1030. return this.decode(reader, reader.uint32());
  1031. };
  1032. /**
  1033. * Verifies a ForumPostMetadata message.
  1034. * @function verify
  1035. * @memberof ForumPostMetadata
  1036. * @static
  1037. * @param {Object.<string,*>} message Plain object to verify
  1038. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1039. */
  1040. ForumPostMetadata.verify = function verify(message) {
  1041. if (typeof message !== "object" || message === null)
  1042. return "object expected";
  1043. if (message.text != null && message.hasOwnProperty("text"))
  1044. if (!$util.isString(message.text))
  1045. return "text: string expected";
  1046. if (message.repliesTo != null && message.hasOwnProperty("repliesTo"))
  1047. if (!$util.isInteger(message.repliesTo))
  1048. return "repliesTo: integer expected";
  1049. return null;
  1050. };
  1051. /**
  1052. * Creates a ForumPostMetadata message from a plain object. Also converts values to their respective internal types.
  1053. * @function fromObject
  1054. * @memberof ForumPostMetadata
  1055. * @static
  1056. * @param {Object.<string,*>} object Plain object
  1057. * @returns {ForumPostMetadata} ForumPostMetadata
  1058. */
  1059. ForumPostMetadata.fromObject = function fromObject(object) {
  1060. if (object instanceof $root.ForumPostMetadata)
  1061. return object;
  1062. var message = new $root.ForumPostMetadata();
  1063. if (object.text != null)
  1064. message.text = String(object.text);
  1065. if (object.repliesTo != null)
  1066. message.repliesTo = object.repliesTo >>> 0;
  1067. return message;
  1068. };
  1069. /**
  1070. * Creates a plain object from a ForumPostMetadata message. Also converts values to other types if specified.
  1071. * @function toObject
  1072. * @memberof ForumPostMetadata
  1073. * @static
  1074. * @param {ForumPostMetadata} message ForumPostMetadata
  1075. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1076. * @returns {Object.<string,*>} Plain object
  1077. */
  1078. ForumPostMetadata.toObject = function toObject(message, options) {
  1079. if (!options)
  1080. options = {};
  1081. var object = {};
  1082. if (options.defaults) {
  1083. object.text = "";
  1084. object.repliesTo = 0;
  1085. }
  1086. if (message.text != null && message.hasOwnProperty("text"))
  1087. object.text = message.text;
  1088. if (message.repliesTo != null && message.hasOwnProperty("repliesTo"))
  1089. object.repliesTo = message.repliesTo;
  1090. return object;
  1091. };
  1092. /**
  1093. * Converts this ForumPostMetadata to JSON.
  1094. * @function toJSON
  1095. * @memberof ForumPostMetadata
  1096. * @instance
  1097. * @returns {Object.<string,*>} JSON object
  1098. */
  1099. ForumPostMetadata.prototype.toJSON = function toJSON() {
  1100. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1101. };
  1102. return ForumPostMetadata;
  1103. })();
  1104. $root.ForumThreadMetadata = (function() {
  1105. /**
  1106. * Properties of a ForumThreadMetadata.
  1107. * @exports IForumThreadMetadata
  1108. * @interface IForumThreadMetadata
  1109. * @property {string|null} [title] ForumThreadMetadata title
  1110. * @property {Array.<string>|null} [tags] ForumThreadMetadata tags
  1111. */
  1112. /**
  1113. * Constructs a new ForumThreadMetadata.
  1114. * @exports ForumThreadMetadata
  1115. * @classdesc Represents a ForumThreadMetadata.
  1116. * @implements IForumThreadMetadata
  1117. * @constructor
  1118. * @param {IForumThreadMetadata=} [properties] Properties to set
  1119. */
  1120. function ForumThreadMetadata(properties) {
  1121. this.tags = [];
  1122. if (properties)
  1123. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1124. if (properties[keys[i]] != null)
  1125. this[keys[i]] = properties[keys[i]];
  1126. }
  1127. /**
  1128. * ForumThreadMetadata title.
  1129. * @member {string} title
  1130. * @memberof ForumThreadMetadata
  1131. * @instance
  1132. */
  1133. ForumThreadMetadata.prototype.title = "";
  1134. /**
  1135. * ForumThreadMetadata tags.
  1136. * @member {Array.<string>} tags
  1137. * @memberof ForumThreadMetadata
  1138. * @instance
  1139. */
  1140. ForumThreadMetadata.prototype.tags = $util.emptyArray;
  1141. /**
  1142. * Creates a new ForumThreadMetadata instance using the specified properties.
  1143. * @function create
  1144. * @memberof ForumThreadMetadata
  1145. * @static
  1146. * @param {IForumThreadMetadata=} [properties] Properties to set
  1147. * @returns {ForumThreadMetadata} ForumThreadMetadata instance
  1148. */
  1149. ForumThreadMetadata.create = function create(properties) {
  1150. return new ForumThreadMetadata(properties);
  1151. };
  1152. /**
  1153. * Encodes the specified ForumThreadMetadata message. Does not implicitly {@link ForumThreadMetadata.verify|verify} messages.
  1154. * @function encode
  1155. * @memberof ForumThreadMetadata
  1156. * @static
  1157. * @param {IForumThreadMetadata} message ForumThreadMetadata message or plain object to encode
  1158. * @param {$protobuf.Writer} [writer] Writer to encode to
  1159. * @returns {$protobuf.Writer} Writer
  1160. */
  1161. ForumThreadMetadata.encode = function encode(message, writer) {
  1162. if (!writer)
  1163. writer = $Writer.create();
  1164. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  1165. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  1166. if (message.tags != null && message.tags.length)
  1167. for (var i = 0; i < message.tags.length; ++i)
  1168. writer.uint32(/* id 2, wireType 2 =*/18).string(message.tags[i]);
  1169. return writer;
  1170. };
  1171. /**
  1172. * Encodes the specified ForumThreadMetadata message, length delimited. Does not implicitly {@link ForumThreadMetadata.verify|verify} messages.
  1173. * @function encodeDelimited
  1174. * @memberof ForumThreadMetadata
  1175. * @static
  1176. * @param {IForumThreadMetadata} message ForumThreadMetadata message or plain object to encode
  1177. * @param {$protobuf.Writer} [writer] Writer to encode to
  1178. * @returns {$protobuf.Writer} Writer
  1179. */
  1180. ForumThreadMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  1181. return this.encode(message, writer).ldelim();
  1182. };
  1183. /**
  1184. * Decodes a ForumThreadMetadata message from the specified reader or buffer.
  1185. * @function decode
  1186. * @memberof ForumThreadMetadata
  1187. * @static
  1188. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1189. * @param {number} [length] Message length if known beforehand
  1190. * @returns {ForumThreadMetadata} ForumThreadMetadata
  1191. * @throws {Error} If the payload is not a reader or valid buffer
  1192. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1193. */
  1194. ForumThreadMetadata.decode = function decode(reader, length) {
  1195. if (!(reader instanceof $Reader))
  1196. reader = $Reader.create(reader);
  1197. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ForumThreadMetadata();
  1198. while (reader.pos < end) {
  1199. var tag = reader.uint32();
  1200. switch (tag >>> 3) {
  1201. case 1:
  1202. message.title = reader.string();
  1203. break;
  1204. case 2:
  1205. if (!(message.tags && message.tags.length))
  1206. message.tags = [];
  1207. message.tags.push(reader.string());
  1208. break;
  1209. default:
  1210. reader.skipType(tag & 7);
  1211. break;
  1212. }
  1213. }
  1214. return message;
  1215. };
  1216. /**
  1217. * Decodes a ForumThreadMetadata message from the specified reader or buffer, length delimited.
  1218. * @function decodeDelimited
  1219. * @memberof ForumThreadMetadata
  1220. * @static
  1221. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1222. * @returns {ForumThreadMetadata} ForumThreadMetadata
  1223. * @throws {Error} If the payload is not a reader or valid buffer
  1224. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1225. */
  1226. ForumThreadMetadata.decodeDelimited = function decodeDelimited(reader) {
  1227. if (!(reader instanceof $Reader))
  1228. reader = new $Reader(reader);
  1229. return this.decode(reader, reader.uint32());
  1230. };
  1231. /**
  1232. * Verifies a ForumThreadMetadata message.
  1233. * @function verify
  1234. * @memberof ForumThreadMetadata
  1235. * @static
  1236. * @param {Object.<string,*>} message Plain object to verify
  1237. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1238. */
  1239. ForumThreadMetadata.verify = function verify(message) {
  1240. if (typeof message !== "object" || message === null)
  1241. return "object expected";
  1242. if (message.title != null && message.hasOwnProperty("title"))
  1243. if (!$util.isString(message.title))
  1244. return "title: string expected";
  1245. if (message.tags != null && message.hasOwnProperty("tags")) {
  1246. if (!Array.isArray(message.tags))
  1247. return "tags: array expected";
  1248. for (var i = 0; i < message.tags.length; ++i)
  1249. if (!$util.isString(message.tags[i]))
  1250. return "tags: string[] expected";
  1251. }
  1252. return null;
  1253. };
  1254. /**
  1255. * Creates a ForumThreadMetadata message from a plain object. Also converts values to their respective internal types.
  1256. * @function fromObject
  1257. * @memberof ForumThreadMetadata
  1258. * @static
  1259. * @param {Object.<string,*>} object Plain object
  1260. * @returns {ForumThreadMetadata} ForumThreadMetadata
  1261. */
  1262. ForumThreadMetadata.fromObject = function fromObject(object) {
  1263. if (object instanceof $root.ForumThreadMetadata)
  1264. return object;
  1265. var message = new $root.ForumThreadMetadata();
  1266. if (object.title != null)
  1267. message.title = String(object.title);
  1268. if (object.tags) {
  1269. if (!Array.isArray(object.tags))
  1270. throw TypeError(".ForumThreadMetadata.tags: array expected");
  1271. message.tags = [];
  1272. for (var i = 0; i < object.tags.length; ++i)
  1273. message.tags[i] = String(object.tags[i]);
  1274. }
  1275. return message;
  1276. };
  1277. /**
  1278. * Creates a plain object from a ForumThreadMetadata message. Also converts values to other types if specified.
  1279. * @function toObject
  1280. * @memberof ForumThreadMetadata
  1281. * @static
  1282. * @param {ForumThreadMetadata} message ForumThreadMetadata
  1283. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1284. * @returns {Object.<string,*>} Plain object
  1285. */
  1286. ForumThreadMetadata.toObject = function toObject(message, options) {
  1287. if (!options)
  1288. options = {};
  1289. var object = {};
  1290. if (options.arrays || options.defaults)
  1291. object.tags = [];
  1292. if (options.defaults)
  1293. object.title = "";
  1294. if (message.title != null && message.hasOwnProperty("title"))
  1295. object.title = message.title;
  1296. if (message.tags && message.tags.length) {
  1297. object.tags = [];
  1298. for (var j = 0; j < message.tags.length; ++j)
  1299. object.tags[j] = message.tags[j];
  1300. }
  1301. return object;
  1302. };
  1303. /**
  1304. * Converts this ForumThreadMetadata to JSON.
  1305. * @function toJSON
  1306. * @memberof ForumThreadMetadata
  1307. * @instance
  1308. * @returns {Object.<string,*>} JSON object
  1309. */
  1310. ForumThreadMetadata.prototype.toJSON = function toJSON() {
  1311. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1312. };
  1313. return ForumThreadMetadata;
  1314. })();
  1315. $root.MembershipMetadata = (function() {
  1316. /**
  1317. * Properties of a MembershipMetadata.
  1318. * @exports IMembershipMetadata
  1319. * @interface IMembershipMetadata
  1320. * @property {string|null} [name] MembershipMetadata name
  1321. * @property {number|null} [avatar] MembershipMetadata avatar
  1322. * @property {string|null} [about] MembershipMetadata about
  1323. */
  1324. /**
  1325. * Constructs a new MembershipMetadata.
  1326. * @exports MembershipMetadata
  1327. * @classdesc Represents a MembershipMetadata.
  1328. * @implements IMembershipMetadata
  1329. * @constructor
  1330. * @param {IMembershipMetadata=} [properties] Properties to set
  1331. */
  1332. function MembershipMetadata(properties) {
  1333. if (properties)
  1334. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1335. if (properties[keys[i]] != null)
  1336. this[keys[i]] = properties[keys[i]];
  1337. }
  1338. /**
  1339. * MembershipMetadata name.
  1340. * @member {string} name
  1341. * @memberof MembershipMetadata
  1342. * @instance
  1343. */
  1344. MembershipMetadata.prototype.name = "";
  1345. /**
  1346. * MembershipMetadata avatar.
  1347. * @member {number} avatar
  1348. * @memberof MembershipMetadata
  1349. * @instance
  1350. */
  1351. MembershipMetadata.prototype.avatar = 0;
  1352. /**
  1353. * MembershipMetadata about.
  1354. * @member {string} about
  1355. * @memberof MembershipMetadata
  1356. * @instance
  1357. */
  1358. MembershipMetadata.prototype.about = "";
  1359. /**
  1360. * Creates a new MembershipMetadata instance using the specified properties.
  1361. * @function create
  1362. * @memberof MembershipMetadata
  1363. * @static
  1364. * @param {IMembershipMetadata=} [properties] Properties to set
  1365. * @returns {MembershipMetadata} MembershipMetadata instance
  1366. */
  1367. MembershipMetadata.create = function create(properties) {
  1368. return new MembershipMetadata(properties);
  1369. };
  1370. /**
  1371. * Encodes the specified MembershipMetadata message. Does not implicitly {@link MembershipMetadata.verify|verify} messages.
  1372. * @function encode
  1373. * @memberof MembershipMetadata
  1374. * @static
  1375. * @param {IMembershipMetadata} message MembershipMetadata message or plain object to encode
  1376. * @param {$protobuf.Writer} [writer] Writer to encode to
  1377. * @returns {$protobuf.Writer} Writer
  1378. */
  1379. MembershipMetadata.encode = function encode(message, writer) {
  1380. if (!writer)
  1381. writer = $Writer.create();
  1382. if (message.name != null && Object.hasOwnProperty.call(message, "name"))
  1383. writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
  1384. if (message.avatar != null && Object.hasOwnProperty.call(message, "avatar"))
  1385. writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.avatar);
  1386. if (message.about != null && Object.hasOwnProperty.call(message, "about"))
  1387. writer.uint32(/* id 3, wireType 2 =*/26).string(message.about);
  1388. return writer;
  1389. };
  1390. /**
  1391. * Encodes the specified MembershipMetadata message, length delimited. Does not implicitly {@link MembershipMetadata.verify|verify} messages.
  1392. * @function encodeDelimited
  1393. * @memberof MembershipMetadata
  1394. * @static
  1395. * @param {IMembershipMetadata} message MembershipMetadata message or plain object to encode
  1396. * @param {$protobuf.Writer} [writer] Writer to encode to
  1397. * @returns {$protobuf.Writer} Writer
  1398. */
  1399. MembershipMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  1400. return this.encode(message, writer).ldelim();
  1401. };
  1402. /**
  1403. * Decodes a MembershipMetadata message from the specified reader or buffer.
  1404. * @function decode
  1405. * @memberof MembershipMetadata
  1406. * @static
  1407. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1408. * @param {number} [length] Message length if known beforehand
  1409. * @returns {MembershipMetadata} MembershipMetadata
  1410. * @throws {Error} If the payload is not a reader or valid buffer
  1411. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1412. */
  1413. MembershipMetadata.decode = function decode(reader, length) {
  1414. if (!(reader instanceof $Reader))
  1415. reader = $Reader.create(reader);
  1416. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MembershipMetadata();
  1417. while (reader.pos < end) {
  1418. var tag = reader.uint32();
  1419. switch (tag >>> 3) {
  1420. case 1:
  1421. message.name = reader.string();
  1422. break;
  1423. case 2:
  1424. message.avatar = reader.uint32();
  1425. break;
  1426. case 3:
  1427. message.about = reader.string();
  1428. break;
  1429. default:
  1430. reader.skipType(tag & 7);
  1431. break;
  1432. }
  1433. }
  1434. return message;
  1435. };
  1436. /**
  1437. * Decodes a MembershipMetadata message from the specified reader or buffer, length delimited.
  1438. * @function decodeDelimited
  1439. * @memberof MembershipMetadata
  1440. * @static
  1441. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1442. * @returns {MembershipMetadata} MembershipMetadata
  1443. * @throws {Error} If the payload is not a reader or valid buffer
  1444. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1445. */
  1446. MembershipMetadata.decodeDelimited = function decodeDelimited(reader) {
  1447. if (!(reader instanceof $Reader))
  1448. reader = new $Reader(reader);
  1449. return this.decode(reader, reader.uint32());
  1450. };
  1451. /**
  1452. * Verifies a MembershipMetadata message.
  1453. * @function verify
  1454. * @memberof MembershipMetadata
  1455. * @static
  1456. * @param {Object.<string,*>} message Plain object to verify
  1457. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1458. */
  1459. MembershipMetadata.verify = function verify(message) {
  1460. if (typeof message !== "object" || message === null)
  1461. return "object expected";
  1462. if (message.name != null && message.hasOwnProperty("name"))
  1463. if (!$util.isString(message.name))
  1464. return "name: string expected";
  1465. if (message.avatar != null && message.hasOwnProperty("avatar"))
  1466. if (!$util.isInteger(message.avatar))
  1467. return "avatar: integer expected";
  1468. if (message.about != null && message.hasOwnProperty("about"))
  1469. if (!$util.isString(message.about))
  1470. return "about: string expected";
  1471. return null;
  1472. };
  1473. /**
  1474. * Creates a MembershipMetadata message from a plain object. Also converts values to their respective internal types.
  1475. * @function fromObject
  1476. * @memberof MembershipMetadata
  1477. * @static
  1478. * @param {Object.<string,*>} object Plain object
  1479. * @returns {MembershipMetadata} MembershipMetadata
  1480. */
  1481. MembershipMetadata.fromObject = function fromObject(object) {
  1482. if (object instanceof $root.MembershipMetadata)
  1483. return object;
  1484. var message = new $root.MembershipMetadata();
  1485. if (object.name != null)
  1486. message.name = String(object.name);
  1487. if (object.avatar != null)
  1488. message.avatar = object.avatar >>> 0;
  1489. if (object.about != null)
  1490. message.about = String(object.about);
  1491. return message;
  1492. };
  1493. /**
  1494. * Creates a plain object from a MembershipMetadata message. Also converts values to other types if specified.
  1495. * @function toObject
  1496. * @memberof MembershipMetadata
  1497. * @static
  1498. * @param {MembershipMetadata} message MembershipMetadata
  1499. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1500. * @returns {Object.<string,*>} Plain object
  1501. */
  1502. MembershipMetadata.toObject = function toObject(message, options) {
  1503. if (!options)
  1504. options = {};
  1505. var object = {};
  1506. if (options.defaults) {
  1507. object.name = "";
  1508. object.avatar = 0;
  1509. object.about = "";
  1510. }
  1511. if (message.name != null && message.hasOwnProperty("name"))
  1512. object.name = message.name;
  1513. if (message.avatar != null && message.hasOwnProperty("avatar"))
  1514. object.avatar = message.avatar;
  1515. if (message.about != null && message.hasOwnProperty("about"))
  1516. object.about = message.about;
  1517. return object;
  1518. };
  1519. /**
  1520. * Converts this MembershipMetadata to JSON.
  1521. * @function toJSON
  1522. * @memberof MembershipMetadata
  1523. * @instance
  1524. * @returns {Object.<string,*>} JSON object
  1525. */
  1526. MembershipMetadata.prototype.toJSON = function toJSON() {
  1527. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1528. };
  1529. return MembershipMetadata;
  1530. })();
  1531. $root.PersonMetadata = (function() {
  1532. /**
  1533. * Properties of a PersonMetadata.
  1534. * @exports IPersonMetadata
  1535. * @interface IPersonMetadata
  1536. * @property {string|null} [firstName] PersonMetadata firstName
  1537. * @property {string|null} [middleName] PersonMetadata middleName
  1538. * @property {string|null} [lastName] PersonMetadata lastName
  1539. * @property {string|null} [about] PersonMetadata about
  1540. * @property {number|null} [coverPhoto] PersonMetadata coverPhoto
  1541. * @property {number|null} [avatarPhoto] PersonMetadata avatarPhoto
  1542. */
  1543. /**
  1544. * Constructs a new PersonMetadata.
  1545. * @exports PersonMetadata
  1546. * @classdesc Represents a PersonMetadata.
  1547. * @implements IPersonMetadata
  1548. * @constructor
  1549. * @param {IPersonMetadata=} [properties] Properties to set
  1550. */
  1551. function PersonMetadata(properties) {
  1552. if (properties)
  1553. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1554. if (properties[keys[i]] != null)
  1555. this[keys[i]] = properties[keys[i]];
  1556. }
  1557. /**
  1558. * PersonMetadata firstName.
  1559. * @member {string} firstName
  1560. * @memberof PersonMetadata
  1561. * @instance
  1562. */
  1563. PersonMetadata.prototype.firstName = "";
  1564. /**
  1565. * PersonMetadata middleName.
  1566. * @member {string} middleName
  1567. * @memberof PersonMetadata
  1568. * @instance
  1569. */
  1570. PersonMetadata.prototype.middleName = "";
  1571. /**
  1572. * PersonMetadata lastName.
  1573. * @member {string} lastName
  1574. * @memberof PersonMetadata
  1575. * @instance
  1576. */
  1577. PersonMetadata.prototype.lastName = "";
  1578. /**
  1579. * PersonMetadata about.
  1580. * @member {string} about
  1581. * @memberof PersonMetadata
  1582. * @instance
  1583. */
  1584. PersonMetadata.prototype.about = "";
  1585. /**
  1586. * PersonMetadata coverPhoto.
  1587. * @member {number} coverPhoto
  1588. * @memberof PersonMetadata
  1589. * @instance
  1590. */
  1591. PersonMetadata.prototype.coverPhoto = 0;
  1592. /**
  1593. * PersonMetadata avatarPhoto.
  1594. * @member {number} avatarPhoto
  1595. * @memberof PersonMetadata
  1596. * @instance
  1597. */
  1598. PersonMetadata.prototype.avatarPhoto = 0;
  1599. /**
  1600. * Creates a new PersonMetadata instance using the specified properties.
  1601. * @function create
  1602. * @memberof PersonMetadata
  1603. * @static
  1604. * @param {IPersonMetadata=} [properties] Properties to set
  1605. * @returns {PersonMetadata} PersonMetadata instance
  1606. */
  1607. PersonMetadata.create = function create(properties) {
  1608. return new PersonMetadata(properties);
  1609. };
  1610. /**
  1611. * Encodes the specified PersonMetadata message. Does not implicitly {@link PersonMetadata.verify|verify} messages.
  1612. * @function encode
  1613. * @memberof PersonMetadata
  1614. * @static
  1615. * @param {IPersonMetadata} message PersonMetadata message or plain object to encode
  1616. * @param {$protobuf.Writer} [writer] Writer to encode to
  1617. * @returns {$protobuf.Writer} Writer
  1618. */
  1619. PersonMetadata.encode = function encode(message, writer) {
  1620. if (!writer)
  1621. writer = $Writer.create();
  1622. if (message.firstName != null && Object.hasOwnProperty.call(message, "firstName"))
  1623. writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstName);
  1624. if (message.middleName != null && Object.hasOwnProperty.call(message, "middleName"))
  1625. writer.uint32(/* id 2, wireType 2 =*/18).string(message.middleName);
  1626. if (message.lastName != null && Object.hasOwnProperty.call(message, "lastName"))
  1627. writer.uint32(/* id 3, wireType 2 =*/26).string(message.lastName);
  1628. if (message.about != null && Object.hasOwnProperty.call(message, "about"))
  1629. writer.uint32(/* id 4, wireType 2 =*/34).string(message.about);
  1630. if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
  1631. writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.coverPhoto);
  1632. if (message.avatarPhoto != null && Object.hasOwnProperty.call(message, "avatarPhoto"))
  1633. writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.avatarPhoto);
  1634. return writer;
  1635. };
  1636. /**
  1637. * Encodes the specified PersonMetadata message, length delimited. Does not implicitly {@link PersonMetadata.verify|verify} messages.
  1638. * @function encodeDelimited
  1639. * @memberof PersonMetadata
  1640. * @static
  1641. * @param {IPersonMetadata} message PersonMetadata message or plain object to encode
  1642. * @param {$protobuf.Writer} [writer] Writer to encode to
  1643. * @returns {$protobuf.Writer} Writer
  1644. */
  1645. PersonMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  1646. return this.encode(message, writer).ldelim();
  1647. };
  1648. /**
  1649. * Decodes a PersonMetadata message from the specified reader or buffer.
  1650. * @function decode
  1651. * @memberof PersonMetadata
  1652. * @static
  1653. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1654. * @param {number} [length] Message length if known beforehand
  1655. * @returns {PersonMetadata} PersonMetadata
  1656. * @throws {Error} If the payload is not a reader or valid buffer
  1657. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1658. */
  1659. PersonMetadata.decode = function decode(reader, length) {
  1660. if (!(reader instanceof $Reader))
  1661. reader = $Reader.create(reader);
  1662. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PersonMetadata();
  1663. while (reader.pos < end) {
  1664. var tag = reader.uint32();
  1665. switch (tag >>> 3) {
  1666. case 1:
  1667. message.firstName = reader.string();
  1668. break;
  1669. case 2:
  1670. message.middleName = reader.string();
  1671. break;
  1672. case 3:
  1673. message.lastName = reader.string();
  1674. break;
  1675. case 4:
  1676. message.about = reader.string();
  1677. break;
  1678. case 5:
  1679. message.coverPhoto = reader.uint32();
  1680. break;
  1681. case 6:
  1682. message.avatarPhoto = reader.uint32();
  1683. break;
  1684. default:
  1685. reader.skipType(tag & 7);
  1686. break;
  1687. }
  1688. }
  1689. return message;
  1690. };
  1691. /**
  1692. * Decodes a PersonMetadata message from the specified reader or buffer, length delimited.
  1693. * @function decodeDelimited
  1694. * @memberof PersonMetadata
  1695. * @static
  1696. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1697. * @returns {PersonMetadata} PersonMetadata
  1698. * @throws {Error} If the payload is not a reader or valid buffer
  1699. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1700. */
  1701. PersonMetadata.decodeDelimited = function decodeDelimited(reader) {
  1702. if (!(reader instanceof $Reader))
  1703. reader = new $Reader(reader);
  1704. return this.decode(reader, reader.uint32());
  1705. };
  1706. /**
  1707. * Verifies a PersonMetadata message.
  1708. * @function verify
  1709. * @memberof PersonMetadata
  1710. * @static
  1711. * @param {Object.<string,*>} message Plain object to verify
  1712. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1713. */
  1714. PersonMetadata.verify = function verify(message) {
  1715. if (typeof message !== "object" || message === null)
  1716. return "object expected";
  1717. if (message.firstName != null && message.hasOwnProperty("firstName"))
  1718. if (!$util.isString(message.firstName))
  1719. return "firstName: string expected";
  1720. if (message.middleName != null && message.hasOwnProperty("middleName"))
  1721. if (!$util.isString(message.middleName))
  1722. return "middleName: string expected";
  1723. if (message.lastName != null && message.hasOwnProperty("lastName"))
  1724. if (!$util.isString(message.lastName))
  1725. return "lastName: string expected";
  1726. if (message.about != null && message.hasOwnProperty("about"))
  1727. if (!$util.isString(message.about))
  1728. return "about: string expected";
  1729. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  1730. if (!$util.isInteger(message.coverPhoto))
  1731. return "coverPhoto: integer expected";
  1732. if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
  1733. if (!$util.isInteger(message.avatarPhoto))
  1734. return "avatarPhoto: integer expected";
  1735. return null;
  1736. };
  1737. /**
  1738. * Creates a PersonMetadata message from a plain object. Also converts values to their respective internal types.
  1739. * @function fromObject
  1740. * @memberof PersonMetadata
  1741. * @static
  1742. * @param {Object.<string,*>} object Plain object
  1743. * @returns {PersonMetadata} PersonMetadata
  1744. */
  1745. PersonMetadata.fromObject = function fromObject(object) {
  1746. if (object instanceof $root.PersonMetadata)
  1747. return object;
  1748. var message = new $root.PersonMetadata();
  1749. if (object.firstName != null)
  1750. message.firstName = String(object.firstName);
  1751. if (object.middleName != null)
  1752. message.middleName = String(object.middleName);
  1753. if (object.lastName != null)
  1754. message.lastName = String(object.lastName);
  1755. if (object.about != null)
  1756. message.about = String(object.about);
  1757. if (object.coverPhoto != null)
  1758. message.coverPhoto = object.coverPhoto >>> 0;
  1759. if (object.avatarPhoto != null)
  1760. message.avatarPhoto = object.avatarPhoto >>> 0;
  1761. return message;
  1762. };
  1763. /**
  1764. * Creates a plain object from a PersonMetadata message. Also converts values to other types if specified.
  1765. * @function toObject
  1766. * @memberof PersonMetadata
  1767. * @static
  1768. * @param {PersonMetadata} message PersonMetadata
  1769. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1770. * @returns {Object.<string,*>} Plain object
  1771. */
  1772. PersonMetadata.toObject = function toObject(message, options) {
  1773. if (!options)
  1774. options = {};
  1775. var object = {};
  1776. if (options.defaults) {
  1777. object.firstName = "";
  1778. object.middleName = "";
  1779. object.lastName = "";
  1780. object.about = "";
  1781. object.coverPhoto = 0;
  1782. object.avatarPhoto = 0;
  1783. }
  1784. if (message.firstName != null && message.hasOwnProperty("firstName"))
  1785. object.firstName = message.firstName;
  1786. if (message.middleName != null && message.hasOwnProperty("middleName"))
  1787. object.middleName = message.middleName;
  1788. if (message.lastName != null && message.hasOwnProperty("lastName"))
  1789. object.lastName = message.lastName;
  1790. if (message.about != null && message.hasOwnProperty("about"))
  1791. object.about = message.about;
  1792. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  1793. object.coverPhoto = message.coverPhoto;
  1794. if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
  1795. object.avatarPhoto = message.avatarPhoto;
  1796. return object;
  1797. };
  1798. /**
  1799. * Converts this PersonMetadata to JSON.
  1800. * @function toJSON
  1801. * @memberof PersonMetadata
  1802. * @instance
  1803. * @returns {Object.<string,*>} JSON object
  1804. */
  1805. PersonMetadata.prototype.toJSON = function toJSON() {
  1806. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1807. };
  1808. return PersonMetadata;
  1809. })();
  1810. $root.PlaylistMetadata = (function() {
  1811. /**
  1812. * Properties of a PlaylistMetadata.
  1813. * @exports IPlaylistMetadata
  1814. * @interface IPlaylistMetadata
  1815. * @property {string|null} [title] PlaylistMetadata title
  1816. * @property {Array.<Long>|null} [videos] PlaylistMetadata videos
  1817. */
  1818. /**
  1819. * Constructs a new PlaylistMetadata.
  1820. * @exports PlaylistMetadata
  1821. * @classdesc Represents a PlaylistMetadata.
  1822. * @implements IPlaylistMetadata
  1823. * @constructor
  1824. * @param {IPlaylistMetadata=} [properties] Properties to set
  1825. */
  1826. function PlaylistMetadata(properties) {
  1827. this.videos = [];
  1828. if (properties)
  1829. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1830. if (properties[keys[i]] != null)
  1831. this[keys[i]] = properties[keys[i]];
  1832. }
  1833. /**
  1834. * PlaylistMetadata title.
  1835. * @member {string} title
  1836. * @memberof PlaylistMetadata
  1837. * @instance
  1838. */
  1839. PlaylistMetadata.prototype.title = "";
  1840. /**
  1841. * PlaylistMetadata videos.
  1842. * @member {Array.<Long>} videos
  1843. * @memberof PlaylistMetadata
  1844. * @instance
  1845. */
  1846. PlaylistMetadata.prototype.videos = $util.emptyArray;
  1847. /**
  1848. * Creates a new PlaylistMetadata instance using the specified properties.
  1849. * @function create
  1850. * @memberof PlaylistMetadata
  1851. * @static
  1852. * @param {IPlaylistMetadata=} [properties] Properties to set
  1853. * @returns {PlaylistMetadata} PlaylistMetadata instance
  1854. */
  1855. PlaylistMetadata.create = function create(properties) {
  1856. return new PlaylistMetadata(properties);
  1857. };
  1858. /**
  1859. * Encodes the specified PlaylistMetadata message. Does not implicitly {@link PlaylistMetadata.verify|verify} messages.
  1860. * @function encode
  1861. * @memberof PlaylistMetadata
  1862. * @static
  1863. * @param {IPlaylistMetadata} message PlaylistMetadata message or plain object to encode
  1864. * @param {$protobuf.Writer} [writer] Writer to encode to
  1865. * @returns {$protobuf.Writer} Writer
  1866. */
  1867. PlaylistMetadata.encode = function encode(message, writer) {
  1868. if (!writer)
  1869. writer = $Writer.create();
  1870. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  1871. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  1872. if (message.videos != null && message.videos.length)
  1873. for (var i = 0; i < message.videos.length; ++i)
  1874. writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.videos[i]);
  1875. return writer;
  1876. };
  1877. /**
  1878. * Encodes the specified PlaylistMetadata message, length delimited. Does not implicitly {@link PlaylistMetadata.verify|verify} messages.
  1879. * @function encodeDelimited
  1880. * @memberof PlaylistMetadata
  1881. * @static
  1882. * @param {IPlaylistMetadata} message PlaylistMetadata message or plain object to encode
  1883. * @param {$protobuf.Writer} [writer] Writer to encode to
  1884. * @returns {$protobuf.Writer} Writer
  1885. */
  1886. PlaylistMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  1887. return this.encode(message, writer).ldelim();
  1888. };
  1889. /**
  1890. * Decodes a PlaylistMetadata message from the specified reader or buffer.
  1891. * @function decode
  1892. * @memberof PlaylistMetadata
  1893. * @static
  1894. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1895. * @param {number} [length] Message length if known beforehand
  1896. * @returns {PlaylistMetadata} PlaylistMetadata
  1897. * @throws {Error} If the payload is not a reader or valid buffer
  1898. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1899. */
  1900. PlaylistMetadata.decode = function decode(reader, length) {
  1901. if (!(reader instanceof $Reader))
  1902. reader = $Reader.create(reader);
  1903. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PlaylistMetadata();
  1904. while (reader.pos < end) {
  1905. var tag = reader.uint32();
  1906. switch (tag >>> 3) {
  1907. case 1:
  1908. message.title = reader.string();
  1909. break;
  1910. case 2:
  1911. if (!(message.videos && message.videos.length))
  1912. message.videos = [];
  1913. if ((tag & 7) === 2) {
  1914. var end2 = reader.uint32() + reader.pos;
  1915. while (reader.pos < end2)
  1916. message.videos.push(reader.uint64());
  1917. } else
  1918. message.videos.push(reader.uint64());
  1919. break;
  1920. default:
  1921. reader.skipType(tag & 7);
  1922. break;
  1923. }
  1924. }
  1925. return message;
  1926. };
  1927. /**
  1928. * Decodes a PlaylistMetadata message from the specified reader or buffer, length delimited.
  1929. * @function decodeDelimited
  1930. * @memberof PlaylistMetadata
  1931. * @static
  1932. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1933. * @returns {PlaylistMetadata} PlaylistMetadata
  1934. * @throws {Error} If the payload is not a reader or valid buffer
  1935. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1936. */
  1937. PlaylistMetadata.decodeDelimited = function decodeDelimited(reader) {
  1938. if (!(reader instanceof $Reader))
  1939. reader = new $Reader(reader);
  1940. return this.decode(reader, reader.uint32());
  1941. };
  1942. /**
  1943. * Verifies a PlaylistMetadata message.
  1944. * @function verify
  1945. * @memberof PlaylistMetadata
  1946. * @static
  1947. * @param {Object.<string,*>} message Plain object to verify
  1948. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1949. */
  1950. PlaylistMetadata.verify = function verify(message) {
  1951. if (typeof message !== "object" || message === null)
  1952. return "object expected";
  1953. if (message.title != null && message.hasOwnProperty("title"))
  1954. if (!$util.isString(message.title))
  1955. return "title: string expected";
  1956. if (message.videos != null && message.hasOwnProperty("videos")) {
  1957. if (!Array.isArray(message.videos))
  1958. return "videos: array expected";
  1959. for (var i = 0; i < message.videos.length; ++i)
  1960. if (!$util.isInteger(message.videos[i]) && !(message.videos[i] && $util.isInteger(message.videos[i].low) && $util.isInteger(message.videos[i].high)))
  1961. return "videos: integer|Long[] expected";
  1962. }
  1963. return null;
  1964. };
  1965. /**
  1966. * Creates a PlaylistMetadata message from a plain object. Also converts values to their respective internal types.
  1967. * @function fromObject
  1968. * @memberof PlaylistMetadata
  1969. * @static
  1970. * @param {Object.<string,*>} object Plain object
  1971. * @returns {PlaylistMetadata} PlaylistMetadata
  1972. */
  1973. PlaylistMetadata.fromObject = function fromObject(object) {
  1974. if (object instanceof $root.PlaylistMetadata)
  1975. return object;
  1976. var message = new $root.PlaylistMetadata();
  1977. if (object.title != null)
  1978. message.title = String(object.title);
  1979. if (object.videos) {
  1980. if (!Array.isArray(object.videos))
  1981. throw TypeError(".PlaylistMetadata.videos: array expected");
  1982. message.videos = [];
  1983. for (var i = 0; i < object.videos.length; ++i)
  1984. if ($util.Long)
  1985. (message.videos[i] = $util.Long.fromValue(object.videos[i])).unsigned = true;
  1986. else if (typeof object.videos[i] === "string")
  1987. message.videos[i] = parseInt(object.videos[i], 10);
  1988. else if (typeof object.videos[i] === "number")
  1989. message.videos[i] = object.videos[i];
  1990. else if (typeof object.videos[i] === "object")
  1991. message.videos[i] = new $util.LongBits(object.videos[i].low >>> 0, object.videos[i].high >>> 0).toNumber(true);
  1992. }
  1993. return message;
  1994. };
  1995. /**
  1996. * Creates a plain object from a PlaylistMetadata message. Also converts values to other types if specified.
  1997. * @function toObject
  1998. * @memberof PlaylistMetadata
  1999. * @static
  2000. * @param {PlaylistMetadata} message PlaylistMetadata
  2001. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2002. * @returns {Object.<string,*>} Plain object
  2003. */
  2004. PlaylistMetadata.toObject = function toObject(message, options) {
  2005. if (!options)
  2006. options = {};
  2007. var object = {};
  2008. if (options.arrays || options.defaults)
  2009. object.videos = [];
  2010. if (options.defaults)
  2011. object.title = "";
  2012. if (message.title != null && message.hasOwnProperty("title"))
  2013. object.title = message.title;
  2014. if (message.videos && message.videos.length) {
  2015. object.videos = [];
  2016. for (var j = 0; j < message.videos.length; ++j)
  2017. if (typeof message.videos[j] === "number")
  2018. object.videos[j] = options.longs === String ? String(message.videos[j]) : message.videos[j];
  2019. else
  2020. object.videos[j] = options.longs === String ? $util.Long.prototype.toString.call(message.videos[j]) : options.longs === Number ? new $util.LongBits(message.videos[j].low >>> 0, message.videos[j].high >>> 0).toNumber(true) : message.videos[j];
  2021. }
  2022. return object;
  2023. };
  2024. /**
  2025. * Converts this PlaylistMetadata to JSON.
  2026. * @function toJSON
  2027. * @memberof PlaylistMetadata
  2028. * @instance
  2029. * @returns {Object.<string,*>} JSON object
  2030. */
  2031. PlaylistMetadata.prototype.toJSON = function toJSON() {
  2032. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2033. };
  2034. return PlaylistMetadata;
  2035. })();
  2036. $root.SeriesMetadata = (function() {
  2037. /**
  2038. * Properties of a SeriesMetadata.
  2039. * @exports ISeriesMetadata
  2040. * @interface ISeriesMetadata
  2041. * @property {string|null} [title] SeriesMetadata title
  2042. * @property {string|null} [description] SeriesMetadata description
  2043. * @property {number|null} [coverPhoto] SeriesMetadata coverPhoto
  2044. * @property {Array.<Long>|null} [persons] SeriesMetadata persons
  2045. */
  2046. /**
  2047. * Constructs a new SeriesMetadata.
  2048. * @exports SeriesMetadata
  2049. * @classdesc Represents a SeriesMetadata.
  2050. * @implements ISeriesMetadata
  2051. * @constructor
  2052. * @param {ISeriesMetadata=} [properties] Properties to set
  2053. */
  2054. function SeriesMetadata(properties) {
  2055. this.persons = [];
  2056. if (properties)
  2057. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  2058. if (properties[keys[i]] != null)
  2059. this[keys[i]] = properties[keys[i]];
  2060. }
  2061. /**
  2062. * SeriesMetadata title.
  2063. * @member {string} title
  2064. * @memberof SeriesMetadata
  2065. * @instance
  2066. */
  2067. SeriesMetadata.prototype.title = "";
  2068. /**
  2069. * SeriesMetadata description.
  2070. * @member {string} description
  2071. * @memberof SeriesMetadata
  2072. * @instance
  2073. */
  2074. SeriesMetadata.prototype.description = "";
  2075. /**
  2076. * SeriesMetadata coverPhoto.
  2077. * @member {number} coverPhoto
  2078. * @memberof SeriesMetadata
  2079. * @instance
  2080. */
  2081. SeriesMetadata.prototype.coverPhoto = 0;
  2082. /**
  2083. * SeriesMetadata persons.
  2084. * @member {Array.<Long>} persons
  2085. * @memberof SeriesMetadata
  2086. * @instance
  2087. */
  2088. SeriesMetadata.prototype.persons = $util.emptyArray;
  2089. /**
  2090. * Creates a new SeriesMetadata instance using the specified properties.
  2091. * @function create
  2092. * @memberof SeriesMetadata
  2093. * @static
  2094. * @param {ISeriesMetadata=} [properties] Properties to set
  2095. * @returns {SeriesMetadata} SeriesMetadata instance
  2096. */
  2097. SeriesMetadata.create = function create(properties) {
  2098. return new SeriesMetadata(properties);
  2099. };
  2100. /**
  2101. * Encodes the specified SeriesMetadata message. Does not implicitly {@link SeriesMetadata.verify|verify} messages.
  2102. * @function encode
  2103. * @memberof SeriesMetadata
  2104. * @static
  2105. * @param {ISeriesMetadata} message SeriesMetadata message or plain object to encode
  2106. * @param {$protobuf.Writer} [writer] Writer to encode to
  2107. * @returns {$protobuf.Writer} Writer
  2108. */
  2109. SeriesMetadata.encode = function encode(message, writer) {
  2110. if (!writer)
  2111. writer = $Writer.create();
  2112. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  2113. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  2114. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  2115. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  2116. if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
  2117. writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.coverPhoto);
  2118. if (message.persons != null && message.persons.length) {
  2119. writer.uint32(/* id 4, wireType 2 =*/34).fork();
  2120. for (var i = 0; i < message.persons.length; ++i)
  2121. writer.uint64(message.persons[i]);
  2122. writer.ldelim();
  2123. }
  2124. return writer;
  2125. };
  2126. /**
  2127. * Encodes the specified SeriesMetadata message, length delimited. Does not implicitly {@link SeriesMetadata.verify|verify} messages.
  2128. * @function encodeDelimited
  2129. * @memberof SeriesMetadata
  2130. * @static
  2131. * @param {ISeriesMetadata} message SeriesMetadata message or plain object to encode
  2132. * @param {$protobuf.Writer} [writer] Writer to encode to
  2133. * @returns {$protobuf.Writer} Writer
  2134. */
  2135. SeriesMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  2136. return this.encode(message, writer).ldelim();
  2137. };
  2138. /**
  2139. * Decodes a SeriesMetadata message from the specified reader or buffer.
  2140. * @function decode
  2141. * @memberof SeriesMetadata
  2142. * @static
  2143. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2144. * @param {number} [length] Message length if known beforehand
  2145. * @returns {SeriesMetadata} SeriesMetadata
  2146. * @throws {Error} If the payload is not a reader or valid buffer
  2147. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2148. */
  2149. SeriesMetadata.decode = function decode(reader, length) {
  2150. if (!(reader instanceof $Reader))
  2151. reader = $Reader.create(reader);
  2152. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SeriesMetadata();
  2153. while (reader.pos < end) {
  2154. var tag = reader.uint32();
  2155. switch (tag >>> 3) {
  2156. case 1:
  2157. message.title = reader.string();
  2158. break;
  2159. case 2:
  2160. message.description = reader.string();
  2161. break;
  2162. case 3:
  2163. message.coverPhoto = reader.uint32();
  2164. break;
  2165. case 4:
  2166. if (!(message.persons && message.persons.length))
  2167. message.persons = [];
  2168. if ((tag & 7) === 2) {
  2169. var end2 = reader.uint32() + reader.pos;
  2170. while (reader.pos < end2)
  2171. message.persons.push(reader.uint64());
  2172. } else
  2173. message.persons.push(reader.uint64());
  2174. break;
  2175. default:
  2176. reader.skipType(tag & 7);
  2177. break;
  2178. }
  2179. }
  2180. return message;
  2181. };
  2182. /**
  2183. * Decodes a SeriesMetadata message from the specified reader or buffer, length delimited.
  2184. * @function decodeDelimited
  2185. * @memberof SeriesMetadata
  2186. * @static
  2187. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2188. * @returns {SeriesMetadata} SeriesMetadata
  2189. * @throws {Error} If the payload is not a reader or valid buffer
  2190. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2191. */
  2192. SeriesMetadata.decodeDelimited = function decodeDelimited(reader) {
  2193. if (!(reader instanceof $Reader))
  2194. reader = new $Reader(reader);
  2195. return this.decode(reader, reader.uint32());
  2196. };
  2197. /**
  2198. * Verifies a SeriesMetadata message.
  2199. * @function verify
  2200. * @memberof SeriesMetadata
  2201. * @static
  2202. * @param {Object.<string,*>} message Plain object to verify
  2203. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  2204. */
  2205. SeriesMetadata.verify = function verify(message) {
  2206. if (typeof message !== "object" || message === null)
  2207. return "object expected";
  2208. if (message.title != null && message.hasOwnProperty("title"))
  2209. if (!$util.isString(message.title))
  2210. return "title: string expected";
  2211. if (message.description != null && message.hasOwnProperty("description"))
  2212. if (!$util.isString(message.description))
  2213. return "description: string expected";
  2214. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  2215. if (!$util.isInteger(message.coverPhoto))
  2216. return "coverPhoto: integer expected";
  2217. if (message.persons != null && message.hasOwnProperty("persons")) {
  2218. if (!Array.isArray(message.persons))
  2219. return "persons: array expected";
  2220. for (var i = 0; i < message.persons.length; ++i)
  2221. if (!$util.isInteger(message.persons[i]) && !(message.persons[i] && $util.isInteger(message.persons[i].low) && $util.isInteger(message.persons[i].high)))
  2222. return "persons: integer|Long[] expected";
  2223. }
  2224. return null;
  2225. };
  2226. /**
  2227. * Creates a SeriesMetadata message from a plain object. Also converts values to their respective internal types.
  2228. * @function fromObject
  2229. * @memberof SeriesMetadata
  2230. * @static
  2231. * @param {Object.<string,*>} object Plain object
  2232. * @returns {SeriesMetadata} SeriesMetadata
  2233. */
  2234. SeriesMetadata.fromObject = function fromObject(object) {
  2235. if (object instanceof $root.SeriesMetadata)
  2236. return object;
  2237. var message = new $root.SeriesMetadata();
  2238. if (object.title != null)
  2239. message.title = String(object.title);
  2240. if (object.description != null)
  2241. message.description = String(object.description);
  2242. if (object.coverPhoto != null)
  2243. message.coverPhoto = object.coverPhoto >>> 0;
  2244. if (object.persons) {
  2245. if (!Array.isArray(object.persons))
  2246. throw TypeError(".SeriesMetadata.persons: array expected");
  2247. message.persons = [];
  2248. for (var i = 0; i < object.persons.length; ++i)
  2249. if ($util.Long)
  2250. (message.persons[i] = $util.Long.fromValue(object.persons[i])).unsigned = true;
  2251. else if (typeof object.persons[i] === "string")
  2252. message.persons[i] = parseInt(object.persons[i], 10);
  2253. else if (typeof object.persons[i] === "number")
  2254. message.persons[i] = object.persons[i];
  2255. else if (typeof object.persons[i] === "object")
  2256. message.persons[i] = new $util.LongBits(object.persons[i].low >>> 0, object.persons[i].high >>> 0).toNumber(true);
  2257. }
  2258. return message;
  2259. };
  2260. /**
  2261. * Creates a plain object from a SeriesMetadata message. Also converts values to other types if specified.
  2262. * @function toObject
  2263. * @memberof SeriesMetadata
  2264. * @static
  2265. * @param {SeriesMetadata} message SeriesMetadata
  2266. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2267. * @returns {Object.<string,*>} Plain object
  2268. */
  2269. SeriesMetadata.toObject = function toObject(message, options) {
  2270. if (!options)
  2271. options = {};
  2272. var object = {};
  2273. if (options.arrays || options.defaults)
  2274. object.persons = [];
  2275. if (options.defaults) {
  2276. object.title = "";
  2277. object.description = "";
  2278. object.coverPhoto = 0;
  2279. }
  2280. if (message.title != null && message.hasOwnProperty("title"))
  2281. object.title = message.title;
  2282. if (message.description != null && message.hasOwnProperty("description"))
  2283. object.description = message.description;
  2284. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  2285. object.coverPhoto = message.coverPhoto;
  2286. if (message.persons && message.persons.length) {
  2287. object.persons = [];
  2288. for (var j = 0; j < message.persons.length; ++j)
  2289. if (typeof message.persons[j] === "number")
  2290. object.persons[j] = options.longs === String ? String(message.persons[j]) : message.persons[j];
  2291. else
  2292. object.persons[j] = options.longs === String ? $util.Long.prototype.toString.call(message.persons[j]) : options.longs === Number ? new $util.LongBits(message.persons[j].low >>> 0, message.persons[j].high >>> 0).toNumber(true) : message.persons[j];
  2293. }
  2294. return object;
  2295. };
  2296. /**
  2297. * Converts this SeriesMetadata to JSON.
  2298. * @function toJSON
  2299. * @memberof SeriesMetadata
  2300. * @instance
  2301. * @returns {Object.<string,*>} JSON object
  2302. */
  2303. SeriesMetadata.prototype.toJSON = function toJSON() {
  2304. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2305. };
  2306. return SeriesMetadata;
  2307. })();
  2308. $root.SeasonMetadata = (function() {
  2309. /**
  2310. * Properties of a SeasonMetadata.
  2311. * @exports ISeasonMetadata
  2312. * @interface ISeasonMetadata
  2313. * @property {string|null} [title] SeasonMetadata title
  2314. * @property {string|null} [description] SeasonMetadata description
  2315. * @property {number|null} [coverPhoto] SeasonMetadata coverPhoto
  2316. * @property {Array.<Long>|null} [persons] SeasonMetadata persons
  2317. */
  2318. /**
  2319. * Constructs a new SeasonMetadata.
  2320. * @exports SeasonMetadata
  2321. * @classdesc Represents a SeasonMetadata.
  2322. * @implements ISeasonMetadata
  2323. * @constructor
  2324. * @param {ISeasonMetadata=} [properties] Properties to set
  2325. */
  2326. function SeasonMetadata(properties) {
  2327. this.persons = [];
  2328. if (properties)
  2329. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  2330. if (properties[keys[i]] != null)
  2331. this[keys[i]] = properties[keys[i]];
  2332. }
  2333. /**
  2334. * SeasonMetadata title.
  2335. * @member {string} title
  2336. * @memberof SeasonMetadata
  2337. * @instance
  2338. */
  2339. SeasonMetadata.prototype.title = "";
  2340. /**
  2341. * SeasonMetadata description.
  2342. * @member {string} description
  2343. * @memberof SeasonMetadata
  2344. * @instance
  2345. */
  2346. SeasonMetadata.prototype.description = "";
  2347. /**
  2348. * SeasonMetadata coverPhoto.
  2349. * @member {number} coverPhoto
  2350. * @memberof SeasonMetadata
  2351. * @instance
  2352. */
  2353. SeasonMetadata.prototype.coverPhoto = 0;
  2354. /**
  2355. * SeasonMetadata persons.
  2356. * @member {Array.<Long>} persons
  2357. * @memberof SeasonMetadata
  2358. * @instance
  2359. */
  2360. SeasonMetadata.prototype.persons = $util.emptyArray;
  2361. /**
  2362. * Creates a new SeasonMetadata instance using the specified properties.
  2363. * @function create
  2364. * @memberof SeasonMetadata
  2365. * @static
  2366. * @param {ISeasonMetadata=} [properties] Properties to set
  2367. * @returns {SeasonMetadata} SeasonMetadata instance
  2368. */
  2369. SeasonMetadata.create = function create(properties) {
  2370. return new SeasonMetadata(properties);
  2371. };
  2372. /**
  2373. * Encodes the specified SeasonMetadata message. Does not implicitly {@link SeasonMetadata.verify|verify} messages.
  2374. * @function encode
  2375. * @memberof SeasonMetadata
  2376. * @static
  2377. * @param {ISeasonMetadata} message SeasonMetadata message or plain object to encode
  2378. * @param {$protobuf.Writer} [writer] Writer to encode to
  2379. * @returns {$protobuf.Writer} Writer
  2380. */
  2381. SeasonMetadata.encode = function encode(message, writer) {
  2382. if (!writer)
  2383. writer = $Writer.create();
  2384. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  2385. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  2386. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  2387. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  2388. if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
  2389. writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.coverPhoto);
  2390. if (message.persons != null && message.persons.length) {
  2391. writer.uint32(/* id 4, wireType 2 =*/34).fork();
  2392. for (var i = 0; i < message.persons.length; ++i)
  2393. writer.uint64(message.persons[i]);
  2394. writer.ldelim();
  2395. }
  2396. return writer;
  2397. };
  2398. /**
  2399. * Encodes the specified SeasonMetadata message, length delimited. Does not implicitly {@link SeasonMetadata.verify|verify} messages.
  2400. * @function encodeDelimited
  2401. * @memberof SeasonMetadata
  2402. * @static
  2403. * @param {ISeasonMetadata} message SeasonMetadata message or plain object to encode
  2404. * @param {$protobuf.Writer} [writer] Writer to encode to
  2405. * @returns {$protobuf.Writer} Writer
  2406. */
  2407. SeasonMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  2408. return this.encode(message, writer).ldelim();
  2409. };
  2410. /**
  2411. * Decodes a SeasonMetadata message from the specified reader or buffer.
  2412. * @function decode
  2413. * @memberof SeasonMetadata
  2414. * @static
  2415. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2416. * @param {number} [length] Message length if known beforehand
  2417. * @returns {SeasonMetadata} SeasonMetadata
  2418. * @throws {Error} If the payload is not a reader or valid buffer
  2419. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2420. */
  2421. SeasonMetadata.decode = function decode(reader, length) {
  2422. if (!(reader instanceof $Reader))
  2423. reader = $Reader.create(reader);
  2424. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SeasonMetadata();
  2425. while (reader.pos < end) {
  2426. var tag = reader.uint32();
  2427. switch (tag >>> 3) {
  2428. case 1:
  2429. message.title = reader.string();
  2430. break;
  2431. case 2:
  2432. message.description = reader.string();
  2433. break;
  2434. case 3:
  2435. message.coverPhoto = reader.uint32();
  2436. break;
  2437. case 4:
  2438. if (!(message.persons && message.persons.length))
  2439. message.persons = [];
  2440. if ((tag & 7) === 2) {
  2441. var end2 = reader.uint32() + reader.pos;
  2442. while (reader.pos < end2)
  2443. message.persons.push(reader.uint64());
  2444. } else
  2445. message.persons.push(reader.uint64());
  2446. break;
  2447. default:
  2448. reader.skipType(tag & 7);
  2449. break;
  2450. }
  2451. }
  2452. return message;
  2453. };
  2454. /**
  2455. * Decodes a SeasonMetadata message from the specified reader or buffer, length delimited.
  2456. * @function decodeDelimited
  2457. * @memberof SeasonMetadata
  2458. * @static
  2459. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2460. * @returns {SeasonMetadata} SeasonMetadata
  2461. * @throws {Error} If the payload is not a reader or valid buffer
  2462. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2463. */
  2464. SeasonMetadata.decodeDelimited = function decodeDelimited(reader) {
  2465. if (!(reader instanceof $Reader))
  2466. reader = new $Reader(reader);
  2467. return this.decode(reader, reader.uint32());
  2468. };
  2469. /**
  2470. * Verifies a SeasonMetadata message.
  2471. * @function verify
  2472. * @memberof SeasonMetadata
  2473. * @static
  2474. * @param {Object.<string,*>} message Plain object to verify
  2475. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  2476. */
  2477. SeasonMetadata.verify = function verify(message) {
  2478. if (typeof message !== "object" || message === null)
  2479. return "object expected";
  2480. if (message.title != null && message.hasOwnProperty("title"))
  2481. if (!$util.isString(message.title))
  2482. return "title: string expected";
  2483. if (message.description != null && message.hasOwnProperty("description"))
  2484. if (!$util.isString(message.description))
  2485. return "description: string expected";
  2486. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  2487. if (!$util.isInteger(message.coverPhoto))
  2488. return "coverPhoto: integer expected";
  2489. if (message.persons != null && message.hasOwnProperty("persons")) {
  2490. if (!Array.isArray(message.persons))
  2491. return "persons: array expected";
  2492. for (var i = 0; i < message.persons.length; ++i)
  2493. if (!$util.isInteger(message.persons[i]) && !(message.persons[i] && $util.isInteger(message.persons[i].low) && $util.isInteger(message.persons[i].high)))
  2494. return "persons: integer|Long[] expected";
  2495. }
  2496. return null;
  2497. };
  2498. /**
  2499. * Creates a SeasonMetadata message from a plain object. Also converts values to their respective internal types.
  2500. * @function fromObject
  2501. * @memberof SeasonMetadata
  2502. * @static
  2503. * @param {Object.<string,*>} object Plain object
  2504. * @returns {SeasonMetadata} SeasonMetadata
  2505. */
  2506. SeasonMetadata.fromObject = function fromObject(object) {
  2507. if (object instanceof $root.SeasonMetadata)
  2508. return object;
  2509. var message = new $root.SeasonMetadata();
  2510. if (object.title != null)
  2511. message.title = String(object.title);
  2512. if (object.description != null)
  2513. message.description = String(object.description);
  2514. if (object.coverPhoto != null)
  2515. message.coverPhoto = object.coverPhoto >>> 0;
  2516. if (object.persons) {
  2517. if (!Array.isArray(object.persons))
  2518. throw TypeError(".SeasonMetadata.persons: array expected");
  2519. message.persons = [];
  2520. for (var i = 0; i < object.persons.length; ++i)
  2521. if ($util.Long)
  2522. (message.persons[i] = $util.Long.fromValue(object.persons[i])).unsigned = true;
  2523. else if (typeof object.persons[i] === "string")
  2524. message.persons[i] = parseInt(object.persons[i], 10);
  2525. else if (typeof object.persons[i] === "number")
  2526. message.persons[i] = object.persons[i];
  2527. else if (typeof object.persons[i] === "object")
  2528. message.persons[i] = new $util.LongBits(object.persons[i].low >>> 0, object.persons[i].high >>> 0).toNumber(true);
  2529. }
  2530. return message;
  2531. };
  2532. /**
  2533. * Creates a plain object from a SeasonMetadata message. Also converts values to other types if specified.
  2534. * @function toObject
  2535. * @memberof SeasonMetadata
  2536. * @static
  2537. * @param {SeasonMetadata} message SeasonMetadata
  2538. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2539. * @returns {Object.<string,*>} Plain object
  2540. */
  2541. SeasonMetadata.toObject = function toObject(message, options) {
  2542. if (!options)
  2543. options = {};
  2544. var object = {};
  2545. if (options.arrays || options.defaults)
  2546. object.persons = [];
  2547. if (options.defaults) {
  2548. object.title = "";
  2549. object.description = "";
  2550. object.coverPhoto = 0;
  2551. }
  2552. if (message.title != null && message.hasOwnProperty("title"))
  2553. object.title = message.title;
  2554. if (message.description != null && message.hasOwnProperty("description"))
  2555. object.description = message.description;
  2556. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  2557. object.coverPhoto = message.coverPhoto;
  2558. if (message.persons && message.persons.length) {
  2559. object.persons = [];
  2560. for (var j = 0; j < message.persons.length; ++j)
  2561. if (typeof message.persons[j] === "number")
  2562. object.persons[j] = options.longs === String ? String(message.persons[j]) : message.persons[j];
  2563. else
  2564. object.persons[j] = options.longs === String ? $util.Long.prototype.toString.call(message.persons[j]) : options.longs === Number ? new $util.LongBits(message.persons[j].low >>> 0, message.persons[j].high >>> 0).toNumber(true) : message.persons[j];
  2565. }
  2566. return object;
  2567. };
  2568. /**
  2569. * Converts this SeasonMetadata to JSON.
  2570. * @function toJSON
  2571. * @memberof SeasonMetadata
  2572. * @instance
  2573. * @returns {Object.<string,*>} JSON object
  2574. */
  2575. SeasonMetadata.prototype.toJSON = function toJSON() {
  2576. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2577. };
  2578. return SeasonMetadata;
  2579. })();
  2580. $root.PublishedBeforeJoystream = (function() {
  2581. /**
  2582. * Properties of a PublishedBeforeJoystream.
  2583. * @exports IPublishedBeforeJoystream
  2584. * @interface IPublishedBeforeJoystream
  2585. * @property {boolean|null} [isPublished] PublishedBeforeJoystream isPublished
  2586. * @property {string|null} [date] PublishedBeforeJoystream date
  2587. */
  2588. /**
  2589. * Constructs a new PublishedBeforeJoystream.
  2590. * @exports PublishedBeforeJoystream
  2591. * @classdesc Represents a PublishedBeforeJoystream.
  2592. * @implements IPublishedBeforeJoystream
  2593. * @constructor
  2594. * @param {IPublishedBeforeJoystream=} [properties] Properties to set
  2595. */
  2596. function PublishedBeforeJoystream(properties) {
  2597. if (properties)
  2598. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  2599. if (properties[keys[i]] != null)
  2600. this[keys[i]] = properties[keys[i]];
  2601. }
  2602. /**
  2603. * PublishedBeforeJoystream isPublished.
  2604. * @member {boolean} isPublished
  2605. * @memberof PublishedBeforeJoystream
  2606. * @instance
  2607. */
  2608. PublishedBeforeJoystream.prototype.isPublished = false;
  2609. /**
  2610. * PublishedBeforeJoystream date.
  2611. * @member {string} date
  2612. * @memberof PublishedBeforeJoystream
  2613. * @instance
  2614. */
  2615. PublishedBeforeJoystream.prototype.date = "";
  2616. /**
  2617. * Creates a new PublishedBeforeJoystream instance using the specified properties.
  2618. * @function create
  2619. * @memberof PublishedBeforeJoystream
  2620. * @static
  2621. * @param {IPublishedBeforeJoystream=} [properties] Properties to set
  2622. * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream instance
  2623. */
  2624. PublishedBeforeJoystream.create = function create(properties) {
  2625. return new PublishedBeforeJoystream(properties);
  2626. };
  2627. /**
  2628. * Encodes the specified PublishedBeforeJoystream message. Does not implicitly {@link PublishedBeforeJoystream.verify|verify} messages.
  2629. * @function encode
  2630. * @memberof PublishedBeforeJoystream
  2631. * @static
  2632. * @param {IPublishedBeforeJoystream} message PublishedBeforeJoystream message or plain object to encode
  2633. * @param {$protobuf.Writer} [writer] Writer to encode to
  2634. * @returns {$protobuf.Writer} Writer
  2635. */
  2636. PublishedBeforeJoystream.encode = function encode(message, writer) {
  2637. if (!writer)
  2638. writer = $Writer.create();
  2639. if (message.isPublished != null && Object.hasOwnProperty.call(message, "isPublished"))
  2640. writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isPublished);
  2641. if (message.date != null && Object.hasOwnProperty.call(message, "date"))
  2642. writer.uint32(/* id 2, wireType 2 =*/18).string(message.date);
  2643. return writer;
  2644. };
  2645. /**
  2646. * Encodes the specified PublishedBeforeJoystream message, length delimited. Does not implicitly {@link PublishedBeforeJoystream.verify|verify} messages.
  2647. * @function encodeDelimited
  2648. * @memberof PublishedBeforeJoystream
  2649. * @static
  2650. * @param {IPublishedBeforeJoystream} message PublishedBeforeJoystream message or plain object to encode
  2651. * @param {$protobuf.Writer} [writer] Writer to encode to
  2652. * @returns {$protobuf.Writer} Writer
  2653. */
  2654. PublishedBeforeJoystream.encodeDelimited = function encodeDelimited(message, writer) {
  2655. return this.encode(message, writer).ldelim();
  2656. };
  2657. /**
  2658. * Decodes a PublishedBeforeJoystream message from the specified reader or buffer.
  2659. * @function decode
  2660. * @memberof PublishedBeforeJoystream
  2661. * @static
  2662. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2663. * @param {number} [length] Message length if known beforehand
  2664. * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream
  2665. * @throws {Error} If the payload is not a reader or valid buffer
  2666. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2667. */
  2668. PublishedBeforeJoystream.decode = function decode(reader, length) {
  2669. if (!(reader instanceof $Reader))
  2670. reader = $Reader.create(reader);
  2671. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PublishedBeforeJoystream();
  2672. while (reader.pos < end) {
  2673. var tag = reader.uint32();
  2674. switch (tag >>> 3) {
  2675. case 1:
  2676. message.isPublished = reader.bool();
  2677. break;
  2678. case 2:
  2679. message.date = reader.string();
  2680. break;
  2681. default:
  2682. reader.skipType(tag & 7);
  2683. break;
  2684. }
  2685. }
  2686. return message;
  2687. };
  2688. /**
  2689. * Decodes a PublishedBeforeJoystream message from the specified reader or buffer, length delimited.
  2690. * @function decodeDelimited
  2691. * @memberof PublishedBeforeJoystream
  2692. * @static
  2693. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2694. * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream
  2695. * @throws {Error} If the payload is not a reader or valid buffer
  2696. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2697. */
  2698. PublishedBeforeJoystream.decodeDelimited = function decodeDelimited(reader) {
  2699. if (!(reader instanceof $Reader))
  2700. reader = new $Reader(reader);
  2701. return this.decode(reader, reader.uint32());
  2702. };
  2703. /**
  2704. * Verifies a PublishedBeforeJoystream message.
  2705. * @function verify
  2706. * @memberof PublishedBeforeJoystream
  2707. * @static
  2708. * @param {Object.<string,*>} message Plain object to verify
  2709. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  2710. */
  2711. PublishedBeforeJoystream.verify = function verify(message) {
  2712. if (typeof message !== "object" || message === null)
  2713. return "object expected";
  2714. if (message.isPublished != null && message.hasOwnProperty("isPublished"))
  2715. if (typeof message.isPublished !== "boolean")
  2716. return "isPublished: boolean expected";
  2717. if (message.date != null && message.hasOwnProperty("date"))
  2718. if (!$util.isString(message.date))
  2719. return "date: string expected";
  2720. return null;
  2721. };
  2722. /**
  2723. * Creates a PublishedBeforeJoystream message from a plain object. Also converts values to their respective internal types.
  2724. * @function fromObject
  2725. * @memberof PublishedBeforeJoystream
  2726. * @static
  2727. * @param {Object.<string,*>} object Plain object
  2728. * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream
  2729. */
  2730. PublishedBeforeJoystream.fromObject = function fromObject(object) {
  2731. if (object instanceof $root.PublishedBeforeJoystream)
  2732. return object;
  2733. var message = new $root.PublishedBeforeJoystream();
  2734. if (object.isPublished != null)
  2735. message.isPublished = Boolean(object.isPublished);
  2736. if (object.date != null)
  2737. message.date = String(object.date);
  2738. return message;
  2739. };
  2740. /**
  2741. * Creates a plain object from a PublishedBeforeJoystream message. Also converts values to other types if specified.
  2742. * @function toObject
  2743. * @memberof PublishedBeforeJoystream
  2744. * @static
  2745. * @param {PublishedBeforeJoystream} message PublishedBeforeJoystream
  2746. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2747. * @returns {Object.<string,*>} Plain object
  2748. */
  2749. PublishedBeforeJoystream.toObject = function toObject(message, options) {
  2750. if (!options)
  2751. options = {};
  2752. var object = {};
  2753. if (options.defaults) {
  2754. object.isPublished = false;
  2755. object.date = "";
  2756. }
  2757. if (message.isPublished != null && message.hasOwnProperty("isPublished"))
  2758. object.isPublished = message.isPublished;
  2759. if (message.date != null && message.hasOwnProperty("date"))
  2760. object.date = message.date;
  2761. return object;
  2762. };
  2763. /**
  2764. * Converts this PublishedBeforeJoystream to JSON.
  2765. * @function toJSON
  2766. * @memberof PublishedBeforeJoystream
  2767. * @instance
  2768. * @returns {Object.<string,*>} JSON object
  2769. */
  2770. PublishedBeforeJoystream.prototype.toJSON = function toJSON() {
  2771. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2772. };
  2773. return PublishedBeforeJoystream;
  2774. })();
  2775. $root.License = (function() {
  2776. /**
  2777. * Properties of a License.
  2778. * @exports ILicense
  2779. * @interface ILicense
  2780. * @property {number|null} [code] License code
  2781. * @property {string|null} [attribution] License attribution
  2782. * @property {string|null} [customText] License customText
  2783. */
  2784. /**
  2785. * Constructs a new License.
  2786. * @exports License
  2787. * @classdesc Represents a License.
  2788. * @implements ILicense
  2789. * @constructor
  2790. * @param {ILicense=} [properties] Properties to set
  2791. */
  2792. function License(properties) {
  2793. if (properties)
  2794. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  2795. if (properties[keys[i]] != null)
  2796. this[keys[i]] = properties[keys[i]];
  2797. }
  2798. /**
  2799. * License code.
  2800. * @member {number} code
  2801. * @memberof License
  2802. * @instance
  2803. */
  2804. License.prototype.code = 0;
  2805. /**
  2806. * License attribution.
  2807. * @member {string} attribution
  2808. * @memberof License
  2809. * @instance
  2810. */
  2811. License.prototype.attribution = "";
  2812. /**
  2813. * License customText.
  2814. * @member {string} customText
  2815. * @memberof License
  2816. * @instance
  2817. */
  2818. License.prototype.customText = "";
  2819. /**
  2820. * Creates a new License instance using the specified properties.
  2821. * @function create
  2822. * @memberof License
  2823. * @static
  2824. * @param {ILicense=} [properties] Properties to set
  2825. * @returns {License} License instance
  2826. */
  2827. License.create = function create(properties) {
  2828. return new License(properties);
  2829. };
  2830. /**
  2831. * Encodes the specified License message. Does not implicitly {@link License.verify|verify} messages.
  2832. * @function encode
  2833. * @memberof License
  2834. * @static
  2835. * @param {ILicense} message License message or plain object to encode
  2836. * @param {$protobuf.Writer} [writer] Writer to encode to
  2837. * @returns {$protobuf.Writer} Writer
  2838. */
  2839. License.encode = function encode(message, writer) {
  2840. if (!writer)
  2841. writer = $Writer.create();
  2842. if (message.code != null && Object.hasOwnProperty.call(message, "code"))
  2843. writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code);
  2844. if (message.attribution != null && Object.hasOwnProperty.call(message, "attribution"))
  2845. writer.uint32(/* id 2, wireType 2 =*/18).string(message.attribution);
  2846. if (message.customText != null && Object.hasOwnProperty.call(message, "customText"))
  2847. writer.uint32(/* id 3, wireType 2 =*/26).string(message.customText);
  2848. return writer;
  2849. };
  2850. /**
  2851. * Encodes the specified License message, length delimited. Does not implicitly {@link License.verify|verify} messages.
  2852. * @function encodeDelimited
  2853. * @memberof License
  2854. * @static
  2855. * @param {ILicense} message License message or plain object to encode
  2856. * @param {$protobuf.Writer} [writer] Writer to encode to
  2857. * @returns {$protobuf.Writer} Writer
  2858. */
  2859. License.encodeDelimited = function encodeDelimited(message, writer) {
  2860. return this.encode(message, writer).ldelim();
  2861. };
  2862. /**
  2863. * Decodes a License message from the specified reader or buffer.
  2864. * @function decode
  2865. * @memberof License
  2866. * @static
  2867. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2868. * @param {number} [length] Message length if known beforehand
  2869. * @returns {License} License
  2870. * @throws {Error} If the payload is not a reader or valid buffer
  2871. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2872. */
  2873. License.decode = function decode(reader, length) {
  2874. if (!(reader instanceof $Reader))
  2875. reader = $Reader.create(reader);
  2876. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.License();
  2877. while (reader.pos < end) {
  2878. var tag = reader.uint32();
  2879. switch (tag >>> 3) {
  2880. case 1:
  2881. message.code = reader.uint32();
  2882. break;
  2883. case 2:
  2884. message.attribution = reader.string();
  2885. break;
  2886. case 3:
  2887. message.customText = reader.string();
  2888. break;
  2889. default:
  2890. reader.skipType(tag & 7);
  2891. break;
  2892. }
  2893. }
  2894. return message;
  2895. };
  2896. /**
  2897. * Decodes a License message from the specified reader or buffer, length delimited.
  2898. * @function decodeDelimited
  2899. * @memberof License
  2900. * @static
  2901. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2902. * @returns {License} License
  2903. * @throws {Error} If the payload is not a reader or valid buffer
  2904. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2905. */
  2906. License.decodeDelimited = function decodeDelimited(reader) {
  2907. if (!(reader instanceof $Reader))
  2908. reader = new $Reader(reader);
  2909. return this.decode(reader, reader.uint32());
  2910. };
  2911. /**
  2912. * Verifies a License message.
  2913. * @function verify
  2914. * @memberof License
  2915. * @static
  2916. * @param {Object.<string,*>} message Plain object to verify
  2917. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  2918. */
  2919. License.verify = function verify(message) {
  2920. if (typeof message !== "object" || message === null)
  2921. return "object expected";
  2922. if (message.code != null && message.hasOwnProperty("code"))
  2923. if (!$util.isInteger(message.code))
  2924. return "code: integer expected";
  2925. if (message.attribution != null && message.hasOwnProperty("attribution"))
  2926. if (!$util.isString(message.attribution))
  2927. return "attribution: string expected";
  2928. if (message.customText != null && message.hasOwnProperty("customText"))
  2929. if (!$util.isString(message.customText))
  2930. return "customText: string expected";
  2931. return null;
  2932. };
  2933. /**
  2934. * Creates a License message from a plain object. Also converts values to their respective internal types.
  2935. * @function fromObject
  2936. * @memberof License
  2937. * @static
  2938. * @param {Object.<string,*>} object Plain object
  2939. * @returns {License} License
  2940. */
  2941. License.fromObject = function fromObject(object) {
  2942. if (object instanceof $root.License)
  2943. return object;
  2944. var message = new $root.License();
  2945. if (object.code != null)
  2946. message.code = object.code >>> 0;
  2947. if (object.attribution != null)
  2948. message.attribution = String(object.attribution);
  2949. if (object.customText != null)
  2950. message.customText = String(object.customText);
  2951. return message;
  2952. };
  2953. /**
  2954. * Creates a plain object from a License message. Also converts values to other types if specified.
  2955. * @function toObject
  2956. * @memberof License
  2957. * @static
  2958. * @param {License} message License
  2959. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2960. * @returns {Object.<string,*>} Plain object
  2961. */
  2962. License.toObject = function toObject(message, options) {
  2963. if (!options)
  2964. options = {};
  2965. var object = {};
  2966. if (options.defaults) {
  2967. object.code = 0;
  2968. object.attribution = "";
  2969. object.customText = "";
  2970. }
  2971. if (message.code != null && message.hasOwnProperty("code"))
  2972. object.code = message.code;
  2973. if (message.attribution != null && message.hasOwnProperty("attribution"))
  2974. object.attribution = message.attribution;
  2975. if (message.customText != null && message.hasOwnProperty("customText"))
  2976. object.customText = message.customText;
  2977. return object;
  2978. };
  2979. /**
  2980. * Converts this License to JSON.
  2981. * @function toJSON
  2982. * @memberof License
  2983. * @instance
  2984. * @returns {Object.<string,*>} JSON object
  2985. */
  2986. License.prototype.toJSON = function toJSON() {
  2987. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2988. };
  2989. return License;
  2990. })();
  2991. $root.MediaType = (function() {
  2992. /**
  2993. * Properties of a MediaType.
  2994. * @exports IMediaType
  2995. * @interface IMediaType
  2996. * @property {string|null} [codecName] MediaType codecName
  2997. * @property {string|null} [container] MediaType container
  2998. * @property {string|null} [mimeMediaType] MediaType mimeMediaType
  2999. */
  3000. /**
  3001. * Constructs a new MediaType.
  3002. * @exports MediaType
  3003. * @classdesc Represents a MediaType.
  3004. * @implements IMediaType
  3005. * @constructor
  3006. * @param {IMediaType=} [properties] Properties to set
  3007. */
  3008. function MediaType(properties) {
  3009. if (properties)
  3010. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  3011. if (properties[keys[i]] != null)
  3012. this[keys[i]] = properties[keys[i]];
  3013. }
  3014. /**
  3015. * MediaType codecName.
  3016. * @member {string} codecName
  3017. * @memberof MediaType
  3018. * @instance
  3019. */
  3020. MediaType.prototype.codecName = "";
  3021. /**
  3022. * MediaType container.
  3023. * @member {string} container
  3024. * @memberof MediaType
  3025. * @instance
  3026. */
  3027. MediaType.prototype.container = "";
  3028. /**
  3029. * MediaType mimeMediaType.
  3030. * @member {string} mimeMediaType
  3031. * @memberof MediaType
  3032. * @instance
  3033. */
  3034. MediaType.prototype.mimeMediaType = "";
  3035. /**
  3036. * Creates a new MediaType instance using the specified properties.
  3037. * @function create
  3038. * @memberof MediaType
  3039. * @static
  3040. * @param {IMediaType=} [properties] Properties to set
  3041. * @returns {MediaType} MediaType instance
  3042. */
  3043. MediaType.create = function create(properties) {
  3044. return new MediaType(properties);
  3045. };
  3046. /**
  3047. * Encodes the specified MediaType message. Does not implicitly {@link MediaType.verify|verify} messages.
  3048. * @function encode
  3049. * @memberof MediaType
  3050. * @static
  3051. * @param {IMediaType} message MediaType message or plain object to encode
  3052. * @param {$protobuf.Writer} [writer] Writer to encode to
  3053. * @returns {$protobuf.Writer} Writer
  3054. */
  3055. MediaType.encode = function encode(message, writer) {
  3056. if (!writer)
  3057. writer = $Writer.create();
  3058. if (message.codecName != null && Object.hasOwnProperty.call(message, "codecName"))
  3059. writer.uint32(/* id 1, wireType 2 =*/10).string(message.codecName);
  3060. if (message.container != null && Object.hasOwnProperty.call(message, "container"))
  3061. writer.uint32(/* id 2, wireType 2 =*/18).string(message.container);
  3062. if (message.mimeMediaType != null && Object.hasOwnProperty.call(message, "mimeMediaType"))
  3063. writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeMediaType);
  3064. return writer;
  3065. };
  3066. /**
  3067. * Encodes the specified MediaType message, length delimited. Does not implicitly {@link MediaType.verify|verify} messages.
  3068. * @function encodeDelimited
  3069. * @memberof MediaType
  3070. * @static
  3071. * @param {IMediaType} message MediaType message or plain object to encode
  3072. * @param {$protobuf.Writer} [writer] Writer to encode to
  3073. * @returns {$protobuf.Writer} Writer
  3074. */
  3075. MediaType.encodeDelimited = function encodeDelimited(message, writer) {
  3076. return this.encode(message, writer).ldelim();
  3077. };
  3078. /**
  3079. * Decodes a MediaType message from the specified reader or buffer.
  3080. * @function decode
  3081. * @memberof MediaType
  3082. * @static
  3083. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3084. * @param {number} [length] Message length if known beforehand
  3085. * @returns {MediaType} MediaType
  3086. * @throws {Error} If the payload is not a reader or valid buffer
  3087. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3088. */
  3089. MediaType.decode = function decode(reader, length) {
  3090. if (!(reader instanceof $Reader))
  3091. reader = $Reader.create(reader);
  3092. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MediaType();
  3093. while (reader.pos < end) {
  3094. var tag = reader.uint32();
  3095. switch (tag >>> 3) {
  3096. case 1:
  3097. message.codecName = reader.string();
  3098. break;
  3099. case 2:
  3100. message.container = reader.string();
  3101. break;
  3102. case 3:
  3103. message.mimeMediaType = reader.string();
  3104. break;
  3105. default:
  3106. reader.skipType(tag & 7);
  3107. break;
  3108. }
  3109. }
  3110. return message;
  3111. };
  3112. /**
  3113. * Decodes a MediaType message from the specified reader or buffer, length delimited.
  3114. * @function decodeDelimited
  3115. * @memberof MediaType
  3116. * @static
  3117. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3118. * @returns {MediaType} MediaType
  3119. * @throws {Error} If the payload is not a reader or valid buffer
  3120. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3121. */
  3122. MediaType.decodeDelimited = function decodeDelimited(reader) {
  3123. if (!(reader instanceof $Reader))
  3124. reader = new $Reader(reader);
  3125. return this.decode(reader, reader.uint32());
  3126. };
  3127. /**
  3128. * Verifies a MediaType message.
  3129. * @function verify
  3130. * @memberof MediaType
  3131. * @static
  3132. * @param {Object.<string,*>} message Plain object to verify
  3133. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  3134. */
  3135. MediaType.verify = function verify(message) {
  3136. if (typeof message !== "object" || message === null)
  3137. return "object expected";
  3138. if (message.codecName != null && message.hasOwnProperty("codecName"))
  3139. if (!$util.isString(message.codecName))
  3140. return "codecName: string expected";
  3141. if (message.container != null && message.hasOwnProperty("container"))
  3142. if (!$util.isString(message.container))
  3143. return "container: string expected";
  3144. if (message.mimeMediaType != null && message.hasOwnProperty("mimeMediaType"))
  3145. if (!$util.isString(message.mimeMediaType))
  3146. return "mimeMediaType: string expected";
  3147. return null;
  3148. };
  3149. /**
  3150. * Creates a MediaType message from a plain object. Also converts values to their respective internal types.
  3151. * @function fromObject
  3152. * @memberof MediaType
  3153. * @static
  3154. * @param {Object.<string,*>} object Plain object
  3155. * @returns {MediaType} MediaType
  3156. */
  3157. MediaType.fromObject = function fromObject(object) {
  3158. if (object instanceof $root.MediaType)
  3159. return object;
  3160. var message = new $root.MediaType();
  3161. if (object.codecName != null)
  3162. message.codecName = String(object.codecName);
  3163. if (object.container != null)
  3164. message.container = String(object.container);
  3165. if (object.mimeMediaType != null)
  3166. message.mimeMediaType = String(object.mimeMediaType);
  3167. return message;
  3168. };
  3169. /**
  3170. * Creates a plain object from a MediaType message. Also converts values to other types if specified.
  3171. * @function toObject
  3172. * @memberof MediaType
  3173. * @static
  3174. * @param {MediaType} message MediaType
  3175. * @param {$protobuf.IConversionOptions} [options] Conversion options
  3176. * @returns {Object.<string,*>} Plain object
  3177. */
  3178. MediaType.toObject = function toObject(message, options) {
  3179. if (!options)
  3180. options = {};
  3181. var object = {};
  3182. if (options.defaults) {
  3183. object.codecName = "";
  3184. object.container = "";
  3185. object.mimeMediaType = "";
  3186. }
  3187. if (message.codecName != null && message.hasOwnProperty("codecName"))
  3188. object.codecName = message.codecName;
  3189. if (message.container != null && message.hasOwnProperty("container"))
  3190. object.container = message.container;
  3191. if (message.mimeMediaType != null && message.hasOwnProperty("mimeMediaType"))
  3192. object.mimeMediaType = message.mimeMediaType;
  3193. return object;
  3194. };
  3195. /**
  3196. * Converts this MediaType to JSON.
  3197. * @function toJSON
  3198. * @memberof MediaType
  3199. * @instance
  3200. * @returns {Object.<string,*>} JSON object
  3201. */
  3202. MediaType.prototype.toJSON = function toJSON() {
  3203. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  3204. };
  3205. return MediaType;
  3206. })();
  3207. $root.VideoMetadata = (function() {
  3208. /**
  3209. * Properties of a VideoMetadata.
  3210. * @exports IVideoMetadata
  3211. * @interface IVideoMetadata
  3212. * @property {string|null} [title] VideoMetadata title
  3213. * @property {string|null} [description] VideoMetadata description
  3214. * @property {number|null} [video] VideoMetadata video
  3215. * @property {number|null} [thumbnailPhoto] VideoMetadata thumbnailPhoto
  3216. * @property {number|null} [duration] VideoMetadata duration
  3217. * @property {number|null} [mediaPixelHeight] VideoMetadata mediaPixelHeight
  3218. * @property {number|null} [mediaPixelWidth] VideoMetadata mediaPixelWidth
  3219. * @property {IMediaType|null} [mediaType] VideoMetadata mediaType
  3220. * @property {string|null} [language] VideoMetadata language
  3221. * @property {ILicense|null} [license] VideoMetadata license
  3222. * @property {IPublishedBeforeJoystream|null} [publishedBeforeJoystream] VideoMetadata publishedBeforeJoystream
  3223. * @property {boolean|null} [hasMarketing] VideoMetadata hasMarketing
  3224. * @property {boolean|null} [isPublic] VideoMetadata isPublic
  3225. * @property {boolean|null} [isExplicit] VideoMetadata isExplicit
  3226. * @property {Array.<Long>|null} [persons] VideoMetadata persons
  3227. * @property {Long|null} [category] VideoMetadata category
  3228. */
  3229. /**
  3230. * Constructs a new VideoMetadata.
  3231. * @exports VideoMetadata
  3232. * @classdesc Represents a VideoMetadata.
  3233. * @implements IVideoMetadata
  3234. * @constructor
  3235. * @param {IVideoMetadata=} [properties] Properties to set
  3236. */
  3237. function VideoMetadata(properties) {
  3238. this.persons = [];
  3239. if (properties)
  3240. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  3241. if (properties[keys[i]] != null)
  3242. this[keys[i]] = properties[keys[i]];
  3243. }
  3244. /**
  3245. * VideoMetadata title.
  3246. * @member {string} title
  3247. * @memberof VideoMetadata
  3248. * @instance
  3249. */
  3250. VideoMetadata.prototype.title = "";
  3251. /**
  3252. * VideoMetadata description.
  3253. * @member {string} description
  3254. * @memberof VideoMetadata
  3255. * @instance
  3256. */
  3257. VideoMetadata.prototype.description = "";
  3258. /**
  3259. * VideoMetadata video.
  3260. * @member {number} video
  3261. * @memberof VideoMetadata
  3262. * @instance
  3263. */
  3264. VideoMetadata.prototype.video = 0;
  3265. /**
  3266. * VideoMetadata thumbnailPhoto.
  3267. * @member {number} thumbnailPhoto
  3268. * @memberof VideoMetadata
  3269. * @instance
  3270. */
  3271. VideoMetadata.prototype.thumbnailPhoto = 0;
  3272. /**
  3273. * VideoMetadata duration.
  3274. * @member {number} duration
  3275. * @memberof VideoMetadata
  3276. * @instance
  3277. */
  3278. VideoMetadata.prototype.duration = 0;
  3279. /**
  3280. * VideoMetadata mediaPixelHeight.
  3281. * @member {number} mediaPixelHeight
  3282. * @memberof VideoMetadata
  3283. * @instance
  3284. */
  3285. VideoMetadata.prototype.mediaPixelHeight = 0;
  3286. /**
  3287. * VideoMetadata mediaPixelWidth.
  3288. * @member {number} mediaPixelWidth
  3289. * @memberof VideoMetadata
  3290. * @instance
  3291. */
  3292. VideoMetadata.prototype.mediaPixelWidth = 0;
  3293. /**
  3294. * VideoMetadata mediaType.
  3295. * @member {IMediaType|null|undefined} mediaType
  3296. * @memberof VideoMetadata
  3297. * @instance
  3298. */
  3299. VideoMetadata.prototype.mediaType = null;
  3300. /**
  3301. * VideoMetadata language.
  3302. * @member {string} language
  3303. * @memberof VideoMetadata
  3304. * @instance
  3305. */
  3306. VideoMetadata.prototype.language = "";
  3307. /**
  3308. * VideoMetadata license.
  3309. * @member {ILicense|null|undefined} license
  3310. * @memberof VideoMetadata
  3311. * @instance
  3312. */
  3313. VideoMetadata.prototype.license = null;
  3314. /**
  3315. * VideoMetadata publishedBeforeJoystream.
  3316. * @member {IPublishedBeforeJoystream|null|undefined} publishedBeforeJoystream
  3317. * @memberof VideoMetadata
  3318. * @instance
  3319. */
  3320. VideoMetadata.prototype.publishedBeforeJoystream = null;
  3321. /**
  3322. * VideoMetadata hasMarketing.
  3323. * @member {boolean} hasMarketing
  3324. * @memberof VideoMetadata
  3325. * @instance
  3326. */
  3327. VideoMetadata.prototype.hasMarketing = false;
  3328. /**
  3329. * VideoMetadata isPublic.
  3330. * @member {boolean} isPublic
  3331. * @memberof VideoMetadata
  3332. * @instance
  3333. */
  3334. VideoMetadata.prototype.isPublic = false;
  3335. /**
  3336. * VideoMetadata isExplicit.
  3337. * @member {boolean} isExplicit
  3338. * @memberof VideoMetadata
  3339. * @instance
  3340. */
  3341. VideoMetadata.prototype.isExplicit = false;
  3342. /**
  3343. * VideoMetadata persons.
  3344. * @member {Array.<Long>} persons
  3345. * @memberof VideoMetadata
  3346. * @instance
  3347. */
  3348. VideoMetadata.prototype.persons = $util.emptyArray;
  3349. /**
  3350. * VideoMetadata category.
  3351. * @member {Long} category
  3352. * @memberof VideoMetadata
  3353. * @instance
  3354. */
  3355. VideoMetadata.prototype.category = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
  3356. /**
  3357. * Creates a new VideoMetadata instance using the specified properties.
  3358. * @function create
  3359. * @memberof VideoMetadata
  3360. * @static
  3361. * @param {IVideoMetadata=} [properties] Properties to set
  3362. * @returns {VideoMetadata} VideoMetadata instance
  3363. */
  3364. VideoMetadata.create = function create(properties) {
  3365. return new VideoMetadata(properties);
  3366. };
  3367. /**
  3368. * Encodes the specified VideoMetadata message. Does not implicitly {@link VideoMetadata.verify|verify} messages.
  3369. * @function encode
  3370. * @memberof VideoMetadata
  3371. * @static
  3372. * @param {IVideoMetadata} message VideoMetadata message or plain object to encode
  3373. * @param {$protobuf.Writer} [writer] Writer to encode to
  3374. * @returns {$protobuf.Writer} Writer
  3375. */
  3376. VideoMetadata.encode = function encode(message, writer) {
  3377. if (!writer)
  3378. writer = $Writer.create();
  3379. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  3380. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  3381. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  3382. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  3383. if (message.video != null && Object.hasOwnProperty.call(message, "video"))
  3384. writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.video);
  3385. if (message.thumbnailPhoto != null && Object.hasOwnProperty.call(message, "thumbnailPhoto"))
  3386. writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.thumbnailPhoto);
  3387. if (message.duration != null && Object.hasOwnProperty.call(message, "duration"))
  3388. writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.duration);
  3389. if (message.mediaPixelHeight != null && Object.hasOwnProperty.call(message, "mediaPixelHeight"))
  3390. writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.mediaPixelHeight);
  3391. if (message.mediaPixelWidth != null && Object.hasOwnProperty.call(message, "mediaPixelWidth"))
  3392. writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.mediaPixelWidth);
  3393. if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType"))
  3394. $root.MediaType.encode(message.mediaType, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
  3395. if (message.language != null && Object.hasOwnProperty.call(message, "language"))
  3396. writer.uint32(/* id 9, wireType 2 =*/74).string(message.language);
  3397. if (message.license != null && Object.hasOwnProperty.call(message, "license"))
  3398. $root.License.encode(message.license, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
  3399. if (message.publishedBeforeJoystream != null && Object.hasOwnProperty.call(message, "publishedBeforeJoystream"))
  3400. $root.PublishedBeforeJoystream.encode(message.publishedBeforeJoystream, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
  3401. if (message.hasMarketing != null && Object.hasOwnProperty.call(message, "hasMarketing"))
  3402. writer.uint32(/* id 12, wireType 0 =*/96).bool(message.hasMarketing);
  3403. if (message.isPublic != null && Object.hasOwnProperty.call(message, "isPublic"))
  3404. writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isPublic);
  3405. if (message.isExplicit != null && Object.hasOwnProperty.call(message, "isExplicit"))
  3406. writer.uint32(/* id 14, wireType 0 =*/112).bool(message.isExplicit);
  3407. if (message.persons != null && message.persons.length) {
  3408. writer.uint32(/* id 15, wireType 2 =*/122).fork();
  3409. for (var i = 0; i < message.persons.length; ++i)
  3410. writer.uint64(message.persons[i]);
  3411. writer.ldelim();
  3412. }
  3413. if (message.category != null && Object.hasOwnProperty.call(message, "category"))
  3414. writer.uint32(/* id 16, wireType 0 =*/128).uint64(message.category);
  3415. return writer;
  3416. };
  3417. /**
  3418. * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link VideoMetadata.verify|verify} messages.
  3419. * @function encodeDelimited
  3420. * @memberof VideoMetadata
  3421. * @static
  3422. * @param {IVideoMetadata} message VideoMetadata message or plain object to encode
  3423. * @param {$protobuf.Writer} [writer] Writer to encode to
  3424. * @returns {$protobuf.Writer} Writer
  3425. */
  3426. VideoMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  3427. return this.encode(message, writer).ldelim();
  3428. };
  3429. /**
  3430. * Decodes a VideoMetadata message from the specified reader or buffer.
  3431. * @function decode
  3432. * @memberof VideoMetadata
  3433. * @static
  3434. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3435. * @param {number} [length] Message length if known beforehand
  3436. * @returns {VideoMetadata} VideoMetadata
  3437. * @throws {Error} If the payload is not a reader or valid buffer
  3438. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3439. */
  3440. VideoMetadata.decode = function decode(reader, length) {
  3441. if (!(reader instanceof $Reader))
  3442. reader = $Reader.create(reader);
  3443. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.VideoMetadata();
  3444. while (reader.pos < end) {
  3445. var tag = reader.uint32();
  3446. switch (tag >>> 3) {
  3447. case 1:
  3448. message.title = reader.string();
  3449. break;
  3450. case 2:
  3451. message.description = reader.string();
  3452. break;
  3453. case 3:
  3454. message.video = reader.uint32();
  3455. break;
  3456. case 4:
  3457. message.thumbnailPhoto = reader.uint32();
  3458. break;
  3459. case 5:
  3460. message.duration = reader.uint32();
  3461. break;
  3462. case 6:
  3463. message.mediaPixelHeight = reader.uint32();
  3464. break;
  3465. case 7:
  3466. message.mediaPixelWidth = reader.uint32();
  3467. break;
  3468. case 8:
  3469. message.mediaType = $root.MediaType.decode(reader, reader.uint32());
  3470. break;
  3471. case 9:
  3472. message.language = reader.string();
  3473. break;
  3474. case 10:
  3475. message.license = $root.License.decode(reader, reader.uint32());
  3476. break;
  3477. case 11:
  3478. message.publishedBeforeJoystream = $root.PublishedBeforeJoystream.decode(reader, reader.uint32());
  3479. break;
  3480. case 12:
  3481. message.hasMarketing = reader.bool();
  3482. break;
  3483. case 13:
  3484. message.isPublic = reader.bool();
  3485. break;
  3486. case 14:
  3487. message.isExplicit = reader.bool();
  3488. break;
  3489. case 15:
  3490. if (!(message.persons && message.persons.length))
  3491. message.persons = [];
  3492. if ((tag & 7) === 2) {
  3493. var end2 = reader.uint32() + reader.pos;
  3494. while (reader.pos < end2)
  3495. message.persons.push(reader.uint64());
  3496. } else
  3497. message.persons.push(reader.uint64());
  3498. break;
  3499. case 16:
  3500. message.category = reader.uint64();
  3501. break;
  3502. default:
  3503. reader.skipType(tag & 7);
  3504. break;
  3505. }
  3506. }
  3507. return message;
  3508. };
  3509. /**
  3510. * Decodes a VideoMetadata message from the specified reader or buffer, length delimited.
  3511. * @function decodeDelimited
  3512. * @memberof VideoMetadata
  3513. * @static
  3514. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3515. * @returns {VideoMetadata} VideoMetadata
  3516. * @throws {Error} If the payload is not a reader or valid buffer
  3517. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3518. */
  3519. VideoMetadata.decodeDelimited = function decodeDelimited(reader) {
  3520. if (!(reader instanceof $Reader))
  3521. reader = new $Reader(reader);
  3522. return this.decode(reader, reader.uint32());
  3523. };
  3524. /**
  3525. * Verifies a VideoMetadata message.
  3526. * @function verify
  3527. * @memberof VideoMetadata
  3528. * @static
  3529. * @param {Object.<string,*>} message Plain object to verify
  3530. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  3531. */
  3532. VideoMetadata.verify = function verify(message) {
  3533. if (typeof message !== "object" || message === null)
  3534. return "object expected";
  3535. if (message.title != null && message.hasOwnProperty("title"))
  3536. if (!$util.isString(message.title))
  3537. return "title: string expected";
  3538. if (message.description != null && message.hasOwnProperty("description"))
  3539. if (!$util.isString(message.description))
  3540. return "description: string expected";
  3541. if (message.video != null && message.hasOwnProperty("video"))
  3542. if (!$util.isInteger(message.video))
  3543. return "video: integer expected";
  3544. if (message.thumbnailPhoto != null && message.hasOwnProperty("thumbnailPhoto"))
  3545. if (!$util.isInteger(message.thumbnailPhoto))
  3546. return "thumbnailPhoto: integer expected";
  3547. if (message.duration != null && message.hasOwnProperty("duration"))
  3548. if (!$util.isInteger(message.duration))
  3549. return "duration: integer expected";
  3550. if (message.mediaPixelHeight != null && message.hasOwnProperty("mediaPixelHeight"))
  3551. if (!$util.isInteger(message.mediaPixelHeight))
  3552. return "mediaPixelHeight: integer expected";
  3553. if (message.mediaPixelWidth != null && message.hasOwnProperty("mediaPixelWidth"))
  3554. if (!$util.isInteger(message.mediaPixelWidth))
  3555. return "mediaPixelWidth: integer expected";
  3556. if (message.mediaType != null && message.hasOwnProperty("mediaType")) {
  3557. var error = $root.MediaType.verify(message.mediaType);
  3558. if (error)
  3559. return "mediaType." + error;
  3560. }
  3561. if (message.language != null && message.hasOwnProperty("language"))
  3562. if (!$util.isString(message.language))
  3563. return "language: string expected";
  3564. if (message.license != null && message.hasOwnProperty("license")) {
  3565. var error = $root.License.verify(message.license);
  3566. if (error)
  3567. return "license." + error;
  3568. }
  3569. if (message.publishedBeforeJoystream != null && message.hasOwnProperty("publishedBeforeJoystream")) {
  3570. var error = $root.PublishedBeforeJoystream.verify(message.publishedBeforeJoystream);
  3571. if (error)
  3572. return "publishedBeforeJoystream." + error;
  3573. }
  3574. if (message.hasMarketing != null && message.hasOwnProperty("hasMarketing"))
  3575. if (typeof message.hasMarketing !== "boolean")
  3576. return "hasMarketing: boolean expected";
  3577. if (message.isPublic != null && message.hasOwnProperty("isPublic"))
  3578. if (typeof message.isPublic !== "boolean")
  3579. return "isPublic: boolean expected";
  3580. if (message.isExplicit != null && message.hasOwnProperty("isExplicit"))
  3581. if (typeof message.isExplicit !== "boolean")
  3582. return "isExplicit: boolean expected";
  3583. if (message.persons != null && message.hasOwnProperty("persons")) {
  3584. if (!Array.isArray(message.persons))
  3585. return "persons: array expected";
  3586. for (var i = 0; i < message.persons.length; ++i)
  3587. if (!$util.isInteger(message.persons[i]) && !(message.persons[i] && $util.isInteger(message.persons[i].low) && $util.isInteger(message.persons[i].high)))
  3588. return "persons: integer|Long[] expected";
  3589. }
  3590. if (message.category != null && message.hasOwnProperty("category"))
  3591. if (!$util.isInteger(message.category) && !(message.category && $util.isInteger(message.category.low) && $util.isInteger(message.category.high)))
  3592. return "category: integer|Long expected";
  3593. return null;
  3594. };
  3595. /**
  3596. * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types.
  3597. * @function fromObject
  3598. * @memberof VideoMetadata
  3599. * @static
  3600. * @param {Object.<string,*>} object Plain object
  3601. * @returns {VideoMetadata} VideoMetadata
  3602. */
  3603. VideoMetadata.fromObject = function fromObject(object) {
  3604. if (object instanceof $root.VideoMetadata)
  3605. return object;
  3606. var message = new $root.VideoMetadata();
  3607. if (object.title != null)
  3608. message.title = String(object.title);
  3609. if (object.description != null)
  3610. message.description = String(object.description);
  3611. if (object.video != null)
  3612. message.video = object.video >>> 0;
  3613. if (object.thumbnailPhoto != null)
  3614. message.thumbnailPhoto = object.thumbnailPhoto >>> 0;
  3615. if (object.duration != null)
  3616. message.duration = object.duration >>> 0;
  3617. if (object.mediaPixelHeight != null)
  3618. message.mediaPixelHeight = object.mediaPixelHeight >>> 0;
  3619. if (object.mediaPixelWidth != null)
  3620. message.mediaPixelWidth = object.mediaPixelWidth >>> 0;
  3621. if (object.mediaType != null) {
  3622. if (typeof object.mediaType !== "object")
  3623. throw TypeError(".VideoMetadata.mediaType: object expected");
  3624. message.mediaType = $root.MediaType.fromObject(object.mediaType);
  3625. }
  3626. if (object.language != null)
  3627. message.language = String(object.language);
  3628. if (object.license != null) {
  3629. if (typeof object.license !== "object")
  3630. throw TypeError(".VideoMetadata.license: object expected");
  3631. message.license = $root.License.fromObject(object.license);
  3632. }
  3633. if (object.publishedBeforeJoystream != null) {
  3634. if (typeof object.publishedBeforeJoystream !== "object")
  3635. throw TypeError(".VideoMetadata.publishedBeforeJoystream: object expected");
  3636. message.publishedBeforeJoystream = $root.PublishedBeforeJoystream.fromObject(object.publishedBeforeJoystream);
  3637. }
  3638. if (object.hasMarketing != null)
  3639. message.hasMarketing = Boolean(object.hasMarketing);
  3640. if (object.isPublic != null)
  3641. message.isPublic = Boolean(object.isPublic);
  3642. if (object.isExplicit != null)
  3643. message.isExplicit = Boolean(object.isExplicit);
  3644. if (object.persons) {
  3645. if (!Array.isArray(object.persons))
  3646. throw TypeError(".VideoMetadata.persons: array expected");
  3647. message.persons = [];
  3648. for (var i = 0; i < object.persons.length; ++i)
  3649. if ($util.Long)
  3650. (message.persons[i] = $util.Long.fromValue(object.persons[i])).unsigned = true;
  3651. else if (typeof object.persons[i] === "string")
  3652. message.persons[i] = parseInt(object.persons[i], 10);
  3653. else if (typeof object.persons[i] === "number")
  3654. message.persons[i] = object.persons[i];
  3655. else if (typeof object.persons[i] === "object")
  3656. message.persons[i] = new $util.LongBits(object.persons[i].low >>> 0, object.persons[i].high >>> 0).toNumber(true);
  3657. }
  3658. if (object.category != null)
  3659. if ($util.Long)
  3660. (message.category = $util.Long.fromValue(object.category)).unsigned = true;
  3661. else if (typeof object.category === "string")
  3662. message.category = parseInt(object.category, 10);
  3663. else if (typeof object.category === "number")
  3664. message.category = object.category;
  3665. else if (typeof object.category === "object")
  3666. message.category = new $util.LongBits(object.category.low >>> 0, object.category.high >>> 0).toNumber(true);
  3667. return message;
  3668. };
  3669. /**
  3670. * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified.
  3671. * @function toObject
  3672. * @memberof VideoMetadata
  3673. * @static
  3674. * @param {VideoMetadata} message VideoMetadata
  3675. * @param {$protobuf.IConversionOptions} [options] Conversion options
  3676. * @returns {Object.<string,*>} Plain object
  3677. */
  3678. VideoMetadata.toObject = function toObject(message, options) {
  3679. if (!options)
  3680. options = {};
  3681. var object = {};
  3682. if (options.arrays || options.defaults)
  3683. object.persons = [];
  3684. if (options.defaults) {
  3685. object.title = "";
  3686. object.description = "";
  3687. object.video = 0;
  3688. object.thumbnailPhoto = 0;
  3689. object.duration = 0;
  3690. object.mediaPixelHeight = 0;
  3691. object.mediaPixelWidth = 0;
  3692. object.mediaType = null;
  3693. object.language = "";
  3694. object.license = null;
  3695. object.publishedBeforeJoystream = null;
  3696. object.hasMarketing = false;
  3697. object.isPublic = false;
  3698. object.isExplicit = false;
  3699. if ($util.Long) {
  3700. var long = new $util.Long(0, 0, true);
  3701. object.category = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  3702. } else
  3703. object.category = options.longs === String ? "0" : 0;
  3704. }
  3705. if (message.title != null && message.hasOwnProperty("title"))
  3706. object.title = message.title;
  3707. if (message.description != null && message.hasOwnProperty("description"))
  3708. object.description = message.description;
  3709. if (message.video != null && message.hasOwnProperty("video"))
  3710. object.video = message.video;
  3711. if (message.thumbnailPhoto != null && message.hasOwnProperty("thumbnailPhoto"))
  3712. object.thumbnailPhoto = message.thumbnailPhoto;
  3713. if (message.duration != null && message.hasOwnProperty("duration"))
  3714. object.duration = message.duration;
  3715. if (message.mediaPixelHeight != null && message.hasOwnProperty("mediaPixelHeight"))
  3716. object.mediaPixelHeight = message.mediaPixelHeight;
  3717. if (message.mediaPixelWidth != null && message.hasOwnProperty("mediaPixelWidth"))
  3718. object.mediaPixelWidth = message.mediaPixelWidth;
  3719. if (message.mediaType != null && message.hasOwnProperty("mediaType"))
  3720. object.mediaType = $root.MediaType.toObject(message.mediaType, options);
  3721. if (message.language != null && message.hasOwnProperty("language"))
  3722. object.language = message.language;
  3723. if (message.license != null && message.hasOwnProperty("license"))
  3724. object.license = $root.License.toObject(message.license, options);
  3725. if (message.publishedBeforeJoystream != null && message.hasOwnProperty("publishedBeforeJoystream"))
  3726. object.publishedBeforeJoystream = $root.PublishedBeforeJoystream.toObject(message.publishedBeforeJoystream, options);
  3727. if (message.hasMarketing != null && message.hasOwnProperty("hasMarketing"))
  3728. object.hasMarketing = message.hasMarketing;
  3729. if (message.isPublic != null && message.hasOwnProperty("isPublic"))
  3730. object.isPublic = message.isPublic;
  3731. if (message.isExplicit != null && message.hasOwnProperty("isExplicit"))
  3732. object.isExplicit = message.isExplicit;
  3733. if (message.persons && message.persons.length) {
  3734. object.persons = [];
  3735. for (var j = 0; j < message.persons.length; ++j)
  3736. if (typeof message.persons[j] === "number")
  3737. object.persons[j] = options.longs === String ? String(message.persons[j]) : message.persons[j];
  3738. else
  3739. object.persons[j] = options.longs === String ? $util.Long.prototype.toString.call(message.persons[j]) : options.longs === Number ? new $util.LongBits(message.persons[j].low >>> 0, message.persons[j].high >>> 0).toNumber(true) : message.persons[j];
  3740. }
  3741. if (message.category != null && message.hasOwnProperty("category"))
  3742. if (typeof message.category === "number")
  3743. object.category = options.longs === String ? String(message.category) : message.category;
  3744. else
  3745. object.category = options.longs === String ? $util.Long.prototype.toString.call(message.category) : options.longs === Number ? new $util.LongBits(message.category.low >>> 0, message.category.high >>> 0).toNumber(true) : message.category;
  3746. return object;
  3747. };
  3748. /**
  3749. * Converts this VideoMetadata to JSON.
  3750. * @function toJSON
  3751. * @memberof VideoMetadata
  3752. * @instance
  3753. * @returns {Object.<string,*>} JSON object
  3754. */
  3755. VideoMetadata.prototype.toJSON = function toJSON() {
  3756. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  3757. };
  3758. return VideoMetadata;
  3759. })();
  3760. $root.VideoCategoryMetadata = (function() {
  3761. /**
  3762. * Properties of a VideoCategoryMetadata.
  3763. * @exports IVideoCategoryMetadata
  3764. * @interface IVideoCategoryMetadata
  3765. * @property {string|null} [name] VideoCategoryMetadata name
  3766. */
  3767. /**
  3768. * Constructs a new VideoCategoryMetadata.
  3769. * @exports VideoCategoryMetadata
  3770. * @classdesc Represents a VideoCategoryMetadata.
  3771. * @implements IVideoCategoryMetadata
  3772. * @constructor
  3773. * @param {IVideoCategoryMetadata=} [properties] Properties to set
  3774. */
  3775. function VideoCategoryMetadata(properties) {
  3776. if (properties)
  3777. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  3778. if (properties[keys[i]] != null)
  3779. this[keys[i]] = properties[keys[i]];
  3780. }
  3781. /**
  3782. * VideoCategoryMetadata name.
  3783. * @member {string} name
  3784. * @memberof VideoCategoryMetadata
  3785. * @instance
  3786. */
  3787. VideoCategoryMetadata.prototype.name = "";
  3788. /**
  3789. * Creates a new VideoCategoryMetadata instance using the specified properties.
  3790. * @function create
  3791. * @memberof VideoCategoryMetadata
  3792. * @static
  3793. * @param {IVideoCategoryMetadata=} [properties] Properties to set
  3794. * @returns {VideoCategoryMetadata} VideoCategoryMetadata instance
  3795. */
  3796. VideoCategoryMetadata.create = function create(properties) {
  3797. return new VideoCategoryMetadata(properties);
  3798. };
  3799. /**
  3800. * Encodes the specified VideoCategoryMetadata message. Does not implicitly {@link VideoCategoryMetadata.verify|verify} messages.
  3801. * @function encode
  3802. * @memberof VideoCategoryMetadata
  3803. * @static
  3804. * @param {IVideoCategoryMetadata} message VideoCategoryMetadata message or plain object to encode
  3805. * @param {$protobuf.Writer} [writer] Writer to encode to
  3806. * @returns {$protobuf.Writer} Writer
  3807. */
  3808. VideoCategoryMetadata.encode = function encode(message, writer) {
  3809. if (!writer)
  3810. writer = $Writer.create();
  3811. if (message.name != null && Object.hasOwnProperty.call(message, "name"))
  3812. writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
  3813. return writer;
  3814. };
  3815. /**
  3816. * Encodes the specified VideoCategoryMetadata message, length delimited. Does not implicitly {@link VideoCategoryMetadata.verify|verify} messages.
  3817. * @function encodeDelimited
  3818. * @memberof VideoCategoryMetadata
  3819. * @static
  3820. * @param {IVideoCategoryMetadata} message VideoCategoryMetadata message or plain object to encode
  3821. * @param {$protobuf.Writer} [writer] Writer to encode to
  3822. * @returns {$protobuf.Writer} Writer
  3823. */
  3824. VideoCategoryMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  3825. return this.encode(message, writer).ldelim();
  3826. };
  3827. /**
  3828. * Decodes a VideoCategoryMetadata message from the specified reader or buffer.
  3829. * @function decode
  3830. * @memberof VideoCategoryMetadata
  3831. * @static
  3832. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3833. * @param {number} [length] Message length if known beforehand
  3834. * @returns {VideoCategoryMetadata} VideoCategoryMetadata
  3835. * @throws {Error} If the payload is not a reader or valid buffer
  3836. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3837. */
  3838. VideoCategoryMetadata.decode = function decode(reader, length) {
  3839. if (!(reader instanceof $Reader))
  3840. reader = $Reader.create(reader);
  3841. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.VideoCategoryMetadata();
  3842. while (reader.pos < end) {
  3843. var tag = reader.uint32();
  3844. switch (tag >>> 3) {
  3845. case 1:
  3846. message.name = reader.string();
  3847. break;
  3848. default:
  3849. reader.skipType(tag & 7);
  3850. break;
  3851. }
  3852. }
  3853. return message;
  3854. };
  3855. /**
  3856. * Decodes a VideoCategoryMetadata message from the specified reader or buffer, length delimited.
  3857. * @function decodeDelimited
  3858. * @memberof VideoCategoryMetadata
  3859. * @static
  3860. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3861. * @returns {VideoCategoryMetadata} VideoCategoryMetadata
  3862. * @throws {Error} If the payload is not a reader or valid buffer
  3863. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3864. */
  3865. VideoCategoryMetadata.decodeDelimited = function decodeDelimited(reader) {
  3866. if (!(reader instanceof $Reader))
  3867. reader = new $Reader(reader);
  3868. return this.decode(reader, reader.uint32());
  3869. };
  3870. /**
  3871. * Verifies a VideoCategoryMetadata message.
  3872. * @function verify
  3873. * @memberof VideoCategoryMetadata
  3874. * @static
  3875. * @param {Object.<string,*>} message Plain object to verify
  3876. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  3877. */
  3878. VideoCategoryMetadata.verify = function verify(message) {
  3879. if (typeof message !== "object" || message === null)
  3880. return "object expected";
  3881. if (message.name != null && message.hasOwnProperty("name"))
  3882. if (!$util.isString(message.name))
  3883. return "name: string expected";
  3884. return null;
  3885. };
  3886. /**
  3887. * Creates a VideoCategoryMetadata message from a plain object. Also converts values to their respective internal types.
  3888. * @function fromObject
  3889. * @memberof VideoCategoryMetadata
  3890. * @static
  3891. * @param {Object.<string,*>} object Plain object
  3892. * @returns {VideoCategoryMetadata} VideoCategoryMetadata
  3893. */
  3894. VideoCategoryMetadata.fromObject = function fromObject(object) {
  3895. if (object instanceof $root.VideoCategoryMetadata)
  3896. return object;
  3897. var message = new $root.VideoCategoryMetadata();
  3898. if (object.name != null)
  3899. message.name = String(object.name);
  3900. return message;
  3901. };
  3902. /**
  3903. * Creates a plain object from a VideoCategoryMetadata message. Also converts values to other types if specified.
  3904. * @function toObject
  3905. * @memberof VideoCategoryMetadata
  3906. * @static
  3907. * @param {VideoCategoryMetadata} message VideoCategoryMetadata
  3908. * @param {$protobuf.IConversionOptions} [options] Conversion options
  3909. * @returns {Object.<string,*>} Plain object
  3910. */
  3911. VideoCategoryMetadata.toObject = function toObject(message, options) {
  3912. if (!options)
  3913. options = {};
  3914. var object = {};
  3915. if (options.defaults)
  3916. object.name = "";
  3917. if (message.name != null && message.hasOwnProperty("name"))
  3918. object.name = message.name;
  3919. return object;
  3920. };
  3921. /**
  3922. * Converts this VideoCategoryMetadata to JSON.
  3923. * @function toJSON
  3924. * @memberof VideoCategoryMetadata
  3925. * @instance
  3926. * @returns {Object.<string,*>} JSON object
  3927. */
  3928. VideoCategoryMetadata.prototype.toJSON = function toJSON() {
  3929. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  3930. };
  3931. return VideoCategoryMetadata;
  3932. })();
  3933. $root.OpeningMetadata = (function() {
  3934. /**
  3935. * Properties of an OpeningMetadata.
  3936. * @exports IOpeningMetadata
  3937. * @interface IOpeningMetadata
  3938. * @property {string|null} [shortDescription] OpeningMetadata shortDescription
  3939. * @property {string|null} [description] OpeningMetadata description
  3940. * @property {number|null} [hiringLimit] OpeningMetadata hiringLimit
  3941. * @property {number|null} [expectedEndingTimestamp] OpeningMetadata expectedEndingTimestamp
  3942. * @property {string|null} [applicationDetails] OpeningMetadata applicationDetails
  3943. * @property {Array.<OpeningMetadata.IApplicationFormQuestion>|null} [applicationFormQuestions] OpeningMetadata applicationFormQuestions
  3944. */
  3945. /**
  3946. * Constructs a new OpeningMetadata.
  3947. * @exports OpeningMetadata
  3948. * @classdesc Represents an OpeningMetadata.
  3949. * @implements IOpeningMetadata
  3950. * @constructor
  3951. * @param {IOpeningMetadata=} [properties] Properties to set
  3952. */
  3953. function OpeningMetadata(properties) {
  3954. this.applicationFormQuestions = [];
  3955. if (properties)
  3956. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  3957. if (properties[keys[i]] != null)
  3958. this[keys[i]] = properties[keys[i]];
  3959. }
  3960. /**
  3961. * OpeningMetadata shortDescription.
  3962. * @member {string} shortDescription
  3963. * @memberof OpeningMetadata
  3964. * @instance
  3965. */
  3966. OpeningMetadata.prototype.shortDescription = "";
  3967. /**
  3968. * OpeningMetadata description.
  3969. * @member {string} description
  3970. * @memberof OpeningMetadata
  3971. * @instance
  3972. */
  3973. OpeningMetadata.prototype.description = "";
  3974. /**
  3975. * OpeningMetadata hiringLimit.
  3976. * @member {number} hiringLimit
  3977. * @memberof OpeningMetadata
  3978. * @instance
  3979. */
  3980. OpeningMetadata.prototype.hiringLimit = 0;
  3981. /**
  3982. * OpeningMetadata expectedEndingTimestamp.
  3983. * @member {number} expectedEndingTimestamp
  3984. * @memberof OpeningMetadata
  3985. * @instance
  3986. */
  3987. OpeningMetadata.prototype.expectedEndingTimestamp = 0;
  3988. /**
  3989. * OpeningMetadata applicationDetails.
  3990. * @member {string} applicationDetails
  3991. * @memberof OpeningMetadata
  3992. * @instance
  3993. */
  3994. OpeningMetadata.prototype.applicationDetails = "";
  3995. /**
  3996. * OpeningMetadata applicationFormQuestions.
  3997. * @member {Array.<OpeningMetadata.IApplicationFormQuestion>} applicationFormQuestions
  3998. * @memberof OpeningMetadata
  3999. * @instance
  4000. */
  4001. OpeningMetadata.prototype.applicationFormQuestions = $util.emptyArray;
  4002. /**
  4003. * Creates a new OpeningMetadata instance using the specified properties.
  4004. * @function create
  4005. * @memberof OpeningMetadata
  4006. * @static
  4007. * @param {IOpeningMetadata=} [properties] Properties to set
  4008. * @returns {OpeningMetadata} OpeningMetadata instance
  4009. */
  4010. OpeningMetadata.create = function create(properties) {
  4011. return new OpeningMetadata(properties);
  4012. };
  4013. /**
  4014. * Encodes the specified OpeningMetadata message. Does not implicitly {@link OpeningMetadata.verify|verify} messages.
  4015. * @function encode
  4016. * @memberof OpeningMetadata
  4017. * @static
  4018. * @param {IOpeningMetadata} message OpeningMetadata message or plain object to encode
  4019. * @param {$protobuf.Writer} [writer] Writer to encode to
  4020. * @returns {$protobuf.Writer} Writer
  4021. */
  4022. OpeningMetadata.encode = function encode(message, writer) {
  4023. if (!writer)
  4024. writer = $Writer.create();
  4025. if (message.shortDescription != null && Object.hasOwnProperty.call(message, "shortDescription"))
  4026. writer.uint32(/* id 1, wireType 2 =*/10).string(message.shortDescription);
  4027. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  4028. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  4029. if (message.hiringLimit != null && Object.hasOwnProperty.call(message, "hiringLimit"))
  4030. writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.hiringLimit);
  4031. if (message.expectedEndingTimestamp != null && Object.hasOwnProperty.call(message, "expectedEndingTimestamp"))
  4032. writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.expectedEndingTimestamp);
  4033. if (message.applicationDetails != null && Object.hasOwnProperty.call(message, "applicationDetails"))
  4034. writer.uint32(/* id 5, wireType 2 =*/42).string(message.applicationDetails);
  4035. if (message.applicationFormQuestions != null && message.applicationFormQuestions.length)
  4036. for (var i = 0; i < message.applicationFormQuestions.length; ++i)
  4037. $root.OpeningMetadata.ApplicationFormQuestion.encode(message.applicationFormQuestions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
  4038. return writer;
  4039. };
  4040. /**
  4041. * Encodes the specified OpeningMetadata message, length delimited. Does not implicitly {@link OpeningMetadata.verify|verify} messages.
  4042. * @function encodeDelimited
  4043. * @memberof OpeningMetadata
  4044. * @static
  4045. * @param {IOpeningMetadata} message OpeningMetadata message or plain object to encode
  4046. * @param {$protobuf.Writer} [writer] Writer to encode to
  4047. * @returns {$protobuf.Writer} Writer
  4048. */
  4049. OpeningMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  4050. return this.encode(message, writer).ldelim();
  4051. };
  4052. /**
  4053. * Decodes an OpeningMetadata message from the specified reader or buffer.
  4054. * @function decode
  4055. * @memberof OpeningMetadata
  4056. * @static
  4057. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4058. * @param {number} [length] Message length if known beforehand
  4059. * @returns {OpeningMetadata} OpeningMetadata
  4060. * @throws {Error} If the payload is not a reader or valid buffer
  4061. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4062. */
  4063. OpeningMetadata.decode = function decode(reader, length) {
  4064. if (!(reader instanceof $Reader))
  4065. reader = $Reader.create(reader);
  4066. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.OpeningMetadata();
  4067. while (reader.pos < end) {
  4068. var tag = reader.uint32();
  4069. switch (tag >>> 3) {
  4070. case 1:
  4071. message.shortDescription = reader.string();
  4072. break;
  4073. case 2:
  4074. message.description = reader.string();
  4075. break;
  4076. case 3:
  4077. message.hiringLimit = reader.uint32();
  4078. break;
  4079. case 4:
  4080. message.expectedEndingTimestamp = reader.uint32();
  4081. break;
  4082. case 5:
  4083. message.applicationDetails = reader.string();
  4084. break;
  4085. case 6:
  4086. if (!(message.applicationFormQuestions && message.applicationFormQuestions.length))
  4087. message.applicationFormQuestions = [];
  4088. message.applicationFormQuestions.push($root.OpeningMetadata.ApplicationFormQuestion.decode(reader, reader.uint32()));
  4089. break;
  4090. default:
  4091. reader.skipType(tag & 7);
  4092. break;
  4093. }
  4094. }
  4095. return message;
  4096. };
  4097. /**
  4098. * Decodes an OpeningMetadata message from the specified reader or buffer, length delimited.
  4099. * @function decodeDelimited
  4100. * @memberof OpeningMetadata
  4101. * @static
  4102. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4103. * @returns {OpeningMetadata} OpeningMetadata
  4104. * @throws {Error} If the payload is not a reader or valid buffer
  4105. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4106. */
  4107. OpeningMetadata.decodeDelimited = function decodeDelimited(reader) {
  4108. if (!(reader instanceof $Reader))
  4109. reader = new $Reader(reader);
  4110. return this.decode(reader, reader.uint32());
  4111. };
  4112. /**
  4113. * Verifies an OpeningMetadata message.
  4114. * @function verify
  4115. * @memberof OpeningMetadata
  4116. * @static
  4117. * @param {Object.<string,*>} message Plain object to verify
  4118. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  4119. */
  4120. OpeningMetadata.verify = function verify(message) {
  4121. if (typeof message !== "object" || message === null)
  4122. return "object expected";
  4123. if (message.shortDescription != null && message.hasOwnProperty("shortDescription"))
  4124. if (!$util.isString(message.shortDescription))
  4125. return "shortDescription: string expected";
  4126. if (message.description != null && message.hasOwnProperty("description"))
  4127. if (!$util.isString(message.description))
  4128. return "description: string expected";
  4129. if (message.hiringLimit != null && message.hasOwnProperty("hiringLimit"))
  4130. if (!$util.isInteger(message.hiringLimit))
  4131. return "hiringLimit: integer expected";
  4132. if (message.expectedEndingTimestamp != null && message.hasOwnProperty("expectedEndingTimestamp"))
  4133. if (!$util.isInteger(message.expectedEndingTimestamp))
  4134. return "expectedEndingTimestamp: integer expected";
  4135. if (message.applicationDetails != null && message.hasOwnProperty("applicationDetails"))
  4136. if (!$util.isString(message.applicationDetails))
  4137. return "applicationDetails: string expected";
  4138. if (message.applicationFormQuestions != null && message.hasOwnProperty("applicationFormQuestions")) {
  4139. if (!Array.isArray(message.applicationFormQuestions))
  4140. return "applicationFormQuestions: array expected";
  4141. for (var i = 0; i < message.applicationFormQuestions.length; ++i) {
  4142. var error = $root.OpeningMetadata.ApplicationFormQuestion.verify(message.applicationFormQuestions[i]);
  4143. if (error)
  4144. return "applicationFormQuestions." + error;
  4145. }
  4146. }
  4147. return null;
  4148. };
  4149. /**
  4150. * Creates an OpeningMetadata message from a plain object. Also converts values to their respective internal types.
  4151. * @function fromObject
  4152. * @memberof OpeningMetadata
  4153. * @static
  4154. * @param {Object.<string,*>} object Plain object
  4155. * @returns {OpeningMetadata} OpeningMetadata
  4156. */
  4157. OpeningMetadata.fromObject = function fromObject(object) {
  4158. if (object instanceof $root.OpeningMetadata)
  4159. return object;
  4160. var message = new $root.OpeningMetadata();
  4161. if (object.shortDescription != null)
  4162. message.shortDescription = String(object.shortDescription);
  4163. if (object.description != null)
  4164. message.description = String(object.description);
  4165. if (object.hiringLimit != null)
  4166. message.hiringLimit = object.hiringLimit >>> 0;
  4167. if (object.expectedEndingTimestamp != null)
  4168. message.expectedEndingTimestamp = object.expectedEndingTimestamp >>> 0;
  4169. if (object.applicationDetails != null)
  4170. message.applicationDetails = String(object.applicationDetails);
  4171. if (object.applicationFormQuestions) {
  4172. if (!Array.isArray(object.applicationFormQuestions))
  4173. throw TypeError(".OpeningMetadata.applicationFormQuestions: array expected");
  4174. message.applicationFormQuestions = [];
  4175. for (var i = 0; i < object.applicationFormQuestions.length; ++i) {
  4176. if (typeof object.applicationFormQuestions[i] !== "object")
  4177. throw TypeError(".OpeningMetadata.applicationFormQuestions: object expected");
  4178. message.applicationFormQuestions[i] = $root.OpeningMetadata.ApplicationFormQuestion.fromObject(object.applicationFormQuestions[i]);
  4179. }
  4180. }
  4181. return message;
  4182. };
  4183. /**
  4184. * Creates a plain object from an OpeningMetadata message. Also converts values to other types if specified.
  4185. * @function toObject
  4186. * @memberof OpeningMetadata
  4187. * @static
  4188. * @param {OpeningMetadata} message OpeningMetadata
  4189. * @param {$protobuf.IConversionOptions} [options] Conversion options
  4190. * @returns {Object.<string,*>} Plain object
  4191. */
  4192. OpeningMetadata.toObject = function toObject(message, options) {
  4193. if (!options)
  4194. options = {};
  4195. var object = {};
  4196. if (options.arrays || options.defaults)
  4197. object.applicationFormQuestions = [];
  4198. if (options.defaults) {
  4199. object.shortDescription = "";
  4200. object.description = "";
  4201. object.hiringLimit = 0;
  4202. object.expectedEndingTimestamp = 0;
  4203. object.applicationDetails = "";
  4204. }
  4205. if (message.shortDescription != null && message.hasOwnProperty("shortDescription"))
  4206. object.shortDescription = message.shortDescription;
  4207. if (message.description != null && message.hasOwnProperty("description"))
  4208. object.description = message.description;
  4209. if (message.hiringLimit != null && message.hasOwnProperty("hiringLimit"))
  4210. object.hiringLimit = message.hiringLimit;
  4211. if (message.expectedEndingTimestamp != null && message.hasOwnProperty("expectedEndingTimestamp"))
  4212. object.expectedEndingTimestamp = message.expectedEndingTimestamp;
  4213. if (message.applicationDetails != null && message.hasOwnProperty("applicationDetails"))
  4214. object.applicationDetails = message.applicationDetails;
  4215. if (message.applicationFormQuestions && message.applicationFormQuestions.length) {
  4216. object.applicationFormQuestions = [];
  4217. for (var j = 0; j < message.applicationFormQuestions.length; ++j)
  4218. object.applicationFormQuestions[j] = $root.OpeningMetadata.ApplicationFormQuestion.toObject(message.applicationFormQuestions[j], options);
  4219. }
  4220. return object;
  4221. };
  4222. /**
  4223. * Converts this OpeningMetadata to JSON.
  4224. * @function toJSON
  4225. * @memberof OpeningMetadata
  4226. * @instance
  4227. * @returns {Object.<string,*>} JSON object
  4228. */
  4229. OpeningMetadata.prototype.toJSON = function toJSON() {
  4230. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  4231. };
  4232. OpeningMetadata.ApplicationFormQuestion = (function() {
  4233. /**
  4234. * Properties of an ApplicationFormQuestion.
  4235. * @memberof OpeningMetadata
  4236. * @interface IApplicationFormQuestion
  4237. * @property {string|null} [question] ApplicationFormQuestion question
  4238. * @property {OpeningMetadata.ApplicationFormQuestion.InputType|null} [type] ApplicationFormQuestion type
  4239. */
  4240. /**
  4241. * Constructs a new ApplicationFormQuestion.
  4242. * @memberof OpeningMetadata
  4243. * @classdesc Represents an ApplicationFormQuestion.
  4244. * @implements IApplicationFormQuestion
  4245. * @constructor
  4246. * @param {OpeningMetadata.IApplicationFormQuestion=} [properties] Properties to set
  4247. */
  4248. function ApplicationFormQuestion(properties) {
  4249. if (properties)
  4250. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  4251. if (properties[keys[i]] != null)
  4252. this[keys[i]] = properties[keys[i]];
  4253. }
  4254. /**
  4255. * ApplicationFormQuestion question.
  4256. * @member {string} question
  4257. * @memberof OpeningMetadata.ApplicationFormQuestion
  4258. * @instance
  4259. */
  4260. ApplicationFormQuestion.prototype.question = "";
  4261. /**
  4262. * ApplicationFormQuestion type.
  4263. * @member {OpeningMetadata.ApplicationFormQuestion.InputType} type
  4264. * @memberof OpeningMetadata.ApplicationFormQuestion
  4265. * @instance
  4266. */
  4267. ApplicationFormQuestion.prototype.type = 0;
  4268. /**
  4269. * Creates a new ApplicationFormQuestion instance using the specified properties.
  4270. * @function create
  4271. * @memberof OpeningMetadata.ApplicationFormQuestion
  4272. * @static
  4273. * @param {OpeningMetadata.IApplicationFormQuestion=} [properties] Properties to set
  4274. * @returns {OpeningMetadata.ApplicationFormQuestion} ApplicationFormQuestion instance
  4275. */
  4276. ApplicationFormQuestion.create = function create(properties) {
  4277. return new ApplicationFormQuestion(properties);
  4278. };
  4279. /**
  4280. * Encodes the specified ApplicationFormQuestion message. Does not implicitly {@link OpeningMetadata.ApplicationFormQuestion.verify|verify} messages.
  4281. * @function encode
  4282. * @memberof OpeningMetadata.ApplicationFormQuestion
  4283. * @static
  4284. * @param {OpeningMetadata.IApplicationFormQuestion} message ApplicationFormQuestion message or plain object to encode
  4285. * @param {$protobuf.Writer} [writer] Writer to encode to
  4286. * @returns {$protobuf.Writer} Writer
  4287. */
  4288. ApplicationFormQuestion.encode = function encode(message, writer) {
  4289. if (!writer)
  4290. writer = $Writer.create();
  4291. if (message.question != null && Object.hasOwnProperty.call(message, "question"))
  4292. writer.uint32(/* id 1, wireType 2 =*/10).string(message.question);
  4293. if (message.type != null && Object.hasOwnProperty.call(message, "type"))
  4294. writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
  4295. return writer;
  4296. };
  4297. /**
  4298. * Encodes the specified ApplicationFormQuestion message, length delimited. Does not implicitly {@link OpeningMetadata.ApplicationFormQuestion.verify|verify} messages.
  4299. * @function encodeDelimited
  4300. * @memberof OpeningMetadata.ApplicationFormQuestion
  4301. * @static
  4302. * @param {OpeningMetadata.IApplicationFormQuestion} message ApplicationFormQuestion message or plain object to encode
  4303. * @param {$protobuf.Writer} [writer] Writer to encode to
  4304. * @returns {$protobuf.Writer} Writer
  4305. */
  4306. ApplicationFormQuestion.encodeDelimited = function encodeDelimited(message, writer) {
  4307. return this.encode(message, writer).ldelim();
  4308. };
  4309. /**
  4310. * Decodes an ApplicationFormQuestion message from the specified reader or buffer.
  4311. * @function decode
  4312. * @memberof OpeningMetadata.ApplicationFormQuestion
  4313. * @static
  4314. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4315. * @param {number} [length] Message length if known beforehand
  4316. * @returns {OpeningMetadata.ApplicationFormQuestion} ApplicationFormQuestion
  4317. * @throws {Error} If the payload is not a reader or valid buffer
  4318. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4319. */
  4320. ApplicationFormQuestion.decode = function decode(reader, length) {
  4321. if (!(reader instanceof $Reader))
  4322. reader = $Reader.create(reader);
  4323. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.OpeningMetadata.ApplicationFormQuestion();
  4324. while (reader.pos < end) {
  4325. var tag = reader.uint32();
  4326. switch (tag >>> 3) {
  4327. case 1:
  4328. message.question = reader.string();
  4329. break;
  4330. case 2:
  4331. message.type = reader.int32();
  4332. break;
  4333. default:
  4334. reader.skipType(tag & 7);
  4335. break;
  4336. }
  4337. }
  4338. return message;
  4339. };
  4340. /**
  4341. * Decodes an ApplicationFormQuestion message from the specified reader or buffer, length delimited.
  4342. * @function decodeDelimited
  4343. * @memberof OpeningMetadata.ApplicationFormQuestion
  4344. * @static
  4345. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4346. * @returns {OpeningMetadata.ApplicationFormQuestion} ApplicationFormQuestion
  4347. * @throws {Error} If the payload is not a reader or valid buffer
  4348. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4349. */
  4350. ApplicationFormQuestion.decodeDelimited = function decodeDelimited(reader) {
  4351. if (!(reader instanceof $Reader))
  4352. reader = new $Reader(reader);
  4353. return this.decode(reader, reader.uint32());
  4354. };
  4355. /**
  4356. * Verifies an ApplicationFormQuestion message.
  4357. * @function verify
  4358. * @memberof OpeningMetadata.ApplicationFormQuestion
  4359. * @static
  4360. * @param {Object.<string,*>} message Plain object to verify
  4361. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  4362. */
  4363. ApplicationFormQuestion.verify = function verify(message) {
  4364. if (typeof message !== "object" || message === null)
  4365. return "object expected";
  4366. if (message.question != null && message.hasOwnProperty("question"))
  4367. if (!$util.isString(message.question))
  4368. return "question: string expected";
  4369. if (message.type != null && message.hasOwnProperty("type"))
  4370. switch (message.type) {
  4371. default:
  4372. return "type: enum value expected";
  4373. case 0:
  4374. case 1:
  4375. break;
  4376. }
  4377. return null;
  4378. };
  4379. /**
  4380. * Creates an ApplicationFormQuestion message from a plain object. Also converts values to their respective internal types.
  4381. * @function fromObject
  4382. * @memberof OpeningMetadata.ApplicationFormQuestion
  4383. * @static
  4384. * @param {Object.<string,*>} object Plain object
  4385. * @returns {OpeningMetadata.ApplicationFormQuestion} ApplicationFormQuestion
  4386. */
  4387. ApplicationFormQuestion.fromObject = function fromObject(object) {
  4388. if (object instanceof $root.OpeningMetadata.ApplicationFormQuestion)
  4389. return object;
  4390. var message = new $root.OpeningMetadata.ApplicationFormQuestion();
  4391. if (object.question != null)
  4392. message.question = String(object.question);
  4393. switch (object.type) {
  4394. case "TEXTAREA":
  4395. case 0:
  4396. message.type = 0;
  4397. break;
  4398. case "TEXT":
  4399. case 1:
  4400. message.type = 1;
  4401. break;
  4402. }
  4403. return message;
  4404. };
  4405. /**
  4406. * Creates a plain object from an ApplicationFormQuestion message. Also converts values to other types if specified.
  4407. * @function toObject
  4408. * @memberof OpeningMetadata.ApplicationFormQuestion
  4409. * @static
  4410. * @param {OpeningMetadata.ApplicationFormQuestion} message ApplicationFormQuestion
  4411. * @param {$protobuf.IConversionOptions} [options] Conversion options
  4412. * @returns {Object.<string,*>} Plain object
  4413. */
  4414. ApplicationFormQuestion.toObject = function toObject(message, options) {
  4415. if (!options)
  4416. options = {};
  4417. var object = {};
  4418. if (options.defaults) {
  4419. object.question = "";
  4420. object.type = options.enums === String ? "TEXTAREA" : 0;
  4421. }
  4422. if (message.question != null && message.hasOwnProperty("question"))
  4423. object.question = message.question;
  4424. if (message.type != null && message.hasOwnProperty("type"))
  4425. object.type = options.enums === String ? $root.OpeningMetadata.ApplicationFormQuestion.InputType[message.type] : message.type;
  4426. return object;
  4427. };
  4428. /**
  4429. * Converts this ApplicationFormQuestion to JSON.
  4430. * @function toJSON
  4431. * @memberof OpeningMetadata.ApplicationFormQuestion
  4432. * @instance
  4433. * @returns {Object.<string,*>} JSON object
  4434. */
  4435. ApplicationFormQuestion.prototype.toJSON = function toJSON() {
  4436. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  4437. };
  4438. /**
  4439. * InputType enum.
  4440. * @name OpeningMetadata.ApplicationFormQuestion.InputType
  4441. * @enum {number}
  4442. * @property {number} TEXTAREA=0 TEXTAREA value
  4443. * @property {number} TEXT=1 TEXT value
  4444. */
  4445. ApplicationFormQuestion.InputType = (function() {
  4446. var valuesById = {}, values = Object.create(valuesById);
  4447. values[valuesById[0] = "TEXTAREA"] = 0;
  4448. values[valuesById[1] = "TEXT"] = 1;
  4449. return values;
  4450. })();
  4451. return ApplicationFormQuestion;
  4452. })();
  4453. return OpeningMetadata;
  4454. })();
  4455. $root.UpcomingOpeningMetadata = (function() {
  4456. /**
  4457. * Properties of an UpcomingOpeningMetadata.
  4458. * @exports IUpcomingOpeningMetadata
  4459. * @interface IUpcomingOpeningMetadata
  4460. * @property {number|null} [expectedStart] UpcomingOpeningMetadata expectedStart
  4461. * @property {Long|null} [rewardPerBlock] UpcomingOpeningMetadata rewardPerBlock
  4462. * @property {Long|null} [minApplicationStake] UpcomingOpeningMetadata minApplicationStake
  4463. * @property {IOpeningMetadata|null} [metadata] UpcomingOpeningMetadata metadata
  4464. */
  4465. /**
  4466. * Constructs a new UpcomingOpeningMetadata.
  4467. * @exports UpcomingOpeningMetadata
  4468. * @classdesc Represents an UpcomingOpeningMetadata.
  4469. * @implements IUpcomingOpeningMetadata
  4470. * @constructor
  4471. * @param {IUpcomingOpeningMetadata=} [properties] Properties to set
  4472. */
  4473. function UpcomingOpeningMetadata(properties) {
  4474. if (properties)
  4475. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  4476. if (properties[keys[i]] != null)
  4477. this[keys[i]] = properties[keys[i]];
  4478. }
  4479. /**
  4480. * UpcomingOpeningMetadata expectedStart.
  4481. * @member {number} expectedStart
  4482. * @memberof UpcomingOpeningMetadata
  4483. * @instance
  4484. */
  4485. UpcomingOpeningMetadata.prototype.expectedStart = 0;
  4486. /**
  4487. * UpcomingOpeningMetadata rewardPerBlock.
  4488. * @member {Long} rewardPerBlock
  4489. * @memberof UpcomingOpeningMetadata
  4490. * @instance
  4491. */
  4492. UpcomingOpeningMetadata.prototype.rewardPerBlock = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
  4493. /**
  4494. * UpcomingOpeningMetadata minApplicationStake.
  4495. * @member {Long} minApplicationStake
  4496. * @memberof UpcomingOpeningMetadata
  4497. * @instance
  4498. */
  4499. UpcomingOpeningMetadata.prototype.minApplicationStake = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
  4500. /**
  4501. * UpcomingOpeningMetadata metadata.
  4502. * @member {IOpeningMetadata|null|undefined} metadata
  4503. * @memberof UpcomingOpeningMetadata
  4504. * @instance
  4505. */
  4506. UpcomingOpeningMetadata.prototype.metadata = null;
  4507. /**
  4508. * Creates a new UpcomingOpeningMetadata instance using the specified properties.
  4509. * @function create
  4510. * @memberof UpcomingOpeningMetadata
  4511. * @static
  4512. * @param {IUpcomingOpeningMetadata=} [properties] Properties to set
  4513. * @returns {UpcomingOpeningMetadata} UpcomingOpeningMetadata instance
  4514. */
  4515. UpcomingOpeningMetadata.create = function create(properties) {
  4516. return new UpcomingOpeningMetadata(properties);
  4517. };
  4518. /**
  4519. * Encodes the specified UpcomingOpeningMetadata message. Does not implicitly {@link UpcomingOpeningMetadata.verify|verify} messages.
  4520. * @function encode
  4521. * @memberof UpcomingOpeningMetadata
  4522. * @static
  4523. * @param {IUpcomingOpeningMetadata} message UpcomingOpeningMetadata message or plain object to encode
  4524. * @param {$protobuf.Writer} [writer] Writer to encode to
  4525. * @returns {$protobuf.Writer} Writer
  4526. */
  4527. UpcomingOpeningMetadata.encode = function encode(message, writer) {
  4528. if (!writer)
  4529. writer = $Writer.create();
  4530. if (message.expectedStart != null && Object.hasOwnProperty.call(message, "expectedStart"))
  4531. writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.expectedStart);
  4532. if (message.rewardPerBlock != null && Object.hasOwnProperty.call(message, "rewardPerBlock"))
  4533. writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.rewardPerBlock);
  4534. if (message.minApplicationStake != null && Object.hasOwnProperty.call(message, "minApplicationStake"))
  4535. writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.minApplicationStake);
  4536. if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
  4537. $root.OpeningMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
  4538. return writer;
  4539. };
  4540. /**
  4541. * Encodes the specified UpcomingOpeningMetadata message, length delimited. Does not implicitly {@link UpcomingOpeningMetadata.verify|verify} messages.
  4542. * @function encodeDelimited
  4543. * @memberof UpcomingOpeningMetadata
  4544. * @static
  4545. * @param {IUpcomingOpeningMetadata} message UpcomingOpeningMetadata message or plain object to encode
  4546. * @param {$protobuf.Writer} [writer] Writer to encode to
  4547. * @returns {$protobuf.Writer} Writer
  4548. */
  4549. UpcomingOpeningMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  4550. return this.encode(message, writer).ldelim();
  4551. };
  4552. /**
  4553. * Decodes an UpcomingOpeningMetadata message from the specified reader or buffer.
  4554. * @function decode
  4555. * @memberof UpcomingOpeningMetadata
  4556. * @static
  4557. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4558. * @param {number} [length] Message length if known beforehand
  4559. * @returns {UpcomingOpeningMetadata} UpcomingOpeningMetadata
  4560. * @throws {Error} If the payload is not a reader or valid buffer
  4561. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4562. */
  4563. UpcomingOpeningMetadata.decode = function decode(reader, length) {
  4564. if (!(reader instanceof $Reader))
  4565. reader = $Reader.create(reader);
  4566. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpcomingOpeningMetadata();
  4567. while (reader.pos < end) {
  4568. var tag = reader.uint32();
  4569. switch (tag >>> 3) {
  4570. case 1:
  4571. message.expectedStart = reader.uint32();
  4572. break;
  4573. case 2:
  4574. message.rewardPerBlock = reader.uint64();
  4575. break;
  4576. case 3:
  4577. message.minApplicationStake = reader.uint64();
  4578. break;
  4579. case 4:
  4580. message.metadata = $root.OpeningMetadata.decode(reader, reader.uint32());
  4581. break;
  4582. default:
  4583. reader.skipType(tag & 7);
  4584. break;
  4585. }
  4586. }
  4587. return message;
  4588. };
  4589. /**
  4590. * Decodes an UpcomingOpeningMetadata message from the specified reader or buffer, length delimited.
  4591. * @function decodeDelimited
  4592. * @memberof UpcomingOpeningMetadata
  4593. * @static
  4594. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4595. * @returns {UpcomingOpeningMetadata} UpcomingOpeningMetadata
  4596. * @throws {Error} If the payload is not a reader or valid buffer
  4597. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4598. */
  4599. UpcomingOpeningMetadata.decodeDelimited = function decodeDelimited(reader) {
  4600. if (!(reader instanceof $Reader))
  4601. reader = new $Reader(reader);
  4602. return this.decode(reader, reader.uint32());
  4603. };
  4604. /**
  4605. * Verifies an UpcomingOpeningMetadata message.
  4606. * @function verify
  4607. * @memberof UpcomingOpeningMetadata
  4608. * @static
  4609. * @param {Object.<string,*>} message Plain object to verify
  4610. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  4611. */
  4612. UpcomingOpeningMetadata.verify = function verify(message) {
  4613. if (typeof message !== "object" || message === null)
  4614. return "object expected";
  4615. if (message.expectedStart != null && message.hasOwnProperty("expectedStart"))
  4616. if (!$util.isInteger(message.expectedStart))
  4617. return "expectedStart: integer expected";
  4618. if (message.rewardPerBlock != null && message.hasOwnProperty("rewardPerBlock"))
  4619. if (!$util.isInteger(message.rewardPerBlock) && !(message.rewardPerBlock && $util.isInteger(message.rewardPerBlock.low) && $util.isInteger(message.rewardPerBlock.high)))
  4620. return "rewardPerBlock: integer|Long expected";
  4621. if (message.minApplicationStake != null && message.hasOwnProperty("minApplicationStake"))
  4622. if (!$util.isInteger(message.minApplicationStake) && !(message.minApplicationStake && $util.isInteger(message.minApplicationStake.low) && $util.isInteger(message.minApplicationStake.high)))
  4623. return "minApplicationStake: integer|Long expected";
  4624. if (message.metadata != null && message.hasOwnProperty("metadata")) {
  4625. var error = $root.OpeningMetadata.verify(message.metadata);
  4626. if (error)
  4627. return "metadata." + error;
  4628. }
  4629. return null;
  4630. };
  4631. /**
  4632. * Creates an UpcomingOpeningMetadata message from a plain object. Also converts values to their respective internal types.
  4633. * @function fromObject
  4634. * @memberof UpcomingOpeningMetadata
  4635. * @static
  4636. * @param {Object.<string,*>} object Plain object
  4637. * @returns {UpcomingOpeningMetadata} UpcomingOpeningMetadata
  4638. */
  4639. UpcomingOpeningMetadata.fromObject = function fromObject(object) {
  4640. if (object instanceof $root.UpcomingOpeningMetadata)
  4641. return object;
  4642. var message = new $root.UpcomingOpeningMetadata();
  4643. if (object.expectedStart != null)
  4644. message.expectedStart = object.expectedStart >>> 0;
  4645. if (object.rewardPerBlock != null)
  4646. if ($util.Long)
  4647. (message.rewardPerBlock = $util.Long.fromValue(object.rewardPerBlock)).unsigned = true;
  4648. else if (typeof object.rewardPerBlock === "string")
  4649. message.rewardPerBlock = parseInt(object.rewardPerBlock, 10);
  4650. else if (typeof object.rewardPerBlock === "number")
  4651. message.rewardPerBlock = object.rewardPerBlock;
  4652. else if (typeof object.rewardPerBlock === "object")
  4653. message.rewardPerBlock = new $util.LongBits(object.rewardPerBlock.low >>> 0, object.rewardPerBlock.high >>> 0).toNumber(true);
  4654. if (object.minApplicationStake != null)
  4655. if ($util.Long)
  4656. (message.minApplicationStake = $util.Long.fromValue(object.minApplicationStake)).unsigned = true;
  4657. else if (typeof object.minApplicationStake === "string")
  4658. message.minApplicationStake = parseInt(object.minApplicationStake, 10);
  4659. else if (typeof object.minApplicationStake === "number")
  4660. message.minApplicationStake = object.minApplicationStake;
  4661. else if (typeof object.minApplicationStake === "object")
  4662. message.minApplicationStake = new $util.LongBits(object.minApplicationStake.low >>> 0, object.minApplicationStake.high >>> 0).toNumber(true);
  4663. if (object.metadata != null) {
  4664. if (typeof object.metadata !== "object")
  4665. throw TypeError(".UpcomingOpeningMetadata.metadata: object expected");
  4666. message.metadata = $root.OpeningMetadata.fromObject(object.metadata);
  4667. }
  4668. return message;
  4669. };
  4670. /**
  4671. * Creates a plain object from an UpcomingOpeningMetadata message. Also converts values to other types if specified.
  4672. * @function toObject
  4673. * @memberof UpcomingOpeningMetadata
  4674. * @static
  4675. * @param {UpcomingOpeningMetadata} message UpcomingOpeningMetadata
  4676. * @param {$protobuf.IConversionOptions} [options] Conversion options
  4677. * @returns {Object.<string,*>} Plain object
  4678. */
  4679. UpcomingOpeningMetadata.toObject = function toObject(message, options) {
  4680. if (!options)
  4681. options = {};
  4682. var object = {};
  4683. if (options.defaults) {
  4684. object.expectedStart = 0;
  4685. if ($util.Long) {
  4686. var long = new $util.Long(0, 0, true);
  4687. object.rewardPerBlock = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  4688. } else
  4689. object.rewardPerBlock = options.longs === String ? "0" : 0;
  4690. if ($util.Long) {
  4691. var long = new $util.Long(0, 0, true);
  4692. object.minApplicationStake = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  4693. } else
  4694. object.minApplicationStake = options.longs === String ? "0" : 0;
  4695. object.metadata = null;
  4696. }
  4697. if (message.expectedStart != null && message.hasOwnProperty("expectedStart"))
  4698. object.expectedStart = message.expectedStart;
  4699. if (message.rewardPerBlock != null && message.hasOwnProperty("rewardPerBlock"))
  4700. if (typeof message.rewardPerBlock === "number")
  4701. object.rewardPerBlock = options.longs === String ? String(message.rewardPerBlock) : message.rewardPerBlock;
  4702. else
  4703. object.rewardPerBlock = options.longs === String ? $util.Long.prototype.toString.call(message.rewardPerBlock) : options.longs === Number ? new $util.LongBits(message.rewardPerBlock.low >>> 0, message.rewardPerBlock.high >>> 0).toNumber(true) : message.rewardPerBlock;
  4704. if (message.minApplicationStake != null && message.hasOwnProperty("minApplicationStake"))
  4705. if (typeof message.minApplicationStake === "number")
  4706. object.minApplicationStake = options.longs === String ? String(message.minApplicationStake) : message.minApplicationStake;
  4707. else
  4708. object.minApplicationStake = options.longs === String ? $util.Long.prototype.toString.call(message.minApplicationStake) : options.longs === Number ? new $util.LongBits(message.minApplicationStake.low >>> 0, message.minApplicationStake.high >>> 0).toNumber(true) : message.minApplicationStake;
  4709. if (message.metadata != null && message.hasOwnProperty("metadata"))
  4710. object.metadata = $root.OpeningMetadata.toObject(message.metadata, options);
  4711. return object;
  4712. };
  4713. /**
  4714. * Converts this UpcomingOpeningMetadata to JSON.
  4715. * @function toJSON
  4716. * @memberof UpcomingOpeningMetadata
  4717. * @instance
  4718. * @returns {Object.<string,*>} JSON object
  4719. */
  4720. UpcomingOpeningMetadata.prototype.toJSON = function toJSON() {
  4721. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  4722. };
  4723. return UpcomingOpeningMetadata;
  4724. })();
  4725. $root.ApplicationMetadata = (function() {
  4726. /**
  4727. * Properties of an ApplicationMetadata.
  4728. * @exports IApplicationMetadata
  4729. * @interface IApplicationMetadata
  4730. * @property {Array.<string>|null} [answers] ApplicationMetadata answers
  4731. */
  4732. /**
  4733. * Constructs a new ApplicationMetadata.
  4734. * @exports ApplicationMetadata
  4735. * @classdesc Represents an ApplicationMetadata.
  4736. * @implements IApplicationMetadata
  4737. * @constructor
  4738. * @param {IApplicationMetadata=} [properties] Properties to set
  4739. */
  4740. function ApplicationMetadata(properties) {
  4741. this.answers = [];
  4742. if (properties)
  4743. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  4744. if (properties[keys[i]] != null)
  4745. this[keys[i]] = properties[keys[i]];
  4746. }
  4747. /**
  4748. * ApplicationMetadata answers.
  4749. * @member {Array.<string>} answers
  4750. * @memberof ApplicationMetadata
  4751. * @instance
  4752. */
  4753. ApplicationMetadata.prototype.answers = $util.emptyArray;
  4754. /**
  4755. * Creates a new ApplicationMetadata instance using the specified properties.
  4756. * @function create
  4757. * @memberof ApplicationMetadata
  4758. * @static
  4759. * @param {IApplicationMetadata=} [properties] Properties to set
  4760. * @returns {ApplicationMetadata} ApplicationMetadata instance
  4761. */
  4762. ApplicationMetadata.create = function create(properties) {
  4763. return new ApplicationMetadata(properties);
  4764. };
  4765. /**
  4766. * Encodes the specified ApplicationMetadata message. Does not implicitly {@link ApplicationMetadata.verify|verify} messages.
  4767. * @function encode
  4768. * @memberof ApplicationMetadata
  4769. * @static
  4770. * @param {IApplicationMetadata} message ApplicationMetadata message or plain object to encode
  4771. * @param {$protobuf.Writer} [writer] Writer to encode to
  4772. * @returns {$protobuf.Writer} Writer
  4773. */
  4774. ApplicationMetadata.encode = function encode(message, writer) {
  4775. if (!writer)
  4776. writer = $Writer.create();
  4777. if (message.answers != null && message.answers.length)
  4778. for (var i = 0; i < message.answers.length; ++i)
  4779. writer.uint32(/* id 1, wireType 2 =*/10).string(message.answers[i]);
  4780. return writer;
  4781. };
  4782. /**
  4783. * Encodes the specified ApplicationMetadata message, length delimited. Does not implicitly {@link ApplicationMetadata.verify|verify} messages.
  4784. * @function encodeDelimited
  4785. * @memberof ApplicationMetadata
  4786. * @static
  4787. * @param {IApplicationMetadata} message ApplicationMetadata message or plain object to encode
  4788. * @param {$protobuf.Writer} [writer] Writer to encode to
  4789. * @returns {$protobuf.Writer} Writer
  4790. */
  4791. ApplicationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  4792. return this.encode(message, writer).ldelim();
  4793. };
  4794. /**
  4795. * Decodes an ApplicationMetadata message from the specified reader or buffer.
  4796. * @function decode
  4797. * @memberof ApplicationMetadata
  4798. * @static
  4799. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4800. * @param {number} [length] Message length if known beforehand
  4801. * @returns {ApplicationMetadata} ApplicationMetadata
  4802. * @throws {Error} If the payload is not a reader or valid buffer
  4803. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4804. */
  4805. ApplicationMetadata.decode = function decode(reader, length) {
  4806. if (!(reader instanceof $Reader))
  4807. reader = $Reader.create(reader);
  4808. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApplicationMetadata();
  4809. while (reader.pos < end) {
  4810. var tag = reader.uint32();
  4811. switch (tag >>> 3) {
  4812. case 1:
  4813. if (!(message.answers && message.answers.length))
  4814. message.answers = [];
  4815. message.answers.push(reader.string());
  4816. break;
  4817. default:
  4818. reader.skipType(tag & 7);
  4819. break;
  4820. }
  4821. }
  4822. return message;
  4823. };
  4824. /**
  4825. * Decodes an ApplicationMetadata message from the specified reader or buffer, length delimited.
  4826. * @function decodeDelimited
  4827. * @memberof ApplicationMetadata
  4828. * @static
  4829. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4830. * @returns {ApplicationMetadata} ApplicationMetadata
  4831. * @throws {Error} If the payload is not a reader or valid buffer
  4832. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4833. */
  4834. ApplicationMetadata.decodeDelimited = function decodeDelimited(reader) {
  4835. if (!(reader instanceof $Reader))
  4836. reader = new $Reader(reader);
  4837. return this.decode(reader, reader.uint32());
  4838. };
  4839. /**
  4840. * Verifies an ApplicationMetadata message.
  4841. * @function verify
  4842. * @memberof ApplicationMetadata
  4843. * @static
  4844. * @param {Object.<string,*>} message Plain object to verify
  4845. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  4846. */
  4847. ApplicationMetadata.verify = function verify(message) {
  4848. if (typeof message !== "object" || message === null)
  4849. return "object expected";
  4850. if (message.answers != null && message.hasOwnProperty("answers")) {
  4851. if (!Array.isArray(message.answers))
  4852. return "answers: array expected";
  4853. for (var i = 0; i < message.answers.length; ++i)
  4854. if (!$util.isString(message.answers[i]))
  4855. return "answers: string[] expected";
  4856. }
  4857. return null;
  4858. };
  4859. /**
  4860. * Creates an ApplicationMetadata message from a plain object. Also converts values to their respective internal types.
  4861. * @function fromObject
  4862. * @memberof ApplicationMetadata
  4863. * @static
  4864. * @param {Object.<string,*>} object Plain object
  4865. * @returns {ApplicationMetadata} ApplicationMetadata
  4866. */
  4867. ApplicationMetadata.fromObject = function fromObject(object) {
  4868. if (object instanceof $root.ApplicationMetadata)
  4869. return object;
  4870. var message = new $root.ApplicationMetadata();
  4871. if (object.answers) {
  4872. if (!Array.isArray(object.answers))
  4873. throw TypeError(".ApplicationMetadata.answers: array expected");
  4874. message.answers = [];
  4875. for (var i = 0; i < object.answers.length; ++i)
  4876. message.answers[i] = String(object.answers[i]);
  4877. }
  4878. return message;
  4879. };
  4880. /**
  4881. * Creates a plain object from an ApplicationMetadata message. Also converts values to other types if specified.
  4882. * @function toObject
  4883. * @memberof ApplicationMetadata
  4884. * @static
  4885. * @param {ApplicationMetadata} message ApplicationMetadata
  4886. * @param {$protobuf.IConversionOptions} [options] Conversion options
  4887. * @returns {Object.<string,*>} Plain object
  4888. */
  4889. ApplicationMetadata.toObject = function toObject(message, options) {
  4890. if (!options)
  4891. options = {};
  4892. var object = {};
  4893. if (options.arrays || options.defaults)
  4894. object.answers = [];
  4895. if (message.answers && message.answers.length) {
  4896. object.answers = [];
  4897. for (var j = 0; j < message.answers.length; ++j)
  4898. object.answers[j] = message.answers[j];
  4899. }
  4900. return object;
  4901. };
  4902. /**
  4903. * Converts this ApplicationMetadata to JSON.
  4904. * @function toJSON
  4905. * @memberof ApplicationMetadata
  4906. * @instance
  4907. * @returns {Object.<string,*>} JSON object
  4908. */
  4909. ApplicationMetadata.prototype.toJSON = function toJSON() {
  4910. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  4911. };
  4912. return ApplicationMetadata;
  4913. })();
  4914. $root.WorkingGroupMetadata = (function() {
  4915. /**
  4916. * Properties of a WorkingGroupMetadata.
  4917. * @exports IWorkingGroupMetadata
  4918. * @interface IWorkingGroupMetadata
  4919. * @property {string|null} [description] WorkingGroupMetadata description
  4920. * @property {string|null} [about] WorkingGroupMetadata about
  4921. * @property {string|null} [status] WorkingGroupMetadata status
  4922. * @property {string|null} [statusMessage] WorkingGroupMetadata statusMessage
  4923. */
  4924. /**
  4925. * Constructs a new WorkingGroupMetadata.
  4926. * @exports WorkingGroupMetadata
  4927. * @classdesc Represents a WorkingGroupMetadata.
  4928. * @implements IWorkingGroupMetadata
  4929. * @constructor
  4930. * @param {IWorkingGroupMetadata=} [properties] Properties to set
  4931. */
  4932. function WorkingGroupMetadata(properties) {
  4933. if (properties)
  4934. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  4935. if (properties[keys[i]] != null)
  4936. this[keys[i]] = properties[keys[i]];
  4937. }
  4938. /**
  4939. * WorkingGroupMetadata description.
  4940. * @member {string} description
  4941. * @memberof WorkingGroupMetadata
  4942. * @instance
  4943. */
  4944. WorkingGroupMetadata.prototype.description = "";
  4945. /**
  4946. * WorkingGroupMetadata about.
  4947. * @member {string} about
  4948. * @memberof WorkingGroupMetadata
  4949. * @instance
  4950. */
  4951. WorkingGroupMetadata.prototype.about = "";
  4952. /**
  4953. * WorkingGroupMetadata status.
  4954. * @member {string} status
  4955. * @memberof WorkingGroupMetadata
  4956. * @instance
  4957. */
  4958. WorkingGroupMetadata.prototype.status = "";
  4959. /**
  4960. * WorkingGroupMetadata statusMessage.
  4961. * @member {string} statusMessage
  4962. * @memberof WorkingGroupMetadata
  4963. * @instance
  4964. */
  4965. WorkingGroupMetadata.prototype.statusMessage = "";
  4966. /**
  4967. * Creates a new WorkingGroupMetadata instance using the specified properties.
  4968. * @function create
  4969. * @memberof WorkingGroupMetadata
  4970. * @static
  4971. * @param {IWorkingGroupMetadata=} [properties] Properties to set
  4972. * @returns {WorkingGroupMetadata} WorkingGroupMetadata instance
  4973. */
  4974. WorkingGroupMetadata.create = function create(properties) {
  4975. return new WorkingGroupMetadata(properties);
  4976. };
  4977. /**
  4978. * Encodes the specified WorkingGroupMetadata message. Does not implicitly {@link WorkingGroupMetadata.verify|verify} messages.
  4979. * @function encode
  4980. * @memberof WorkingGroupMetadata
  4981. * @static
  4982. * @param {IWorkingGroupMetadata} message WorkingGroupMetadata message or plain object to encode
  4983. * @param {$protobuf.Writer} [writer] Writer to encode to
  4984. * @returns {$protobuf.Writer} Writer
  4985. */
  4986. WorkingGroupMetadata.encode = function encode(message, writer) {
  4987. if (!writer)
  4988. writer = $Writer.create();
  4989. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  4990. writer.uint32(/* id 1, wireType 2 =*/10).string(message.description);
  4991. if (message.about != null && Object.hasOwnProperty.call(message, "about"))
  4992. writer.uint32(/* id 2, wireType 2 =*/18).string(message.about);
  4993. if (message.status != null && Object.hasOwnProperty.call(message, "status"))
  4994. writer.uint32(/* id 3, wireType 2 =*/26).string(message.status);
  4995. if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage"))
  4996. writer.uint32(/* id 4, wireType 2 =*/34).string(message.statusMessage);
  4997. return writer;
  4998. };
  4999. /**
  5000. * Encodes the specified WorkingGroupMetadata message, length delimited. Does not implicitly {@link WorkingGroupMetadata.verify|verify} messages.
  5001. * @function encodeDelimited
  5002. * @memberof WorkingGroupMetadata
  5003. * @static
  5004. * @param {IWorkingGroupMetadata} message WorkingGroupMetadata message or plain object to encode
  5005. * @param {$protobuf.Writer} [writer] Writer to encode to
  5006. * @returns {$protobuf.Writer} Writer
  5007. */
  5008. WorkingGroupMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  5009. return this.encode(message, writer).ldelim();
  5010. };
  5011. /**
  5012. * Decodes a WorkingGroupMetadata message from the specified reader or buffer.
  5013. * @function decode
  5014. * @memberof WorkingGroupMetadata
  5015. * @static
  5016. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5017. * @param {number} [length] Message length if known beforehand
  5018. * @returns {WorkingGroupMetadata} WorkingGroupMetadata
  5019. * @throws {Error} If the payload is not a reader or valid buffer
  5020. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5021. */
  5022. WorkingGroupMetadata.decode = function decode(reader, length) {
  5023. if (!(reader instanceof $Reader))
  5024. reader = $Reader.create(reader);
  5025. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.WorkingGroupMetadata();
  5026. while (reader.pos < end) {
  5027. var tag = reader.uint32();
  5028. switch (tag >>> 3) {
  5029. case 1:
  5030. message.description = reader.string();
  5031. break;
  5032. case 2:
  5033. message.about = reader.string();
  5034. break;
  5035. case 3:
  5036. message.status = reader.string();
  5037. break;
  5038. case 4:
  5039. message.statusMessage = reader.string();
  5040. break;
  5041. default:
  5042. reader.skipType(tag & 7);
  5043. break;
  5044. }
  5045. }
  5046. return message;
  5047. };
  5048. /**
  5049. * Decodes a WorkingGroupMetadata message from the specified reader or buffer, length delimited.
  5050. * @function decodeDelimited
  5051. * @memberof WorkingGroupMetadata
  5052. * @static
  5053. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5054. * @returns {WorkingGroupMetadata} WorkingGroupMetadata
  5055. * @throws {Error} If the payload is not a reader or valid buffer
  5056. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5057. */
  5058. WorkingGroupMetadata.decodeDelimited = function decodeDelimited(reader) {
  5059. if (!(reader instanceof $Reader))
  5060. reader = new $Reader(reader);
  5061. return this.decode(reader, reader.uint32());
  5062. };
  5063. /**
  5064. * Verifies a WorkingGroupMetadata message.
  5065. * @function verify
  5066. * @memberof WorkingGroupMetadata
  5067. * @static
  5068. * @param {Object.<string,*>} message Plain object to verify
  5069. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5070. */
  5071. WorkingGroupMetadata.verify = function verify(message) {
  5072. if (typeof message !== "object" || message === null)
  5073. return "object expected";
  5074. if (message.description != null && message.hasOwnProperty("description"))
  5075. if (!$util.isString(message.description))
  5076. return "description: string expected";
  5077. if (message.about != null && message.hasOwnProperty("about"))
  5078. if (!$util.isString(message.about))
  5079. return "about: string expected";
  5080. if (message.status != null && message.hasOwnProperty("status"))
  5081. if (!$util.isString(message.status))
  5082. return "status: string expected";
  5083. if (message.statusMessage != null && message.hasOwnProperty("statusMessage"))
  5084. if (!$util.isString(message.statusMessage))
  5085. return "statusMessage: string expected";
  5086. return null;
  5087. };
  5088. /**
  5089. * Creates a WorkingGroupMetadata message from a plain object. Also converts values to their respective internal types.
  5090. * @function fromObject
  5091. * @memberof WorkingGroupMetadata
  5092. * @static
  5093. * @param {Object.<string,*>} object Plain object
  5094. * @returns {WorkingGroupMetadata} WorkingGroupMetadata
  5095. */
  5096. WorkingGroupMetadata.fromObject = function fromObject(object) {
  5097. if (object instanceof $root.WorkingGroupMetadata)
  5098. return object;
  5099. var message = new $root.WorkingGroupMetadata();
  5100. if (object.description != null)
  5101. message.description = String(object.description);
  5102. if (object.about != null)
  5103. message.about = String(object.about);
  5104. if (object.status != null)
  5105. message.status = String(object.status);
  5106. if (object.statusMessage != null)
  5107. message.statusMessage = String(object.statusMessage);
  5108. return message;
  5109. };
  5110. /**
  5111. * Creates a plain object from a WorkingGroupMetadata message. Also converts values to other types if specified.
  5112. * @function toObject
  5113. * @memberof WorkingGroupMetadata
  5114. * @static
  5115. * @param {WorkingGroupMetadata} message WorkingGroupMetadata
  5116. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5117. * @returns {Object.<string,*>} Plain object
  5118. */
  5119. WorkingGroupMetadata.toObject = function toObject(message, options) {
  5120. if (!options)
  5121. options = {};
  5122. var object = {};
  5123. if (options.defaults) {
  5124. object.description = "";
  5125. object.about = "";
  5126. object.status = "";
  5127. object.statusMessage = "";
  5128. }
  5129. if (message.description != null && message.hasOwnProperty("description"))
  5130. object.description = message.description;
  5131. if (message.about != null && message.hasOwnProperty("about"))
  5132. object.about = message.about;
  5133. if (message.status != null && message.hasOwnProperty("status"))
  5134. object.status = message.status;
  5135. if (message.statusMessage != null && message.hasOwnProperty("statusMessage"))
  5136. object.statusMessage = message.statusMessage;
  5137. return object;
  5138. };
  5139. /**
  5140. * Converts this WorkingGroupMetadata to JSON.
  5141. * @function toJSON
  5142. * @memberof WorkingGroupMetadata
  5143. * @instance
  5144. * @returns {Object.<string,*>} JSON object
  5145. */
  5146. WorkingGroupMetadata.prototype.toJSON = function toJSON() {
  5147. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5148. };
  5149. return WorkingGroupMetadata;
  5150. })();
  5151. $root.SetGroupMetadata = (function() {
  5152. /**
  5153. * Properties of a SetGroupMetadata.
  5154. * @exports ISetGroupMetadata
  5155. * @interface ISetGroupMetadata
  5156. * @property {IWorkingGroupMetadata|null} [newMetadata] SetGroupMetadata newMetadata
  5157. */
  5158. /**
  5159. * Constructs a new SetGroupMetadata.
  5160. * @exports SetGroupMetadata
  5161. * @classdesc Represents a SetGroupMetadata.
  5162. * @implements ISetGroupMetadata
  5163. * @constructor
  5164. * @param {ISetGroupMetadata=} [properties] Properties to set
  5165. */
  5166. function SetGroupMetadata(properties) {
  5167. if (properties)
  5168. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  5169. if (properties[keys[i]] != null)
  5170. this[keys[i]] = properties[keys[i]];
  5171. }
  5172. /**
  5173. * SetGroupMetadata newMetadata.
  5174. * @member {IWorkingGroupMetadata|null|undefined} newMetadata
  5175. * @memberof SetGroupMetadata
  5176. * @instance
  5177. */
  5178. SetGroupMetadata.prototype.newMetadata = null;
  5179. /**
  5180. * Creates a new SetGroupMetadata instance using the specified properties.
  5181. * @function create
  5182. * @memberof SetGroupMetadata
  5183. * @static
  5184. * @param {ISetGroupMetadata=} [properties] Properties to set
  5185. * @returns {SetGroupMetadata} SetGroupMetadata instance
  5186. */
  5187. SetGroupMetadata.create = function create(properties) {
  5188. return new SetGroupMetadata(properties);
  5189. };
  5190. /**
  5191. * Encodes the specified SetGroupMetadata message. Does not implicitly {@link SetGroupMetadata.verify|verify} messages.
  5192. * @function encode
  5193. * @memberof SetGroupMetadata
  5194. * @static
  5195. * @param {ISetGroupMetadata} message SetGroupMetadata message or plain object to encode
  5196. * @param {$protobuf.Writer} [writer] Writer to encode to
  5197. * @returns {$protobuf.Writer} Writer
  5198. */
  5199. SetGroupMetadata.encode = function encode(message, writer) {
  5200. if (!writer)
  5201. writer = $Writer.create();
  5202. if (message.newMetadata != null && Object.hasOwnProperty.call(message, "newMetadata"))
  5203. $root.WorkingGroupMetadata.encode(message.newMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
  5204. return writer;
  5205. };
  5206. /**
  5207. * Encodes the specified SetGroupMetadata message, length delimited. Does not implicitly {@link SetGroupMetadata.verify|verify} messages.
  5208. * @function encodeDelimited
  5209. * @memberof SetGroupMetadata
  5210. * @static
  5211. * @param {ISetGroupMetadata} message SetGroupMetadata message or plain object to encode
  5212. * @param {$protobuf.Writer} [writer] Writer to encode to
  5213. * @returns {$protobuf.Writer} Writer
  5214. */
  5215. SetGroupMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  5216. return this.encode(message, writer).ldelim();
  5217. };
  5218. /**
  5219. * Decodes a SetGroupMetadata message from the specified reader or buffer.
  5220. * @function decode
  5221. * @memberof SetGroupMetadata
  5222. * @static
  5223. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5224. * @param {number} [length] Message length if known beforehand
  5225. * @returns {SetGroupMetadata} SetGroupMetadata
  5226. * @throws {Error} If the payload is not a reader or valid buffer
  5227. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5228. */
  5229. SetGroupMetadata.decode = function decode(reader, length) {
  5230. if (!(reader instanceof $Reader))
  5231. reader = $Reader.create(reader);
  5232. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SetGroupMetadata();
  5233. while (reader.pos < end) {
  5234. var tag = reader.uint32();
  5235. switch (tag >>> 3) {
  5236. case 1:
  5237. message.newMetadata = $root.WorkingGroupMetadata.decode(reader, reader.uint32());
  5238. break;
  5239. default:
  5240. reader.skipType(tag & 7);
  5241. break;
  5242. }
  5243. }
  5244. return message;
  5245. };
  5246. /**
  5247. * Decodes a SetGroupMetadata message from the specified reader or buffer, length delimited.
  5248. * @function decodeDelimited
  5249. * @memberof SetGroupMetadata
  5250. * @static
  5251. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5252. * @returns {SetGroupMetadata} SetGroupMetadata
  5253. * @throws {Error} If the payload is not a reader or valid buffer
  5254. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5255. */
  5256. SetGroupMetadata.decodeDelimited = function decodeDelimited(reader) {
  5257. if (!(reader instanceof $Reader))
  5258. reader = new $Reader(reader);
  5259. return this.decode(reader, reader.uint32());
  5260. };
  5261. /**
  5262. * Verifies a SetGroupMetadata message.
  5263. * @function verify
  5264. * @memberof SetGroupMetadata
  5265. * @static
  5266. * @param {Object.<string,*>} message Plain object to verify
  5267. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5268. */
  5269. SetGroupMetadata.verify = function verify(message) {
  5270. if (typeof message !== "object" || message === null)
  5271. return "object expected";
  5272. if (message.newMetadata != null && message.hasOwnProperty("newMetadata")) {
  5273. var error = $root.WorkingGroupMetadata.verify(message.newMetadata);
  5274. if (error)
  5275. return "newMetadata." + error;
  5276. }
  5277. return null;
  5278. };
  5279. /**
  5280. * Creates a SetGroupMetadata message from a plain object. Also converts values to their respective internal types.
  5281. * @function fromObject
  5282. * @memberof SetGroupMetadata
  5283. * @static
  5284. * @param {Object.<string,*>} object Plain object
  5285. * @returns {SetGroupMetadata} SetGroupMetadata
  5286. */
  5287. SetGroupMetadata.fromObject = function fromObject(object) {
  5288. if (object instanceof $root.SetGroupMetadata)
  5289. return object;
  5290. var message = new $root.SetGroupMetadata();
  5291. if (object.newMetadata != null) {
  5292. if (typeof object.newMetadata !== "object")
  5293. throw TypeError(".SetGroupMetadata.newMetadata: object expected");
  5294. message.newMetadata = $root.WorkingGroupMetadata.fromObject(object.newMetadata);
  5295. }
  5296. return message;
  5297. };
  5298. /**
  5299. * Creates a plain object from a SetGroupMetadata message. Also converts values to other types if specified.
  5300. * @function toObject
  5301. * @memberof SetGroupMetadata
  5302. * @static
  5303. * @param {SetGroupMetadata} message SetGroupMetadata
  5304. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5305. * @returns {Object.<string,*>} Plain object
  5306. */
  5307. SetGroupMetadata.toObject = function toObject(message, options) {
  5308. if (!options)
  5309. options = {};
  5310. var object = {};
  5311. if (options.defaults)
  5312. object.newMetadata = null;
  5313. if (message.newMetadata != null && message.hasOwnProperty("newMetadata"))
  5314. object.newMetadata = $root.WorkingGroupMetadata.toObject(message.newMetadata, options);
  5315. return object;
  5316. };
  5317. /**
  5318. * Converts this SetGroupMetadata to JSON.
  5319. * @function toJSON
  5320. * @memberof SetGroupMetadata
  5321. * @instance
  5322. * @returns {Object.<string,*>} JSON object
  5323. */
  5324. SetGroupMetadata.prototype.toJSON = function toJSON() {
  5325. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5326. };
  5327. return SetGroupMetadata;
  5328. })();
  5329. $root.AddUpcomingOpening = (function() {
  5330. /**
  5331. * Properties of an AddUpcomingOpening.
  5332. * @exports IAddUpcomingOpening
  5333. * @interface IAddUpcomingOpening
  5334. * @property {IUpcomingOpeningMetadata|null} [metadata] AddUpcomingOpening metadata
  5335. */
  5336. /**
  5337. * Constructs a new AddUpcomingOpening.
  5338. * @exports AddUpcomingOpening
  5339. * @classdesc Represents an AddUpcomingOpening.
  5340. * @implements IAddUpcomingOpening
  5341. * @constructor
  5342. * @param {IAddUpcomingOpening=} [properties] Properties to set
  5343. */
  5344. function AddUpcomingOpening(properties) {
  5345. if (properties)
  5346. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  5347. if (properties[keys[i]] != null)
  5348. this[keys[i]] = properties[keys[i]];
  5349. }
  5350. /**
  5351. * AddUpcomingOpening metadata.
  5352. * @member {IUpcomingOpeningMetadata|null|undefined} metadata
  5353. * @memberof AddUpcomingOpening
  5354. * @instance
  5355. */
  5356. AddUpcomingOpening.prototype.metadata = null;
  5357. /**
  5358. * Creates a new AddUpcomingOpening instance using the specified properties.
  5359. * @function create
  5360. * @memberof AddUpcomingOpening
  5361. * @static
  5362. * @param {IAddUpcomingOpening=} [properties] Properties to set
  5363. * @returns {AddUpcomingOpening} AddUpcomingOpening instance
  5364. */
  5365. AddUpcomingOpening.create = function create(properties) {
  5366. return new AddUpcomingOpening(properties);
  5367. };
  5368. /**
  5369. * Encodes the specified AddUpcomingOpening message. Does not implicitly {@link AddUpcomingOpening.verify|verify} messages.
  5370. * @function encode
  5371. * @memberof AddUpcomingOpening
  5372. * @static
  5373. * @param {IAddUpcomingOpening} message AddUpcomingOpening message or plain object to encode
  5374. * @param {$protobuf.Writer} [writer] Writer to encode to
  5375. * @returns {$protobuf.Writer} Writer
  5376. */
  5377. AddUpcomingOpening.encode = function encode(message, writer) {
  5378. if (!writer)
  5379. writer = $Writer.create();
  5380. if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
  5381. $root.UpcomingOpeningMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
  5382. return writer;
  5383. };
  5384. /**
  5385. * Encodes the specified AddUpcomingOpening message, length delimited. Does not implicitly {@link AddUpcomingOpening.verify|verify} messages.
  5386. * @function encodeDelimited
  5387. * @memberof AddUpcomingOpening
  5388. * @static
  5389. * @param {IAddUpcomingOpening} message AddUpcomingOpening message or plain object to encode
  5390. * @param {$protobuf.Writer} [writer] Writer to encode to
  5391. * @returns {$protobuf.Writer} Writer
  5392. */
  5393. AddUpcomingOpening.encodeDelimited = function encodeDelimited(message, writer) {
  5394. return this.encode(message, writer).ldelim();
  5395. };
  5396. /**
  5397. * Decodes an AddUpcomingOpening message from the specified reader or buffer.
  5398. * @function decode
  5399. * @memberof AddUpcomingOpening
  5400. * @static
  5401. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5402. * @param {number} [length] Message length if known beforehand
  5403. * @returns {AddUpcomingOpening} AddUpcomingOpening
  5404. * @throws {Error} If the payload is not a reader or valid buffer
  5405. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5406. */
  5407. AddUpcomingOpening.decode = function decode(reader, length) {
  5408. if (!(reader instanceof $Reader))
  5409. reader = $Reader.create(reader);
  5410. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AddUpcomingOpening();
  5411. while (reader.pos < end) {
  5412. var tag = reader.uint32();
  5413. switch (tag >>> 3) {
  5414. case 1:
  5415. message.metadata = $root.UpcomingOpeningMetadata.decode(reader, reader.uint32());
  5416. break;
  5417. default:
  5418. reader.skipType(tag & 7);
  5419. break;
  5420. }
  5421. }
  5422. return message;
  5423. };
  5424. /**
  5425. * Decodes an AddUpcomingOpening message from the specified reader or buffer, length delimited.
  5426. * @function decodeDelimited
  5427. * @memberof AddUpcomingOpening
  5428. * @static
  5429. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5430. * @returns {AddUpcomingOpening} AddUpcomingOpening
  5431. * @throws {Error} If the payload is not a reader or valid buffer
  5432. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5433. */
  5434. AddUpcomingOpening.decodeDelimited = function decodeDelimited(reader) {
  5435. if (!(reader instanceof $Reader))
  5436. reader = new $Reader(reader);
  5437. return this.decode(reader, reader.uint32());
  5438. };
  5439. /**
  5440. * Verifies an AddUpcomingOpening message.
  5441. * @function verify
  5442. * @memberof AddUpcomingOpening
  5443. * @static
  5444. * @param {Object.<string,*>} message Plain object to verify
  5445. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5446. */
  5447. AddUpcomingOpening.verify = function verify(message) {
  5448. if (typeof message !== "object" || message === null)
  5449. return "object expected";
  5450. if (message.metadata != null && message.hasOwnProperty("metadata")) {
  5451. var error = $root.UpcomingOpeningMetadata.verify(message.metadata);
  5452. if (error)
  5453. return "metadata." + error;
  5454. }
  5455. return null;
  5456. };
  5457. /**
  5458. * Creates an AddUpcomingOpening message from a plain object. Also converts values to their respective internal types.
  5459. * @function fromObject
  5460. * @memberof AddUpcomingOpening
  5461. * @static
  5462. * @param {Object.<string,*>} object Plain object
  5463. * @returns {AddUpcomingOpening} AddUpcomingOpening
  5464. */
  5465. AddUpcomingOpening.fromObject = function fromObject(object) {
  5466. if (object instanceof $root.AddUpcomingOpening)
  5467. return object;
  5468. var message = new $root.AddUpcomingOpening();
  5469. if (object.metadata != null) {
  5470. if (typeof object.metadata !== "object")
  5471. throw TypeError(".AddUpcomingOpening.metadata: object expected");
  5472. message.metadata = $root.UpcomingOpeningMetadata.fromObject(object.metadata);
  5473. }
  5474. return message;
  5475. };
  5476. /**
  5477. * Creates a plain object from an AddUpcomingOpening message. Also converts values to other types if specified.
  5478. * @function toObject
  5479. * @memberof AddUpcomingOpening
  5480. * @static
  5481. * @param {AddUpcomingOpening} message AddUpcomingOpening
  5482. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5483. * @returns {Object.<string,*>} Plain object
  5484. */
  5485. AddUpcomingOpening.toObject = function toObject(message, options) {
  5486. if (!options)
  5487. options = {};
  5488. var object = {};
  5489. if (options.defaults)
  5490. object.metadata = null;
  5491. if (message.metadata != null && message.hasOwnProperty("metadata"))
  5492. object.metadata = $root.UpcomingOpeningMetadata.toObject(message.metadata, options);
  5493. return object;
  5494. };
  5495. /**
  5496. * Converts this AddUpcomingOpening to JSON.
  5497. * @function toJSON
  5498. * @memberof AddUpcomingOpening
  5499. * @instance
  5500. * @returns {Object.<string,*>} JSON object
  5501. */
  5502. AddUpcomingOpening.prototype.toJSON = function toJSON() {
  5503. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5504. };
  5505. return AddUpcomingOpening;
  5506. })();
  5507. $root.RemoveUpcomingOpening = (function() {
  5508. /**
  5509. * Properties of a RemoveUpcomingOpening.
  5510. * @exports IRemoveUpcomingOpening
  5511. * @interface IRemoveUpcomingOpening
  5512. * @property {string|null} [id] RemoveUpcomingOpening id
  5513. */
  5514. /**
  5515. * Constructs a new RemoveUpcomingOpening.
  5516. * @exports RemoveUpcomingOpening
  5517. * @classdesc Represents a RemoveUpcomingOpening.
  5518. * @implements IRemoveUpcomingOpening
  5519. * @constructor
  5520. * @param {IRemoveUpcomingOpening=} [properties] Properties to set
  5521. */
  5522. function RemoveUpcomingOpening(properties) {
  5523. if (properties)
  5524. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  5525. if (properties[keys[i]] != null)
  5526. this[keys[i]] = properties[keys[i]];
  5527. }
  5528. /**
  5529. * RemoveUpcomingOpening id.
  5530. * @member {string} id
  5531. * @memberof RemoveUpcomingOpening
  5532. * @instance
  5533. */
  5534. RemoveUpcomingOpening.prototype.id = "";
  5535. /**
  5536. * Creates a new RemoveUpcomingOpening instance using the specified properties.
  5537. * @function create
  5538. * @memberof RemoveUpcomingOpening
  5539. * @static
  5540. * @param {IRemoveUpcomingOpening=} [properties] Properties to set
  5541. * @returns {RemoveUpcomingOpening} RemoveUpcomingOpening instance
  5542. */
  5543. RemoveUpcomingOpening.create = function create(properties) {
  5544. return new RemoveUpcomingOpening(properties);
  5545. };
  5546. /**
  5547. * Encodes the specified RemoveUpcomingOpening message. Does not implicitly {@link RemoveUpcomingOpening.verify|verify} messages.
  5548. * @function encode
  5549. * @memberof RemoveUpcomingOpening
  5550. * @static
  5551. * @param {IRemoveUpcomingOpening} message RemoveUpcomingOpening message or plain object to encode
  5552. * @param {$protobuf.Writer} [writer] Writer to encode to
  5553. * @returns {$protobuf.Writer} Writer
  5554. */
  5555. RemoveUpcomingOpening.encode = function encode(message, writer) {
  5556. if (!writer)
  5557. writer = $Writer.create();
  5558. if (message.id != null && Object.hasOwnProperty.call(message, "id"))
  5559. writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
  5560. return writer;
  5561. };
  5562. /**
  5563. * Encodes the specified RemoveUpcomingOpening message, length delimited. Does not implicitly {@link RemoveUpcomingOpening.verify|verify} messages.
  5564. * @function encodeDelimited
  5565. * @memberof RemoveUpcomingOpening
  5566. * @static
  5567. * @param {IRemoveUpcomingOpening} message RemoveUpcomingOpening message or plain object to encode
  5568. * @param {$protobuf.Writer} [writer] Writer to encode to
  5569. * @returns {$protobuf.Writer} Writer
  5570. */
  5571. RemoveUpcomingOpening.encodeDelimited = function encodeDelimited(message, writer) {
  5572. return this.encode(message, writer).ldelim();
  5573. };
  5574. /**
  5575. * Decodes a RemoveUpcomingOpening message from the specified reader or buffer.
  5576. * @function decode
  5577. * @memberof RemoveUpcomingOpening
  5578. * @static
  5579. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5580. * @param {number} [length] Message length if known beforehand
  5581. * @returns {RemoveUpcomingOpening} RemoveUpcomingOpening
  5582. * @throws {Error} If the payload is not a reader or valid buffer
  5583. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5584. */
  5585. RemoveUpcomingOpening.decode = function decode(reader, length) {
  5586. if (!(reader instanceof $Reader))
  5587. reader = $Reader.create(reader);
  5588. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.RemoveUpcomingOpening();
  5589. while (reader.pos < end) {
  5590. var tag = reader.uint32();
  5591. switch (tag >>> 3) {
  5592. case 1:
  5593. message.id = reader.string();
  5594. break;
  5595. default:
  5596. reader.skipType(tag & 7);
  5597. break;
  5598. }
  5599. }
  5600. return message;
  5601. };
  5602. /**
  5603. * Decodes a RemoveUpcomingOpening message from the specified reader or buffer, length delimited.
  5604. * @function decodeDelimited
  5605. * @memberof RemoveUpcomingOpening
  5606. * @static
  5607. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5608. * @returns {RemoveUpcomingOpening} RemoveUpcomingOpening
  5609. * @throws {Error} If the payload is not a reader or valid buffer
  5610. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5611. */
  5612. RemoveUpcomingOpening.decodeDelimited = function decodeDelimited(reader) {
  5613. if (!(reader instanceof $Reader))
  5614. reader = new $Reader(reader);
  5615. return this.decode(reader, reader.uint32());
  5616. };
  5617. /**
  5618. * Verifies a RemoveUpcomingOpening message.
  5619. * @function verify
  5620. * @memberof RemoveUpcomingOpening
  5621. * @static
  5622. * @param {Object.<string,*>} message Plain object to verify
  5623. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5624. */
  5625. RemoveUpcomingOpening.verify = function verify(message) {
  5626. if (typeof message !== "object" || message === null)
  5627. return "object expected";
  5628. if (message.id != null && message.hasOwnProperty("id"))
  5629. if (!$util.isString(message.id))
  5630. return "id: string expected";
  5631. return null;
  5632. };
  5633. /**
  5634. * Creates a RemoveUpcomingOpening message from a plain object. Also converts values to their respective internal types.
  5635. * @function fromObject
  5636. * @memberof RemoveUpcomingOpening
  5637. * @static
  5638. * @param {Object.<string,*>} object Plain object
  5639. * @returns {RemoveUpcomingOpening} RemoveUpcomingOpening
  5640. */
  5641. RemoveUpcomingOpening.fromObject = function fromObject(object) {
  5642. if (object instanceof $root.RemoveUpcomingOpening)
  5643. return object;
  5644. var message = new $root.RemoveUpcomingOpening();
  5645. if (object.id != null)
  5646. message.id = String(object.id);
  5647. return message;
  5648. };
  5649. /**
  5650. * Creates a plain object from a RemoveUpcomingOpening message. Also converts values to other types if specified.
  5651. * @function toObject
  5652. * @memberof RemoveUpcomingOpening
  5653. * @static
  5654. * @param {RemoveUpcomingOpening} message RemoveUpcomingOpening
  5655. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5656. * @returns {Object.<string,*>} Plain object
  5657. */
  5658. RemoveUpcomingOpening.toObject = function toObject(message, options) {
  5659. if (!options)
  5660. options = {};
  5661. var object = {};
  5662. if (options.defaults)
  5663. object.id = "";
  5664. if (message.id != null && message.hasOwnProperty("id"))
  5665. object.id = message.id;
  5666. return object;
  5667. };
  5668. /**
  5669. * Converts this RemoveUpcomingOpening to JSON.
  5670. * @function toJSON
  5671. * @memberof RemoveUpcomingOpening
  5672. * @instance
  5673. * @returns {Object.<string,*>} JSON object
  5674. */
  5675. RemoveUpcomingOpening.prototype.toJSON = function toJSON() {
  5676. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5677. };
  5678. return RemoveUpcomingOpening;
  5679. })();
  5680. $root.WorkingGroupMetadataAction = (function() {
  5681. /**
  5682. * Properties of a WorkingGroupMetadataAction.
  5683. * @exports IWorkingGroupMetadataAction
  5684. * @interface IWorkingGroupMetadataAction
  5685. * @property {ISetGroupMetadata|null} [setGroupMetadata] WorkingGroupMetadataAction setGroupMetadata
  5686. * @property {IAddUpcomingOpening|null} [addUpcomingOpening] WorkingGroupMetadataAction addUpcomingOpening
  5687. * @property {IRemoveUpcomingOpening|null} [removeUpcomingOpening] WorkingGroupMetadataAction removeUpcomingOpening
  5688. */
  5689. /**
  5690. * Constructs a new WorkingGroupMetadataAction.
  5691. * @exports WorkingGroupMetadataAction
  5692. * @classdesc Represents a WorkingGroupMetadataAction.
  5693. * @implements IWorkingGroupMetadataAction
  5694. * @constructor
  5695. * @param {IWorkingGroupMetadataAction=} [properties] Properties to set
  5696. */
  5697. function WorkingGroupMetadataAction(properties) {
  5698. if (properties)
  5699. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  5700. if (properties[keys[i]] != null)
  5701. this[keys[i]] = properties[keys[i]];
  5702. }
  5703. /**
  5704. * WorkingGroupMetadataAction setGroupMetadata.
  5705. * @member {ISetGroupMetadata|null|undefined} setGroupMetadata
  5706. * @memberof WorkingGroupMetadataAction
  5707. * @instance
  5708. */
  5709. WorkingGroupMetadataAction.prototype.setGroupMetadata = null;
  5710. /**
  5711. * WorkingGroupMetadataAction addUpcomingOpening.
  5712. * @member {IAddUpcomingOpening|null|undefined} addUpcomingOpening
  5713. * @memberof WorkingGroupMetadataAction
  5714. * @instance
  5715. */
  5716. WorkingGroupMetadataAction.prototype.addUpcomingOpening = null;
  5717. /**
  5718. * WorkingGroupMetadataAction removeUpcomingOpening.
  5719. * @member {IRemoveUpcomingOpening|null|undefined} removeUpcomingOpening
  5720. * @memberof WorkingGroupMetadataAction
  5721. * @instance
  5722. */
  5723. WorkingGroupMetadataAction.prototype.removeUpcomingOpening = null;
  5724. // OneOf field names bound to virtual getters and setters
  5725. var $oneOfFields;
  5726. /**
  5727. * WorkingGroupMetadataAction action.
  5728. * @member {"setGroupMetadata"|"addUpcomingOpening"|"removeUpcomingOpening"|undefined} action
  5729. * @memberof WorkingGroupMetadataAction
  5730. * @instance
  5731. */
  5732. Object.defineProperty(WorkingGroupMetadataAction.prototype, "action", {
  5733. get: $util.oneOfGetter($oneOfFields = ["setGroupMetadata", "addUpcomingOpening", "removeUpcomingOpening"]),
  5734. set: $util.oneOfSetter($oneOfFields)
  5735. });
  5736. /**
  5737. * Creates a new WorkingGroupMetadataAction instance using the specified properties.
  5738. * @function create
  5739. * @memberof WorkingGroupMetadataAction
  5740. * @static
  5741. * @param {IWorkingGroupMetadataAction=} [properties] Properties to set
  5742. * @returns {WorkingGroupMetadataAction} WorkingGroupMetadataAction instance
  5743. */
  5744. WorkingGroupMetadataAction.create = function create(properties) {
  5745. return new WorkingGroupMetadataAction(properties);
  5746. };
  5747. /**
  5748. * Encodes the specified WorkingGroupMetadataAction message. Does not implicitly {@link WorkingGroupMetadataAction.verify|verify} messages.
  5749. * @function encode
  5750. * @memberof WorkingGroupMetadataAction
  5751. * @static
  5752. * @param {IWorkingGroupMetadataAction} message WorkingGroupMetadataAction message or plain object to encode
  5753. * @param {$protobuf.Writer} [writer] Writer to encode to
  5754. * @returns {$protobuf.Writer} Writer
  5755. */
  5756. WorkingGroupMetadataAction.encode = function encode(message, writer) {
  5757. if (!writer)
  5758. writer = $Writer.create();
  5759. if (message.setGroupMetadata != null && Object.hasOwnProperty.call(message, "setGroupMetadata"))
  5760. $root.SetGroupMetadata.encode(message.setGroupMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
  5761. if (message.addUpcomingOpening != null && Object.hasOwnProperty.call(message, "addUpcomingOpening"))
  5762. $root.AddUpcomingOpening.encode(message.addUpcomingOpening, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
  5763. if (message.removeUpcomingOpening != null && Object.hasOwnProperty.call(message, "removeUpcomingOpening"))
  5764. $root.RemoveUpcomingOpening.encode(message.removeUpcomingOpening, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
  5765. return writer;
  5766. };
  5767. /**
  5768. * Encodes the specified WorkingGroupMetadataAction message, length delimited. Does not implicitly {@link WorkingGroupMetadataAction.verify|verify} messages.
  5769. * @function encodeDelimited
  5770. * @memberof WorkingGroupMetadataAction
  5771. * @static
  5772. * @param {IWorkingGroupMetadataAction} message WorkingGroupMetadataAction message or plain object to encode
  5773. * @param {$protobuf.Writer} [writer] Writer to encode to
  5774. * @returns {$protobuf.Writer} Writer
  5775. */
  5776. WorkingGroupMetadataAction.encodeDelimited = function encodeDelimited(message, writer) {
  5777. return this.encode(message, writer).ldelim();
  5778. };
  5779. /**
  5780. * Decodes a WorkingGroupMetadataAction message from the specified reader or buffer.
  5781. * @function decode
  5782. * @memberof WorkingGroupMetadataAction
  5783. * @static
  5784. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5785. * @param {number} [length] Message length if known beforehand
  5786. * @returns {WorkingGroupMetadataAction} WorkingGroupMetadataAction
  5787. * @throws {Error} If the payload is not a reader or valid buffer
  5788. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5789. */
  5790. WorkingGroupMetadataAction.decode = function decode(reader, length) {
  5791. if (!(reader instanceof $Reader))
  5792. reader = $Reader.create(reader);
  5793. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.WorkingGroupMetadataAction();
  5794. while (reader.pos < end) {
  5795. var tag = reader.uint32();
  5796. switch (tag >>> 3) {
  5797. case 1:
  5798. message.setGroupMetadata = $root.SetGroupMetadata.decode(reader, reader.uint32());
  5799. break;
  5800. case 2:
  5801. message.addUpcomingOpening = $root.AddUpcomingOpening.decode(reader, reader.uint32());
  5802. break;
  5803. case 3:
  5804. message.removeUpcomingOpening = $root.RemoveUpcomingOpening.decode(reader, reader.uint32());
  5805. break;
  5806. default:
  5807. reader.skipType(tag & 7);
  5808. break;
  5809. }
  5810. }
  5811. return message;
  5812. };
  5813. /**
  5814. * Decodes a WorkingGroupMetadataAction message from the specified reader or buffer, length delimited.
  5815. * @function decodeDelimited
  5816. * @memberof WorkingGroupMetadataAction
  5817. * @static
  5818. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5819. * @returns {WorkingGroupMetadataAction} WorkingGroupMetadataAction
  5820. * @throws {Error} If the payload is not a reader or valid buffer
  5821. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5822. */
  5823. WorkingGroupMetadataAction.decodeDelimited = function decodeDelimited(reader) {
  5824. if (!(reader instanceof $Reader))
  5825. reader = new $Reader(reader);
  5826. return this.decode(reader, reader.uint32());
  5827. };
  5828. /**
  5829. * Verifies a WorkingGroupMetadataAction message.
  5830. * @function verify
  5831. * @memberof WorkingGroupMetadataAction
  5832. * @static
  5833. * @param {Object.<string,*>} message Plain object to verify
  5834. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5835. */
  5836. WorkingGroupMetadataAction.verify = function verify(message) {
  5837. if (typeof message !== "object" || message === null)
  5838. return "object expected";
  5839. var properties = {};
  5840. if (message.setGroupMetadata != null && message.hasOwnProperty("setGroupMetadata")) {
  5841. properties.action = 1;
  5842. {
  5843. var error = $root.SetGroupMetadata.verify(message.setGroupMetadata);
  5844. if (error)
  5845. return "setGroupMetadata." + error;
  5846. }
  5847. }
  5848. if (message.addUpcomingOpening != null && message.hasOwnProperty("addUpcomingOpening")) {
  5849. if (properties.action === 1)
  5850. return "action: multiple values";
  5851. properties.action = 1;
  5852. {
  5853. var error = $root.AddUpcomingOpening.verify(message.addUpcomingOpening);
  5854. if (error)
  5855. return "addUpcomingOpening." + error;
  5856. }
  5857. }
  5858. if (message.removeUpcomingOpening != null && message.hasOwnProperty("removeUpcomingOpening")) {
  5859. if (properties.action === 1)
  5860. return "action: multiple values";
  5861. properties.action = 1;
  5862. {
  5863. var error = $root.RemoveUpcomingOpening.verify(message.removeUpcomingOpening);
  5864. if (error)
  5865. return "removeUpcomingOpening." + error;
  5866. }
  5867. }
  5868. return null;
  5869. };
  5870. /**
  5871. * Creates a WorkingGroupMetadataAction message from a plain object. Also converts values to their respective internal types.
  5872. * @function fromObject
  5873. * @memberof WorkingGroupMetadataAction
  5874. * @static
  5875. * @param {Object.<string,*>} object Plain object
  5876. * @returns {WorkingGroupMetadataAction} WorkingGroupMetadataAction
  5877. */
  5878. WorkingGroupMetadataAction.fromObject = function fromObject(object) {
  5879. if (object instanceof $root.WorkingGroupMetadataAction)
  5880. return object;
  5881. var message = new $root.WorkingGroupMetadataAction();
  5882. if (object.setGroupMetadata != null) {
  5883. if (typeof object.setGroupMetadata !== "object")
  5884. throw TypeError(".WorkingGroupMetadataAction.setGroupMetadata: object expected");
  5885. message.setGroupMetadata = $root.SetGroupMetadata.fromObject(object.setGroupMetadata);
  5886. }
  5887. if (object.addUpcomingOpening != null) {
  5888. if (typeof object.addUpcomingOpening !== "object")
  5889. throw TypeError(".WorkingGroupMetadataAction.addUpcomingOpening: object expected");
  5890. message.addUpcomingOpening = $root.AddUpcomingOpening.fromObject(object.addUpcomingOpening);
  5891. }
  5892. if (object.removeUpcomingOpening != null) {
  5893. if (typeof object.removeUpcomingOpening !== "object")
  5894. throw TypeError(".WorkingGroupMetadataAction.removeUpcomingOpening: object expected");
  5895. message.removeUpcomingOpening = $root.RemoveUpcomingOpening.fromObject(object.removeUpcomingOpening);
  5896. }
  5897. return message;
  5898. };
  5899. /**
  5900. * Creates a plain object from a WorkingGroupMetadataAction message. Also converts values to other types if specified.
  5901. * @function toObject
  5902. * @memberof WorkingGroupMetadataAction
  5903. * @static
  5904. * @param {WorkingGroupMetadataAction} message WorkingGroupMetadataAction
  5905. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5906. * @returns {Object.<string,*>} Plain object
  5907. */
  5908. WorkingGroupMetadataAction.toObject = function toObject(message, options) {
  5909. if (!options)
  5910. options = {};
  5911. var object = {};
  5912. if (message.setGroupMetadata != null && message.hasOwnProperty("setGroupMetadata")) {
  5913. object.setGroupMetadata = $root.SetGroupMetadata.toObject(message.setGroupMetadata, options);
  5914. if (options.oneofs)
  5915. object.action = "setGroupMetadata";
  5916. }
  5917. if (message.addUpcomingOpening != null && message.hasOwnProperty("addUpcomingOpening")) {
  5918. object.addUpcomingOpening = $root.AddUpcomingOpening.toObject(message.addUpcomingOpening, options);
  5919. if (options.oneofs)
  5920. object.action = "addUpcomingOpening";
  5921. }
  5922. if (message.removeUpcomingOpening != null && message.hasOwnProperty("removeUpcomingOpening")) {
  5923. object.removeUpcomingOpening = $root.RemoveUpcomingOpening.toObject(message.removeUpcomingOpening, options);
  5924. if (options.oneofs)
  5925. object.action = "removeUpcomingOpening";
  5926. }
  5927. return object;
  5928. };
  5929. /**
  5930. * Converts this WorkingGroupMetadataAction to JSON.
  5931. * @function toJSON
  5932. * @memberof WorkingGroupMetadataAction
  5933. * @instance
  5934. * @returns {Object.<string,*>} JSON object
  5935. */
  5936. WorkingGroupMetadataAction.prototype.toJSON = function toJSON() {
  5937. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5938. };
  5939. return WorkingGroupMetadataAction;
  5940. })();
  5941. module.exports = $root;