index.js 263 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614
  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} [avatarObject] MembershipMetadata avatarObject
  1322. * @property {string|null} [avatarUri] MembershipMetadata avatarUri
  1323. * @property {string|null} [about] MembershipMetadata about
  1324. */
  1325. /**
  1326. * Constructs a new MembershipMetadata.
  1327. * @exports MembershipMetadata
  1328. * @classdesc Represents a MembershipMetadata.
  1329. * @implements IMembershipMetadata
  1330. * @constructor
  1331. * @param {IMembershipMetadata=} [properties] Properties to set
  1332. */
  1333. function MembershipMetadata(properties) {
  1334. if (properties)
  1335. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1336. if (properties[keys[i]] != null)
  1337. this[keys[i]] = properties[keys[i]];
  1338. }
  1339. /**
  1340. * MembershipMetadata name.
  1341. * @member {string} name
  1342. * @memberof MembershipMetadata
  1343. * @instance
  1344. */
  1345. MembershipMetadata.prototype.name = "";
  1346. /**
  1347. * MembershipMetadata avatarObject.
  1348. * @member {number|null|undefined} avatarObject
  1349. * @memberof MembershipMetadata
  1350. * @instance
  1351. */
  1352. MembershipMetadata.prototype.avatarObject = null;
  1353. /**
  1354. * MembershipMetadata avatarUri.
  1355. * @member {string|null|undefined} avatarUri
  1356. * @memberof MembershipMetadata
  1357. * @instance
  1358. */
  1359. MembershipMetadata.prototype.avatarUri = null;
  1360. /**
  1361. * MembershipMetadata about.
  1362. * @member {string} about
  1363. * @memberof MembershipMetadata
  1364. * @instance
  1365. */
  1366. MembershipMetadata.prototype.about = "";
  1367. // OneOf field names bound to virtual getters and setters
  1368. var $oneOfFields;
  1369. /**
  1370. * MembershipMetadata avatar.
  1371. * @member {"avatarObject"|"avatarUri"|undefined} avatar
  1372. * @memberof MembershipMetadata
  1373. * @instance
  1374. */
  1375. Object.defineProperty(MembershipMetadata.prototype, "avatar", {
  1376. get: $util.oneOfGetter($oneOfFields = ["avatarObject", "avatarUri"]),
  1377. set: $util.oneOfSetter($oneOfFields)
  1378. });
  1379. /**
  1380. * Creates a new MembershipMetadata instance using the specified properties.
  1381. * @function create
  1382. * @memberof MembershipMetadata
  1383. * @static
  1384. * @param {IMembershipMetadata=} [properties] Properties to set
  1385. * @returns {MembershipMetadata} MembershipMetadata instance
  1386. */
  1387. MembershipMetadata.create = function create(properties) {
  1388. return new MembershipMetadata(properties);
  1389. };
  1390. /**
  1391. * Encodes the specified MembershipMetadata message. Does not implicitly {@link MembershipMetadata.verify|verify} messages.
  1392. * @function encode
  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.encode = function encode(message, writer) {
  1400. if (!writer)
  1401. writer = $Writer.create();
  1402. if (message.name != null && Object.hasOwnProperty.call(message, "name"))
  1403. writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
  1404. if (message.avatarObject != null && Object.hasOwnProperty.call(message, "avatarObject"))
  1405. writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.avatarObject);
  1406. if (message.about != null && Object.hasOwnProperty.call(message, "about"))
  1407. writer.uint32(/* id 3, wireType 2 =*/26).string(message.about);
  1408. if (message.avatarUri != null && Object.hasOwnProperty.call(message, "avatarUri"))
  1409. writer.uint32(/* id 4, wireType 2 =*/34).string(message.avatarUri);
  1410. return writer;
  1411. };
  1412. /**
  1413. * Encodes the specified MembershipMetadata message, length delimited. Does not implicitly {@link MembershipMetadata.verify|verify} messages.
  1414. * @function encodeDelimited
  1415. * @memberof MembershipMetadata
  1416. * @static
  1417. * @param {IMembershipMetadata} message MembershipMetadata message or plain object to encode
  1418. * @param {$protobuf.Writer} [writer] Writer to encode to
  1419. * @returns {$protobuf.Writer} Writer
  1420. */
  1421. MembershipMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  1422. return this.encode(message, writer).ldelim();
  1423. };
  1424. /**
  1425. * Decodes a MembershipMetadata message from the specified reader or buffer.
  1426. * @function decode
  1427. * @memberof MembershipMetadata
  1428. * @static
  1429. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1430. * @param {number} [length] Message length if known beforehand
  1431. * @returns {MembershipMetadata} MembershipMetadata
  1432. * @throws {Error} If the payload is not a reader or valid buffer
  1433. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1434. */
  1435. MembershipMetadata.decode = function decode(reader, length) {
  1436. if (!(reader instanceof $Reader))
  1437. reader = $Reader.create(reader);
  1438. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MembershipMetadata();
  1439. while (reader.pos < end) {
  1440. var tag = reader.uint32();
  1441. switch (tag >>> 3) {
  1442. case 1:
  1443. message.name = reader.string();
  1444. break;
  1445. case 2:
  1446. message.avatarObject = reader.uint32();
  1447. break;
  1448. case 4:
  1449. message.avatarUri = reader.string();
  1450. break;
  1451. case 3:
  1452. message.about = reader.string();
  1453. break;
  1454. default:
  1455. reader.skipType(tag & 7);
  1456. break;
  1457. }
  1458. }
  1459. return message;
  1460. };
  1461. /**
  1462. * Decodes a MembershipMetadata message from the specified reader or buffer, length delimited.
  1463. * @function decodeDelimited
  1464. * @memberof MembershipMetadata
  1465. * @static
  1466. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1467. * @returns {MembershipMetadata} MembershipMetadata
  1468. * @throws {Error} If the payload is not a reader or valid buffer
  1469. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1470. */
  1471. MembershipMetadata.decodeDelimited = function decodeDelimited(reader) {
  1472. if (!(reader instanceof $Reader))
  1473. reader = new $Reader(reader);
  1474. return this.decode(reader, reader.uint32());
  1475. };
  1476. /**
  1477. * Verifies a MembershipMetadata message.
  1478. * @function verify
  1479. * @memberof MembershipMetadata
  1480. * @static
  1481. * @param {Object.<string,*>} message Plain object to verify
  1482. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1483. */
  1484. MembershipMetadata.verify = function verify(message) {
  1485. if (typeof message !== "object" || message === null)
  1486. return "object expected";
  1487. var properties = {};
  1488. if (message.name != null && message.hasOwnProperty("name"))
  1489. if (!$util.isString(message.name))
  1490. return "name: string expected";
  1491. if (message.avatarObject != null && message.hasOwnProperty("avatarObject")) {
  1492. properties.avatar = 1;
  1493. if (!$util.isInteger(message.avatarObject))
  1494. return "avatarObject: integer expected";
  1495. }
  1496. if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) {
  1497. if (properties.avatar === 1)
  1498. return "avatar: multiple values";
  1499. properties.avatar = 1;
  1500. if (!$util.isString(message.avatarUri))
  1501. return "avatarUri: string expected";
  1502. }
  1503. if (message.about != null && message.hasOwnProperty("about"))
  1504. if (!$util.isString(message.about))
  1505. return "about: string expected";
  1506. return null;
  1507. };
  1508. /**
  1509. * Creates a MembershipMetadata message from a plain object. Also converts values to their respective internal types.
  1510. * @function fromObject
  1511. * @memberof MembershipMetadata
  1512. * @static
  1513. * @param {Object.<string,*>} object Plain object
  1514. * @returns {MembershipMetadata} MembershipMetadata
  1515. */
  1516. MembershipMetadata.fromObject = function fromObject(object) {
  1517. if (object instanceof $root.MembershipMetadata)
  1518. return object;
  1519. var message = new $root.MembershipMetadata();
  1520. if (object.name != null)
  1521. message.name = String(object.name);
  1522. if (object.avatarObject != null)
  1523. message.avatarObject = object.avatarObject >>> 0;
  1524. if (object.avatarUri != null)
  1525. message.avatarUri = String(object.avatarUri);
  1526. if (object.about != null)
  1527. message.about = String(object.about);
  1528. return message;
  1529. };
  1530. /**
  1531. * Creates a plain object from a MembershipMetadata message. Also converts values to other types if specified.
  1532. * @function toObject
  1533. * @memberof MembershipMetadata
  1534. * @static
  1535. * @param {MembershipMetadata} message MembershipMetadata
  1536. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1537. * @returns {Object.<string,*>} Plain object
  1538. */
  1539. MembershipMetadata.toObject = function toObject(message, options) {
  1540. if (!options)
  1541. options = {};
  1542. var object = {};
  1543. if (options.defaults) {
  1544. object.name = "";
  1545. object.about = "";
  1546. }
  1547. if (message.name != null && message.hasOwnProperty("name"))
  1548. object.name = message.name;
  1549. if (message.avatarObject != null && message.hasOwnProperty("avatarObject")) {
  1550. object.avatarObject = message.avatarObject;
  1551. if (options.oneofs)
  1552. object.avatar = "avatarObject";
  1553. }
  1554. if (message.about != null && message.hasOwnProperty("about"))
  1555. object.about = message.about;
  1556. if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) {
  1557. object.avatarUri = message.avatarUri;
  1558. if (options.oneofs)
  1559. object.avatar = "avatarUri";
  1560. }
  1561. return object;
  1562. };
  1563. /**
  1564. * Converts this MembershipMetadata to JSON.
  1565. * @function toJSON
  1566. * @memberof MembershipMetadata
  1567. * @instance
  1568. * @returns {Object.<string,*>} JSON object
  1569. */
  1570. MembershipMetadata.prototype.toJSON = function toJSON() {
  1571. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1572. };
  1573. return MembershipMetadata;
  1574. })();
  1575. $root.PersonMetadata = (function() {
  1576. /**
  1577. * Properties of a PersonMetadata.
  1578. * @exports IPersonMetadata
  1579. * @interface IPersonMetadata
  1580. * @property {string|null} [firstName] PersonMetadata firstName
  1581. * @property {string|null} [middleName] PersonMetadata middleName
  1582. * @property {string|null} [lastName] PersonMetadata lastName
  1583. * @property {string|null} [about] PersonMetadata about
  1584. * @property {number|null} [coverPhoto] PersonMetadata coverPhoto
  1585. * @property {number|null} [avatarPhoto] PersonMetadata avatarPhoto
  1586. */
  1587. /**
  1588. * Constructs a new PersonMetadata.
  1589. * @exports PersonMetadata
  1590. * @classdesc Represents a PersonMetadata.
  1591. * @implements IPersonMetadata
  1592. * @constructor
  1593. * @param {IPersonMetadata=} [properties] Properties to set
  1594. */
  1595. function PersonMetadata(properties) {
  1596. if (properties)
  1597. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1598. if (properties[keys[i]] != null)
  1599. this[keys[i]] = properties[keys[i]];
  1600. }
  1601. /**
  1602. * PersonMetadata firstName.
  1603. * @member {string} firstName
  1604. * @memberof PersonMetadata
  1605. * @instance
  1606. */
  1607. PersonMetadata.prototype.firstName = "";
  1608. /**
  1609. * PersonMetadata middleName.
  1610. * @member {string} middleName
  1611. * @memberof PersonMetadata
  1612. * @instance
  1613. */
  1614. PersonMetadata.prototype.middleName = "";
  1615. /**
  1616. * PersonMetadata lastName.
  1617. * @member {string} lastName
  1618. * @memberof PersonMetadata
  1619. * @instance
  1620. */
  1621. PersonMetadata.prototype.lastName = "";
  1622. /**
  1623. * PersonMetadata about.
  1624. * @member {string} about
  1625. * @memberof PersonMetadata
  1626. * @instance
  1627. */
  1628. PersonMetadata.prototype.about = "";
  1629. /**
  1630. * PersonMetadata coverPhoto.
  1631. * @member {number} coverPhoto
  1632. * @memberof PersonMetadata
  1633. * @instance
  1634. */
  1635. PersonMetadata.prototype.coverPhoto = 0;
  1636. /**
  1637. * PersonMetadata avatarPhoto.
  1638. * @member {number} avatarPhoto
  1639. * @memberof PersonMetadata
  1640. * @instance
  1641. */
  1642. PersonMetadata.prototype.avatarPhoto = 0;
  1643. /**
  1644. * Creates a new PersonMetadata instance using the specified properties.
  1645. * @function create
  1646. * @memberof PersonMetadata
  1647. * @static
  1648. * @param {IPersonMetadata=} [properties] Properties to set
  1649. * @returns {PersonMetadata} PersonMetadata instance
  1650. */
  1651. PersonMetadata.create = function create(properties) {
  1652. return new PersonMetadata(properties);
  1653. };
  1654. /**
  1655. * Encodes the specified PersonMetadata message. Does not implicitly {@link PersonMetadata.verify|verify} messages.
  1656. * @function encode
  1657. * @memberof PersonMetadata
  1658. * @static
  1659. * @param {IPersonMetadata} message PersonMetadata message or plain object to encode
  1660. * @param {$protobuf.Writer} [writer] Writer to encode to
  1661. * @returns {$protobuf.Writer} Writer
  1662. */
  1663. PersonMetadata.encode = function encode(message, writer) {
  1664. if (!writer)
  1665. writer = $Writer.create();
  1666. if (message.firstName != null && Object.hasOwnProperty.call(message, "firstName"))
  1667. writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstName);
  1668. if (message.middleName != null && Object.hasOwnProperty.call(message, "middleName"))
  1669. writer.uint32(/* id 2, wireType 2 =*/18).string(message.middleName);
  1670. if (message.lastName != null && Object.hasOwnProperty.call(message, "lastName"))
  1671. writer.uint32(/* id 3, wireType 2 =*/26).string(message.lastName);
  1672. if (message.about != null && Object.hasOwnProperty.call(message, "about"))
  1673. writer.uint32(/* id 4, wireType 2 =*/34).string(message.about);
  1674. if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
  1675. writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.coverPhoto);
  1676. if (message.avatarPhoto != null && Object.hasOwnProperty.call(message, "avatarPhoto"))
  1677. writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.avatarPhoto);
  1678. return writer;
  1679. };
  1680. /**
  1681. * Encodes the specified PersonMetadata message, length delimited. Does not implicitly {@link PersonMetadata.verify|verify} messages.
  1682. * @function encodeDelimited
  1683. * @memberof PersonMetadata
  1684. * @static
  1685. * @param {IPersonMetadata} message PersonMetadata message or plain object to encode
  1686. * @param {$protobuf.Writer} [writer] Writer to encode to
  1687. * @returns {$protobuf.Writer} Writer
  1688. */
  1689. PersonMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  1690. return this.encode(message, writer).ldelim();
  1691. };
  1692. /**
  1693. * Decodes a PersonMetadata message from the specified reader or buffer.
  1694. * @function decode
  1695. * @memberof PersonMetadata
  1696. * @static
  1697. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1698. * @param {number} [length] Message length if known beforehand
  1699. * @returns {PersonMetadata} PersonMetadata
  1700. * @throws {Error} If the payload is not a reader or valid buffer
  1701. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1702. */
  1703. PersonMetadata.decode = function decode(reader, length) {
  1704. if (!(reader instanceof $Reader))
  1705. reader = $Reader.create(reader);
  1706. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PersonMetadata();
  1707. while (reader.pos < end) {
  1708. var tag = reader.uint32();
  1709. switch (tag >>> 3) {
  1710. case 1:
  1711. message.firstName = reader.string();
  1712. break;
  1713. case 2:
  1714. message.middleName = reader.string();
  1715. break;
  1716. case 3:
  1717. message.lastName = reader.string();
  1718. break;
  1719. case 4:
  1720. message.about = reader.string();
  1721. break;
  1722. case 5:
  1723. message.coverPhoto = reader.uint32();
  1724. break;
  1725. case 6:
  1726. message.avatarPhoto = reader.uint32();
  1727. break;
  1728. default:
  1729. reader.skipType(tag & 7);
  1730. break;
  1731. }
  1732. }
  1733. return message;
  1734. };
  1735. /**
  1736. * Decodes a PersonMetadata message from the specified reader or buffer, length delimited.
  1737. * @function decodeDelimited
  1738. * @memberof PersonMetadata
  1739. * @static
  1740. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1741. * @returns {PersonMetadata} PersonMetadata
  1742. * @throws {Error} If the payload is not a reader or valid buffer
  1743. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1744. */
  1745. PersonMetadata.decodeDelimited = function decodeDelimited(reader) {
  1746. if (!(reader instanceof $Reader))
  1747. reader = new $Reader(reader);
  1748. return this.decode(reader, reader.uint32());
  1749. };
  1750. /**
  1751. * Verifies a PersonMetadata message.
  1752. * @function verify
  1753. * @memberof PersonMetadata
  1754. * @static
  1755. * @param {Object.<string,*>} message Plain object to verify
  1756. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1757. */
  1758. PersonMetadata.verify = function verify(message) {
  1759. if (typeof message !== "object" || message === null)
  1760. return "object expected";
  1761. if (message.firstName != null && message.hasOwnProperty("firstName"))
  1762. if (!$util.isString(message.firstName))
  1763. return "firstName: string expected";
  1764. if (message.middleName != null && message.hasOwnProperty("middleName"))
  1765. if (!$util.isString(message.middleName))
  1766. return "middleName: string expected";
  1767. if (message.lastName != null && message.hasOwnProperty("lastName"))
  1768. if (!$util.isString(message.lastName))
  1769. return "lastName: string expected";
  1770. if (message.about != null && message.hasOwnProperty("about"))
  1771. if (!$util.isString(message.about))
  1772. return "about: string expected";
  1773. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  1774. if (!$util.isInteger(message.coverPhoto))
  1775. return "coverPhoto: integer expected";
  1776. if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
  1777. if (!$util.isInteger(message.avatarPhoto))
  1778. return "avatarPhoto: integer expected";
  1779. return null;
  1780. };
  1781. /**
  1782. * Creates a PersonMetadata message from a plain object. Also converts values to their respective internal types.
  1783. * @function fromObject
  1784. * @memberof PersonMetadata
  1785. * @static
  1786. * @param {Object.<string,*>} object Plain object
  1787. * @returns {PersonMetadata} PersonMetadata
  1788. */
  1789. PersonMetadata.fromObject = function fromObject(object) {
  1790. if (object instanceof $root.PersonMetadata)
  1791. return object;
  1792. var message = new $root.PersonMetadata();
  1793. if (object.firstName != null)
  1794. message.firstName = String(object.firstName);
  1795. if (object.middleName != null)
  1796. message.middleName = String(object.middleName);
  1797. if (object.lastName != null)
  1798. message.lastName = String(object.lastName);
  1799. if (object.about != null)
  1800. message.about = String(object.about);
  1801. if (object.coverPhoto != null)
  1802. message.coverPhoto = object.coverPhoto >>> 0;
  1803. if (object.avatarPhoto != null)
  1804. message.avatarPhoto = object.avatarPhoto >>> 0;
  1805. return message;
  1806. };
  1807. /**
  1808. * Creates a plain object from a PersonMetadata message. Also converts values to other types if specified.
  1809. * @function toObject
  1810. * @memberof PersonMetadata
  1811. * @static
  1812. * @param {PersonMetadata} message PersonMetadata
  1813. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1814. * @returns {Object.<string,*>} Plain object
  1815. */
  1816. PersonMetadata.toObject = function toObject(message, options) {
  1817. if (!options)
  1818. options = {};
  1819. var object = {};
  1820. if (options.defaults) {
  1821. object.firstName = "";
  1822. object.middleName = "";
  1823. object.lastName = "";
  1824. object.about = "";
  1825. object.coverPhoto = 0;
  1826. object.avatarPhoto = 0;
  1827. }
  1828. if (message.firstName != null && message.hasOwnProperty("firstName"))
  1829. object.firstName = message.firstName;
  1830. if (message.middleName != null && message.hasOwnProperty("middleName"))
  1831. object.middleName = message.middleName;
  1832. if (message.lastName != null && message.hasOwnProperty("lastName"))
  1833. object.lastName = message.lastName;
  1834. if (message.about != null && message.hasOwnProperty("about"))
  1835. object.about = message.about;
  1836. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  1837. object.coverPhoto = message.coverPhoto;
  1838. if (message.avatarPhoto != null && message.hasOwnProperty("avatarPhoto"))
  1839. object.avatarPhoto = message.avatarPhoto;
  1840. return object;
  1841. };
  1842. /**
  1843. * Converts this PersonMetadata to JSON.
  1844. * @function toJSON
  1845. * @memberof PersonMetadata
  1846. * @instance
  1847. * @returns {Object.<string,*>} JSON object
  1848. */
  1849. PersonMetadata.prototype.toJSON = function toJSON() {
  1850. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1851. };
  1852. return PersonMetadata;
  1853. })();
  1854. $root.PlaylistMetadata = (function() {
  1855. /**
  1856. * Properties of a PlaylistMetadata.
  1857. * @exports IPlaylistMetadata
  1858. * @interface IPlaylistMetadata
  1859. * @property {string|null} [title] PlaylistMetadata title
  1860. * @property {Array.<Long>|null} [videos] PlaylistMetadata videos
  1861. */
  1862. /**
  1863. * Constructs a new PlaylistMetadata.
  1864. * @exports PlaylistMetadata
  1865. * @classdesc Represents a PlaylistMetadata.
  1866. * @implements IPlaylistMetadata
  1867. * @constructor
  1868. * @param {IPlaylistMetadata=} [properties] Properties to set
  1869. */
  1870. function PlaylistMetadata(properties) {
  1871. this.videos = [];
  1872. if (properties)
  1873. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1874. if (properties[keys[i]] != null)
  1875. this[keys[i]] = properties[keys[i]];
  1876. }
  1877. /**
  1878. * PlaylistMetadata title.
  1879. * @member {string} title
  1880. * @memberof PlaylistMetadata
  1881. * @instance
  1882. */
  1883. PlaylistMetadata.prototype.title = "";
  1884. /**
  1885. * PlaylistMetadata videos.
  1886. * @member {Array.<Long>} videos
  1887. * @memberof PlaylistMetadata
  1888. * @instance
  1889. */
  1890. PlaylistMetadata.prototype.videos = $util.emptyArray;
  1891. /**
  1892. * Creates a new PlaylistMetadata instance using the specified properties.
  1893. * @function create
  1894. * @memberof PlaylistMetadata
  1895. * @static
  1896. * @param {IPlaylistMetadata=} [properties] Properties to set
  1897. * @returns {PlaylistMetadata} PlaylistMetadata instance
  1898. */
  1899. PlaylistMetadata.create = function create(properties) {
  1900. return new PlaylistMetadata(properties);
  1901. };
  1902. /**
  1903. * Encodes the specified PlaylistMetadata message. Does not implicitly {@link PlaylistMetadata.verify|verify} messages.
  1904. * @function encode
  1905. * @memberof PlaylistMetadata
  1906. * @static
  1907. * @param {IPlaylistMetadata} message PlaylistMetadata message or plain object to encode
  1908. * @param {$protobuf.Writer} [writer] Writer to encode to
  1909. * @returns {$protobuf.Writer} Writer
  1910. */
  1911. PlaylistMetadata.encode = function encode(message, writer) {
  1912. if (!writer)
  1913. writer = $Writer.create();
  1914. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  1915. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  1916. if (message.videos != null && message.videos.length)
  1917. for (var i = 0; i < message.videos.length; ++i)
  1918. writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.videos[i]);
  1919. return writer;
  1920. };
  1921. /**
  1922. * Encodes the specified PlaylistMetadata message, length delimited. Does not implicitly {@link PlaylistMetadata.verify|verify} messages.
  1923. * @function encodeDelimited
  1924. * @memberof PlaylistMetadata
  1925. * @static
  1926. * @param {IPlaylistMetadata} message PlaylistMetadata message or plain object to encode
  1927. * @param {$protobuf.Writer} [writer] Writer to encode to
  1928. * @returns {$protobuf.Writer} Writer
  1929. */
  1930. PlaylistMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  1931. return this.encode(message, writer).ldelim();
  1932. };
  1933. /**
  1934. * Decodes a PlaylistMetadata message from the specified reader or buffer.
  1935. * @function decode
  1936. * @memberof PlaylistMetadata
  1937. * @static
  1938. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1939. * @param {number} [length] Message length if known beforehand
  1940. * @returns {PlaylistMetadata} PlaylistMetadata
  1941. * @throws {Error} If the payload is not a reader or valid buffer
  1942. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1943. */
  1944. PlaylistMetadata.decode = function decode(reader, length) {
  1945. if (!(reader instanceof $Reader))
  1946. reader = $Reader.create(reader);
  1947. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PlaylistMetadata();
  1948. while (reader.pos < end) {
  1949. var tag = reader.uint32();
  1950. switch (tag >>> 3) {
  1951. case 1:
  1952. message.title = reader.string();
  1953. break;
  1954. case 2:
  1955. if (!(message.videos && message.videos.length))
  1956. message.videos = [];
  1957. if ((tag & 7) === 2) {
  1958. var end2 = reader.uint32() + reader.pos;
  1959. while (reader.pos < end2)
  1960. message.videos.push(reader.uint64());
  1961. } else
  1962. message.videos.push(reader.uint64());
  1963. break;
  1964. default:
  1965. reader.skipType(tag & 7);
  1966. break;
  1967. }
  1968. }
  1969. return message;
  1970. };
  1971. /**
  1972. * Decodes a PlaylistMetadata message from the specified reader or buffer, length delimited.
  1973. * @function decodeDelimited
  1974. * @memberof PlaylistMetadata
  1975. * @static
  1976. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1977. * @returns {PlaylistMetadata} PlaylistMetadata
  1978. * @throws {Error} If the payload is not a reader or valid buffer
  1979. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1980. */
  1981. PlaylistMetadata.decodeDelimited = function decodeDelimited(reader) {
  1982. if (!(reader instanceof $Reader))
  1983. reader = new $Reader(reader);
  1984. return this.decode(reader, reader.uint32());
  1985. };
  1986. /**
  1987. * Verifies a PlaylistMetadata message.
  1988. * @function verify
  1989. * @memberof PlaylistMetadata
  1990. * @static
  1991. * @param {Object.<string,*>} message Plain object to verify
  1992. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1993. */
  1994. PlaylistMetadata.verify = function verify(message) {
  1995. if (typeof message !== "object" || message === null)
  1996. return "object expected";
  1997. if (message.title != null && message.hasOwnProperty("title"))
  1998. if (!$util.isString(message.title))
  1999. return "title: string expected";
  2000. if (message.videos != null && message.hasOwnProperty("videos")) {
  2001. if (!Array.isArray(message.videos))
  2002. return "videos: array expected";
  2003. for (var i = 0; i < message.videos.length; ++i)
  2004. if (!$util.isInteger(message.videos[i]) && !(message.videos[i] && $util.isInteger(message.videos[i].low) && $util.isInteger(message.videos[i].high)))
  2005. return "videos: integer|Long[] expected";
  2006. }
  2007. return null;
  2008. };
  2009. /**
  2010. * Creates a PlaylistMetadata message from a plain object. Also converts values to their respective internal types.
  2011. * @function fromObject
  2012. * @memberof PlaylistMetadata
  2013. * @static
  2014. * @param {Object.<string,*>} object Plain object
  2015. * @returns {PlaylistMetadata} PlaylistMetadata
  2016. */
  2017. PlaylistMetadata.fromObject = function fromObject(object) {
  2018. if (object instanceof $root.PlaylistMetadata)
  2019. return object;
  2020. var message = new $root.PlaylistMetadata();
  2021. if (object.title != null)
  2022. message.title = String(object.title);
  2023. if (object.videos) {
  2024. if (!Array.isArray(object.videos))
  2025. throw TypeError(".PlaylistMetadata.videos: array expected");
  2026. message.videos = [];
  2027. for (var i = 0; i < object.videos.length; ++i)
  2028. if ($util.Long)
  2029. (message.videos[i] = $util.Long.fromValue(object.videos[i])).unsigned = true;
  2030. else if (typeof object.videos[i] === "string")
  2031. message.videos[i] = parseInt(object.videos[i], 10);
  2032. else if (typeof object.videos[i] === "number")
  2033. message.videos[i] = object.videos[i];
  2034. else if (typeof object.videos[i] === "object")
  2035. message.videos[i] = new $util.LongBits(object.videos[i].low >>> 0, object.videos[i].high >>> 0).toNumber(true);
  2036. }
  2037. return message;
  2038. };
  2039. /**
  2040. * Creates a plain object from a PlaylistMetadata message. Also converts values to other types if specified.
  2041. * @function toObject
  2042. * @memberof PlaylistMetadata
  2043. * @static
  2044. * @param {PlaylistMetadata} message PlaylistMetadata
  2045. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2046. * @returns {Object.<string,*>} Plain object
  2047. */
  2048. PlaylistMetadata.toObject = function toObject(message, options) {
  2049. if (!options)
  2050. options = {};
  2051. var object = {};
  2052. if (options.arrays || options.defaults)
  2053. object.videos = [];
  2054. if (options.defaults)
  2055. object.title = "";
  2056. if (message.title != null && message.hasOwnProperty("title"))
  2057. object.title = message.title;
  2058. if (message.videos && message.videos.length) {
  2059. object.videos = [];
  2060. for (var j = 0; j < message.videos.length; ++j)
  2061. if (typeof message.videos[j] === "number")
  2062. object.videos[j] = options.longs === String ? String(message.videos[j]) : message.videos[j];
  2063. else
  2064. 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];
  2065. }
  2066. return object;
  2067. };
  2068. /**
  2069. * Converts this PlaylistMetadata to JSON.
  2070. * @function toJSON
  2071. * @memberof PlaylistMetadata
  2072. * @instance
  2073. * @returns {Object.<string,*>} JSON object
  2074. */
  2075. PlaylistMetadata.prototype.toJSON = function toJSON() {
  2076. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2077. };
  2078. return PlaylistMetadata;
  2079. })();
  2080. $root.ProposalsDiscussionPostMetadata = (function() {
  2081. /**
  2082. * Properties of a ProposalsDiscussionPostMetadata.
  2083. * @exports IProposalsDiscussionPostMetadata
  2084. * @interface IProposalsDiscussionPostMetadata
  2085. * @property {string|null} [text] ProposalsDiscussionPostMetadata text
  2086. * @property {number|null} [repliesTo] ProposalsDiscussionPostMetadata repliesTo
  2087. */
  2088. /**
  2089. * Constructs a new ProposalsDiscussionPostMetadata.
  2090. * @exports ProposalsDiscussionPostMetadata
  2091. * @classdesc Represents a ProposalsDiscussionPostMetadata.
  2092. * @implements IProposalsDiscussionPostMetadata
  2093. * @constructor
  2094. * @param {IProposalsDiscussionPostMetadata=} [properties] Properties to set
  2095. */
  2096. function ProposalsDiscussionPostMetadata(properties) {
  2097. if (properties)
  2098. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  2099. if (properties[keys[i]] != null)
  2100. this[keys[i]] = properties[keys[i]];
  2101. }
  2102. /**
  2103. * ProposalsDiscussionPostMetadata text.
  2104. * @member {string} text
  2105. * @memberof ProposalsDiscussionPostMetadata
  2106. * @instance
  2107. */
  2108. ProposalsDiscussionPostMetadata.prototype.text = "";
  2109. /**
  2110. * ProposalsDiscussionPostMetadata repliesTo.
  2111. * @member {number} repliesTo
  2112. * @memberof ProposalsDiscussionPostMetadata
  2113. * @instance
  2114. */
  2115. ProposalsDiscussionPostMetadata.prototype.repliesTo = 0;
  2116. /**
  2117. * Creates a new ProposalsDiscussionPostMetadata instance using the specified properties.
  2118. * @function create
  2119. * @memberof ProposalsDiscussionPostMetadata
  2120. * @static
  2121. * @param {IProposalsDiscussionPostMetadata=} [properties] Properties to set
  2122. * @returns {ProposalsDiscussionPostMetadata} ProposalsDiscussionPostMetadata instance
  2123. */
  2124. ProposalsDiscussionPostMetadata.create = function create(properties) {
  2125. return new ProposalsDiscussionPostMetadata(properties);
  2126. };
  2127. /**
  2128. * Encodes the specified ProposalsDiscussionPostMetadata message. Does not implicitly {@link ProposalsDiscussionPostMetadata.verify|verify} messages.
  2129. * @function encode
  2130. * @memberof ProposalsDiscussionPostMetadata
  2131. * @static
  2132. * @param {IProposalsDiscussionPostMetadata} message ProposalsDiscussionPostMetadata message or plain object to encode
  2133. * @param {$protobuf.Writer} [writer] Writer to encode to
  2134. * @returns {$protobuf.Writer} Writer
  2135. */
  2136. ProposalsDiscussionPostMetadata.encode = function encode(message, writer) {
  2137. if (!writer)
  2138. writer = $Writer.create();
  2139. if (message.text != null && Object.hasOwnProperty.call(message, "text"))
  2140. writer.uint32(/* id 1, wireType 2 =*/10).string(message.text);
  2141. if (message.repliesTo != null && Object.hasOwnProperty.call(message, "repliesTo"))
  2142. writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.repliesTo);
  2143. return writer;
  2144. };
  2145. /**
  2146. * Encodes the specified ProposalsDiscussionPostMetadata message, length delimited. Does not implicitly {@link ProposalsDiscussionPostMetadata.verify|verify} messages.
  2147. * @function encodeDelimited
  2148. * @memberof ProposalsDiscussionPostMetadata
  2149. * @static
  2150. * @param {IProposalsDiscussionPostMetadata} message ProposalsDiscussionPostMetadata message or plain object to encode
  2151. * @param {$protobuf.Writer} [writer] Writer to encode to
  2152. * @returns {$protobuf.Writer} Writer
  2153. */
  2154. ProposalsDiscussionPostMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  2155. return this.encode(message, writer).ldelim();
  2156. };
  2157. /**
  2158. * Decodes a ProposalsDiscussionPostMetadata message from the specified reader or buffer.
  2159. * @function decode
  2160. * @memberof ProposalsDiscussionPostMetadata
  2161. * @static
  2162. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2163. * @param {number} [length] Message length if known beforehand
  2164. * @returns {ProposalsDiscussionPostMetadata} ProposalsDiscussionPostMetadata
  2165. * @throws {Error} If the payload is not a reader or valid buffer
  2166. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2167. */
  2168. ProposalsDiscussionPostMetadata.decode = function decode(reader, length) {
  2169. if (!(reader instanceof $Reader))
  2170. reader = $Reader.create(reader);
  2171. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ProposalsDiscussionPostMetadata();
  2172. while (reader.pos < end) {
  2173. var tag = reader.uint32();
  2174. switch (tag >>> 3) {
  2175. case 1:
  2176. message.text = reader.string();
  2177. break;
  2178. case 2:
  2179. message.repliesTo = reader.uint32();
  2180. break;
  2181. default:
  2182. reader.skipType(tag & 7);
  2183. break;
  2184. }
  2185. }
  2186. return message;
  2187. };
  2188. /**
  2189. * Decodes a ProposalsDiscussionPostMetadata message from the specified reader or buffer, length delimited.
  2190. * @function decodeDelimited
  2191. * @memberof ProposalsDiscussionPostMetadata
  2192. * @static
  2193. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2194. * @returns {ProposalsDiscussionPostMetadata} ProposalsDiscussionPostMetadata
  2195. * @throws {Error} If the payload is not a reader or valid buffer
  2196. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2197. */
  2198. ProposalsDiscussionPostMetadata.decodeDelimited = function decodeDelimited(reader) {
  2199. if (!(reader instanceof $Reader))
  2200. reader = new $Reader(reader);
  2201. return this.decode(reader, reader.uint32());
  2202. };
  2203. /**
  2204. * Verifies a ProposalsDiscussionPostMetadata message.
  2205. * @function verify
  2206. * @memberof ProposalsDiscussionPostMetadata
  2207. * @static
  2208. * @param {Object.<string,*>} message Plain object to verify
  2209. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  2210. */
  2211. ProposalsDiscussionPostMetadata.verify = function verify(message) {
  2212. if (typeof message !== "object" || message === null)
  2213. return "object expected";
  2214. if (message.text != null && message.hasOwnProperty("text"))
  2215. if (!$util.isString(message.text))
  2216. return "text: string expected";
  2217. if (message.repliesTo != null && message.hasOwnProperty("repliesTo"))
  2218. if (!$util.isInteger(message.repliesTo))
  2219. return "repliesTo: integer expected";
  2220. return null;
  2221. };
  2222. /**
  2223. * Creates a ProposalsDiscussionPostMetadata message from a plain object. Also converts values to their respective internal types.
  2224. * @function fromObject
  2225. * @memberof ProposalsDiscussionPostMetadata
  2226. * @static
  2227. * @param {Object.<string,*>} object Plain object
  2228. * @returns {ProposalsDiscussionPostMetadata} ProposalsDiscussionPostMetadata
  2229. */
  2230. ProposalsDiscussionPostMetadata.fromObject = function fromObject(object) {
  2231. if (object instanceof $root.ProposalsDiscussionPostMetadata)
  2232. return object;
  2233. var message = new $root.ProposalsDiscussionPostMetadata();
  2234. if (object.text != null)
  2235. message.text = String(object.text);
  2236. if (object.repliesTo != null)
  2237. message.repliesTo = object.repliesTo >>> 0;
  2238. return message;
  2239. };
  2240. /**
  2241. * Creates a plain object from a ProposalsDiscussionPostMetadata message. Also converts values to other types if specified.
  2242. * @function toObject
  2243. * @memberof ProposalsDiscussionPostMetadata
  2244. * @static
  2245. * @param {ProposalsDiscussionPostMetadata} message ProposalsDiscussionPostMetadata
  2246. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2247. * @returns {Object.<string,*>} Plain object
  2248. */
  2249. ProposalsDiscussionPostMetadata.toObject = function toObject(message, options) {
  2250. if (!options)
  2251. options = {};
  2252. var object = {};
  2253. if (options.defaults) {
  2254. object.text = "";
  2255. object.repliesTo = 0;
  2256. }
  2257. if (message.text != null && message.hasOwnProperty("text"))
  2258. object.text = message.text;
  2259. if (message.repliesTo != null && message.hasOwnProperty("repliesTo"))
  2260. object.repliesTo = message.repliesTo;
  2261. return object;
  2262. };
  2263. /**
  2264. * Converts this ProposalsDiscussionPostMetadata to JSON.
  2265. * @function toJSON
  2266. * @memberof ProposalsDiscussionPostMetadata
  2267. * @instance
  2268. * @returns {Object.<string,*>} JSON object
  2269. */
  2270. ProposalsDiscussionPostMetadata.prototype.toJSON = function toJSON() {
  2271. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2272. };
  2273. return ProposalsDiscussionPostMetadata;
  2274. })();
  2275. $root.SeriesMetadata = (function() {
  2276. /**
  2277. * Properties of a SeriesMetadata.
  2278. * @exports ISeriesMetadata
  2279. * @interface ISeriesMetadata
  2280. * @property {string|null} [title] SeriesMetadata title
  2281. * @property {string|null} [description] SeriesMetadata description
  2282. * @property {number|null} [coverPhoto] SeriesMetadata coverPhoto
  2283. * @property {Array.<Long>|null} [persons] SeriesMetadata persons
  2284. */
  2285. /**
  2286. * Constructs a new SeriesMetadata.
  2287. * @exports SeriesMetadata
  2288. * @classdesc Represents a SeriesMetadata.
  2289. * @implements ISeriesMetadata
  2290. * @constructor
  2291. * @param {ISeriesMetadata=} [properties] Properties to set
  2292. */
  2293. function SeriesMetadata(properties) {
  2294. this.persons = [];
  2295. if (properties)
  2296. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  2297. if (properties[keys[i]] != null)
  2298. this[keys[i]] = properties[keys[i]];
  2299. }
  2300. /**
  2301. * SeriesMetadata title.
  2302. * @member {string} title
  2303. * @memberof SeriesMetadata
  2304. * @instance
  2305. */
  2306. SeriesMetadata.prototype.title = "";
  2307. /**
  2308. * SeriesMetadata description.
  2309. * @member {string} description
  2310. * @memberof SeriesMetadata
  2311. * @instance
  2312. */
  2313. SeriesMetadata.prototype.description = "";
  2314. /**
  2315. * SeriesMetadata coverPhoto.
  2316. * @member {number} coverPhoto
  2317. * @memberof SeriesMetadata
  2318. * @instance
  2319. */
  2320. SeriesMetadata.prototype.coverPhoto = 0;
  2321. /**
  2322. * SeriesMetadata persons.
  2323. * @member {Array.<Long>} persons
  2324. * @memberof SeriesMetadata
  2325. * @instance
  2326. */
  2327. SeriesMetadata.prototype.persons = $util.emptyArray;
  2328. /**
  2329. * Creates a new SeriesMetadata instance using the specified properties.
  2330. * @function create
  2331. * @memberof SeriesMetadata
  2332. * @static
  2333. * @param {ISeriesMetadata=} [properties] Properties to set
  2334. * @returns {SeriesMetadata} SeriesMetadata instance
  2335. */
  2336. SeriesMetadata.create = function create(properties) {
  2337. return new SeriesMetadata(properties);
  2338. };
  2339. /**
  2340. * Encodes the specified SeriesMetadata message. Does not implicitly {@link SeriesMetadata.verify|verify} messages.
  2341. * @function encode
  2342. * @memberof SeriesMetadata
  2343. * @static
  2344. * @param {ISeriesMetadata} message SeriesMetadata message or plain object to encode
  2345. * @param {$protobuf.Writer} [writer] Writer to encode to
  2346. * @returns {$protobuf.Writer} Writer
  2347. */
  2348. SeriesMetadata.encode = function encode(message, writer) {
  2349. if (!writer)
  2350. writer = $Writer.create();
  2351. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  2352. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  2353. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  2354. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  2355. if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
  2356. writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.coverPhoto);
  2357. if (message.persons != null && message.persons.length) {
  2358. writer.uint32(/* id 4, wireType 2 =*/34).fork();
  2359. for (var i = 0; i < message.persons.length; ++i)
  2360. writer.uint64(message.persons[i]);
  2361. writer.ldelim();
  2362. }
  2363. return writer;
  2364. };
  2365. /**
  2366. * Encodes the specified SeriesMetadata message, length delimited. Does not implicitly {@link SeriesMetadata.verify|verify} messages.
  2367. * @function encodeDelimited
  2368. * @memberof SeriesMetadata
  2369. * @static
  2370. * @param {ISeriesMetadata} message SeriesMetadata message or plain object to encode
  2371. * @param {$protobuf.Writer} [writer] Writer to encode to
  2372. * @returns {$protobuf.Writer} Writer
  2373. */
  2374. SeriesMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  2375. return this.encode(message, writer).ldelim();
  2376. };
  2377. /**
  2378. * Decodes a SeriesMetadata message from the specified reader or buffer.
  2379. * @function decode
  2380. * @memberof SeriesMetadata
  2381. * @static
  2382. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2383. * @param {number} [length] Message length if known beforehand
  2384. * @returns {SeriesMetadata} SeriesMetadata
  2385. * @throws {Error} If the payload is not a reader or valid buffer
  2386. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2387. */
  2388. SeriesMetadata.decode = function decode(reader, length) {
  2389. if (!(reader instanceof $Reader))
  2390. reader = $Reader.create(reader);
  2391. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SeriesMetadata();
  2392. while (reader.pos < end) {
  2393. var tag = reader.uint32();
  2394. switch (tag >>> 3) {
  2395. case 1:
  2396. message.title = reader.string();
  2397. break;
  2398. case 2:
  2399. message.description = reader.string();
  2400. break;
  2401. case 3:
  2402. message.coverPhoto = reader.uint32();
  2403. break;
  2404. case 4:
  2405. if (!(message.persons && message.persons.length))
  2406. message.persons = [];
  2407. if ((tag & 7) === 2) {
  2408. var end2 = reader.uint32() + reader.pos;
  2409. while (reader.pos < end2)
  2410. message.persons.push(reader.uint64());
  2411. } else
  2412. message.persons.push(reader.uint64());
  2413. break;
  2414. default:
  2415. reader.skipType(tag & 7);
  2416. break;
  2417. }
  2418. }
  2419. return message;
  2420. };
  2421. /**
  2422. * Decodes a SeriesMetadata message from the specified reader or buffer, length delimited.
  2423. * @function decodeDelimited
  2424. * @memberof SeriesMetadata
  2425. * @static
  2426. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2427. * @returns {SeriesMetadata} SeriesMetadata
  2428. * @throws {Error} If the payload is not a reader or valid buffer
  2429. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2430. */
  2431. SeriesMetadata.decodeDelimited = function decodeDelimited(reader) {
  2432. if (!(reader instanceof $Reader))
  2433. reader = new $Reader(reader);
  2434. return this.decode(reader, reader.uint32());
  2435. };
  2436. /**
  2437. * Verifies a SeriesMetadata message.
  2438. * @function verify
  2439. * @memberof SeriesMetadata
  2440. * @static
  2441. * @param {Object.<string,*>} message Plain object to verify
  2442. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  2443. */
  2444. SeriesMetadata.verify = function verify(message) {
  2445. if (typeof message !== "object" || message === null)
  2446. return "object expected";
  2447. if (message.title != null && message.hasOwnProperty("title"))
  2448. if (!$util.isString(message.title))
  2449. return "title: string expected";
  2450. if (message.description != null && message.hasOwnProperty("description"))
  2451. if (!$util.isString(message.description))
  2452. return "description: string expected";
  2453. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  2454. if (!$util.isInteger(message.coverPhoto))
  2455. return "coverPhoto: integer expected";
  2456. if (message.persons != null && message.hasOwnProperty("persons")) {
  2457. if (!Array.isArray(message.persons))
  2458. return "persons: array expected";
  2459. for (var i = 0; i < message.persons.length; ++i)
  2460. if (!$util.isInteger(message.persons[i]) && !(message.persons[i] && $util.isInteger(message.persons[i].low) && $util.isInteger(message.persons[i].high)))
  2461. return "persons: integer|Long[] expected";
  2462. }
  2463. return null;
  2464. };
  2465. /**
  2466. * Creates a SeriesMetadata message from a plain object. Also converts values to their respective internal types.
  2467. * @function fromObject
  2468. * @memberof SeriesMetadata
  2469. * @static
  2470. * @param {Object.<string,*>} object Plain object
  2471. * @returns {SeriesMetadata} SeriesMetadata
  2472. */
  2473. SeriesMetadata.fromObject = function fromObject(object) {
  2474. if (object instanceof $root.SeriesMetadata)
  2475. return object;
  2476. var message = new $root.SeriesMetadata();
  2477. if (object.title != null)
  2478. message.title = String(object.title);
  2479. if (object.description != null)
  2480. message.description = String(object.description);
  2481. if (object.coverPhoto != null)
  2482. message.coverPhoto = object.coverPhoto >>> 0;
  2483. if (object.persons) {
  2484. if (!Array.isArray(object.persons))
  2485. throw TypeError(".SeriesMetadata.persons: array expected");
  2486. message.persons = [];
  2487. for (var i = 0; i < object.persons.length; ++i)
  2488. if ($util.Long)
  2489. (message.persons[i] = $util.Long.fromValue(object.persons[i])).unsigned = true;
  2490. else if (typeof object.persons[i] === "string")
  2491. message.persons[i] = parseInt(object.persons[i], 10);
  2492. else if (typeof object.persons[i] === "number")
  2493. message.persons[i] = object.persons[i];
  2494. else if (typeof object.persons[i] === "object")
  2495. message.persons[i] = new $util.LongBits(object.persons[i].low >>> 0, object.persons[i].high >>> 0).toNumber(true);
  2496. }
  2497. return message;
  2498. };
  2499. /**
  2500. * Creates a plain object from a SeriesMetadata message. Also converts values to other types if specified.
  2501. * @function toObject
  2502. * @memberof SeriesMetadata
  2503. * @static
  2504. * @param {SeriesMetadata} message SeriesMetadata
  2505. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2506. * @returns {Object.<string,*>} Plain object
  2507. */
  2508. SeriesMetadata.toObject = function toObject(message, options) {
  2509. if (!options)
  2510. options = {};
  2511. var object = {};
  2512. if (options.arrays || options.defaults)
  2513. object.persons = [];
  2514. if (options.defaults) {
  2515. object.title = "";
  2516. object.description = "";
  2517. object.coverPhoto = 0;
  2518. }
  2519. if (message.title != null && message.hasOwnProperty("title"))
  2520. object.title = message.title;
  2521. if (message.description != null && message.hasOwnProperty("description"))
  2522. object.description = message.description;
  2523. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  2524. object.coverPhoto = message.coverPhoto;
  2525. if (message.persons && message.persons.length) {
  2526. object.persons = [];
  2527. for (var j = 0; j < message.persons.length; ++j)
  2528. if (typeof message.persons[j] === "number")
  2529. object.persons[j] = options.longs === String ? String(message.persons[j]) : message.persons[j];
  2530. else
  2531. 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];
  2532. }
  2533. return object;
  2534. };
  2535. /**
  2536. * Converts this SeriesMetadata to JSON.
  2537. * @function toJSON
  2538. * @memberof SeriesMetadata
  2539. * @instance
  2540. * @returns {Object.<string,*>} JSON object
  2541. */
  2542. SeriesMetadata.prototype.toJSON = function toJSON() {
  2543. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2544. };
  2545. return SeriesMetadata;
  2546. })();
  2547. $root.SeasonMetadata = (function() {
  2548. /**
  2549. * Properties of a SeasonMetadata.
  2550. * @exports ISeasonMetadata
  2551. * @interface ISeasonMetadata
  2552. * @property {string|null} [title] SeasonMetadata title
  2553. * @property {string|null} [description] SeasonMetadata description
  2554. * @property {number|null} [coverPhoto] SeasonMetadata coverPhoto
  2555. * @property {Array.<Long>|null} [persons] SeasonMetadata persons
  2556. */
  2557. /**
  2558. * Constructs a new SeasonMetadata.
  2559. * @exports SeasonMetadata
  2560. * @classdesc Represents a SeasonMetadata.
  2561. * @implements ISeasonMetadata
  2562. * @constructor
  2563. * @param {ISeasonMetadata=} [properties] Properties to set
  2564. */
  2565. function SeasonMetadata(properties) {
  2566. this.persons = [];
  2567. if (properties)
  2568. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  2569. if (properties[keys[i]] != null)
  2570. this[keys[i]] = properties[keys[i]];
  2571. }
  2572. /**
  2573. * SeasonMetadata title.
  2574. * @member {string} title
  2575. * @memberof SeasonMetadata
  2576. * @instance
  2577. */
  2578. SeasonMetadata.prototype.title = "";
  2579. /**
  2580. * SeasonMetadata description.
  2581. * @member {string} description
  2582. * @memberof SeasonMetadata
  2583. * @instance
  2584. */
  2585. SeasonMetadata.prototype.description = "";
  2586. /**
  2587. * SeasonMetadata coverPhoto.
  2588. * @member {number} coverPhoto
  2589. * @memberof SeasonMetadata
  2590. * @instance
  2591. */
  2592. SeasonMetadata.prototype.coverPhoto = 0;
  2593. /**
  2594. * SeasonMetadata persons.
  2595. * @member {Array.<Long>} persons
  2596. * @memberof SeasonMetadata
  2597. * @instance
  2598. */
  2599. SeasonMetadata.prototype.persons = $util.emptyArray;
  2600. /**
  2601. * Creates a new SeasonMetadata instance using the specified properties.
  2602. * @function create
  2603. * @memberof SeasonMetadata
  2604. * @static
  2605. * @param {ISeasonMetadata=} [properties] Properties to set
  2606. * @returns {SeasonMetadata} SeasonMetadata instance
  2607. */
  2608. SeasonMetadata.create = function create(properties) {
  2609. return new SeasonMetadata(properties);
  2610. };
  2611. /**
  2612. * Encodes the specified SeasonMetadata message. Does not implicitly {@link SeasonMetadata.verify|verify} messages.
  2613. * @function encode
  2614. * @memberof SeasonMetadata
  2615. * @static
  2616. * @param {ISeasonMetadata} message SeasonMetadata message or plain object to encode
  2617. * @param {$protobuf.Writer} [writer] Writer to encode to
  2618. * @returns {$protobuf.Writer} Writer
  2619. */
  2620. SeasonMetadata.encode = function encode(message, writer) {
  2621. if (!writer)
  2622. writer = $Writer.create();
  2623. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  2624. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  2625. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  2626. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  2627. if (message.coverPhoto != null && Object.hasOwnProperty.call(message, "coverPhoto"))
  2628. writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.coverPhoto);
  2629. if (message.persons != null && message.persons.length) {
  2630. writer.uint32(/* id 4, wireType 2 =*/34).fork();
  2631. for (var i = 0; i < message.persons.length; ++i)
  2632. writer.uint64(message.persons[i]);
  2633. writer.ldelim();
  2634. }
  2635. return writer;
  2636. };
  2637. /**
  2638. * Encodes the specified SeasonMetadata message, length delimited. Does not implicitly {@link SeasonMetadata.verify|verify} messages.
  2639. * @function encodeDelimited
  2640. * @memberof SeasonMetadata
  2641. * @static
  2642. * @param {ISeasonMetadata} message SeasonMetadata message or plain object to encode
  2643. * @param {$protobuf.Writer} [writer] Writer to encode to
  2644. * @returns {$protobuf.Writer} Writer
  2645. */
  2646. SeasonMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  2647. return this.encode(message, writer).ldelim();
  2648. };
  2649. /**
  2650. * Decodes a SeasonMetadata message from the specified reader or buffer.
  2651. * @function decode
  2652. * @memberof SeasonMetadata
  2653. * @static
  2654. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2655. * @param {number} [length] Message length if known beforehand
  2656. * @returns {SeasonMetadata} SeasonMetadata
  2657. * @throws {Error} If the payload is not a reader or valid buffer
  2658. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2659. */
  2660. SeasonMetadata.decode = function decode(reader, length) {
  2661. if (!(reader instanceof $Reader))
  2662. reader = $Reader.create(reader);
  2663. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SeasonMetadata();
  2664. while (reader.pos < end) {
  2665. var tag = reader.uint32();
  2666. switch (tag >>> 3) {
  2667. case 1:
  2668. message.title = reader.string();
  2669. break;
  2670. case 2:
  2671. message.description = reader.string();
  2672. break;
  2673. case 3:
  2674. message.coverPhoto = reader.uint32();
  2675. break;
  2676. case 4:
  2677. if (!(message.persons && message.persons.length))
  2678. message.persons = [];
  2679. if ((tag & 7) === 2) {
  2680. var end2 = reader.uint32() + reader.pos;
  2681. while (reader.pos < end2)
  2682. message.persons.push(reader.uint64());
  2683. } else
  2684. message.persons.push(reader.uint64());
  2685. break;
  2686. default:
  2687. reader.skipType(tag & 7);
  2688. break;
  2689. }
  2690. }
  2691. return message;
  2692. };
  2693. /**
  2694. * Decodes a SeasonMetadata message from the specified reader or buffer, length delimited.
  2695. * @function decodeDelimited
  2696. * @memberof SeasonMetadata
  2697. * @static
  2698. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2699. * @returns {SeasonMetadata} SeasonMetadata
  2700. * @throws {Error} If the payload is not a reader or valid buffer
  2701. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2702. */
  2703. SeasonMetadata.decodeDelimited = function decodeDelimited(reader) {
  2704. if (!(reader instanceof $Reader))
  2705. reader = new $Reader(reader);
  2706. return this.decode(reader, reader.uint32());
  2707. };
  2708. /**
  2709. * Verifies a SeasonMetadata message.
  2710. * @function verify
  2711. * @memberof SeasonMetadata
  2712. * @static
  2713. * @param {Object.<string,*>} message Plain object to verify
  2714. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  2715. */
  2716. SeasonMetadata.verify = function verify(message) {
  2717. if (typeof message !== "object" || message === null)
  2718. return "object expected";
  2719. if (message.title != null && message.hasOwnProperty("title"))
  2720. if (!$util.isString(message.title))
  2721. return "title: string expected";
  2722. if (message.description != null && message.hasOwnProperty("description"))
  2723. if (!$util.isString(message.description))
  2724. return "description: string expected";
  2725. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  2726. if (!$util.isInteger(message.coverPhoto))
  2727. return "coverPhoto: integer expected";
  2728. if (message.persons != null && message.hasOwnProperty("persons")) {
  2729. if (!Array.isArray(message.persons))
  2730. return "persons: array expected";
  2731. for (var i = 0; i < message.persons.length; ++i)
  2732. if (!$util.isInteger(message.persons[i]) && !(message.persons[i] && $util.isInteger(message.persons[i].low) && $util.isInteger(message.persons[i].high)))
  2733. return "persons: integer|Long[] expected";
  2734. }
  2735. return null;
  2736. };
  2737. /**
  2738. * Creates a SeasonMetadata message from a plain object. Also converts values to their respective internal types.
  2739. * @function fromObject
  2740. * @memberof SeasonMetadata
  2741. * @static
  2742. * @param {Object.<string,*>} object Plain object
  2743. * @returns {SeasonMetadata} SeasonMetadata
  2744. */
  2745. SeasonMetadata.fromObject = function fromObject(object) {
  2746. if (object instanceof $root.SeasonMetadata)
  2747. return object;
  2748. var message = new $root.SeasonMetadata();
  2749. if (object.title != null)
  2750. message.title = String(object.title);
  2751. if (object.description != null)
  2752. message.description = String(object.description);
  2753. if (object.coverPhoto != null)
  2754. message.coverPhoto = object.coverPhoto >>> 0;
  2755. if (object.persons) {
  2756. if (!Array.isArray(object.persons))
  2757. throw TypeError(".SeasonMetadata.persons: array expected");
  2758. message.persons = [];
  2759. for (var i = 0; i < object.persons.length; ++i)
  2760. if ($util.Long)
  2761. (message.persons[i] = $util.Long.fromValue(object.persons[i])).unsigned = true;
  2762. else if (typeof object.persons[i] === "string")
  2763. message.persons[i] = parseInt(object.persons[i], 10);
  2764. else if (typeof object.persons[i] === "number")
  2765. message.persons[i] = object.persons[i];
  2766. else if (typeof object.persons[i] === "object")
  2767. message.persons[i] = new $util.LongBits(object.persons[i].low >>> 0, object.persons[i].high >>> 0).toNumber(true);
  2768. }
  2769. return message;
  2770. };
  2771. /**
  2772. * Creates a plain object from a SeasonMetadata message. Also converts values to other types if specified.
  2773. * @function toObject
  2774. * @memberof SeasonMetadata
  2775. * @static
  2776. * @param {SeasonMetadata} message SeasonMetadata
  2777. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2778. * @returns {Object.<string,*>} Plain object
  2779. */
  2780. SeasonMetadata.toObject = function toObject(message, options) {
  2781. if (!options)
  2782. options = {};
  2783. var object = {};
  2784. if (options.arrays || options.defaults)
  2785. object.persons = [];
  2786. if (options.defaults) {
  2787. object.title = "";
  2788. object.description = "";
  2789. object.coverPhoto = 0;
  2790. }
  2791. if (message.title != null && message.hasOwnProperty("title"))
  2792. object.title = message.title;
  2793. if (message.description != null && message.hasOwnProperty("description"))
  2794. object.description = message.description;
  2795. if (message.coverPhoto != null && message.hasOwnProperty("coverPhoto"))
  2796. object.coverPhoto = message.coverPhoto;
  2797. if (message.persons && message.persons.length) {
  2798. object.persons = [];
  2799. for (var j = 0; j < message.persons.length; ++j)
  2800. if (typeof message.persons[j] === "number")
  2801. object.persons[j] = options.longs === String ? String(message.persons[j]) : message.persons[j];
  2802. else
  2803. 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];
  2804. }
  2805. return object;
  2806. };
  2807. /**
  2808. * Converts this SeasonMetadata to JSON.
  2809. * @function toJSON
  2810. * @memberof SeasonMetadata
  2811. * @instance
  2812. * @returns {Object.<string,*>} JSON object
  2813. */
  2814. SeasonMetadata.prototype.toJSON = function toJSON() {
  2815. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  2816. };
  2817. return SeasonMetadata;
  2818. })();
  2819. $root.PublishedBeforeJoystream = (function() {
  2820. /**
  2821. * Properties of a PublishedBeforeJoystream.
  2822. * @exports IPublishedBeforeJoystream
  2823. * @interface IPublishedBeforeJoystream
  2824. * @property {boolean|null} [isPublished] PublishedBeforeJoystream isPublished
  2825. * @property {string|null} [date] PublishedBeforeJoystream date
  2826. */
  2827. /**
  2828. * Constructs a new PublishedBeforeJoystream.
  2829. * @exports PublishedBeforeJoystream
  2830. * @classdesc Represents a PublishedBeforeJoystream.
  2831. * @implements IPublishedBeforeJoystream
  2832. * @constructor
  2833. * @param {IPublishedBeforeJoystream=} [properties] Properties to set
  2834. */
  2835. function PublishedBeforeJoystream(properties) {
  2836. if (properties)
  2837. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  2838. if (properties[keys[i]] != null)
  2839. this[keys[i]] = properties[keys[i]];
  2840. }
  2841. /**
  2842. * PublishedBeforeJoystream isPublished.
  2843. * @member {boolean} isPublished
  2844. * @memberof PublishedBeforeJoystream
  2845. * @instance
  2846. */
  2847. PublishedBeforeJoystream.prototype.isPublished = false;
  2848. /**
  2849. * PublishedBeforeJoystream date.
  2850. * @member {string} date
  2851. * @memberof PublishedBeforeJoystream
  2852. * @instance
  2853. */
  2854. PublishedBeforeJoystream.prototype.date = "";
  2855. /**
  2856. * Creates a new PublishedBeforeJoystream instance using the specified properties.
  2857. * @function create
  2858. * @memberof PublishedBeforeJoystream
  2859. * @static
  2860. * @param {IPublishedBeforeJoystream=} [properties] Properties to set
  2861. * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream instance
  2862. */
  2863. PublishedBeforeJoystream.create = function create(properties) {
  2864. return new PublishedBeforeJoystream(properties);
  2865. };
  2866. /**
  2867. * Encodes the specified PublishedBeforeJoystream message. Does not implicitly {@link PublishedBeforeJoystream.verify|verify} messages.
  2868. * @function encode
  2869. * @memberof PublishedBeforeJoystream
  2870. * @static
  2871. * @param {IPublishedBeforeJoystream} message PublishedBeforeJoystream message or plain object to encode
  2872. * @param {$protobuf.Writer} [writer] Writer to encode to
  2873. * @returns {$protobuf.Writer} Writer
  2874. */
  2875. PublishedBeforeJoystream.encode = function encode(message, writer) {
  2876. if (!writer)
  2877. writer = $Writer.create();
  2878. if (message.isPublished != null && Object.hasOwnProperty.call(message, "isPublished"))
  2879. writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isPublished);
  2880. if (message.date != null && Object.hasOwnProperty.call(message, "date"))
  2881. writer.uint32(/* id 2, wireType 2 =*/18).string(message.date);
  2882. return writer;
  2883. };
  2884. /**
  2885. * Encodes the specified PublishedBeforeJoystream message, length delimited. Does not implicitly {@link PublishedBeforeJoystream.verify|verify} messages.
  2886. * @function encodeDelimited
  2887. * @memberof PublishedBeforeJoystream
  2888. * @static
  2889. * @param {IPublishedBeforeJoystream} message PublishedBeforeJoystream message or plain object to encode
  2890. * @param {$protobuf.Writer} [writer] Writer to encode to
  2891. * @returns {$protobuf.Writer} Writer
  2892. */
  2893. PublishedBeforeJoystream.encodeDelimited = function encodeDelimited(message, writer) {
  2894. return this.encode(message, writer).ldelim();
  2895. };
  2896. /**
  2897. * Decodes a PublishedBeforeJoystream message from the specified reader or buffer.
  2898. * @function decode
  2899. * @memberof PublishedBeforeJoystream
  2900. * @static
  2901. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2902. * @param {number} [length] Message length if known beforehand
  2903. * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream
  2904. * @throws {Error} If the payload is not a reader or valid buffer
  2905. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2906. */
  2907. PublishedBeforeJoystream.decode = function decode(reader, length) {
  2908. if (!(reader instanceof $Reader))
  2909. reader = $Reader.create(reader);
  2910. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PublishedBeforeJoystream();
  2911. while (reader.pos < end) {
  2912. var tag = reader.uint32();
  2913. switch (tag >>> 3) {
  2914. case 1:
  2915. message.isPublished = reader.bool();
  2916. break;
  2917. case 2:
  2918. message.date = reader.string();
  2919. break;
  2920. default:
  2921. reader.skipType(tag & 7);
  2922. break;
  2923. }
  2924. }
  2925. return message;
  2926. };
  2927. /**
  2928. * Decodes a PublishedBeforeJoystream message from the specified reader or buffer, length delimited.
  2929. * @function decodeDelimited
  2930. * @memberof PublishedBeforeJoystream
  2931. * @static
  2932. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  2933. * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream
  2934. * @throws {Error} If the payload is not a reader or valid buffer
  2935. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  2936. */
  2937. PublishedBeforeJoystream.decodeDelimited = function decodeDelimited(reader) {
  2938. if (!(reader instanceof $Reader))
  2939. reader = new $Reader(reader);
  2940. return this.decode(reader, reader.uint32());
  2941. };
  2942. /**
  2943. * Verifies a PublishedBeforeJoystream message.
  2944. * @function verify
  2945. * @memberof PublishedBeforeJoystream
  2946. * @static
  2947. * @param {Object.<string,*>} message Plain object to verify
  2948. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  2949. */
  2950. PublishedBeforeJoystream.verify = function verify(message) {
  2951. if (typeof message !== "object" || message === null)
  2952. return "object expected";
  2953. if (message.isPublished != null && message.hasOwnProperty("isPublished"))
  2954. if (typeof message.isPublished !== "boolean")
  2955. return "isPublished: boolean expected";
  2956. if (message.date != null && message.hasOwnProperty("date"))
  2957. if (!$util.isString(message.date))
  2958. return "date: string expected";
  2959. return null;
  2960. };
  2961. /**
  2962. * Creates a PublishedBeforeJoystream message from a plain object. Also converts values to their respective internal types.
  2963. * @function fromObject
  2964. * @memberof PublishedBeforeJoystream
  2965. * @static
  2966. * @param {Object.<string,*>} object Plain object
  2967. * @returns {PublishedBeforeJoystream} PublishedBeforeJoystream
  2968. */
  2969. PublishedBeforeJoystream.fromObject = function fromObject(object) {
  2970. if (object instanceof $root.PublishedBeforeJoystream)
  2971. return object;
  2972. var message = new $root.PublishedBeforeJoystream();
  2973. if (object.isPublished != null)
  2974. message.isPublished = Boolean(object.isPublished);
  2975. if (object.date != null)
  2976. message.date = String(object.date);
  2977. return message;
  2978. };
  2979. /**
  2980. * Creates a plain object from a PublishedBeforeJoystream message. Also converts values to other types if specified.
  2981. * @function toObject
  2982. * @memberof PublishedBeforeJoystream
  2983. * @static
  2984. * @param {PublishedBeforeJoystream} message PublishedBeforeJoystream
  2985. * @param {$protobuf.IConversionOptions} [options] Conversion options
  2986. * @returns {Object.<string,*>} Plain object
  2987. */
  2988. PublishedBeforeJoystream.toObject = function toObject(message, options) {
  2989. if (!options)
  2990. options = {};
  2991. var object = {};
  2992. if (options.defaults) {
  2993. object.isPublished = false;
  2994. object.date = "";
  2995. }
  2996. if (message.isPublished != null && message.hasOwnProperty("isPublished"))
  2997. object.isPublished = message.isPublished;
  2998. if (message.date != null && message.hasOwnProperty("date"))
  2999. object.date = message.date;
  3000. return object;
  3001. };
  3002. /**
  3003. * Converts this PublishedBeforeJoystream to JSON.
  3004. * @function toJSON
  3005. * @memberof PublishedBeforeJoystream
  3006. * @instance
  3007. * @returns {Object.<string,*>} JSON object
  3008. */
  3009. PublishedBeforeJoystream.prototype.toJSON = function toJSON() {
  3010. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  3011. };
  3012. return PublishedBeforeJoystream;
  3013. })();
  3014. $root.License = (function() {
  3015. /**
  3016. * Properties of a License.
  3017. * @exports ILicense
  3018. * @interface ILicense
  3019. * @property {number|null} [code] License code
  3020. * @property {string|null} [attribution] License attribution
  3021. * @property {string|null} [customText] License customText
  3022. */
  3023. /**
  3024. * Constructs a new License.
  3025. * @exports License
  3026. * @classdesc Represents a License.
  3027. * @implements ILicense
  3028. * @constructor
  3029. * @param {ILicense=} [properties] Properties to set
  3030. */
  3031. function License(properties) {
  3032. if (properties)
  3033. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  3034. if (properties[keys[i]] != null)
  3035. this[keys[i]] = properties[keys[i]];
  3036. }
  3037. /**
  3038. * License code.
  3039. * @member {number} code
  3040. * @memberof License
  3041. * @instance
  3042. */
  3043. License.prototype.code = 0;
  3044. /**
  3045. * License attribution.
  3046. * @member {string} attribution
  3047. * @memberof License
  3048. * @instance
  3049. */
  3050. License.prototype.attribution = "";
  3051. /**
  3052. * License customText.
  3053. * @member {string} customText
  3054. * @memberof License
  3055. * @instance
  3056. */
  3057. License.prototype.customText = "";
  3058. /**
  3059. * Creates a new License instance using the specified properties.
  3060. * @function create
  3061. * @memberof License
  3062. * @static
  3063. * @param {ILicense=} [properties] Properties to set
  3064. * @returns {License} License instance
  3065. */
  3066. License.create = function create(properties) {
  3067. return new License(properties);
  3068. };
  3069. /**
  3070. * Encodes the specified License message. Does not implicitly {@link License.verify|verify} messages.
  3071. * @function encode
  3072. * @memberof License
  3073. * @static
  3074. * @param {ILicense} message License message or plain object to encode
  3075. * @param {$protobuf.Writer} [writer] Writer to encode to
  3076. * @returns {$protobuf.Writer} Writer
  3077. */
  3078. License.encode = function encode(message, writer) {
  3079. if (!writer)
  3080. writer = $Writer.create();
  3081. if (message.code != null && Object.hasOwnProperty.call(message, "code"))
  3082. writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code);
  3083. if (message.attribution != null && Object.hasOwnProperty.call(message, "attribution"))
  3084. writer.uint32(/* id 2, wireType 2 =*/18).string(message.attribution);
  3085. if (message.customText != null && Object.hasOwnProperty.call(message, "customText"))
  3086. writer.uint32(/* id 3, wireType 2 =*/26).string(message.customText);
  3087. return writer;
  3088. };
  3089. /**
  3090. * Encodes the specified License message, length delimited. Does not implicitly {@link License.verify|verify} messages.
  3091. * @function encodeDelimited
  3092. * @memberof License
  3093. * @static
  3094. * @param {ILicense} message License message or plain object to encode
  3095. * @param {$protobuf.Writer} [writer] Writer to encode to
  3096. * @returns {$protobuf.Writer} Writer
  3097. */
  3098. License.encodeDelimited = function encodeDelimited(message, writer) {
  3099. return this.encode(message, writer).ldelim();
  3100. };
  3101. /**
  3102. * Decodes a License message from the specified reader or buffer.
  3103. * @function decode
  3104. * @memberof License
  3105. * @static
  3106. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3107. * @param {number} [length] Message length if known beforehand
  3108. * @returns {License} License
  3109. * @throws {Error} If the payload is not a reader or valid buffer
  3110. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3111. */
  3112. License.decode = function decode(reader, length) {
  3113. if (!(reader instanceof $Reader))
  3114. reader = $Reader.create(reader);
  3115. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.License();
  3116. while (reader.pos < end) {
  3117. var tag = reader.uint32();
  3118. switch (tag >>> 3) {
  3119. case 1:
  3120. message.code = reader.uint32();
  3121. break;
  3122. case 2:
  3123. message.attribution = reader.string();
  3124. break;
  3125. case 3:
  3126. message.customText = reader.string();
  3127. break;
  3128. default:
  3129. reader.skipType(tag & 7);
  3130. break;
  3131. }
  3132. }
  3133. return message;
  3134. };
  3135. /**
  3136. * Decodes a License message from the specified reader or buffer, length delimited.
  3137. * @function decodeDelimited
  3138. * @memberof License
  3139. * @static
  3140. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3141. * @returns {License} License
  3142. * @throws {Error} If the payload is not a reader or valid buffer
  3143. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3144. */
  3145. License.decodeDelimited = function decodeDelimited(reader) {
  3146. if (!(reader instanceof $Reader))
  3147. reader = new $Reader(reader);
  3148. return this.decode(reader, reader.uint32());
  3149. };
  3150. /**
  3151. * Verifies a License message.
  3152. * @function verify
  3153. * @memberof License
  3154. * @static
  3155. * @param {Object.<string,*>} message Plain object to verify
  3156. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  3157. */
  3158. License.verify = function verify(message) {
  3159. if (typeof message !== "object" || message === null)
  3160. return "object expected";
  3161. if (message.code != null && message.hasOwnProperty("code"))
  3162. if (!$util.isInteger(message.code))
  3163. return "code: integer expected";
  3164. if (message.attribution != null && message.hasOwnProperty("attribution"))
  3165. if (!$util.isString(message.attribution))
  3166. return "attribution: string expected";
  3167. if (message.customText != null && message.hasOwnProperty("customText"))
  3168. if (!$util.isString(message.customText))
  3169. return "customText: string expected";
  3170. return null;
  3171. };
  3172. /**
  3173. * Creates a License message from a plain object. Also converts values to their respective internal types.
  3174. * @function fromObject
  3175. * @memberof License
  3176. * @static
  3177. * @param {Object.<string,*>} object Plain object
  3178. * @returns {License} License
  3179. */
  3180. License.fromObject = function fromObject(object) {
  3181. if (object instanceof $root.License)
  3182. return object;
  3183. var message = new $root.License();
  3184. if (object.code != null)
  3185. message.code = object.code >>> 0;
  3186. if (object.attribution != null)
  3187. message.attribution = String(object.attribution);
  3188. if (object.customText != null)
  3189. message.customText = String(object.customText);
  3190. return message;
  3191. };
  3192. /**
  3193. * Creates a plain object from a License message. Also converts values to other types if specified.
  3194. * @function toObject
  3195. * @memberof License
  3196. * @static
  3197. * @param {License} message License
  3198. * @param {$protobuf.IConversionOptions} [options] Conversion options
  3199. * @returns {Object.<string,*>} Plain object
  3200. */
  3201. License.toObject = function toObject(message, options) {
  3202. if (!options)
  3203. options = {};
  3204. var object = {};
  3205. if (options.defaults) {
  3206. object.code = 0;
  3207. object.attribution = "";
  3208. object.customText = "";
  3209. }
  3210. if (message.code != null && message.hasOwnProperty("code"))
  3211. object.code = message.code;
  3212. if (message.attribution != null && message.hasOwnProperty("attribution"))
  3213. object.attribution = message.attribution;
  3214. if (message.customText != null && message.hasOwnProperty("customText"))
  3215. object.customText = message.customText;
  3216. return object;
  3217. };
  3218. /**
  3219. * Converts this License to JSON.
  3220. * @function toJSON
  3221. * @memberof License
  3222. * @instance
  3223. * @returns {Object.<string,*>} JSON object
  3224. */
  3225. License.prototype.toJSON = function toJSON() {
  3226. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  3227. };
  3228. return License;
  3229. })();
  3230. $root.MediaType = (function() {
  3231. /**
  3232. * Properties of a MediaType.
  3233. * @exports IMediaType
  3234. * @interface IMediaType
  3235. * @property {string|null} [codecName] MediaType codecName
  3236. * @property {string|null} [container] MediaType container
  3237. * @property {string|null} [mimeMediaType] MediaType mimeMediaType
  3238. */
  3239. /**
  3240. * Constructs a new MediaType.
  3241. * @exports MediaType
  3242. * @classdesc Represents a MediaType.
  3243. * @implements IMediaType
  3244. * @constructor
  3245. * @param {IMediaType=} [properties] Properties to set
  3246. */
  3247. function MediaType(properties) {
  3248. if (properties)
  3249. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  3250. if (properties[keys[i]] != null)
  3251. this[keys[i]] = properties[keys[i]];
  3252. }
  3253. /**
  3254. * MediaType codecName.
  3255. * @member {string} codecName
  3256. * @memberof MediaType
  3257. * @instance
  3258. */
  3259. MediaType.prototype.codecName = "";
  3260. /**
  3261. * MediaType container.
  3262. * @member {string} container
  3263. * @memberof MediaType
  3264. * @instance
  3265. */
  3266. MediaType.prototype.container = "";
  3267. /**
  3268. * MediaType mimeMediaType.
  3269. * @member {string} mimeMediaType
  3270. * @memberof MediaType
  3271. * @instance
  3272. */
  3273. MediaType.prototype.mimeMediaType = "";
  3274. /**
  3275. * Creates a new MediaType instance using the specified properties.
  3276. * @function create
  3277. * @memberof MediaType
  3278. * @static
  3279. * @param {IMediaType=} [properties] Properties to set
  3280. * @returns {MediaType} MediaType instance
  3281. */
  3282. MediaType.create = function create(properties) {
  3283. return new MediaType(properties);
  3284. };
  3285. /**
  3286. * Encodes the specified MediaType message. Does not implicitly {@link MediaType.verify|verify} messages.
  3287. * @function encode
  3288. * @memberof MediaType
  3289. * @static
  3290. * @param {IMediaType} message MediaType message or plain object to encode
  3291. * @param {$protobuf.Writer} [writer] Writer to encode to
  3292. * @returns {$protobuf.Writer} Writer
  3293. */
  3294. MediaType.encode = function encode(message, writer) {
  3295. if (!writer)
  3296. writer = $Writer.create();
  3297. if (message.codecName != null && Object.hasOwnProperty.call(message, "codecName"))
  3298. writer.uint32(/* id 1, wireType 2 =*/10).string(message.codecName);
  3299. if (message.container != null && Object.hasOwnProperty.call(message, "container"))
  3300. writer.uint32(/* id 2, wireType 2 =*/18).string(message.container);
  3301. if (message.mimeMediaType != null && Object.hasOwnProperty.call(message, "mimeMediaType"))
  3302. writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeMediaType);
  3303. return writer;
  3304. };
  3305. /**
  3306. * Encodes the specified MediaType message, length delimited. Does not implicitly {@link MediaType.verify|verify} messages.
  3307. * @function encodeDelimited
  3308. * @memberof MediaType
  3309. * @static
  3310. * @param {IMediaType} message MediaType message or plain object to encode
  3311. * @param {$protobuf.Writer} [writer] Writer to encode to
  3312. * @returns {$protobuf.Writer} Writer
  3313. */
  3314. MediaType.encodeDelimited = function encodeDelimited(message, writer) {
  3315. return this.encode(message, writer).ldelim();
  3316. };
  3317. /**
  3318. * Decodes a MediaType message from the specified reader or buffer.
  3319. * @function decode
  3320. * @memberof MediaType
  3321. * @static
  3322. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3323. * @param {number} [length] Message length if known beforehand
  3324. * @returns {MediaType} MediaType
  3325. * @throws {Error} If the payload is not a reader or valid buffer
  3326. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3327. */
  3328. MediaType.decode = function decode(reader, length) {
  3329. if (!(reader instanceof $Reader))
  3330. reader = $Reader.create(reader);
  3331. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MediaType();
  3332. while (reader.pos < end) {
  3333. var tag = reader.uint32();
  3334. switch (tag >>> 3) {
  3335. case 1:
  3336. message.codecName = reader.string();
  3337. break;
  3338. case 2:
  3339. message.container = reader.string();
  3340. break;
  3341. case 3:
  3342. message.mimeMediaType = reader.string();
  3343. break;
  3344. default:
  3345. reader.skipType(tag & 7);
  3346. break;
  3347. }
  3348. }
  3349. return message;
  3350. };
  3351. /**
  3352. * Decodes a MediaType message from the specified reader or buffer, length delimited.
  3353. * @function decodeDelimited
  3354. * @memberof MediaType
  3355. * @static
  3356. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3357. * @returns {MediaType} MediaType
  3358. * @throws {Error} If the payload is not a reader or valid buffer
  3359. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3360. */
  3361. MediaType.decodeDelimited = function decodeDelimited(reader) {
  3362. if (!(reader instanceof $Reader))
  3363. reader = new $Reader(reader);
  3364. return this.decode(reader, reader.uint32());
  3365. };
  3366. /**
  3367. * Verifies a MediaType message.
  3368. * @function verify
  3369. * @memberof MediaType
  3370. * @static
  3371. * @param {Object.<string,*>} message Plain object to verify
  3372. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  3373. */
  3374. MediaType.verify = function verify(message) {
  3375. if (typeof message !== "object" || message === null)
  3376. return "object expected";
  3377. if (message.codecName != null && message.hasOwnProperty("codecName"))
  3378. if (!$util.isString(message.codecName))
  3379. return "codecName: string expected";
  3380. if (message.container != null && message.hasOwnProperty("container"))
  3381. if (!$util.isString(message.container))
  3382. return "container: string expected";
  3383. if (message.mimeMediaType != null && message.hasOwnProperty("mimeMediaType"))
  3384. if (!$util.isString(message.mimeMediaType))
  3385. return "mimeMediaType: string expected";
  3386. return null;
  3387. };
  3388. /**
  3389. * Creates a MediaType message from a plain object. Also converts values to their respective internal types.
  3390. * @function fromObject
  3391. * @memberof MediaType
  3392. * @static
  3393. * @param {Object.<string,*>} object Plain object
  3394. * @returns {MediaType} MediaType
  3395. */
  3396. MediaType.fromObject = function fromObject(object) {
  3397. if (object instanceof $root.MediaType)
  3398. return object;
  3399. var message = new $root.MediaType();
  3400. if (object.codecName != null)
  3401. message.codecName = String(object.codecName);
  3402. if (object.container != null)
  3403. message.container = String(object.container);
  3404. if (object.mimeMediaType != null)
  3405. message.mimeMediaType = String(object.mimeMediaType);
  3406. return message;
  3407. };
  3408. /**
  3409. * Creates a plain object from a MediaType message. Also converts values to other types if specified.
  3410. * @function toObject
  3411. * @memberof MediaType
  3412. * @static
  3413. * @param {MediaType} message MediaType
  3414. * @param {$protobuf.IConversionOptions} [options] Conversion options
  3415. * @returns {Object.<string,*>} Plain object
  3416. */
  3417. MediaType.toObject = function toObject(message, options) {
  3418. if (!options)
  3419. options = {};
  3420. var object = {};
  3421. if (options.defaults) {
  3422. object.codecName = "";
  3423. object.container = "";
  3424. object.mimeMediaType = "";
  3425. }
  3426. if (message.codecName != null && message.hasOwnProperty("codecName"))
  3427. object.codecName = message.codecName;
  3428. if (message.container != null && message.hasOwnProperty("container"))
  3429. object.container = message.container;
  3430. if (message.mimeMediaType != null && message.hasOwnProperty("mimeMediaType"))
  3431. object.mimeMediaType = message.mimeMediaType;
  3432. return object;
  3433. };
  3434. /**
  3435. * Converts this MediaType to JSON.
  3436. * @function toJSON
  3437. * @memberof MediaType
  3438. * @instance
  3439. * @returns {Object.<string,*>} JSON object
  3440. */
  3441. MediaType.prototype.toJSON = function toJSON() {
  3442. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  3443. };
  3444. return MediaType;
  3445. })();
  3446. $root.VideoMetadata = (function() {
  3447. /**
  3448. * Properties of a VideoMetadata.
  3449. * @exports IVideoMetadata
  3450. * @interface IVideoMetadata
  3451. * @property {string|null} [title] VideoMetadata title
  3452. * @property {string|null} [description] VideoMetadata description
  3453. * @property {number|null} [video] VideoMetadata video
  3454. * @property {number|null} [thumbnailPhoto] VideoMetadata thumbnailPhoto
  3455. * @property {number|null} [duration] VideoMetadata duration
  3456. * @property {number|null} [mediaPixelHeight] VideoMetadata mediaPixelHeight
  3457. * @property {number|null} [mediaPixelWidth] VideoMetadata mediaPixelWidth
  3458. * @property {IMediaType|null} [mediaType] VideoMetadata mediaType
  3459. * @property {string|null} [language] VideoMetadata language
  3460. * @property {ILicense|null} [license] VideoMetadata license
  3461. * @property {IPublishedBeforeJoystream|null} [publishedBeforeJoystream] VideoMetadata publishedBeforeJoystream
  3462. * @property {boolean|null} [hasMarketing] VideoMetadata hasMarketing
  3463. * @property {boolean|null} [isPublic] VideoMetadata isPublic
  3464. * @property {boolean|null} [isExplicit] VideoMetadata isExplicit
  3465. * @property {Array.<Long>|null} [persons] VideoMetadata persons
  3466. * @property {Long|null} [category] VideoMetadata category
  3467. */
  3468. /**
  3469. * Constructs a new VideoMetadata.
  3470. * @exports VideoMetadata
  3471. * @classdesc Represents a VideoMetadata.
  3472. * @implements IVideoMetadata
  3473. * @constructor
  3474. * @param {IVideoMetadata=} [properties] Properties to set
  3475. */
  3476. function VideoMetadata(properties) {
  3477. this.persons = [];
  3478. if (properties)
  3479. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  3480. if (properties[keys[i]] != null)
  3481. this[keys[i]] = properties[keys[i]];
  3482. }
  3483. /**
  3484. * VideoMetadata title.
  3485. * @member {string} title
  3486. * @memberof VideoMetadata
  3487. * @instance
  3488. */
  3489. VideoMetadata.prototype.title = "";
  3490. /**
  3491. * VideoMetadata description.
  3492. * @member {string} description
  3493. * @memberof VideoMetadata
  3494. * @instance
  3495. */
  3496. VideoMetadata.prototype.description = "";
  3497. /**
  3498. * VideoMetadata video.
  3499. * @member {number} video
  3500. * @memberof VideoMetadata
  3501. * @instance
  3502. */
  3503. VideoMetadata.prototype.video = 0;
  3504. /**
  3505. * VideoMetadata thumbnailPhoto.
  3506. * @member {number} thumbnailPhoto
  3507. * @memberof VideoMetadata
  3508. * @instance
  3509. */
  3510. VideoMetadata.prototype.thumbnailPhoto = 0;
  3511. /**
  3512. * VideoMetadata duration.
  3513. * @member {number} duration
  3514. * @memberof VideoMetadata
  3515. * @instance
  3516. */
  3517. VideoMetadata.prototype.duration = 0;
  3518. /**
  3519. * VideoMetadata mediaPixelHeight.
  3520. * @member {number} mediaPixelHeight
  3521. * @memberof VideoMetadata
  3522. * @instance
  3523. */
  3524. VideoMetadata.prototype.mediaPixelHeight = 0;
  3525. /**
  3526. * VideoMetadata mediaPixelWidth.
  3527. * @member {number} mediaPixelWidth
  3528. * @memberof VideoMetadata
  3529. * @instance
  3530. */
  3531. VideoMetadata.prototype.mediaPixelWidth = 0;
  3532. /**
  3533. * VideoMetadata mediaType.
  3534. * @member {IMediaType|null|undefined} mediaType
  3535. * @memberof VideoMetadata
  3536. * @instance
  3537. */
  3538. VideoMetadata.prototype.mediaType = null;
  3539. /**
  3540. * VideoMetadata language.
  3541. * @member {string} language
  3542. * @memberof VideoMetadata
  3543. * @instance
  3544. */
  3545. VideoMetadata.prototype.language = "";
  3546. /**
  3547. * VideoMetadata license.
  3548. * @member {ILicense|null|undefined} license
  3549. * @memberof VideoMetadata
  3550. * @instance
  3551. */
  3552. VideoMetadata.prototype.license = null;
  3553. /**
  3554. * VideoMetadata publishedBeforeJoystream.
  3555. * @member {IPublishedBeforeJoystream|null|undefined} publishedBeforeJoystream
  3556. * @memberof VideoMetadata
  3557. * @instance
  3558. */
  3559. VideoMetadata.prototype.publishedBeforeJoystream = null;
  3560. /**
  3561. * VideoMetadata hasMarketing.
  3562. * @member {boolean} hasMarketing
  3563. * @memberof VideoMetadata
  3564. * @instance
  3565. */
  3566. VideoMetadata.prototype.hasMarketing = false;
  3567. /**
  3568. * VideoMetadata isPublic.
  3569. * @member {boolean} isPublic
  3570. * @memberof VideoMetadata
  3571. * @instance
  3572. */
  3573. VideoMetadata.prototype.isPublic = false;
  3574. /**
  3575. * VideoMetadata isExplicit.
  3576. * @member {boolean} isExplicit
  3577. * @memberof VideoMetadata
  3578. * @instance
  3579. */
  3580. VideoMetadata.prototype.isExplicit = false;
  3581. /**
  3582. * VideoMetadata persons.
  3583. * @member {Array.<Long>} persons
  3584. * @memberof VideoMetadata
  3585. * @instance
  3586. */
  3587. VideoMetadata.prototype.persons = $util.emptyArray;
  3588. /**
  3589. * VideoMetadata category.
  3590. * @member {Long} category
  3591. * @memberof VideoMetadata
  3592. * @instance
  3593. */
  3594. VideoMetadata.prototype.category = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
  3595. /**
  3596. * Creates a new VideoMetadata instance using the specified properties.
  3597. * @function create
  3598. * @memberof VideoMetadata
  3599. * @static
  3600. * @param {IVideoMetadata=} [properties] Properties to set
  3601. * @returns {VideoMetadata} VideoMetadata instance
  3602. */
  3603. VideoMetadata.create = function create(properties) {
  3604. return new VideoMetadata(properties);
  3605. };
  3606. /**
  3607. * Encodes the specified VideoMetadata message. Does not implicitly {@link VideoMetadata.verify|verify} messages.
  3608. * @function encode
  3609. * @memberof VideoMetadata
  3610. * @static
  3611. * @param {IVideoMetadata} message VideoMetadata message or plain object to encode
  3612. * @param {$protobuf.Writer} [writer] Writer to encode to
  3613. * @returns {$protobuf.Writer} Writer
  3614. */
  3615. VideoMetadata.encode = function encode(message, writer) {
  3616. if (!writer)
  3617. writer = $Writer.create();
  3618. if (message.title != null && Object.hasOwnProperty.call(message, "title"))
  3619. writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
  3620. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  3621. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  3622. if (message.video != null && Object.hasOwnProperty.call(message, "video"))
  3623. writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.video);
  3624. if (message.thumbnailPhoto != null && Object.hasOwnProperty.call(message, "thumbnailPhoto"))
  3625. writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.thumbnailPhoto);
  3626. if (message.duration != null && Object.hasOwnProperty.call(message, "duration"))
  3627. writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.duration);
  3628. if (message.mediaPixelHeight != null && Object.hasOwnProperty.call(message, "mediaPixelHeight"))
  3629. writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.mediaPixelHeight);
  3630. if (message.mediaPixelWidth != null && Object.hasOwnProperty.call(message, "mediaPixelWidth"))
  3631. writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.mediaPixelWidth);
  3632. if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType"))
  3633. $root.MediaType.encode(message.mediaType, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
  3634. if (message.language != null && Object.hasOwnProperty.call(message, "language"))
  3635. writer.uint32(/* id 9, wireType 2 =*/74).string(message.language);
  3636. if (message.license != null && Object.hasOwnProperty.call(message, "license"))
  3637. $root.License.encode(message.license, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
  3638. if (message.publishedBeforeJoystream != null && Object.hasOwnProperty.call(message, "publishedBeforeJoystream"))
  3639. $root.PublishedBeforeJoystream.encode(message.publishedBeforeJoystream, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
  3640. if (message.hasMarketing != null && Object.hasOwnProperty.call(message, "hasMarketing"))
  3641. writer.uint32(/* id 12, wireType 0 =*/96).bool(message.hasMarketing);
  3642. if (message.isPublic != null && Object.hasOwnProperty.call(message, "isPublic"))
  3643. writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isPublic);
  3644. if (message.isExplicit != null && Object.hasOwnProperty.call(message, "isExplicit"))
  3645. writer.uint32(/* id 14, wireType 0 =*/112).bool(message.isExplicit);
  3646. if (message.persons != null && message.persons.length) {
  3647. writer.uint32(/* id 15, wireType 2 =*/122).fork();
  3648. for (var i = 0; i < message.persons.length; ++i)
  3649. writer.uint64(message.persons[i]);
  3650. writer.ldelim();
  3651. }
  3652. if (message.category != null && Object.hasOwnProperty.call(message, "category"))
  3653. writer.uint32(/* id 16, wireType 0 =*/128).uint64(message.category);
  3654. return writer;
  3655. };
  3656. /**
  3657. * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link VideoMetadata.verify|verify} messages.
  3658. * @function encodeDelimited
  3659. * @memberof VideoMetadata
  3660. * @static
  3661. * @param {IVideoMetadata} message VideoMetadata message or plain object to encode
  3662. * @param {$protobuf.Writer} [writer] Writer to encode to
  3663. * @returns {$protobuf.Writer} Writer
  3664. */
  3665. VideoMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  3666. return this.encode(message, writer).ldelim();
  3667. };
  3668. /**
  3669. * Decodes a VideoMetadata message from the specified reader or buffer.
  3670. * @function decode
  3671. * @memberof VideoMetadata
  3672. * @static
  3673. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3674. * @param {number} [length] Message length if known beforehand
  3675. * @returns {VideoMetadata} VideoMetadata
  3676. * @throws {Error} If the payload is not a reader or valid buffer
  3677. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3678. */
  3679. VideoMetadata.decode = function decode(reader, length) {
  3680. if (!(reader instanceof $Reader))
  3681. reader = $Reader.create(reader);
  3682. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.VideoMetadata();
  3683. while (reader.pos < end) {
  3684. var tag = reader.uint32();
  3685. switch (tag >>> 3) {
  3686. case 1:
  3687. message.title = reader.string();
  3688. break;
  3689. case 2:
  3690. message.description = reader.string();
  3691. break;
  3692. case 3:
  3693. message.video = reader.uint32();
  3694. break;
  3695. case 4:
  3696. message.thumbnailPhoto = reader.uint32();
  3697. break;
  3698. case 5:
  3699. message.duration = reader.uint32();
  3700. break;
  3701. case 6:
  3702. message.mediaPixelHeight = reader.uint32();
  3703. break;
  3704. case 7:
  3705. message.mediaPixelWidth = reader.uint32();
  3706. break;
  3707. case 8:
  3708. message.mediaType = $root.MediaType.decode(reader, reader.uint32());
  3709. break;
  3710. case 9:
  3711. message.language = reader.string();
  3712. break;
  3713. case 10:
  3714. message.license = $root.License.decode(reader, reader.uint32());
  3715. break;
  3716. case 11:
  3717. message.publishedBeforeJoystream = $root.PublishedBeforeJoystream.decode(reader, reader.uint32());
  3718. break;
  3719. case 12:
  3720. message.hasMarketing = reader.bool();
  3721. break;
  3722. case 13:
  3723. message.isPublic = reader.bool();
  3724. break;
  3725. case 14:
  3726. message.isExplicit = reader.bool();
  3727. break;
  3728. case 15:
  3729. if (!(message.persons && message.persons.length))
  3730. message.persons = [];
  3731. if ((tag & 7) === 2) {
  3732. var end2 = reader.uint32() + reader.pos;
  3733. while (reader.pos < end2)
  3734. message.persons.push(reader.uint64());
  3735. } else
  3736. message.persons.push(reader.uint64());
  3737. break;
  3738. case 16:
  3739. message.category = reader.uint64();
  3740. break;
  3741. default:
  3742. reader.skipType(tag & 7);
  3743. break;
  3744. }
  3745. }
  3746. return message;
  3747. };
  3748. /**
  3749. * Decodes a VideoMetadata message from the specified reader or buffer, length delimited.
  3750. * @function decodeDelimited
  3751. * @memberof VideoMetadata
  3752. * @static
  3753. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  3754. * @returns {VideoMetadata} VideoMetadata
  3755. * @throws {Error} If the payload is not a reader or valid buffer
  3756. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  3757. */
  3758. VideoMetadata.decodeDelimited = function decodeDelimited(reader) {
  3759. if (!(reader instanceof $Reader))
  3760. reader = new $Reader(reader);
  3761. return this.decode(reader, reader.uint32());
  3762. };
  3763. /**
  3764. * Verifies a VideoMetadata message.
  3765. * @function verify
  3766. * @memberof VideoMetadata
  3767. * @static
  3768. * @param {Object.<string,*>} message Plain object to verify
  3769. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  3770. */
  3771. VideoMetadata.verify = function verify(message) {
  3772. if (typeof message !== "object" || message === null)
  3773. return "object expected";
  3774. if (message.title != null && message.hasOwnProperty("title"))
  3775. if (!$util.isString(message.title))
  3776. return "title: string expected";
  3777. if (message.description != null && message.hasOwnProperty("description"))
  3778. if (!$util.isString(message.description))
  3779. return "description: string expected";
  3780. if (message.video != null && message.hasOwnProperty("video"))
  3781. if (!$util.isInteger(message.video))
  3782. return "video: integer expected";
  3783. if (message.thumbnailPhoto != null && message.hasOwnProperty("thumbnailPhoto"))
  3784. if (!$util.isInteger(message.thumbnailPhoto))
  3785. return "thumbnailPhoto: integer expected";
  3786. if (message.duration != null && message.hasOwnProperty("duration"))
  3787. if (!$util.isInteger(message.duration))
  3788. return "duration: integer expected";
  3789. if (message.mediaPixelHeight != null && message.hasOwnProperty("mediaPixelHeight"))
  3790. if (!$util.isInteger(message.mediaPixelHeight))
  3791. return "mediaPixelHeight: integer expected";
  3792. if (message.mediaPixelWidth != null && message.hasOwnProperty("mediaPixelWidth"))
  3793. if (!$util.isInteger(message.mediaPixelWidth))
  3794. return "mediaPixelWidth: integer expected";
  3795. if (message.mediaType != null && message.hasOwnProperty("mediaType")) {
  3796. var error = $root.MediaType.verify(message.mediaType);
  3797. if (error)
  3798. return "mediaType." + error;
  3799. }
  3800. if (message.language != null && message.hasOwnProperty("language"))
  3801. if (!$util.isString(message.language))
  3802. return "language: string expected";
  3803. if (message.license != null && message.hasOwnProperty("license")) {
  3804. var error = $root.License.verify(message.license);
  3805. if (error)
  3806. return "license." + error;
  3807. }
  3808. if (message.publishedBeforeJoystream != null && message.hasOwnProperty("publishedBeforeJoystream")) {
  3809. var error = $root.PublishedBeforeJoystream.verify(message.publishedBeforeJoystream);
  3810. if (error)
  3811. return "publishedBeforeJoystream." + error;
  3812. }
  3813. if (message.hasMarketing != null && message.hasOwnProperty("hasMarketing"))
  3814. if (typeof message.hasMarketing !== "boolean")
  3815. return "hasMarketing: boolean expected";
  3816. if (message.isPublic != null && message.hasOwnProperty("isPublic"))
  3817. if (typeof message.isPublic !== "boolean")
  3818. return "isPublic: boolean expected";
  3819. if (message.isExplicit != null && message.hasOwnProperty("isExplicit"))
  3820. if (typeof message.isExplicit !== "boolean")
  3821. return "isExplicit: boolean expected";
  3822. if (message.persons != null && message.hasOwnProperty("persons")) {
  3823. if (!Array.isArray(message.persons))
  3824. return "persons: array expected";
  3825. for (var i = 0; i < message.persons.length; ++i)
  3826. if (!$util.isInteger(message.persons[i]) && !(message.persons[i] && $util.isInteger(message.persons[i].low) && $util.isInteger(message.persons[i].high)))
  3827. return "persons: integer|Long[] expected";
  3828. }
  3829. if (message.category != null && message.hasOwnProperty("category"))
  3830. if (!$util.isInteger(message.category) && !(message.category && $util.isInteger(message.category.low) && $util.isInteger(message.category.high)))
  3831. return "category: integer|Long expected";
  3832. return null;
  3833. };
  3834. /**
  3835. * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types.
  3836. * @function fromObject
  3837. * @memberof VideoMetadata
  3838. * @static
  3839. * @param {Object.<string,*>} object Plain object
  3840. * @returns {VideoMetadata} VideoMetadata
  3841. */
  3842. VideoMetadata.fromObject = function fromObject(object) {
  3843. if (object instanceof $root.VideoMetadata)
  3844. return object;
  3845. var message = new $root.VideoMetadata();
  3846. if (object.title != null)
  3847. message.title = String(object.title);
  3848. if (object.description != null)
  3849. message.description = String(object.description);
  3850. if (object.video != null)
  3851. message.video = object.video >>> 0;
  3852. if (object.thumbnailPhoto != null)
  3853. message.thumbnailPhoto = object.thumbnailPhoto >>> 0;
  3854. if (object.duration != null)
  3855. message.duration = object.duration >>> 0;
  3856. if (object.mediaPixelHeight != null)
  3857. message.mediaPixelHeight = object.mediaPixelHeight >>> 0;
  3858. if (object.mediaPixelWidth != null)
  3859. message.mediaPixelWidth = object.mediaPixelWidth >>> 0;
  3860. if (object.mediaType != null) {
  3861. if (typeof object.mediaType !== "object")
  3862. throw TypeError(".VideoMetadata.mediaType: object expected");
  3863. message.mediaType = $root.MediaType.fromObject(object.mediaType);
  3864. }
  3865. if (object.language != null)
  3866. message.language = String(object.language);
  3867. if (object.license != null) {
  3868. if (typeof object.license !== "object")
  3869. throw TypeError(".VideoMetadata.license: object expected");
  3870. message.license = $root.License.fromObject(object.license);
  3871. }
  3872. if (object.publishedBeforeJoystream != null) {
  3873. if (typeof object.publishedBeforeJoystream !== "object")
  3874. throw TypeError(".VideoMetadata.publishedBeforeJoystream: object expected");
  3875. message.publishedBeforeJoystream = $root.PublishedBeforeJoystream.fromObject(object.publishedBeforeJoystream);
  3876. }
  3877. if (object.hasMarketing != null)
  3878. message.hasMarketing = Boolean(object.hasMarketing);
  3879. if (object.isPublic != null)
  3880. message.isPublic = Boolean(object.isPublic);
  3881. if (object.isExplicit != null)
  3882. message.isExplicit = Boolean(object.isExplicit);
  3883. if (object.persons) {
  3884. if (!Array.isArray(object.persons))
  3885. throw TypeError(".VideoMetadata.persons: array expected");
  3886. message.persons = [];
  3887. for (var i = 0; i < object.persons.length; ++i)
  3888. if ($util.Long)
  3889. (message.persons[i] = $util.Long.fromValue(object.persons[i])).unsigned = true;
  3890. else if (typeof object.persons[i] === "string")
  3891. message.persons[i] = parseInt(object.persons[i], 10);
  3892. else if (typeof object.persons[i] === "number")
  3893. message.persons[i] = object.persons[i];
  3894. else if (typeof object.persons[i] === "object")
  3895. message.persons[i] = new $util.LongBits(object.persons[i].low >>> 0, object.persons[i].high >>> 0).toNumber(true);
  3896. }
  3897. if (object.category != null)
  3898. if ($util.Long)
  3899. (message.category = $util.Long.fromValue(object.category)).unsigned = true;
  3900. else if (typeof object.category === "string")
  3901. message.category = parseInt(object.category, 10);
  3902. else if (typeof object.category === "number")
  3903. message.category = object.category;
  3904. else if (typeof object.category === "object")
  3905. message.category = new $util.LongBits(object.category.low >>> 0, object.category.high >>> 0).toNumber(true);
  3906. return message;
  3907. };
  3908. /**
  3909. * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified.
  3910. * @function toObject
  3911. * @memberof VideoMetadata
  3912. * @static
  3913. * @param {VideoMetadata} message VideoMetadata
  3914. * @param {$protobuf.IConversionOptions} [options] Conversion options
  3915. * @returns {Object.<string,*>} Plain object
  3916. */
  3917. VideoMetadata.toObject = function toObject(message, options) {
  3918. if (!options)
  3919. options = {};
  3920. var object = {};
  3921. if (options.arrays || options.defaults)
  3922. object.persons = [];
  3923. if (options.defaults) {
  3924. object.title = "";
  3925. object.description = "";
  3926. object.video = 0;
  3927. object.thumbnailPhoto = 0;
  3928. object.duration = 0;
  3929. object.mediaPixelHeight = 0;
  3930. object.mediaPixelWidth = 0;
  3931. object.mediaType = null;
  3932. object.language = "";
  3933. object.license = null;
  3934. object.publishedBeforeJoystream = null;
  3935. object.hasMarketing = false;
  3936. object.isPublic = false;
  3937. object.isExplicit = false;
  3938. if ($util.Long) {
  3939. var long = new $util.Long(0, 0, true);
  3940. object.category = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  3941. } else
  3942. object.category = options.longs === String ? "0" : 0;
  3943. }
  3944. if (message.title != null && message.hasOwnProperty("title"))
  3945. object.title = message.title;
  3946. if (message.description != null && message.hasOwnProperty("description"))
  3947. object.description = message.description;
  3948. if (message.video != null && message.hasOwnProperty("video"))
  3949. object.video = message.video;
  3950. if (message.thumbnailPhoto != null && message.hasOwnProperty("thumbnailPhoto"))
  3951. object.thumbnailPhoto = message.thumbnailPhoto;
  3952. if (message.duration != null && message.hasOwnProperty("duration"))
  3953. object.duration = message.duration;
  3954. if (message.mediaPixelHeight != null && message.hasOwnProperty("mediaPixelHeight"))
  3955. object.mediaPixelHeight = message.mediaPixelHeight;
  3956. if (message.mediaPixelWidth != null && message.hasOwnProperty("mediaPixelWidth"))
  3957. object.mediaPixelWidth = message.mediaPixelWidth;
  3958. if (message.mediaType != null && message.hasOwnProperty("mediaType"))
  3959. object.mediaType = $root.MediaType.toObject(message.mediaType, options);
  3960. if (message.language != null && message.hasOwnProperty("language"))
  3961. object.language = message.language;
  3962. if (message.license != null && message.hasOwnProperty("license"))
  3963. object.license = $root.License.toObject(message.license, options);
  3964. if (message.publishedBeforeJoystream != null && message.hasOwnProperty("publishedBeforeJoystream"))
  3965. object.publishedBeforeJoystream = $root.PublishedBeforeJoystream.toObject(message.publishedBeforeJoystream, options);
  3966. if (message.hasMarketing != null && message.hasOwnProperty("hasMarketing"))
  3967. object.hasMarketing = message.hasMarketing;
  3968. if (message.isPublic != null && message.hasOwnProperty("isPublic"))
  3969. object.isPublic = message.isPublic;
  3970. if (message.isExplicit != null && message.hasOwnProperty("isExplicit"))
  3971. object.isExplicit = message.isExplicit;
  3972. if (message.persons && message.persons.length) {
  3973. object.persons = [];
  3974. for (var j = 0; j < message.persons.length; ++j)
  3975. if (typeof message.persons[j] === "number")
  3976. object.persons[j] = options.longs === String ? String(message.persons[j]) : message.persons[j];
  3977. else
  3978. 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];
  3979. }
  3980. if (message.category != null && message.hasOwnProperty("category"))
  3981. if (typeof message.category === "number")
  3982. object.category = options.longs === String ? String(message.category) : message.category;
  3983. else
  3984. 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;
  3985. return object;
  3986. };
  3987. /**
  3988. * Converts this VideoMetadata to JSON.
  3989. * @function toJSON
  3990. * @memberof VideoMetadata
  3991. * @instance
  3992. * @returns {Object.<string,*>} JSON object
  3993. */
  3994. VideoMetadata.prototype.toJSON = function toJSON() {
  3995. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  3996. };
  3997. return VideoMetadata;
  3998. })();
  3999. $root.VideoCategoryMetadata = (function() {
  4000. /**
  4001. * Properties of a VideoCategoryMetadata.
  4002. * @exports IVideoCategoryMetadata
  4003. * @interface IVideoCategoryMetadata
  4004. * @property {string|null} [name] VideoCategoryMetadata name
  4005. */
  4006. /**
  4007. * Constructs a new VideoCategoryMetadata.
  4008. * @exports VideoCategoryMetadata
  4009. * @classdesc Represents a VideoCategoryMetadata.
  4010. * @implements IVideoCategoryMetadata
  4011. * @constructor
  4012. * @param {IVideoCategoryMetadata=} [properties] Properties to set
  4013. */
  4014. function VideoCategoryMetadata(properties) {
  4015. if (properties)
  4016. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  4017. if (properties[keys[i]] != null)
  4018. this[keys[i]] = properties[keys[i]];
  4019. }
  4020. /**
  4021. * VideoCategoryMetadata name.
  4022. * @member {string} name
  4023. * @memberof VideoCategoryMetadata
  4024. * @instance
  4025. */
  4026. VideoCategoryMetadata.prototype.name = "";
  4027. /**
  4028. * Creates a new VideoCategoryMetadata instance using the specified properties.
  4029. * @function create
  4030. * @memberof VideoCategoryMetadata
  4031. * @static
  4032. * @param {IVideoCategoryMetadata=} [properties] Properties to set
  4033. * @returns {VideoCategoryMetadata} VideoCategoryMetadata instance
  4034. */
  4035. VideoCategoryMetadata.create = function create(properties) {
  4036. return new VideoCategoryMetadata(properties);
  4037. };
  4038. /**
  4039. * Encodes the specified VideoCategoryMetadata message. Does not implicitly {@link VideoCategoryMetadata.verify|verify} messages.
  4040. * @function encode
  4041. * @memberof VideoCategoryMetadata
  4042. * @static
  4043. * @param {IVideoCategoryMetadata} message VideoCategoryMetadata message or plain object to encode
  4044. * @param {$protobuf.Writer} [writer] Writer to encode to
  4045. * @returns {$protobuf.Writer} Writer
  4046. */
  4047. VideoCategoryMetadata.encode = function encode(message, writer) {
  4048. if (!writer)
  4049. writer = $Writer.create();
  4050. if (message.name != null && Object.hasOwnProperty.call(message, "name"))
  4051. writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
  4052. return writer;
  4053. };
  4054. /**
  4055. * Encodes the specified VideoCategoryMetadata message, length delimited. Does not implicitly {@link VideoCategoryMetadata.verify|verify} messages.
  4056. * @function encodeDelimited
  4057. * @memberof VideoCategoryMetadata
  4058. * @static
  4059. * @param {IVideoCategoryMetadata} message VideoCategoryMetadata message or plain object to encode
  4060. * @param {$protobuf.Writer} [writer] Writer to encode to
  4061. * @returns {$protobuf.Writer} Writer
  4062. */
  4063. VideoCategoryMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  4064. return this.encode(message, writer).ldelim();
  4065. };
  4066. /**
  4067. * Decodes a VideoCategoryMetadata message from the specified reader or buffer.
  4068. * @function decode
  4069. * @memberof VideoCategoryMetadata
  4070. * @static
  4071. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4072. * @param {number} [length] Message length if known beforehand
  4073. * @returns {VideoCategoryMetadata} VideoCategoryMetadata
  4074. * @throws {Error} If the payload is not a reader or valid buffer
  4075. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4076. */
  4077. VideoCategoryMetadata.decode = function decode(reader, length) {
  4078. if (!(reader instanceof $Reader))
  4079. reader = $Reader.create(reader);
  4080. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.VideoCategoryMetadata();
  4081. while (reader.pos < end) {
  4082. var tag = reader.uint32();
  4083. switch (tag >>> 3) {
  4084. case 1:
  4085. message.name = reader.string();
  4086. break;
  4087. default:
  4088. reader.skipType(tag & 7);
  4089. break;
  4090. }
  4091. }
  4092. return message;
  4093. };
  4094. /**
  4095. * Decodes a VideoCategoryMetadata message from the specified reader or buffer, length delimited.
  4096. * @function decodeDelimited
  4097. * @memberof VideoCategoryMetadata
  4098. * @static
  4099. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4100. * @returns {VideoCategoryMetadata} VideoCategoryMetadata
  4101. * @throws {Error} If the payload is not a reader or valid buffer
  4102. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4103. */
  4104. VideoCategoryMetadata.decodeDelimited = function decodeDelimited(reader) {
  4105. if (!(reader instanceof $Reader))
  4106. reader = new $Reader(reader);
  4107. return this.decode(reader, reader.uint32());
  4108. };
  4109. /**
  4110. * Verifies a VideoCategoryMetadata message.
  4111. * @function verify
  4112. * @memberof VideoCategoryMetadata
  4113. * @static
  4114. * @param {Object.<string,*>} message Plain object to verify
  4115. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  4116. */
  4117. VideoCategoryMetadata.verify = function verify(message) {
  4118. if (typeof message !== "object" || message === null)
  4119. return "object expected";
  4120. if (message.name != null && message.hasOwnProperty("name"))
  4121. if (!$util.isString(message.name))
  4122. return "name: string expected";
  4123. return null;
  4124. };
  4125. /**
  4126. * Creates a VideoCategoryMetadata message from a plain object. Also converts values to their respective internal types.
  4127. * @function fromObject
  4128. * @memberof VideoCategoryMetadata
  4129. * @static
  4130. * @param {Object.<string,*>} object Plain object
  4131. * @returns {VideoCategoryMetadata} VideoCategoryMetadata
  4132. */
  4133. VideoCategoryMetadata.fromObject = function fromObject(object) {
  4134. if (object instanceof $root.VideoCategoryMetadata)
  4135. return object;
  4136. var message = new $root.VideoCategoryMetadata();
  4137. if (object.name != null)
  4138. message.name = String(object.name);
  4139. return message;
  4140. };
  4141. /**
  4142. * Creates a plain object from a VideoCategoryMetadata message. Also converts values to other types if specified.
  4143. * @function toObject
  4144. * @memberof VideoCategoryMetadata
  4145. * @static
  4146. * @param {VideoCategoryMetadata} message VideoCategoryMetadata
  4147. * @param {$protobuf.IConversionOptions} [options] Conversion options
  4148. * @returns {Object.<string,*>} Plain object
  4149. */
  4150. VideoCategoryMetadata.toObject = function toObject(message, options) {
  4151. if (!options)
  4152. options = {};
  4153. var object = {};
  4154. if (options.defaults)
  4155. object.name = "";
  4156. if (message.name != null && message.hasOwnProperty("name"))
  4157. object.name = message.name;
  4158. return object;
  4159. };
  4160. /**
  4161. * Converts this VideoCategoryMetadata to JSON.
  4162. * @function toJSON
  4163. * @memberof VideoCategoryMetadata
  4164. * @instance
  4165. * @returns {Object.<string,*>} JSON object
  4166. */
  4167. VideoCategoryMetadata.prototype.toJSON = function toJSON() {
  4168. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  4169. };
  4170. return VideoCategoryMetadata;
  4171. })();
  4172. $root.OpeningMetadata = (function() {
  4173. /**
  4174. * Properties of an OpeningMetadata.
  4175. * @exports IOpeningMetadata
  4176. * @interface IOpeningMetadata
  4177. * @property {string|null} [shortDescription] OpeningMetadata shortDescription
  4178. * @property {string|null} [description] OpeningMetadata description
  4179. * @property {number|null} [hiringLimit] OpeningMetadata hiringLimit
  4180. * @property {number|null} [expectedEndingTimestamp] OpeningMetadata expectedEndingTimestamp
  4181. * @property {string|null} [applicationDetails] OpeningMetadata applicationDetails
  4182. * @property {Array.<OpeningMetadata.IApplicationFormQuestion>|null} [applicationFormQuestions] OpeningMetadata applicationFormQuestions
  4183. */
  4184. /**
  4185. * Constructs a new OpeningMetadata.
  4186. * @exports OpeningMetadata
  4187. * @classdesc Represents an OpeningMetadata.
  4188. * @implements IOpeningMetadata
  4189. * @constructor
  4190. * @param {IOpeningMetadata=} [properties] Properties to set
  4191. */
  4192. function OpeningMetadata(properties) {
  4193. this.applicationFormQuestions = [];
  4194. if (properties)
  4195. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  4196. if (properties[keys[i]] != null)
  4197. this[keys[i]] = properties[keys[i]];
  4198. }
  4199. /**
  4200. * OpeningMetadata shortDescription.
  4201. * @member {string} shortDescription
  4202. * @memberof OpeningMetadata
  4203. * @instance
  4204. */
  4205. OpeningMetadata.prototype.shortDescription = "";
  4206. /**
  4207. * OpeningMetadata description.
  4208. * @member {string} description
  4209. * @memberof OpeningMetadata
  4210. * @instance
  4211. */
  4212. OpeningMetadata.prototype.description = "";
  4213. /**
  4214. * OpeningMetadata hiringLimit.
  4215. * @member {number} hiringLimit
  4216. * @memberof OpeningMetadata
  4217. * @instance
  4218. */
  4219. OpeningMetadata.prototype.hiringLimit = 0;
  4220. /**
  4221. * OpeningMetadata expectedEndingTimestamp.
  4222. * @member {number} expectedEndingTimestamp
  4223. * @memberof OpeningMetadata
  4224. * @instance
  4225. */
  4226. OpeningMetadata.prototype.expectedEndingTimestamp = 0;
  4227. /**
  4228. * OpeningMetadata applicationDetails.
  4229. * @member {string} applicationDetails
  4230. * @memberof OpeningMetadata
  4231. * @instance
  4232. */
  4233. OpeningMetadata.prototype.applicationDetails = "";
  4234. /**
  4235. * OpeningMetadata applicationFormQuestions.
  4236. * @member {Array.<OpeningMetadata.IApplicationFormQuestion>} applicationFormQuestions
  4237. * @memberof OpeningMetadata
  4238. * @instance
  4239. */
  4240. OpeningMetadata.prototype.applicationFormQuestions = $util.emptyArray;
  4241. /**
  4242. * Creates a new OpeningMetadata instance using the specified properties.
  4243. * @function create
  4244. * @memberof OpeningMetadata
  4245. * @static
  4246. * @param {IOpeningMetadata=} [properties] Properties to set
  4247. * @returns {OpeningMetadata} OpeningMetadata instance
  4248. */
  4249. OpeningMetadata.create = function create(properties) {
  4250. return new OpeningMetadata(properties);
  4251. };
  4252. /**
  4253. * Encodes the specified OpeningMetadata message. Does not implicitly {@link OpeningMetadata.verify|verify} messages.
  4254. * @function encode
  4255. * @memberof OpeningMetadata
  4256. * @static
  4257. * @param {IOpeningMetadata} message OpeningMetadata message or plain object to encode
  4258. * @param {$protobuf.Writer} [writer] Writer to encode to
  4259. * @returns {$protobuf.Writer} Writer
  4260. */
  4261. OpeningMetadata.encode = function encode(message, writer) {
  4262. if (!writer)
  4263. writer = $Writer.create();
  4264. if (message.shortDescription != null && Object.hasOwnProperty.call(message, "shortDescription"))
  4265. writer.uint32(/* id 1, wireType 2 =*/10).string(message.shortDescription);
  4266. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  4267. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  4268. if (message.hiringLimit != null && Object.hasOwnProperty.call(message, "hiringLimit"))
  4269. writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.hiringLimit);
  4270. if (message.expectedEndingTimestamp != null && Object.hasOwnProperty.call(message, "expectedEndingTimestamp"))
  4271. writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.expectedEndingTimestamp);
  4272. if (message.applicationDetails != null && Object.hasOwnProperty.call(message, "applicationDetails"))
  4273. writer.uint32(/* id 5, wireType 2 =*/42).string(message.applicationDetails);
  4274. if (message.applicationFormQuestions != null && message.applicationFormQuestions.length)
  4275. for (var i = 0; i < message.applicationFormQuestions.length; ++i)
  4276. $root.OpeningMetadata.ApplicationFormQuestion.encode(message.applicationFormQuestions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
  4277. return writer;
  4278. };
  4279. /**
  4280. * Encodes the specified OpeningMetadata message, length delimited. Does not implicitly {@link OpeningMetadata.verify|verify} messages.
  4281. * @function encodeDelimited
  4282. * @memberof OpeningMetadata
  4283. * @static
  4284. * @param {IOpeningMetadata} message OpeningMetadata message or plain object to encode
  4285. * @param {$protobuf.Writer} [writer] Writer to encode to
  4286. * @returns {$protobuf.Writer} Writer
  4287. */
  4288. OpeningMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  4289. return this.encode(message, writer).ldelim();
  4290. };
  4291. /**
  4292. * Decodes an OpeningMetadata message from the specified reader or buffer.
  4293. * @function decode
  4294. * @memberof OpeningMetadata
  4295. * @static
  4296. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4297. * @param {number} [length] Message length if known beforehand
  4298. * @returns {OpeningMetadata} OpeningMetadata
  4299. * @throws {Error} If the payload is not a reader or valid buffer
  4300. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4301. */
  4302. OpeningMetadata.decode = function decode(reader, length) {
  4303. if (!(reader instanceof $Reader))
  4304. reader = $Reader.create(reader);
  4305. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.OpeningMetadata();
  4306. while (reader.pos < end) {
  4307. var tag = reader.uint32();
  4308. switch (tag >>> 3) {
  4309. case 1:
  4310. message.shortDescription = reader.string();
  4311. break;
  4312. case 2:
  4313. message.description = reader.string();
  4314. break;
  4315. case 3:
  4316. message.hiringLimit = reader.uint32();
  4317. break;
  4318. case 4:
  4319. message.expectedEndingTimestamp = reader.uint32();
  4320. break;
  4321. case 5:
  4322. message.applicationDetails = reader.string();
  4323. break;
  4324. case 6:
  4325. if (!(message.applicationFormQuestions && message.applicationFormQuestions.length))
  4326. message.applicationFormQuestions = [];
  4327. message.applicationFormQuestions.push($root.OpeningMetadata.ApplicationFormQuestion.decode(reader, reader.uint32()));
  4328. break;
  4329. default:
  4330. reader.skipType(tag & 7);
  4331. break;
  4332. }
  4333. }
  4334. return message;
  4335. };
  4336. /**
  4337. * Decodes an OpeningMetadata message from the specified reader or buffer, length delimited.
  4338. * @function decodeDelimited
  4339. * @memberof OpeningMetadata
  4340. * @static
  4341. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4342. * @returns {OpeningMetadata} OpeningMetadata
  4343. * @throws {Error} If the payload is not a reader or valid buffer
  4344. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4345. */
  4346. OpeningMetadata.decodeDelimited = function decodeDelimited(reader) {
  4347. if (!(reader instanceof $Reader))
  4348. reader = new $Reader(reader);
  4349. return this.decode(reader, reader.uint32());
  4350. };
  4351. /**
  4352. * Verifies an OpeningMetadata message.
  4353. * @function verify
  4354. * @memberof OpeningMetadata
  4355. * @static
  4356. * @param {Object.<string,*>} message Plain object to verify
  4357. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  4358. */
  4359. OpeningMetadata.verify = function verify(message) {
  4360. if (typeof message !== "object" || message === null)
  4361. return "object expected";
  4362. if (message.shortDescription != null && message.hasOwnProperty("shortDescription"))
  4363. if (!$util.isString(message.shortDescription))
  4364. return "shortDescription: string expected";
  4365. if (message.description != null && message.hasOwnProperty("description"))
  4366. if (!$util.isString(message.description))
  4367. return "description: string expected";
  4368. if (message.hiringLimit != null && message.hasOwnProperty("hiringLimit"))
  4369. if (!$util.isInteger(message.hiringLimit))
  4370. return "hiringLimit: integer expected";
  4371. if (message.expectedEndingTimestamp != null && message.hasOwnProperty("expectedEndingTimestamp"))
  4372. if (!$util.isInteger(message.expectedEndingTimestamp))
  4373. return "expectedEndingTimestamp: integer expected";
  4374. if (message.applicationDetails != null && message.hasOwnProperty("applicationDetails"))
  4375. if (!$util.isString(message.applicationDetails))
  4376. return "applicationDetails: string expected";
  4377. if (message.applicationFormQuestions != null && message.hasOwnProperty("applicationFormQuestions")) {
  4378. if (!Array.isArray(message.applicationFormQuestions))
  4379. return "applicationFormQuestions: array expected";
  4380. for (var i = 0; i < message.applicationFormQuestions.length; ++i) {
  4381. var error = $root.OpeningMetadata.ApplicationFormQuestion.verify(message.applicationFormQuestions[i]);
  4382. if (error)
  4383. return "applicationFormQuestions." + error;
  4384. }
  4385. }
  4386. return null;
  4387. };
  4388. /**
  4389. * Creates an OpeningMetadata message from a plain object. Also converts values to their respective internal types.
  4390. * @function fromObject
  4391. * @memberof OpeningMetadata
  4392. * @static
  4393. * @param {Object.<string,*>} object Plain object
  4394. * @returns {OpeningMetadata} OpeningMetadata
  4395. */
  4396. OpeningMetadata.fromObject = function fromObject(object) {
  4397. if (object instanceof $root.OpeningMetadata)
  4398. return object;
  4399. var message = new $root.OpeningMetadata();
  4400. if (object.shortDescription != null)
  4401. message.shortDescription = String(object.shortDescription);
  4402. if (object.description != null)
  4403. message.description = String(object.description);
  4404. if (object.hiringLimit != null)
  4405. message.hiringLimit = object.hiringLimit >>> 0;
  4406. if (object.expectedEndingTimestamp != null)
  4407. message.expectedEndingTimestamp = object.expectedEndingTimestamp >>> 0;
  4408. if (object.applicationDetails != null)
  4409. message.applicationDetails = String(object.applicationDetails);
  4410. if (object.applicationFormQuestions) {
  4411. if (!Array.isArray(object.applicationFormQuestions))
  4412. throw TypeError(".OpeningMetadata.applicationFormQuestions: array expected");
  4413. message.applicationFormQuestions = [];
  4414. for (var i = 0; i < object.applicationFormQuestions.length; ++i) {
  4415. if (typeof object.applicationFormQuestions[i] !== "object")
  4416. throw TypeError(".OpeningMetadata.applicationFormQuestions: object expected");
  4417. message.applicationFormQuestions[i] = $root.OpeningMetadata.ApplicationFormQuestion.fromObject(object.applicationFormQuestions[i]);
  4418. }
  4419. }
  4420. return message;
  4421. };
  4422. /**
  4423. * Creates a plain object from an OpeningMetadata message. Also converts values to other types if specified.
  4424. * @function toObject
  4425. * @memberof OpeningMetadata
  4426. * @static
  4427. * @param {OpeningMetadata} message OpeningMetadata
  4428. * @param {$protobuf.IConversionOptions} [options] Conversion options
  4429. * @returns {Object.<string,*>} Plain object
  4430. */
  4431. OpeningMetadata.toObject = function toObject(message, options) {
  4432. if (!options)
  4433. options = {};
  4434. var object = {};
  4435. if (options.arrays || options.defaults)
  4436. object.applicationFormQuestions = [];
  4437. if (options.defaults) {
  4438. object.shortDescription = "";
  4439. object.description = "";
  4440. object.hiringLimit = 0;
  4441. object.expectedEndingTimestamp = 0;
  4442. object.applicationDetails = "";
  4443. }
  4444. if (message.shortDescription != null && message.hasOwnProperty("shortDescription"))
  4445. object.shortDescription = message.shortDescription;
  4446. if (message.description != null && message.hasOwnProperty("description"))
  4447. object.description = message.description;
  4448. if (message.hiringLimit != null && message.hasOwnProperty("hiringLimit"))
  4449. object.hiringLimit = message.hiringLimit;
  4450. if (message.expectedEndingTimestamp != null && message.hasOwnProperty("expectedEndingTimestamp"))
  4451. object.expectedEndingTimestamp = message.expectedEndingTimestamp;
  4452. if (message.applicationDetails != null && message.hasOwnProperty("applicationDetails"))
  4453. object.applicationDetails = message.applicationDetails;
  4454. if (message.applicationFormQuestions && message.applicationFormQuestions.length) {
  4455. object.applicationFormQuestions = [];
  4456. for (var j = 0; j < message.applicationFormQuestions.length; ++j)
  4457. object.applicationFormQuestions[j] = $root.OpeningMetadata.ApplicationFormQuestion.toObject(message.applicationFormQuestions[j], options);
  4458. }
  4459. return object;
  4460. };
  4461. /**
  4462. * Converts this OpeningMetadata to JSON.
  4463. * @function toJSON
  4464. * @memberof OpeningMetadata
  4465. * @instance
  4466. * @returns {Object.<string,*>} JSON object
  4467. */
  4468. OpeningMetadata.prototype.toJSON = function toJSON() {
  4469. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  4470. };
  4471. OpeningMetadata.ApplicationFormQuestion = (function() {
  4472. /**
  4473. * Properties of an ApplicationFormQuestion.
  4474. * @memberof OpeningMetadata
  4475. * @interface IApplicationFormQuestion
  4476. * @property {string|null} [question] ApplicationFormQuestion question
  4477. * @property {OpeningMetadata.ApplicationFormQuestion.InputType|null} [type] ApplicationFormQuestion type
  4478. */
  4479. /**
  4480. * Constructs a new ApplicationFormQuestion.
  4481. * @memberof OpeningMetadata
  4482. * @classdesc Represents an ApplicationFormQuestion.
  4483. * @implements IApplicationFormQuestion
  4484. * @constructor
  4485. * @param {OpeningMetadata.IApplicationFormQuestion=} [properties] Properties to set
  4486. */
  4487. function ApplicationFormQuestion(properties) {
  4488. if (properties)
  4489. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  4490. if (properties[keys[i]] != null)
  4491. this[keys[i]] = properties[keys[i]];
  4492. }
  4493. /**
  4494. * ApplicationFormQuestion question.
  4495. * @member {string} question
  4496. * @memberof OpeningMetadata.ApplicationFormQuestion
  4497. * @instance
  4498. */
  4499. ApplicationFormQuestion.prototype.question = "";
  4500. /**
  4501. * ApplicationFormQuestion type.
  4502. * @member {OpeningMetadata.ApplicationFormQuestion.InputType} type
  4503. * @memberof OpeningMetadata.ApplicationFormQuestion
  4504. * @instance
  4505. */
  4506. ApplicationFormQuestion.prototype.type = 0;
  4507. /**
  4508. * Creates a new ApplicationFormQuestion instance using the specified properties.
  4509. * @function create
  4510. * @memberof OpeningMetadata.ApplicationFormQuestion
  4511. * @static
  4512. * @param {OpeningMetadata.IApplicationFormQuestion=} [properties] Properties to set
  4513. * @returns {OpeningMetadata.ApplicationFormQuestion} ApplicationFormQuestion instance
  4514. */
  4515. ApplicationFormQuestion.create = function create(properties) {
  4516. return new ApplicationFormQuestion(properties);
  4517. };
  4518. /**
  4519. * Encodes the specified ApplicationFormQuestion message. Does not implicitly {@link OpeningMetadata.ApplicationFormQuestion.verify|verify} messages.
  4520. * @function encode
  4521. * @memberof OpeningMetadata.ApplicationFormQuestion
  4522. * @static
  4523. * @param {OpeningMetadata.IApplicationFormQuestion} message ApplicationFormQuestion message or plain object to encode
  4524. * @param {$protobuf.Writer} [writer] Writer to encode to
  4525. * @returns {$protobuf.Writer} Writer
  4526. */
  4527. ApplicationFormQuestion.encode = function encode(message, writer) {
  4528. if (!writer)
  4529. writer = $Writer.create();
  4530. if (message.question != null && Object.hasOwnProperty.call(message, "question"))
  4531. writer.uint32(/* id 1, wireType 2 =*/10).string(message.question);
  4532. if (message.type != null && Object.hasOwnProperty.call(message, "type"))
  4533. writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
  4534. return writer;
  4535. };
  4536. /**
  4537. * Encodes the specified ApplicationFormQuestion message, length delimited. Does not implicitly {@link OpeningMetadata.ApplicationFormQuestion.verify|verify} messages.
  4538. * @function encodeDelimited
  4539. * @memberof OpeningMetadata.ApplicationFormQuestion
  4540. * @static
  4541. * @param {OpeningMetadata.IApplicationFormQuestion} message ApplicationFormQuestion message or plain object to encode
  4542. * @param {$protobuf.Writer} [writer] Writer to encode to
  4543. * @returns {$protobuf.Writer} Writer
  4544. */
  4545. ApplicationFormQuestion.encodeDelimited = function encodeDelimited(message, writer) {
  4546. return this.encode(message, writer).ldelim();
  4547. };
  4548. /**
  4549. * Decodes an ApplicationFormQuestion message from the specified reader or buffer.
  4550. * @function decode
  4551. * @memberof OpeningMetadata.ApplicationFormQuestion
  4552. * @static
  4553. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4554. * @param {number} [length] Message length if known beforehand
  4555. * @returns {OpeningMetadata.ApplicationFormQuestion} ApplicationFormQuestion
  4556. * @throws {Error} If the payload is not a reader or valid buffer
  4557. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4558. */
  4559. ApplicationFormQuestion.decode = function decode(reader, length) {
  4560. if (!(reader instanceof $Reader))
  4561. reader = $Reader.create(reader);
  4562. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.OpeningMetadata.ApplicationFormQuestion();
  4563. while (reader.pos < end) {
  4564. var tag = reader.uint32();
  4565. switch (tag >>> 3) {
  4566. case 1:
  4567. message.question = reader.string();
  4568. break;
  4569. case 2:
  4570. message.type = reader.int32();
  4571. break;
  4572. default:
  4573. reader.skipType(tag & 7);
  4574. break;
  4575. }
  4576. }
  4577. return message;
  4578. };
  4579. /**
  4580. * Decodes an ApplicationFormQuestion message from the specified reader or buffer, length delimited.
  4581. * @function decodeDelimited
  4582. * @memberof OpeningMetadata.ApplicationFormQuestion
  4583. * @static
  4584. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4585. * @returns {OpeningMetadata.ApplicationFormQuestion} ApplicationFormQuestion
  4586. * @throws {Error} If the payload is not a reader or valid buffer
  4587. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4588. */
  4589. ApplicationFormQuestion.decodeDelimited = function decodeDelimited(reader) {
  4590. if (!(reader instanceof $Reader))
  4591. reader = new $Reader(reader);
  4592. return this.decode(reader, reader.uint32());
  4593. };
  4594. /**
  4595. * Verifies an ApplicationFormQuestion message.
  4596. * @function verify
  4597. * @memberof OpeningMetadata.ApplicationFormQuestion
  4598. * @static
  4599. * @param {Object.<string,*>} message Plain object to verify
  4600. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  4601. */
  4602. ApplicationFormQuestion.verify = function verify(message) {
  4603. if (typeof message !== "object" || message === null)
  4604. return "object expected";
  4605. if (message.question != null && message.hasOwnProperty("question"))
  4606. if (!$util.isString(message.question))
  4607. return "question: string expected";
  4608. if (message.type != null && message.hasOwnProperty("type"))
  4609. switch (message.type) {
  4610. default:
  4611. return "type: enum value expected";
  4612. case 0:
  4613. case 1:
  4614. break;
  4615. }
  4616. return null;
  4617. };
  4618. /**
  4619. * Creates an ApplicationFormQuestion message from a plain object. Also converts values to their respective internal types.
  4620. * @function fromObject
  4621. * @memberof OpeningMetadata.ApplicationFormQuestion
  4622. * @static
  4623. * @param {Object.<string,*>} object Plain object
  4624. * @returns {OpeningMetadata.ApplicationFormQuestion} ApplicationFormQuestion
  4625. */
  4626. ApplicationFormQuestion.fromObject = function fromObject(object) {
  4627. if (object instanceof $root.OpeningMetadata.ApplicationFormQuestion)
  4628. return object;
  4629. var message = new $root.OpeningMetadata.ApplicationFormQuestion();
  4630. if (object.question != null)
  4631. message.question = String(object.question);
  4632. switch (object.type) {
  4633. case "TEXTAREA":
  4634. case 0:
  4635. message.type = 0;
  4636. break;
  4637. case "TEXT":
  4638. case 1:
  4639. message.type = 1;
  4640. break;
  4641. }
  4642. return message;
  4643. };
  4644. /**
  4645. * Creates a plain object from an ApplicationFormQuestion message. Also converts values to other types if specified.
  4646. * @function toObject
  4647. * @memberof OpeningMetadata.ApplicationFormQuestion
  4648. * @static
  4649. * @param {OpeningMetadata.ApplicationFormQuestion} message ApplicationFormQuestion
  4650. * @param {$protobuf.IConversionOptions} [options] Conversion options
  4651. * @returns {Object.<string,*>} Plain object
  4652. */
  4653. ApplicationFormQuestion.toObject = function toObject(message, options) {
  4654. if (!options)
  4655. options = {};
  4656. var object = {};
  4657. if (options.defaults) {
  4658. object.question = "";
  4659. object.type = options.enums === String ? "TEXTAREA" : 0;
  4660. }
  4661. if (message.question != null && message.hasOwnProperty("question"))
  4662. object.question = message.question;
  4663. if (message.type != null && message.hasOwnProperty("type"))
  4664. object.type = options.enums === String ? $root.OpeningMetadata.ApplicationFormQuestion.InputType[message.type] : message.type;
  4665. return object;
  4666. };
  4667. /**
  4668. * Converts this ApplicationFormQuestion to JSON.
  4669. * @function toJSON
  4670. * @memberof OpeningMetadata.ApplicationFormQuestion
  4671. * @instance
  4672. * @returns {Object.<string,*>} JSON object
  4673. */
  4674. ApplicationFormQuestion.prototype.toJSON = function toJSON() {
  4675. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  4676. };
  4677. /**
  4678. * InputType enum.
  4679. * @name OpeningMetadata.ApplicationFormQuestion.InputType
  4680. * @enum {number}
  4681. * @property {number} TEXTAREA=0 TEXTAREA value
  4682. * @property {number} TEXT=1 TEXT value
  4683. */
  4684. ApplicationFormQuestion.InputType = (function() {
  4685. var valuesById = {}, values = Object.create(valuesById);
  4686. values[valuesById[0] = "TEXTAREA"] = 0;
  4687. values[valuesById[1] = "TEXT"] = 1;
  4688. return values;
  4689. })();
  4690. return ApplicationFormQuestion;
  4691. })();
  4692. return OpeningMetadata;
  4693. })();
  4694. $root.UpcomingOpeningMetadata = (function() {
  4695. /**
  4696. * Properties of an UpcomingOpeningMetadata.
  4697. * @exports IUpcomingOpeningMetadata
  4698. * @interface IUpcomingOpeningMetadata
  4699. * @property {number|null} [expectedStart] UpcomingOpeningMetadata expectedStart
  4700. * @property {Long|null} [rewardPerBlock] UpcomingOpeningMetadata rewardPerBlock
  4701. * @property {Long|null} [minApplicationStake] UpcomingOpeningMetadata minApplicationStake
  4702. * @property {IOpeningMetadata|null} [metadata] UpcomingOpeningMetadata metadata
  4703. */
  4704. /**
  4705. * Constructs a new UpcomingOpeningMetadata.
  4706. * @exports UpcomingOpeningMetadata
  4707. * @classdesc Represents an UpcomingOpeningMetadata.
  4708. * @implements IUpcomingOpeningMetadata
  4709. * @constructor
  4710. * @param {IUpcomingOpeningMetadata=} [properties] Properties to set
  4711. */
  4712. function UpcomingOpeningMetadata(properties) {
  4713. if (properties)
  4714. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  4715. if (properties[keys[i]] != null)
  4716. this[keys[i]] = properties[keys[i]];
  4717. }
  4718. /**
  4719. * UpcomingOpeningMetadata expectedStart.
  4720. * @member {number} expectedStart
  4721. * @memberof UpcomingOpeningMetadata
  4722. * @instance
  4723. */
  4724. UpcomingOpeningMetadata.prototype.expectedStart = 0;
  4725. /**
  4726. * UpcomingOpeningMetadata rewardPerBlock.
  4727. * @member {Long} rewardPerBlock
  4728. * @memberof UpcomingOpeningMetadata
  4729. * @instance
  4730. */
  4731. UpcomingOpeningMetadata.prototype.rewardPerBlock = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
  4732. /**
  4733. * UpcomingOpeningMetadata minApplicationStake.
  4734. * @member {Long} minApplicationStake
  4735. * @memberof UpcomingOpeningMetadata
  4736. * @instance
  4737. */
  4738. UpcomingOpeningMetadata.prototype.minApplicationStake = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
  4739. /**
  4740. * UpcomingOpeningMetadata metadata.
  4741. * @member {IOpeningMetadata|null|undefined} metadata
  4742. * @memberof UpcomingOpeningMetadata
  4743. * @instance
  4744. */
  4745. UpcomingOpeningMetadata.prototype.metadata = null;
  4746. /**
  4747. * Creates a new UpcomingOpeningMetadata instance using the specified properties.
  4748. * @function create
  4749. * @memberof UpcomingOpeningMetadata
  4750. * @static
  4751. * @param {IUpcomingOpeningMetadata=} [properties] Properties to set
  4752. * @returns {UpcomingOpeningMetadata} UpcomingOpeningMetadata instance
  4753. */
  4754. UpcomingOpeningMetadata.create = function create(properties) {
  4755. return new UpcomingOpeningMetadata(properties);
  4756. };
  4757. /**
  4758. * Encodes the specified UpcomingOpeningMetadata message. Does not implicitly {@link UpcomingOpeningMetadata.verify|verify} messages.
  4759. * @function encode
  4760. * @memberof UpcomingOpeningMetadata
  4761. * @static
  4762. * @param {IUpcomingOpeningMetadata} message UpcomingOpeningMetadata message or plain object to encode
  4763. * @param {$protobuf.Writer} [writer] Writer to encode to
  4764. * @returns {$protobuf.Writer} Writer
  4765. */
  4766. UpcomingOpeningMetadata.encode = function encode(message, writer) {
  4767. if (!writer)
  4768. writer = $Writer.create();
  4769. if (message.expectedStart != null && Object.hasOwnProperty.call(message, "expectedStart"))
  4770. writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.expectedStart);
  4771. if (message.rewardPerBlock != null && Object.hasOwnProperty.call(message, "rewardPerBlock"))
  4772. writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.rewardPerBlock);
  4773. if (message.minApplicationStake != null && Object.hasOwnProperty.call(message, "minApplicationStake"))
  4774. writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.minApplicationStake);
  4775. if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
  4776. $root.OpeningMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
  4777. return writer;
  4778. };
  4779. /**
  4780. * Encodes the specified UpcomingOpeningMetadata message, length delimited. Does not implicitly {@link UpcomingOpeningMetadata.verify|verify} messages.
  4781. * @function encodeDelimited
  4782. * @memberof UpcomingOpeningMetadata
  4783. * @static
  4784. * @param {IUpcomingOpeningMetadata} message UpcomingOpeningMetadata message or plain object to encode
  4785. * @param {$protobuf.Writer} [writer] Writer to encode to
  4786. * @returns {$protobuf.Writer} Writer
  4787. */
  4788. UpcomingOpeningMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  4789. return this.encode(message, writer).ldelim();
  4790. };
  4791. /**
  4792. * Decodes an UpcomingOpeningMetadata message from the specified reader or buffer.
  4793. * @function decode
  4794. * @memberof UpcomingOpeningMetadata
  4795. * @static
  4796. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4797. * @param {number} [length] Message length if known beforehand
  4798. * @returns {UpcomingOpeningMetadata} UpcomingOpeningMetadata
  4799. * @throws {Error} If the payload is not a reader or valid buffer
  4800. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4801. */
  4802. UpcomingOpeningMetadata.decode = function decode(reader, length) {
  4803. if (!(reader instanceof $Reader))
  4804. reader = $Reader.create(reader);
  4805. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpcomingOpeningMetadata();
  4806. while (reader.pos < end) {
  4807. var tag = reader.uint32();
  4808. switch (tag >>> 3) {
  4809. case 1:
  4810. message.expectedStart = reader.uint32();
  4811. break;
  4812. case 2:
  4813. message.rewardPerBlock = reader.uint64();
  4814. break;
  4815. case 3:
  4816. message.minApplicationStake = reader.uint64();
  4817. break;
  4818. case 4:
  4819. message.metadata = $root.OpeningMetadata.decode(reader, reader.uint32());
  4820. break;
  4821. default:
  4822. reader.skipType(tag & 7);
  4823. break;
  4824. }
  4825. }
  4826. return message;
  4827. };
  4828. /**
  4829. * Decodes an UpcomingOpeningMetadata message from the specified reader or buffer, length delimited.
  4830. * @function decodeDelimited
  4831. * @memberof UpcomingOpeningMetadata
  4832. * @static
  4833. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  4834. * @returns {UpcomingOpeningMetadata} UpcomingOpeningMetadata
  4835. * @throws {Error} If the payload is not a reader or valid buffer
  4836. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  4837. */
  4838. UpcomingOpeningMetadata.decodeDelimited = function decodeDelimited(reader) {
  4839. if (!(reader instanceof $Reader))
  4840. reader = new $Reader(reader);
  4841. return this.decode(reader, reader.uint32());
  4842. };
  4843. /**
  4844. * Verifies an UpcomingOpeningMetadata message.
  4845. * @function verify
  4846. * @memberof UpcomingOpeningMetadata
  4847. * @static
  4848. * @param {Object.<string,*>} message Plain object to verify
  4849. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  4850. */
  4851. UpcomingOpeningMetadata.verify = function verify(message) {
  4852. if (typeof message !== "object" || message === null)
  4853. return "object expected";
  4854. if (message.expectedStart != null && message.hasOwnProperty("expectedStart"))
  4855. if (!$util.isInteger(message.expectedStart))
  4856. return "expectedStart: integer expected";
  4857. if (message.rewardPerBlock != null && message.hasOwnProperty("rewardPerBlock"))
  4858. if (!$util.isInteger(message.rewardPerBlock) && !(message.rewardPerBlock && $util.isInteger(message.rewardPerBlock.low) && $util.isInteger(message.rewardPerBlock.high)))
  4859. return "rewardPerBlock: integer|Long expected";
  4860. if (message.minApplicationStake != null && message.hasOwnProperty("minApplicationStake"))
  4861. if (!$util.isInteger(message.minApplicationStake) && !(message.minApplicationStake && $util.isInteger(message.minApplicationStake.low) && $util.isInteger(message.minApplicationStake.high)))
  4862. return "minApplicationStake: integer|Long expected";
  4863. if (message.metadata != null && message.hasOwnProperty("metadata")) {
  4864. var error = $root.OpeningMetadata.verify(message.metadata);
  4865. if (error)
  4866. return "metadata." + error;
  4867. }
  4868. return null;
  4869. };
  4870. /**
  4871. * Creates an UpcomingOpeningMetadata message from a plain object. Also converts values to their respective internal types.
  4872. * @function fromObject
  4873. * @memberof UpcomingOpeningMetadata
  4874. * @static
  4875. * @param {Object.<string,*>} object Plain object
  4876. * @returns {UpcomingOpeningMetadata} UpcomingOpeningMetadata
  4877. */
  4878. UpcomingOpeningMetadata.fromObject = function fromObject(object) {
  4879. if (object instanceof $root.UpcomingOpeningMetadata)
  4880. return object;
  4881. var message = new $root.UpcomingOpeningMetadata();
  4882. if (object.expectedStart != null)
  4883. message.expectedStart = object.expectedStart >>> 0;
  4884. if (object.rewardPerBlock != null)
  4885. if ($util.Long)
  4886. (message.rewardPerBlock = $util.Long.fromValue(object.rewardPerBlock)).unsigned = true;
  4887. else if (typeof object.rewardPerBlock === "string")
  4888. message.rewardPerBlock = parseInt(object.rewardPerBlock, 10);
  4889. else if (typeof object.rewardPerBlock === "number")
  4890. message.rewardPerBlock = object.rewardPerBlock;
  4891. else if (typeof object.rewardPerBlock === "object")
  4892. message.rewardPerBlock = new $util.LongBits(object.rewardPerBlock.low >>> 0, object.rewardPerBlock.high >>> 0).toNumber(true);
  4893. if (object.minApplicationStake != null)
  4894. if ($util.Long)
  4895. (message.minApplicationStake = $util.Long.fromValue(object.minApplicationStake)).unsigned = true;
  4896. else if (typeof object.minApplicationStake === "string")
  4897. message.minApplicationStake = parseInt(object.minApplicationStake, 10);
  4898. else if (typeof object.minApplicationStake === "number")
  4899. message.minApplicationStake = object.minApplicationStake;
  4900. else if (typeof object.minApplicationStake === "object")
  4901. message.minApplicationStake = new $util.LongBits(object.minApplicationStake.low >>> 0, object.minApplicationStake.high >>> 0).toNumber(true);
  4902. if (object.metadata != null) {
  4903. if (typeof object.metadata !== "object")
  4904. throw TypeError(".UpcomingOpeningMetadata.metadata: object expected");
  4905. message.metadata = $root.OpeningMetadata.fromObject(object.metadata);
  4906. }
  4907. return message;
  4908. };
  4909. /**
  4910. * Creates a plain object from an UpcomingOpeningMetadata message. Also converts values to other types if specified.
  4911. * @function toObject
  4912. * @memberof UpcomingOpeningMetadata
  4913. * @static
  4914. * @param {UpcomingOpeningMetadata} message UpcomingOpeningMetadata
  4915. * @param {$protobuf.IConversionOptions} [options] Conversion options
  4916. * @returns {Object.<string,*>} Plain object
  4917. */
  4918. UpcomingOpeningMetadata.toObject = function toObject(message, options) {
  4919. if (!options)
  4920. options = {};
  4921. var object = {};
  4922. if (options.defaults) {
  4923. object.expectedStart = 0;
  4924. if ($util.Long) {
  4925. var long = new $util.Long(0, 0, true);
  4926. object.rewardPerBlock = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  4927. } else
  4928. object.rewardPerBlock = options.longs === String ? "0" : 0;
  4929. if ($util.Long) {
  4930. var long = new $util.Long(0, 0, true);
  4931. object.minApplicationStake = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  4932. } else
  4933. object.minApplicationStake = options.longs === String ? "0" : 0;
  4934. object.metadata = null;
  4935. }
  4936. if (message.expectedStart != null && message.hasOwnProperty("expectedStart"))
  4937. object.expectedStart = message.expectedStart;
  4938. if (message.rewardPerBlock != null && message.hasOwnProperty("rewardPerBlock"))
  4939. if (typeof message.rewardPerBlock === "number")
  4940. object.rewardPerBlock = options.longs === String ? String(message.rewardPerBlock) : message.rewardPerBlock;
  4941. else
  4942. 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;
  4943. if (message.minApplicationStake != null && message.hasOwnProperty("minApplicationStake"))
  4944. if (typeof message.minApplicationStake === "number")
  4945. object.minApplicationStake = options.longs === String ? String(message.minApplicationStake) : message.minApplicationStake;
  4946. else
  4947. 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;
  4948. if (message.metadata != null && message.hasOwnProperty("metadata"))
  4949. object.metadata = $root.OpeningMetadata.toObject(message.metadata, options);
  4950. return object;
  4951. };
  4952. /**
  4953. * Converts this UpcomingOpeningMetadata to JSON.
  4954. * @function toJSON
  4955. * @memberof UpcomingOpeningMetadata
  4956. * @instance
  4957. * @returns {Object.<string,*>} JSON object
  4958. */
  4959. UpcomingOpeningMetadata.prototype.toJSON = function toJSON() {
  4960. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  4961. };
  4962. return UpcomingOpeningMetadata;
  4963. })();
  4964. $root.ApplicationMetadata = (function() {
  4965. /**
  4966. * Properties of an ApplicationMetadata.
  4967. * @exports IApplicationMetadata
  4968. * @interface IApplicationMetadata
  4969. * @property {Array.<string>|null} [answers] ApplicationMetadata answers
  4970. */
  4971. /**
  4972. * Constructs a new ApplicationMetadata.
  4973. * @exports ApplicationMetadata
  4974. * @classdesc Represents an ApplicationMetadata.
  4975. * @implements IApplicationMetadata
  4976. * @constructor
  4977. * @param {IApplicationMetadata=} [properties] Properties to set
  4978. */
  4979. function ApplicationMetadata(properties) {
  4980. this.answers = [];
  4981. if (properties)
  4982. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  4983. if (properties[keys[i]] != null)
  4984. this[keys[i]] = properties[keys[i]];
  4985. }
  4986. /**
  4987. * ApplicationMetadata answers.
  4988. * @member {Array.<string>} answers
  4989. * @memberof ApplicationMetadata
  4990. * @instance
  4991. */
  4992. ApplicationMetadata.prototype.answers = $util.emptyArray;
  4993. /**
  4994. * Creates a new ApplicationMetadata instance using the specified properties.
  4995. * @function create
  4996. * @memberof ApplicationMetadata
  4997. * @static
  4998. * @param {IApplicationMetadata=} [properties] Properties to set
  4999. * @returns {ApplicationMetadata} ApplicationMetadata instance
  5000. */
  5001. ApplicationMetadata.create = function create(properties) {
  5002. return new ApplicationMetadata(properties);
  5003. };
  5004. /**
  5005. * Encodes the specified ApplicationMetadata message. Does not implicitly {@link ApplicationMetadata.verify|verify} messages.
  5006. * @function encode
  5007. * @memberof ApplicationMetadata
  5008. * @static
  5009. * @param {IApplicationMetadata} message ApplicationMetadata message or plain object to encode
  5010. * @param {$protobuf.Writer} [writer] Writer to encode to
  5011. * @returns {$protobuf.Writer} Writer
  5012. */
  5013. ApplicationMetadata.encode = function encode(message, writer) {
  5014. if (!writer)
  5015. writer = $Writer.create();
  5016. if (message.answers != null && message.answers.length)
  5017. for (var i = 0; i < message.answers.length; ++i)
  5018. writer.uint32(/* id 1, wireType 2 =*/10).string(message.answers[i]);
  5019. return writer;
  5020. };
  5021. /**
  5022. * Encodes the specified ApplicationMetadata message, length delimited. Does not implicitly {@link ApplicationMetadata.verify|verify} messages.
  5023. * @function encodeDelimited
  5024. * @memberof ApplicationMetadata
  5025. * @static
  5026. * @param {IApplicationMetadata} message ApplicationMetadata message or plain object to encode
  5027. * @param {$protobuf.Writer} [writer] Writer to encode to
  5028. * @returns {$protobuf.Writer} Writer
  5029. */
  5030. ApplicationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  5031. return this.encode(message, writer).ldelim();
  5032. };
  5033. /**
  5034. * Decodes an ApplicationMetadata message from the specified reader or buffer.
  5035. * @function decode
  5036. * @memberof ApplicationMetadata
  5037. * @static
  5038. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5039. * @param {number} [length] Message length if known beforehand
  5040. * @returns {ApplicationMetadata} ApplicationMetadata
  5041. * @throws {Error} If the payload is not a reader or valid buffer
  5042. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5043. */
  5044. ApplicationMetadata.decode = function decode(reader, length) {
  5045. if (!(reader instanceof $Reader))
  5046. reader = $Reader.create(reader);
  5047. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApplicationMetadata();
  5048. while (reader.pos < end) {
  5049. var tag = reader.uint32();
  5050. switch (tag >>> 3) {
  5051. case 1:
  5052. if (!(message.answers && message.answers.length))
  5053. message.answers = [];
  5054. message.answers.push(reader.string());
  5055. break;
  5056. default:
  5057. reader.skipType(tag & 7);
  5058. break;
  5059. }
  5060. }
  5061. return message;
  5062. };
  5063. /**
  5064. * Decodes an ApplicationMetadata message from the specified reader or buffer, length delimited.
  5065. * @function decodeDelimited
  5066. * @memberof ApplicationMetadata
  5067. * @static
  5068. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5069. * @returns {ApplicationMetadata} ApplicationMetadata
  5070. * @throws {Error} If the payload is not a reader or valid buffer
  5071. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5072. */
  5073. ApplicationMetadata.decodeDelimited = function decodeDelimited(reader) {
  5074. if (!(reader instanceof $Reader))
  5075. reader = new $Reader(reader);
  5076. return this.decode(reader, reader.uint32());
  5077. };
  5078. /**
  5079. * Verifies an ApplicationMetadata message.
  5080. * @function verify
  5081. * @memberof ApplicationMetadata
  5082. * @static
  5083. * @param {Object.<string,*>} message Plain object to verify
  5084. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5085. */
  5086. ApplicationMetadata.verify = function verify(message) {
  5087. if (typeof message !== "object" || message === null)
  5088. return "object expected";
  5089. if (message.answers != null && message.hasOwnProperty("answers")) {
  5090. if (!Array.isArray(message.answers))
  5091. return "answers: array expected";
  5092. for (var i = 0; i < message.answers.length; ++i)
  5093. if (!$util.isString(message.answers[i]))
  5094. return "answers: string[] expected";
  5095. }
  5096. return null;
  5097. };
  5098. /**
  5099. * Creates an ApplicationMetadata message from a plain object. Also converts values to their respective internal types.
  5100. * @function fromObject
  5101. * @memberof ApplicationMetadata
  5102. * @static
  5103. * @param {Object.<string,*>} object Plain object
  5104. * @returns {ApplicationMetadata} ApplicationMetadata
  5105. */
  5106. ApplicationMetadata.fromObject = function fromObject(object) {
  5107. if (object instanceof $root.ApplicationMetadata)
  5108. return object;
  5109. var message = new $root.ApplicationMetadata();
  5110. if (object.answers) {
  5111. if (!Array.isArray(object.answers))
  5112. throw TypeError(".ApplicationMetadata.answers: array expected");
  5113. message.answers = [];
  5114. for (var i = 0; i < object.answers.length; ++i)
  5115. message.answers[i] = String(object.answers[i]);
  5116. }
  5117. return message;
  5118. };
  5119. /**
  5120. * Creates a plain object from an ApplicationMetadata message. Also converts values to other types if specified.
  5121. * @function toObject
  5122. * @memberof ApplicationMetadata
  5123. * @static
  5124. * @param {ApplicationMetadata} message ApplicationMetadata
  5125. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5126. * @returns {Object.<string,*>} Plain object
  5127. */
  5128. ApplicationMetadata.toObject = function toObject(message, options) {
  5129. if (!options)
  5130. options = {};
  5131. var object = {};
  5132. if (options.arrays || options.defaults)
  5133. object.answers = [];
  5134. if (message.answers && message.answers.length) {
  5135. object.answers = [];
  5136. for (var j = 0; j < message.answers.length; ++j)
  5137. object.answers[j] = message.answers[j];
  5138. }
  5139. return object;
  5140. };
  5141. /**
  5142. * Converts this ApplicationMetadata to JSON.
  5143. * @function toJSON
  5144. * @memberof ApplicationMetadata
  5145. * @instance
  5146. * @returns {Object.<string,*>} JSON object
  5147. */
  5148. ApplicationMetadata.prototype.toJSON = function toJSON() {
  5149. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5150. };
  5151. return ApplicationMetadata;
  5152. })();
  5153. $root.WorkingGroupMetadata = (function() {
  5154. /**
  5155. * Properties of a WorkingGroupMetadata.
  5156. * @exports IWorkingGroupMetadata
  5157. * @interface IWorkingGroupMetadata
  5158. * @property {string|null} [description] WorkingGroupMetadata description
  5159. * @property {string|null} [about] WorkingGroupMetadata about
  5160. * @property {string|null} [status] WorkingGroupMetadata status
  5161. * @property {string|null} [statusMessage] WorkingGroupMetadata statusMessage
  5162. */
  5163. /**
  5164. * Constructs a new WorkingGroupMetadata.
  5165. * @exports WorkingGroupMetadata
  5166. * @classdesc Represents a WorkingGroupMetadata.
  5167. * @implements IWorkingGroupMetadata
  5168. * @constructor
  5169. * @param {IWorkingGroupMetadata=} [properties] Properties to set
  5170. */
  5171. function WorkingGroupMetadata(properties) {
  5172. if (properties)
  5173. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  5174. if (properties[keys[i]] != null)
  5175. this[keys[i]] = properties[keys[i]];
  5176. }
  5177. /**
  5178. * WorkingGroupMetadata description.
  5179. * @member {string} description
  5180. * @memberof WorkingGroupMetadata
  5181. * @instance
  5182. */
  5183. WorkingGroupMetadata.prototype.description = "";
  5184. /**
  5185. * WorkingGroupMetadata about.
  5186. * @member {string} about
  5187. * @memberof WorkingGroupMetadata
  5188. * @instance
  5189. */
  5190. WorkingGroupMetadata.prototype.about = "";
  5191. /**
  5192. * WorkingGroupMetadata status.
  5193. * @member {string} status
  5194. * @memberof WorkingGroupMetadata
  5195. * @instance
  5196. */
  5197. WorkingGroupMetadata.prototype.status = "";
  5198. /**
  5199. * WorkingGroupMetadata statusMessage.
  5200. * @member {string} statusMessage
  5201. * @memberof WorkingGroupMetadata
  5202. * @instance
  5203. */
  5204. WorkingGroupMetadata.prototype.statusMessage = "";
  5205. /**
  5206. * Creates a new WorkingGroupMetadata instance using the specified properties.
  5207. * @function create
  5208. * @memberof WorkingGroupMetadata
  5209. * @static
  5210. * @param {IWorkingGroupMetadata=} [properties] Properties to set
  5211. * @returns {WorkingGroupMetadata} WorkingGroupMetadata instance
  5212. */
  5213. WorkingGroupMetadata.create = function create(properties) {
  5214. return new WorkingGroupMetadata(properties);
  5215. };
  5216. /**
  5217. * Encodes the specified WorkingGroupMetadata message. Does not implicitly {@link WorkingGroupMetadata.verify|verify} messages.
  5218. * @function encode
  5219. * @memberof WorkingGroupMetadata
  5220. * @static
  5221. * @param {IWorkingGroupMetadata} message WorkingGroupMetadata message or plain object to encode
  5222. * @param {$protobuf.Writer} [writer] Writer to encode to
  5223. * @returns {$protobuf.Writer} Writer
  5224. */
  5225. WorkingGroupMetadata.encode = function encode(message, writer) {
  5226. if (!writer)
  5227. writer = $Writer.create();
  5228. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  5229. writer.uint32(/* id 1, wireType 2 =*/10).string(message.description);
  5230. if (message.about != null && Object.hasOwnProperty.call(message, "about"))
  5231. writer.uint32(/* id 2, wireType 2 =*/18).string(message.about);
  5232. if (message.status != null && Object.hasOwnProperty.call(message, "status"))
  5233. writer.uint32(/* id 3, wireType 2 =*/26).string(message.status);
  5234. if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage"))
  5235. writer.uint32(/* id 4, wireType 2 =*/34).string(message.statusMessage);
  5236. return writer;
  5237. };
  5238. /**
  5239. * Encodes the specified WorkingGroupMetadata message, length delimited. Does not implicitly {@link WorkingGroupMetadata.verify|verify} messages.
  5240. * @function encodeDelimited
  5241. * @memberof WorkingGroupMetadata
  5242. * @static
  5243. * @param {IWorkingGroupMetadata} message WorkingGroupMetadata message or plain object to encode
  5244. * @param {$protobuf.Writer} [writer] Writer to encode to
  5245. * @returns {$protobuf.Writer} Writer
  5246. */
  5247. WorkingGroupMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  5248. return this.encode(message, writer).ldelim();
  5249. };
  5250. /**
  5251. * Decodes a WorkingGroupMetadata message from the specified reader or buffer.
  5252. * @function decode
  5253. * @memberof WorkingGroupMetadata
  5254. * @static
  5255. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5256. * @param {number} [length] Message length if known beforehand
  5257. * @returns {WorkingGroupMetadata} WorkingGroupMetadata
  5258. * @throws {Error} If the payload is not a reader or valid buffer
  5259. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5260. */
  5261. WorkingGroupMetadata.decode = function decode(reader, length) {
  5262. if (!(reader instanceof $Reader))
  5263. reader = $Reader.create(reader);
  5264. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.WorkingGroupMetadata();
  5265. while (reader.pos < end) {
  5266. var tag = reader.uint32();
  5267. switch (tag >>> 3) {
  5268. case 1:
  5269. message.description = reader.string();
  5270. break;
  5271. case 2:
  5272. message.about = reader.string();
  5273. break;
  5274. case 3:
  5275. message.status = reader.string();
  5276. break;
  5277. case 4:
  5278. message.statusMessage = reader.string();
  5279. break;
  5280. default:
  5281. reader.skipType(tag & 7);
  5282. break;
  5283. }
  5284. }
  5285. return message;
  5286. };
  5287. /**
  5288. * Decodes a WorkingGroupMetadata message from the specified reader or buffer, length delimited.
  5289. * @function decodeDelimited
  5290. * @memberof WorkingGroupMetadata
  5291. * @static
  5292. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5293. * @returns {WorkingGroupMetadata} WorkingGroupMetadata
  5294. * @throws {Error} If the payload is not a reader or valid buffer
  5295. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5296. */
  5297. WorkingGroupMetadata.decodeDelimited = function decodeDelimited(reader) {
  5298. if (!(reader instanceof $Reader))
  5299. reader = new $Reader(reader);
  5300. return this.decode(reader, reader.uint32());
  5301. };
  5302. /**
  5303. * Verifies a WorkingGroupMetadata message.
  5304. * @function verify
  5305. * @memberof WorkingGroupMetadata
  5306. * @static
  5307. * @param {Object.<string,*>} message Plain object to verify
  5308. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5309. */
  5310. WorkingGroupMetadata.verify = function verify(message) {
  5311. if (typeof message !== "object" || message === null)
  5312. return "object expected";
  5313. if (message.description != null && message.hasOwnProperty("description"))
  5314. if (!$util.isString(message.description))
  5315. return "description: string expected";
  5316. if (message.about != null && message.hasOwnProperty("about"))
  5317. if (!$util.isString(message.about))
  5318. return "about: string expected";
  5319. if (message.status != null && message.hasOwnProperty("status"))
  5320. if (!$util.isString(message.status))
  5321. return "status: string expected";
  5322. if (message.statusMessage != null && message.hasOwnProperty("statusMessage"))
  5323. if (!$util.isString(message.statusMessage))
  5324. return "statusMessage: string expected";
  5325. return null;
  5326. };
  5327. /**
  5328. * Creates a WorkingGroupMetadata message from a plain object. Also converts values to their respective internal types.
  5329. * @function fromObject
  5330. * @memberof WorkingGroupMetadata
  5331. * @static
  5332. * @param {Object.<string,*>} object Plain object
  5333. * @returns {WorkingGroupMetadata} WorkingGroupMetadata
  5334. */
  5335. WorkingGroupMetadata.fromObject = function fromObject(object) {
  5336. if (object instanceof $root.WorkingGroupMetadata)
  5337. return object;
  5338. var message = new $root.WorkingGroupMetadata();
  5339. if (object.description != null)
  5340. message.description = String(object.description);
  5341. if (object.about != null)
  5342. message.about = String(object.about);
  5343. if (object.status != null)
  5344. message.status = String(object.status);
  5345. if (object.statusMessage != null)
  5346. message.statusMessage = String(object.statusMessage);
  5347. return message;
  5348. };
  5349. /**
  5350. * Creates a plain object from a WorkingGroupMetadata message. Also converts values to other types if specified.
  5351. * @function toObject
  5352. * @memberof WorkingGroupMetadata
  5353. * @static
  5354. * @param {WorkingGroupMetadata} message WorkingGroupMetadata
  5355. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5356. * @returns {Object.<string,*>} Plain object
  5357. */
  5358. WorkingGroupMetadata.toObject = function toObject(message, options) {
  5359. if (!options)
  5360. options = {};
  5361. var object = {};
  5362. if (options.defaults) {
  5363. object.description = "";
  5364. object.about = "";
  5365. object.status = "";
  5366. object.statusMessage = "";
  5367. }
  5368. if (message.description != null && message.hasOwnProperty("description"))
  5369. object.description = message.description;
  5370. if (message.about != null && message.hasOwnProperty("about"))
  5371. object.about = message.about;
  5372. if (message.status != null && message.hasOwnProperty("status"))
  5373. object.status = message.status;
  5374. if (message.statusMessage != null && message.hasOwnProperty("statusMessage"))
  5375. object.statusMessage = message.statusMessage;
  5376. return object;
  5377. };
  5378. /**
  5379. * Converts this WorkingGroupMetadata to JSON.
  5380. * @function toJSON
  5381. * @memberof WorkingGroupMetadata
  5382. * @instance
  5383. * @returns {Object.<string,*>} JSON object
  5384. */
  5385. WorkingGroupMetadata.prototype.toJSON = function toJSON() {
  5386. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5387. };
  5388. return WorkingGroupMetadata;
  5389. })();
  5390. $root.SetGroupMetadata = (function() {
  5391. /**
  5392. * Properties of a SetGroupMetadata.
  5393. * @exports ISetGroupMetadata
  5394. * @interface ISetGroupMetadata
  5395. * @property {IWorkingGroupMetadata|null} [newMetadata] SetGroupMetadata newMetadata
  5396. */
  5397. /**
  5398. * Constructs a new SetGroupMetadata.
  5399. * @exports SetGroupMetadata
  5400. * @classdesc Represents a SetGroupMetadata.
  5401. * @implements ISetGroupMetadata
  5402. * @constructor
  5403. * @param {ISetGroupMetadata=} [properties] Properties to set
  5404. */
  5405. function SetGroupMetadata(properties) {
  5406. if (properties)
  5407. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  5408. if (properties[keys[i]] != null)
  5409. this[keys[i]] = properties[keys[i]];
  5410. }
  5411. /**
  5412. * SetGroupMetadata newMetadata.
  5413. * @member {IWorkingGroupMetadata|null|undefined} newMetadata
  5414. * @memberof SetGroupMetadata
  5415. * @instance
  5416. */
  5417. SetGroupMetadata.prototype.newMetadata = null;
  5418. /**
  5419. * Creates a new SetGroupMetadata instance using the specified properties.
  5420. * @function create
  5421. * @memberof SetGroupMetadata
  5422. * @static
  5423. * @param {ISetGroupMetadata=} [properties] Properties to set
  5424. * @returns {SetGroupMetadata} SetGroupMetadata instance
  5425. */
  5426. SetGroupMetadata.create = function create(properties) {
  5427. return new SetGroupMetadata(properties);
  5428. };
  5429. /**
  5430. * Encodes the specified SetGroupMetadata message. Does not implicitly {@link SetGroupMetadata.verify|verify} messages.
  5431. * @function encode
  5432. * @memberof SetGroupMetadata
  5433. * @static
  5434. * @param {ISetGroupMetadata} message SetGroupMetadata message or plain object to encode
  5435. * @param {$protobuf.Writer} [writer] Writer to encode to
  5436. * @returns {$protobuf.Writer} Writer
  5437. */
  5438. SetGroupMetadata.encode = function encode(message, writer) {
  5439. if (!writer)
  5440. writer = $Writer.create();
  5441. if (message.newMetadata != null && Object.hasOwnProperty.call(message, "newMetadata"))
  5442. $root.WorkingGroupMetadata.encode(message.newMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
  5443. return writer;
  5444. };
  5445. /**
  5446. * Encodes the specified SetGroupMetadata message, length delimited. Does not implicitly {@link SetGroupMetadata.verify|verify} messages.
  5447. * @function encodeDelimited
  5448. * @memberof SetGroupMetadata
  5449. * @static
  5450. * @param {ISetGroupMetadata} message SetGroupMetadata message or plain object to encode
  5451. * @param {$protobuf.Writer} [writer] Writer to encode to
  5452. * @returns {$protobuf.Writer} Writer
  5453. */
  5454. SetGroupMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  5455. return this.encode(message, writer).ldelim();
  5456. };
  5457. /**
  5458. * Decodes a SetGroupMetadata message from the specified reader or buffer.
  5459. * @function decode
  5460. * @memberof SetGroupMetadata
  5461. * @static
  5462. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5463. * @param {number} [length] Message length if known beforehand
  5464. * @returns {SetGroupMetadata} SetGroupMetadata
  5465. * @throws {Error} If the payload is not a reader or valid buffer
  5466. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5467. */
  5468. SetGroupMetadata.decode = function decode(reader, length) {
  5469. if (!(reader instanceof $Reader))
  5470. reader = $Reader.create(reader);
  5471. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SetGroupMetadata();
  5472. while (reader.pos < end) {
  5473. var tag = reader.uint32();
  5474. switch (tag >>> 3) {
  5475. case 1:
  5476. message.newMetadata = $root.WorkingGroupMetadata.decode(reader, reader.uint32());
  5477. break;
  5478. default:
  5479. reader.skipType(tag & 7);
  5480. break;
  5481. }
  5482. }
  5483. return message;
  5484. };
  5485. /**
  5486. * Decodes a SetGroupMetadata message from the specified reader or buffer, length delimited.
  5487. * @function decodeDelimited
  5488. * @memberof SetGroupMetadata
  5489. * @static
  5490. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5491. * @returns {SetGroupMetadata} SetGroupMetadata
  5492. * @throws {Error} If the payload is not a reader or valid buffer
  5493. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5494. */
  5495. SetGroupMetadata.decodeDelimited = function decodeDelimited(reader) {
  5496. if (!(reader instanceof $Reader))
  5497. reader = new $Reader(reader);
  5498. return this.decode(reader, reader.uint32());
  5499. };
  5500. /**
  5501. * Verifies a SetGroupMetadata message.
  5502. * @function verify
  5503. * @memberof SetGroupMetadata
  5504. * @static
  5505. * @param {Object.<string,*>} message Plain object to verify
  5506. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5507. */
  5508. SetGroupMetadata.verify = function verify(message) {
  5509. if (typeof message !== "object" || message === null)
  5510. return "object expected";
  5511. if (message.newMetadata != null && message.hasOwnProperty("newMetadata")) {
  5512. var error = $root.WorkingGroupMetadata.verify(message.newMetadata);
  5513. if (error)
  5514. return "newMetadata." + error;
  5515. }
  5516. return null;
  5517. };
  5518. /**
  5519. * Creates a SetGroupMetadata message from a plain object. Also converts values to their respective internal types.
  5520. * @function fromObject
  5521. * @memberof SetGroupMetadata
  5522. * @static
  5523. * @param {Object.<string,*>} object Plain object
  5524. * @returns {SetGroupMetadata} SetGroupMetadata
  5525. */
  5526. SetGroupMetadata.fromObject = function fromObject(object) {
  5527. if (object instanceof $root.SetGroupMetadata)
  5528. return object;
  5529. var message = new $root.SetGroupMetadata();
  5530. if (object.newMetadata != null) {
  5531. if (typeof object.newMetadata !== "object")
  5532. throw TypeError(".SetGroupMetadata.newMetadata: object expected");
  5533. message.newMetadata = $root.WorkingGroupMetadata.fromObject(object.newMetadata);
  5534. }
  5535. return message;
  5536. };
  5537. /**
  5538. * Creates a plain object from a SetGroupMetadata message. Also converts values to other types if specified.
  5539. * @function toObject
  5540. * @memberof SetGroupMetadata
  5541. * @static
  5542. * @param {SetGroupMetadata} message SetGroupMetadata
  5543. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5544. * @returns {Object.<string,*>} Plain object
  5545. */
  5546. SetGroupMetadata.toObject = function toObject(message, options) {
  5547. if (!options)
  5548. options = {};
  5549. var object = {};
  5550. if (options.defaults)
  5551. object.newMetadata = null;
  5552. if (message.newMetadata != null && message.hasOwnProperty("newMetadata"))
  5553. object.newMetadata = $root.WorkingGroupMetadata.toObject(message.newMetadata, options);
  5554. return object;
  5555. };
  5556. /**
  5557. * Converts this SetGroupMetadata to JSON.
  5558. * @function toJSON
  5559. * @memberof SetGroupMetadata
  5560. * @instance
  5561. * @returns {Object.<string,*>} JSON object
  5562. */
  5563. SetGroupMetadata.prototype.toJSON = function toJSON() {
  5564. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5565. };
  5566. return SetGroupMetadata;
  5567. })();
  5568. $root.AddUpcomingOpening = (function() {
  5569. /**
  5570. * Properties of an AddUpcomingOpening.
  5571. * @exports IAddUpcomingOpening
  5572. * @interface IAddUpcomingOpening
  5573. * @property {IUpcomingOpeningMetadata|null} [metadata] AddUpcomingOpening metadata
  5574. */
  5575. /**
  5576. * Constructs a new AddUpcomingOpening.
  5577. * @exports AddUpcomingOpening
  5578. * @classdesc Represents an AddUpcomingOpening.
  5579. * @implements IAddUpcomingOpening
  5580. * @constructor
  5581. * @param {IAddUpcomingOpening=} [properties] Properties to set
  5582. */
  5583. function AddUpcomingOpening(properties) {
  5584. if (properties)
  5585. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  5586. if (properties[keys[i]] != null)
  5587. this[keys[i]] = properties[keys[i]];
  5588. }
  5589. /**
  5590. * AddUpcomingOpening metadata.
  5591. * @member {IUpcomingOpeningMetadata|null|undefined} metadata
  5592. * @memberof AddUpcomingOpening
  5593. * @instance
  5594. */
  5595. AddUpcomingOpening.prototype.metadata = null;
  5596. /**
  5597. * Creates a new AddUpcomingOpening instance using the specified properties.
  5598. * @function create
  5599. * @memberof AddUpcomingOpening
  5600. * @static
  5601. * @param {IAddUpcomingOpening=} [properties] Properties to set
  5602. * @returns {AddUpcomingOpening} AddUpcomingOpening instance
  5603. */
  5604. AddUpcomingOpening.create = function create(properties) {
  5605. return new AddUpcomingOpening(properties);
  5606. };
  5607. /**
  5608. * Encodes the specified AddUpcomingOpening message. Does not implicitly {@link AddUpcomingOpening.verify|verify} messages.
  5609. * @function encode
  5610. * @memberof AddUpcomingOpening
  5611. * @static
  5612. * @param {IAddUpcomingOpening} message AddUpcomingOpening message or plain object to encode
  5613. * @param {$protobuf.Writer} [writer] Writer to encode to
  5614. * @returns {$protobuf.Writer} Writer
  5615. */
  5616. AddUpcomingOpening.encode = function encode(message, writer) {
  5617. if (!writer)
  5618. writer = $Writer.create();
  5619. if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
  5620. $root.UpcomingOpeningMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
  5621. return writer;
  5622. };
  5623. /**
  5624. * Encodes the specified AddUpcomingOpening message, length delimited. Does not implicitly {@link AddUpcomingOpening.verify|verify} messages.
  5625. * @function encodeDelimited
  5626. * @memberof AddUpcomingOpening
  5627. * @static
  5628. * @param {IAddUpcomingOpening} message AddUpcomingOpening message or plain object to encode
  5629. * @param {$protobuf.Writer} [writer] Writer to encode to
  5630. * @returns {$protobuf.Writer} Writer
  5631. */
  5632. AddUpcomingOpening.encodeDelimited = function encodeDelimited(message, writer) {
  5633. return this.encode(message, writer).ldelim();
  5634. };
  5635. /**
  5636. * Decodes an AddUpcomingOpening message from the specified reader or buffer.
  5637. * @function decode
  5638. * @memberof AddUpcomingOpening
  5639. * @static
  5640. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5641. * @param {number} [length] Message length if known beforehand
  5642. * @returns {AddUpcomingOpening} AddUpcomingOpening
  5643. * @throws {Error} If the payload is not a reader or valid buffer
  5644. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5645. */
  5646. AddUpcomingOpening.decode = function decode(reader, length) {
  5647. if (!(reader instanceof $Reader))
  5648. reader = $Reader.create(reader);
  5649. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AddUpcomingOpening();
  5650. while (reader.pos < end) {
  5651. var tag = reader.uint32();
  5652. switch (tag >>> 3) {
  5653. case 1:
  5654. message.metadata = $root.UpcomingOpeningMetadata.decode(reader, reader.uint32());
  5655. break;
  5656. default:
  5657. reader.skipType(tag & 7);
  5658. break;
  5659. }
  5660. }
  5661. return message;
  5662. };
  5663. /**
  5664. * Decodes an AddUpcomingOpening message from the specified reader or buffer, length delimited.
  5665. * @function decodeDelimited
  5666. * @memberof AddUpcomingOpening
  5667. * @static
  5668. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5669. * @returns {AddUpcomingOpening} AddUpcomingOpening
  5670. * @throws {Error} If the payload is not a reader or valid buffer
  5671. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5672. */
  5673. AddUpcomingOpening.decodeDelimited = function decodeDelimited(reader) {
  5674. if (!(reader instanceof $Reader))
  5675. reader = new $Reader(reader);
  5676. return this.decode(reader, reader.uint32());
  5677. };
  5678. /**
  5679. * Verifies an AddUpcomingOpening message.
  5680. * @function verify
  5681. * @memberof AddUpcomingOpening
  5682. * @static
  5683. * @param {Object.<string,*>} message Plain object to verify
  5684. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5685. */
  5686. AddUpcomingOpening.verify = function verify(message) {
  5687. if (typeof message !== "object" || message === null)
  5688. return "object expected";
  5689. if (message.metadata != null && message.hasOwnProperty("metadata")) {
  5690. var error = $root.UpcomingOpeningMetadata.verify(message.metadata);
  5691. if (error)
  5692. return "metadata." + error;
  5693. }
  5694. return null;
  5695. };
  5696. /**
  5697. * Creates an AddUpcomingOpening message from a plain object. Also converts values to their respective internal types.
  5698. * @function fromObject
  5699. * @memberof AddUpcomingOpening
  5700. * @static
  5701. * @param {Object.<string,*>} object Plain object
  5702. * @returns {AddUpcomingOpening} AddUpcomingOpening
  5703. */
  5704. AddUpcomingOpening.fromObject = function fromObject(object) {
  5705. if (object instanceof $root.AddUpcomingOpening)
  5706. return object;
  5707. var message = new $root.AddUpcomingOpening();
  5708. if (object.metadata != null) {
  5709. if (typeof object.metadata !== "object")
  5710. throw TypeError(".AddUpcomingOpening.metadata: object expected");
  5711. message.metadata = $root.UpcomingOpeningMetadata.fromObject(object.metadata);
  5712. }
  5713. return message;
  5714. };
  5715. /**
  5716. * Creates a plain object from an AddUpcomingOpening message. Also converts values to other types if specified.
  5717. * @function toObject
  5718. * @memberof AddUpcomingOpening
  5719. * @static
  5720. * @param {AddUpcomingOpening} message AddUpcomingOpening
  5721. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5722. * @returns {Object.<string,*>} Plain object
  5723. */
  5724. AddUpcomingOpening.toObject = function toObject(message, options) {
  5725. if (!options)
  5726. options = {};
  5727. var object = {};
  5728. if (options.defaults)
  5729. object.metadata = null;
  5730. if (message.metadata != null && message.hasOwnProperty("metadata"))
  5731. object.metadata = $root.UpcomingOpeningMetadata.toObject(message.metadata, options);
  5732. return object;
  5733. };
  5734. /**
  5735. * Converts this AddUpcomingOpening to JSON.
  5736. * @function toJSON
  5737. * @memberof AddUpcomingOpening
  5738. * @instance
  5739. * @returns {Object.<string,*>} JSON object
  5740. */
  5741. AddUpcomingOpening.prototype.toJSON = function toJSON() {
  5742. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5743. };
  5744. return AddUpcomingOpening;
  5745. })();
  5746. $root.RemoveUpcomingOpening = (function() {
  5747. /**
  5748. * Properties of a RemoveUpcomingOpening.
  5749. * @exports IRemoveUpcomingOpening
  5750. * @interface IRemoveUpcomingOpening
  5751. * @property {string|null} [id] RemoveUpcomingOpening id
  5752. */
  5753. /**
  5754. * Constructs a new RemoveUpcomingOpening.
  5755. * @exports RemoveUpcomingOpening
  5756. * @classdesc Represents a RemoveUpcomingOpening.
  5757. * @implements IRemoveUpcomingOpening
  5758. * @constructor
  5759. * @param {IRemoveUpcomingOpening=} [properties] Properties to set
  5760. */
  5761. function RemoveUpcomingOpening(properties) {
  5762. if (properties)
  5763. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  5764. if (properties[keys[i]] != null)
  5765. this[keys[i]] = properties[keys[i]];
  5766. }
  5767. /**
  5768. * RemoveUpcomingOpening id.
  5769. * @member {string} id
  5770. * @memberof RemoveUpcomingOpening
  5771. * @instance
  5772. */
  5773. RemoveUpcomingOpening.prototype.id = "";
  5774. /**
  5775. * Creates a new RemoveUpcomingOpening instance using the specified properties.
  5776. * @function create
  5777. * @memberof RemoveUpcomingOpening
  5778. * @static
  5779. * @param {IRemoveUpcomingOpening=} [properties] Properties to set
  5780. * @returns {RemoveUpcomingOpening} RemoveUpcomingOpening instance
  5781. */
  5782. RemoveUpcomingOpening.create = function create(properties) {
  5783. return new RemoveUpcomingOpening(properties);
  5784. };
  5785. /**
  5786. * Encodes the specified RemoveUpcomingOpening message. Does not implicitly {@link RemoveUpcomingOpening.verify|verify} messages.
  5787. * @function encode
  5788. * @memberof RemoveUpcomingOpening
  5789. * @static
  5790. * @param {IRemoveUpcomingOpening} message RemoveUpcomingOpening message or plain object to encode
  5791. * @param {$protobuf.Writer} [writer] Writer to encode to
  5792. * @returns {$protobuf.Writer} Writer
  5793. */
  5794. RemoveUpcomingOpening.encode = function encode(message, writer) {
  5795. if (!writer)
  5796. writer = $Writer.create();
  5797. if (message.id != null && Object.hasOwnProperty.call(message, "id"))
  5798. writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
  5799. return writer;
  5800. };
  5801. /**
  5802. * Encodes the specified RemoveUpcomingOpening message, length delimited. Does not implicitly {@link RemoveUpcomingOpening.verify|verify} messages.
  5803. * @function encodeDelimited
  5804. * @memberof RemoveUpcomingOpening
  5805. * @static
  5806. * @param {IRemoveUpcomingOpening} message RemoveUpcomingOpening message or plain object to encode
  5807. * @param {$protobuf.Writer} [writer] Writer to encode to
  5808. * @returns {$protobuf.Writer} Writer
  5809. */
  5810. RemoveUpcomingOpening.encodeDelimited = function encodeDelimited(message, writer) {
  5811. return this.encode(message, writer).ldelim();
  5812. };
  5813. /**
  5814. * Decodes a RemoveUpcomingOpening message from the specified reader or buffer.
  5815. * @function decode
  5816. * @memberof RemoveUpcomingOpening
  5817. * @static
  5818. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5819. * @param {number} [length] Message length if known beforehand
  5820. * @returns {RemoveUpcomingOpening} RemoveUpcomingOpening
  5821. * @throws {Error} If the payload is not a reader or valid buffer
  5822. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5823. */
  5824. RemoveUpcomingOpening.decode = function decode(reader, length) {
  5825. if (!(reader instanceof $Reader))
  5826. reader = $Reader.create(reader);
  5827. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.RemoveUpcomingOpening();
  5828. while (reader.pos < end) {
  5829. var tag = reader.uint32();
  5830. switch (tag >>> 3) {
  5831. case 1:
  5832. message.id = reader.string();
  5833. break;
  5834. default:
  5835. reader.skipType(tag & 7);
  5836. break;
  5837. }
  5838. }
  5839. return message;
  5840. };
  5841. /**
  5842. * Decodes a RemoveUpcomingOpening message from the specified reader or buffer, length delimited.
  5843. * @function decodeDelimited
  5844. * @memberof RemoveUpcomingOpening
  5845. * @static
  5846. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  5847. * @returns {RemoveUpcomingOpening} RemoveUpcomingOpening
  5848. * @throws {Error} If the payload is not a reader or valid buffer
  5849. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  5850. */
  5851. RemoveUpcomingOpening.decodeDelimited = function decodeDelimited(reader) {
  5852. if (!(reader instanceof $Reader))
  5853. reader = new $Reader(reader);
  5854. return this.decode(reader, reader.uint32());
  5855. };
  5856. /**
  5857. * Verifies a RemoveUpcomingOpening message.
  5858. * @function verify
  5859. * @memberof RemoveUpcomingOpening
  5860. * @static
  5861. * @param {Object.<string,*>} message Plain object to verify
  5862. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  5863. */
  5864. RemoveUpcomingOpening.verify = function verify(message) {
  5865. if (typeof message !== "object" || message === null)
  5866. return "object expected";
  5867. if (message.id != null && message.hasOwnProperty("id"))
  5868. if (!$util.isString(message.id))
  5869. return "id: string expected";
  5870. return null;
  5871. };
  5872. /**
  5873. * Creates a RemoveUpcomingOpening message from a plain object. Also converts values to their respective internal types.
  5874. * @function fromObject
  5875. * @memberof RemoveUpcomingOpening
  5876. * @static
  5877. * @param {Object.<string,*>} object Plain object
  5878. * @returns {RemoveUpcomingOpening} RemoveUpcomingOpening
  5879. */
  5880. RemoveUpcomingOpening.fromObject = function fromObject(object) {
  5881. if (object instanceof $root.RemoveUpcomingOpening)
  5882. return object;
  5883. var message = new $root.RemoveUpcomingOpening();
  5884. if (object.id != null)
  5885. message.id = String(object.id);
  5886. return message;
  5887. };
  5888. /**
  5889. * Creates a plain object from a RemoveUpcomingOpening message. Also converts values to other types if specified.
  5890. * @function toObject
  5891. * @memberof RemoveUpcomingOpening
  5892. * @static
  5893. * @param {RemoveUpcomingOpening} message RemoveUpcomingOpening
  5894. * @param {$protobuf.IConversionOptions} [options] Conversion options
  5895. * @returns {Object.<string,*>} Plain object
  5896. */
  5897. RemoveUpcomingOpening.toObject = function toObject(message, options) {
  5898. if (!options)
  5899. options = {};
  5900. var object = {};
  5901. if (options.defaults)
  5902. object.id = "";
  5903. if (message.id != null && message.hasOwnProperty("id"))
  5904. object.id = message.id;
  5905. return object;
  5906. };
  5907. /**
  5908. * Converts this RemoveUpcomingOpening to JSON.
  5909. * @function toJSON
  5910. * @memberof RemoveUpcomingOpening
  5911. * @instance
  5912. * @returns {Object.<string,*>} JSON object
  5913. */
  5914. RemoveUpcomingOpening.prototype.toJSON = function toJSON() {
  5915. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  5916. };
  5917. return RemoveUpcomingOpening;
  5918. })();
  5919. $root.WorkingGroupMetadataAction = (function() {
  5920. /**
  5921. * Properties of a WorkingGroupMetadataAction.
  5922. * @exports IWorkingGroupMetadataAction
  5923. * @interface IWorkingGroupMetadataAction
  5924. * @property {ISetGroupMetadata|null} [setGroupMetadata] WorkingGroupMetadataAction setGroupMetadata
  5925. * @property {IAddUpcomingOpening|null} [addUpcomingOpening] WorkingGroupMetadataAction addUpcomingOpening
  5926. * @property {IRemoveUpcomingOpening|null} [removeUpcomingOpening] WorkingGroupMetadataAction removeUpcomingOpening
  5927. */
  5928. /**
  5929. * Constructs a new WorkingGroupMetadataAction.
  5930. * @exports WorkingGroupMetadataAction
  5931. * @classdesc Represents a WorkingGroupMetadataAction.
  5932. * @implements IWorkingGroupMetadataAction
  5933. * @constructor
  5934. * @param {IWorkingGroupMetadataAction=} [properties] Properties to set
  5935. */
  5936. function WorkingGroupMetadataAction(properties) {
  5937. if (properties)
  5938. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  5939. if (properties[keys[i]] != null)
  5940. this[keys[i]] = properties[keys[i]];
  5941. }
  5942. /**
  5943. * WorkingGroupMetadataAction setGroupMetadata.
  5944. * @member {ISetGroupMetadata|null|undefined} setGroupMetadata
  5945. * @memberof WorkingGroupMetadataAction
  5946. * @instance
  5947. */
  5948. WorkingGroupMetadataAction.prototype.setGroupMetadata = null;
  5949. /**
  5950. * WorkingGroupMetadataAction addUpcomingOpening.
  5951. * @member {IAddUpcomingOpening|null|undefined} addUpcomingOpening
  5952. * @memberof WorkingGroupMetadataAction
  5953. * @instance
  5954. */
  5955. WorkingGroupMetadataAction.prototype.addUpcomingOpening = null;
  5956. /**
  5957. * WorkingGroupMetadataAction removeUpcomingOpening.
  5958. * @member {IRemoveUpcomingOpening|null|undefined} removeUpcomingOpening
  5959. * @memberof WorkingGroupMetadataAction
  5960. * @instance
  5961. */
  5962. WorkingGroupMetadataAction.prototype.removeUpcomingOpening = null;
  5963. // OneOf field names bound to virtual getters and setters
  5964. var $oneOfFields;
  5965. /**
  5966. * WorkingGroupMetadataAction action.
  5967. * @member {"setGroupMetadata"|"addUpcomingOpening"|"removeUpcomingOpening"|undefined} action
  5968. * @memberof WorkingGroupMetadataAction
  5969. * @instance
  5970. */
  5971. Object.defineProperty(WorkingGroupMetadataAction.prototype, "action", {
  5972. get: $util.oneOfGetter($oneOfFields = ["setGroupMetadata", "addUpcomingOpening", "removeUpcomingOpening"]),
  5973. set: $util.oneOfSetter($oneOfFields)
  5974. });
  5975. /**
  5976. * Creates a new WorkingGroupMetadataAction instance using the specified properties.
  5977. * @function create
  5978. * @memberof WorkingGroupMetadataAction
  5979. * @static
  5980. * @param {IWorkingGroupMetadataAction=} [properties] Properties to set
  5981. * @returns {WorkingGroupMetadataAction} WorkingGroupMetadataAction instance
  5982. */
  5983. WorkingGroupMetadataAction.create = function create(properties) {
  5984. return new WorkingGroupMetadataAction(properties);
  5985. };
  5986. /**
  5987. * Encodes the specified WorkingGroupMetadataAction message. Does not implicitly {@link WorkingGroupMetadataAction.verify|verify} messages.
  5988. * @function encode
  5989. * @memberof WorkingGroupMetadataAction
  5990. * @static
  5991. * @param {IWorkingGroupMetadataAction} message WorkingGroupMetadataAction message or plain object to encode
  5992. * @param {$protobuf.Writer} [writer] Writer to encode to
  5993. * @returns {$protobuf.Writer} Writer
  5994. */
  5995. WorkingGroupMetadataAction.encode = function encode(message, writer) {
  5996. if (!writer)
  5997. writer = $Writer.create();
  5998. if (message.setGroupMetadata != null && Object.hasOwnProperty.call(message, "setGroupMetadata"))
  5999. $root.SetGroupMetadata.encode(message.setGroupMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
  6000. if (message.addUpcomingOpening != null && Object.hasOwnProperty.call(message, "addUpcomingOpening"))
  6001. $root.AddUpcomingOpening.encode(message.addUpcomingOpening, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
  6002. if (message.removeUpcomingOpening != null && Object.hasOwnProperty.call(message, "removeUpcomingOpening"))
  6003. $root.RemoveUpcomingOpening.encode(message.removeUpcomingOpening, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
  6004. return writer;
  6005. };
  6006. /**
  6007. * Encodes the specified WorkingGroupMetadataAction message, length delimited. Does not implicitly {@link WorkingGroupMetadataAction.verify|verify} messages.
  6008. * @function encodeDelimited
  6009. * @memberof WorkingGroupMetadataAction
  6010. * @static
  6011. * @param {IWorkingGroupMetadataAction} message WorkingGroupMetadataAction message or plain object to encode
  6012. * @param {$protobuf.Writer} [writer] Writer to encode to
  6013. * @returns {$protobuf.Writer} Writer
  6014. */
  6015. WorkingGroupMetadataAction.encodeDelimited = function encodeDelimited(message, writer) {
  6016. return this.encode(message, writer).ldelim();
  6017. };
  6018. /**
  6019. * Decodes a WorkingGroupMetadataAction message from the specified reader or buffer.
  6020. * @function decode
  6021. * @memberof WorkingGroupMetadataAction
  6022. * @static
  6023. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  6024. * @param {number} [length] Message length if known beforehand
  6025. * @returns {WorkingGroupMetadataAction} WorkingGroupMetadataAction
  6026. * @throws {Error} If the payload is not a reader or valid buffer
  6027. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  6028. */
  6029. WorkingGroupMetadataAction.decode = function decode(reader, length) {
  6030. if (!(reader instanceof $Reader))
  6031. reader = $Reader.create(reader);
  6032. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.WorkingGroupMetadataAction();
  6033. while (reader.pos < end) {
  6034. var tag = reader.uint32();
  6035. switch (tag >>> 3) {
  6036. case 1:
  6037. message.setGroupMetadata = $root.SetGroupMetadata.decode(reader, reader.uint32());
  6038. break;
  6039. case 2:
  6040. message.addUpcomingOpening = $root.AddUpcomingOpening.decode(reader, reader.uint32());
  6041. break;
  6042. case 3:
  6043. message.removeUpcomingOpening = $root.RemoveUpcomingOpening.decode(reader, reader.uint32());
  6044. break;
  6045. default:
  6046. reader.skipType(tag & 7);
  6047. break;
  6048. }
  6049. }
  6050. return message;
  6051. };
  6052. /**
  6053. * Decodes a WorkingGroupMetadataAction message from the specified reader or buffer, length delimited.
  6054. * @function decodeDelimited
  6055. * @memberof WorkingGroupMetadataAction
  6056. * @static
  6057. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  6058. * @returns {WorkingGroupMetadataAction} WorkingGroupMetadataAction
  6059. * @throws {Error} If the payload is not a reader or valid buffer
  6060. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  6061. */
  6062. WorkingGroupMetadataAction.decodeDelimited = function decodeDelimited(reader) {
  6063. if (!(reader instanceof $Reader))
  6064. reader = new $Reader(reader);
  6065. return this.decode(reader, reader.uint32());
  6066. };
  6067. /**
  6068. * Verifies a WorkingGroupMetadataAction message.
  6069. * @function verify
  6070. * @memberof WorkingGroupMetadataAction
  6071. * @static
  6072. * @param {Object.<string,*>} message Plain object to verify
  6073. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  6074. */
  6075. WorkingGroupMetadataAction.verify = function verify(message) {
  6076. if (typeof message !== "object" || message === null)
  6077. return "object expected";
  6078. var properties = {};
  6079. if (message.setGroupMetadata != null && message.hasOwnProperty("setGroupMetadata")) {
  6080. properties.action = 1;
  6081. {
  6082. var error = $root.SetGroupMetadata.verify(message.setGroupMetadata);
  6083. if (error)
  6084. return "setGroupMetadata." + error;
  6085. }
  6086. }
  6087. if (message.addUpcomingOpening != null && message.hasOwnProperty("addUpcomingOpening")) {
  6088. if (properties.action === 1)
  6089. return "action: multiple values";
  6090. properties.action = 1;
  6091. {
  6092. var error = $root.AddUpcomingOpening.verify(message.addUpcomingOpening);
  6093. if (error)
  6094. return "addUpcomingOpening." + error;
  6095. }
  6096. }
  6097. if (message.removeUpcomingOpening != null && message.hasOwnProperty("removeUpcomingOpening")) {
  6098. if (properties.action === 1)
  6099. return "action: multiple values";
  6100. properties.action = 1;
  6101. {
  6102. var error = $root.RemoveUpcomingOpening.verify(message.removeUpcomingOpening);
  6103. if (error)
  6104. return "removeUpcomingOpening." + error;
  6105. }
  6106. }
  6107. return null;
  6108. };
  6109. /**
  6110. * Creates a WorkingGroupMetadataAction message from a plain object. Also converts values to their respective internal types.
  6111. * @function fromObject
  6112. * @memberof WorkingGroupMetadataAction
  6113. * @static
  6114. * @param {Object.<string,*>} object Plain object
  6115. * @returns {WorkingGroupMetadataAction} WorkingGroupMetadataAction
  6116. */
  6117. WorkingGroupMetadataAction.fromObject = function fromObject(object) {
  6118. if (object instanceof $root.WorkingGroupMetadataAction)
  6119. return object;
  6120. var message = new $root.WorkingGroupMetadataAction();
  6121. if (object.setGroupMetadata != null) {
  6122. if (typeof object.setGroupMetadata !== "object")
  6123. throw TypeError(".WorkingGroupMetadataAction.setGroupMetadata: object expected");
  6124. message.setGroupMetadata = $root.SetGroupMetadata.fromObject(object.setGroupMetadata);
  6125. }
  6126. if (object.addUpcomingOpening != null) {
  6127. if (typeof object.addUpcomingOpening !== "object")
  6128. throw TypeError(".WorkingGroupMetadataAction.addUpcomingOpening: object expected");
  6129. message.addUpcomingOpening = $root.AddUpcomingOpening.fromObject(object.addUpcomingOpening);
  6130. }
  6131. if (object.removeUpcomingOpening != null) {
  6132. if (typeof object.removeUpcomingOpening !== "object")
  6133. throw TypeError(".WorkingGroupMetadataAction.removeUpcomingOpening: object expected");
  6134. message.removeUpcomingOpening = $root.RemoveUpcomingOpening.fromObject(object.removeUpcomingOpening);
  6135. }
  6136. return message;
  6137. };
  6138. /**
  6139. * Creates a plain object from a WorkingGroupMetadataAction message. Also converts values to other types if specified.
  6140. * @function toObject
  6141. * @memberof WorkingGroupMetadataAction
  6142. * @static
  6143. * @param {WorkingGroupMetadataAction} message WorkingGroupMetadataAction
  6144. * @param {$protobuf.IConversionOptions} [options] Conversion options
  6145. * @returns {Object.<string,*>} Plain object
  6146. */
  6147. WorkingGroupMetadataAction.toObject = function toObject(message, options) {
  6148. if (!options)
  6149. options = {};
  6150. var object = {};
  6151. if (message.setGroupMetadata != null && message.hasOwnProperty("setGroupMetadata")) {
  6152. object.setGroupMetadata = $root.SetGroupMetadata.toObject(message.setGroupMetadata, options);
  6153. if (options.oneofs)
  6154. object.action = "setGroupMetadata";
  6155. }
  6156. if (message.addUpcomingOpening != null && message.hasOwnProperty("addUpcomingOpening")) {
  6157. object.addUpcomingOpening = $root.AddUpcomingOpening.toObject(message.addUpcomingOpening, options);
  6158. if (options.oneofs)
  6159. object.action = "addUpcomingOpening";
  6160. }
  6161. if (message.removeUpcomingOpening != null && message.hasOwnProperty("removeUpcomingOpening")) {
  6162. object.removeUpcomingOpening = $root.RemoveUpcomingOpening.toObject(message.removeUpcomingOpening, options);
  6163. if (options.oneofs)
  6164. object.action = "removeUpcomingOpening";
  6165. }
  6166. return object;
  6167. };
  6168. /**
  6169. * Converts this WorkingGroupMetadataAction to JSON.
  6170. * @function toJSON
  6171. * @memberof WorkingGroupMetadataAction
  6172. * @instance
  6173. * @returns {Object.<string,*>} JSON object
  6174. */
  6175. WorkingGroupMetadataAction.prototype.toJSON = function toJSON() {
  6176. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  6177. };
  6178. return WorkingGroupMetadataAction;
  6179. })();
  6180. module.exports = $root;