channel.go 338 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587
  1. // Code generated by Thrift Compiler (0.15.0). DO NOT EDIT.
  2. package channel
  3. import (
  4. "bytes"
  5. "context"
  6. "database/sql/driver"
  7. "errors"
  8. "fmt"
  9. "time"
  10. "github.com/bashery/thrift"
  11. )
  12. // (needed to ensure safety because of naive import list construction.)
  13. var _ = thrift.ZERO
  14. var _ = fmt.Printf
  15. var _ = context.Background
  16. var _ = time.Now
  17. var _ = bytes.Equal
  18. type AppStoreCode int64
  19. const (
  20. AppStoreCode_PAYMENT_APPLE AppStoreCode = 1
  21. AppStoreCode_PAYMENT_GOOGLE AppStoreCode = 2
  22. )
  23. func (p AppStoreCode) String() string {
  24. switch p {
  25. case AppStoreCode_PAYMENT_APPLE: return "PAYMENT_APPLE"
  26. case AppStoreCode_PAYMENT_GOOGLE: return "PAYMENT_GOOGLE"
  27. }
  28. return "<UNSET>"
  29. }
  30. func AppStoreCodeFromString(s string) (AppStoreCode, error) {
  31. switch s {
  32. case "PAYMENT_APPLE": return AppStoreCode_PAYMENT_APPLE, nil
  33. case "PAYMENT_GOOGLE": return AppStoreCode_PAYMENT_GOOGLE, nil
  34. }
  35. return AppStoreCode(0), fmt.Errorf("not a valid AppStoreCode string")
  36. }
  37. func AppStoreCodePtr(v AppStoreCode) *AppStoreCode { return &v }
  38. func (p AppStoreCode) MarshalText() ([]byte, error) {
  39. return []byte(p.String()), nil
  40. }
  41. func (p *AppStoreCode) UnmarshalText(text []byte) error {
  42. q, err := AppStoreCodeFromString(string(text))
  43. if (err != nil) {
  44. return err
  45. }
  46. *p = q
  47. return nil
  48. }
  49. func (p *AppStoreCode) Scan(value interface{}) error {
  50. v, ok := value.(int64)
  51. if !ok {
  52. return errors.New("Scan value is not int64")
  53. }
  54. *p = AppStoreCode(v)
  55. return nil
  56. }
  57. func (p * AppStoreCode) Value() (driver.Value, error) {
  58. if p == nil {
  59. return nil, nil
  60. }
  61. return int64(*p), nil
  62. }
  63. type ChannelAllowedPermission int64
  64. const (
  65. ChannelAllowedPermission_PROFILE ChannelAllowedPermission = 0
  66. ChannelAllowedPermission_FRIENDS ChannelAllowedPermission = 1
  67. ChannelAllowedPermission_GROUP ChannelAllowedPermission = 2
  68. )
  69. func (p ChannelAllowedPermission) String() string {
  70. switch p {
  71. case ChannelAllowedPermission_PROFILE: return "PROFILE"
  72. case ChannelAllowedPermission_FRIENDS: return "FRIENDS"
  73. case ChannelAllowedPermission_GROUP: return "GROUP"
  74. }
  75. return "<UNSET>"
  76. }
  77. func ChannelAllowedPermissionFromString(s string) (ChannelAllowedPermission, error) {
  78. switch s {
  79. case "PROFILE": return ChannelAllowedPermission_PROFILE, nil
  80. case "FRIENDS": return ChannelAllowedPermission_FRIENDS, nil
  81. case "GROUP": return ChannelAllowedPermission_GROUP, nil
  82. }
  83. return ChannelAllowedPermission(0), fmt.Errorf("not a valid ChannelAllowedPermission string")
  84. }
  85. func ChannelAllowedPermissionPtr(v ChannelAllowedPermission) *ChannelAllowedPermission { return &v }
  86. func (p ChannelAllowedPermission) MarshalText() ([]byte, error) {
  87. return []byte(p.String()), nil
  88. }
  89. func (p *ChannelAllowedPermission) UnmarshalText(text []byte) error {
  90. q, err := ChannelAllowedPermissionFromString(string(text))
  91. if (err != nil) {
  92. return err
  93. }
  94. *p = q
  95. return nil
  96. }
  97. func (p *ChannelAllowedPermission) Scan(value interface{}) error {
  98. v, ok := value.(int64)
  99. if !ok {
  100. return errors.New("Scan value is not int64")
  101. }
  102. *p = ChannelAllowedPermission(v)
  103. return nil
  104. }
  105. func (p * ChannelAllowedPermission) Value() (driver.Value, error) {
  106. if p == nil {
  107. return nil, nil
  108. }
  109. return int64(*p), nil
  110. }
  111. type ChannelConfiguration int64
  112. const (
  113. ChannelConfiguration_MESSAGE ChannelConfiguration = 0
  114. ChannelConfiguration_MESSAGE_NOTIFICATION ChannelConfiguration = 1
  115. ChannelConfiguration_NOTIFICATION_CENTER ChannelConfiguration = 2
  116. )
  117. func (p ChannelConfiguration) String() string {
  118. switch p {
  119. case ChannelConfiguration_MESSAGE: return "MESSAGE"
  120. case ChannelConfiguration_MESSAGE_NOTIFICATION: return "MESSAGE_NOTIFICATION"
  121. case ChannelConfiguration_NOTIFICATION_CENTER: return "NOTIFICATION_CENTER"
  122. }
  123. return "<UNSET>"
  124. }
  125. func ChannelConfigurationFromString(s string) (ChannelConfiguration, error) {
  126. switch s {
  127. case "MESSAGE": return ChannelConfiguration_MESSAGE, nil
  128. case "MESSAGE_NOTIFICATION": return ChannelConfiguration_MESSAGE_NOTIFICATION, nil
  129. case "NOTIFICATION_CENTER": return ChannelConfiguration_NOTIFICATION_CENTER, nil
  130. }
  131. return ChannelConfiguration(0), fmt.Errorf("not a valid ChannelConfiguration string")
  132. }
  133. func ChannelConfigurationPtr(v ChannelConfiguration) *ChannelConfiguration { return &v }
  134. func (p ChannelConfiguration) MarshalText() ([]byte, error) {
  135. return []byte(p.String()), nil
  136. }
  137. func (p *ChannelConfiguration) UnmarshalText(text []byte) error {
  138. q, err := ChannelConfigurationFromString(string(text))
  139. if (err != nil) {
  140. return err
  141. }
  142. *p = q
  143. return nil
  144. }
  145. func (p *ChannelConfiguration) Scan(value interface{}) error {
  146. v, ok := value.(int64)
  147. if !ok {
  148. return errors.New("Scan value is not int64")
  149. }
  150. *p = ChannelConfiguration(v)
  151. return nil
  152. }
  153. func (p * ChannelConfiguration) Value() (driver.Value, error) {
  154. if p == nil {
  155. return nil, nil
  156. }
  157. return int64(*p), nil
  158. }
  159. type ChannelErrorCode int64
  160. const (
  161. ChannelErrorCode_ILLEGAL_ARGUMENT ChannelErrorCode = 0
  162. ChannelErrorCode_INTERNAL_ERROR ChannelErrorCode = 1
  163. ChannelErrorCode_CONNECTION_ERROR ChannelErrorCode = 2
  164. ChannelErrorCode_AUTHENTICATIONI_FAILED ChannelErrorCode = 3
  165. ChannelErrorCode_NEED_PERMISSION_APPROVAL ChannelErrorCode = 4
  166. ChannelErrorCode_COIN_NOT_USABLE ChannelErrorCode = 5
  167. ChannelErrorCode_WEBVIEW_NOT_ALLOWED ChannelErrorCode = 6
  168. )
  169. func (p ChannelErrorCode) String() string {
  170. switch p {
  171. case ChannelErrorCode_ILLEGAL_ARGUMENT: return "ILLEGAL_ARGUMENT"
  172. case ChannelErrorCode_INTERNAL_ERROR: return "INTERNAL_ERROR"
  173. case ChannelErrorCode_CONNECTION_ERROR: return "CONNECTION_ERROR"
  174. case ChannelErrorCode_AUTHENTICATIONI_FAILED: return "AUTHENTICATIONI_FAILED"
  175. case ChannelErrorCode_NEED_PERMISSION_APPROVAL: return "NEED_PERMISSION_APPROVAL"
  176. case ChannelErrorCode_COIN_NOT_USABLE: return "COIN_NOT_USABLE"
  177. case ChannelErrorCode_WEBVIEW_NOT_ALLOWED: return "WEBVIEW_NOT_ALLOWED"
  178. }
  179. return "<UNSET>"
  180. }
  181. func ChannelErrorCodeFromString(s string) (ChannelErrorCode, error) {
  182. switch s {
  183. case "ILLEGAL_ARGUMENT": return ChannelErrorCode_ILLEGAL_ARGUMENT, nil
  184. case "INTERNAL_ERROR": return ChannelErrorCode_INTERNAL_ERROR, nil
  185. case "CONNECTION_ERROR": return ChannelErrorCode_CONNECTION_ERROR, nil
  186. case "AUTHENTICATIONI_FAILED": return ChannelErrorCode_AUTHENTICATIONI_FAILED, nil
  187. case "NEED_PERMISSION_APPROVAL": return ChannelErrorCode_NEED_PERMISSION_APPROVAL, nil
  188. case "COIN_NOT_USABLE": return ChannelErrorCode_COIN_NOT_USABLE, nil
  189. case "WEBVIEW_NOT_ALLOWED": return ChannelErrorCode_WEBVIEW_NOT_ALLOWED, nil
  190. }
  191. return ChannelErrorCode(0), fmt.Errorf("not a valid ChannelErrorCode string")
  192. }
  193. func ChannelErrorCodePtr(v ChannelErrorCode) *ChannelErrorCode { return &v }
  194. func (p ChannelErrorCode) MarshalText() ([]byte, error) {
  195. return []byte(p.String()), nil
  196. }
  197. func (p *ChannelErrorCode) UnmarshalText(text []byte) error {
  198. q, err := ChannelErrorCodeFromString(string(text))
  199. if (err != nil) {
  200. return err
  201. }
  202. *p = q
  203. return nil
  204. }
  205. func (p *ChannelErrorCode) Scan(value interface{}) error {
  206. v, ok := value.(int64)
  207. if !ok {
  208. return errors.New("Scan value is not int64")
  209. }
  210. *p = ChannelErrorCode(v)
  211. return nil
  212. }
  213. func (p * ChannelErrorCode) Value() (driver.Value, error) {
  214. if p == nil {
  215. return nil, nil
  216. }
  217. return int64(*p), nil
  218. }
  219. type ChannelFeatureLicense int64
  220. const (
  221. ChannelFeatureLicense_BLE_LCS_API_USABLE ChannelFeatureLicense = 26
  222. ChannelFeatureLicense_PROHIBIT_MINIMIZE_CHANNEL_BROWSER ChannelFeatureLicense = 27
  223. ChannelFeatureLicense_ALLOW_IOS_WEBKIT ChannelFeatureLicense = 28
  224. ChannelFeatureLicense_PURCHASE_LCS_API_USABLE ChannelFeatureLicense = 38
  225. )
  226. func (p ChannelFeatureLicense) String() string {
  227. switch p {
  228. case ChannelFeatureLicense_BLE_LCS_API_USABLE: return "BLE_LCS_API_USABLE"
  229. case ChannelFeatureLicense_PROHIBIT_MINIMIZE_CHANNEL_BROWSER: return "PROHIBIT_MINIMIZE_CHANNEL_BROWSER"
  230. case ChannelFeatureLicense_ALLOW_IOS_WEBKIT: return "ALLOW_IOS_WEBKIT"
  231. case ChannelFeatureLicense_PURCHASE_LCS_API_USABLE: return "PURCHASE_LCS_API_USABLE"
  232. }
  233. return "<UNSET>"
  234. }
  235. func ChannelFeatureLicenseFromString(s string) (ChannelFeatureLicense, error) {
  236. switch s {
  237. case "BLE_LCS_API_USABLE": return ChannelFeatureLicense_BLE_LCS_API_USABLE, nil
  238. case "PROHIBIT_MINIMIZE_CHANNEL_BROWSER": return ChannelFeatureLicense_PROHIBIT_MINIMIZE_CHANNEL_BROWSER, nil
  239. case "ALLOW_IOS_WEBKIT": return ChannelFeatureLicense_ALLOW_IOS_WEBKIT, nil
  240. case "PURCHASE_LCS_API_USABLE": return ChannelFeatureLicense_PURCHASE_LCS_API_USABLE, nil
  241. }
  242. return ChannelFeatureLicense(0), fmt.Errorf("not a valid ChannelFeatureLicense string")
  243. }
  244. func ChannelFeatureLicensePtr(v ChannelFeatureLicense) *ChannelFeatureLicense { return &v }
  245. func (p ChannelFeatureLicense) MarshalText() ([]byte, error) {
  246. return []byte(p.String()), nil
  247. }
  248. func (p *ChannelFeatureLicense) UnmarshalText(text []byte) error {
  249. q, err := ChannelFeatureLicenseFromString(string(text))
  250. if (err != nil) {
  251. return err
  252. }
  253. *p = q
  254. return nil
  255. }
  256. func (p *ChannelFeatureLicense) Scan(value interface{}) error {
  257. v, ok := value.(int64)
  258. if !ok {
  259. return errors.New("Scan value is not int64")
  260. }
  261. *p = ChannelFeatureLicense(v)
  262. return nil
  263. }
  264. func (p * ChannelFeatureLicense) Value() (driver.Value, error) {
  265. if p == nil {
  266. return nil, nil
  267. }
  268. return int64(*p), nil
  269. }
  270. type PublicType int64
  271. const (
  272. PublicType_HIDDEN PublicType = 0
  273. PublicType_PUBLIC PublicType = 1000
  274. )
  275. func (p PublicType) String() string {
  276. switch p {
  277. case PublicType_HIDDEN: return "HIDDEN"
  278. case PublicType_PUBLIC: return "PUBLIC"
  279. }
  280. return "<UNSET>"
  281. }
  282. func PublicTypeFromString(s string) (PublicType, error) {
  283. switch s {
  284. case "HIDDEN": return PublicType_HIDDEN, nil
  285. case "PUBLIC": return PublicType_PUBLIC, nil
  286. }
  287. return PublicType(0), fmt.Errorf("not a valid PublicType string")
  288. }
  289. func PublicTypePtr(v PublicType) *PublicType { return &v }
  290. func (p PublicType) MarshalText() ([]byte, error) {
  291. return []byte(p.String()), nil
  292. }
  293. func (p *PublicType) UnmarshalText(text []byte) error {
  294. q, err := PublicTypeFromString(string(text))
  295. if (err != nil) {
  296. return err
  297. }
  298. *p = q
  299. return nil
  300. }
  301. func (p *PublicType) Scan(value interface{}) error {
  302. v, ok := value.(int64)
  303. if !ok {
  304. return errors.New("Scan value is not int64")
  305. }
  306. *p = PublicType(v)
  307. return nil
  308. }
  309. func (p * PublicType) Value() (driver.Value, error) {
  310. if p == nil {
  311. return nil, nil
  312. }
  313. return int64(*p), nil
  314. }
  315. // Attributes:
  316. // - Code
  317. // - Reason
  318. // - ParameterMap
  319. type ChannelException struct {
  320. Code ChannelErrorCode `thrift:"code,1" db:"code" json:"code"`
  321. Reason string `thrift:"reason,2" db:"reason" json:"reason"`
  322. ParameterMap map[string]string `thrift:"parameterMap,3" db:"parameterMap" json:"parameterMap"`
  323. }
  324. func NewChannelException() *ChannelException {
  325. return &ChannelException{}
  326. }
  327. func (p *ChannelException) GetCode() ChannelErrorCode {
  328. return p.Code
  329. }
  330. func (p *ChannelException) GetReason() string {
  331. return p.Reason
  332. }
  333. func (p *ChannelException) GetParameterMap() map[string]string {
  334. return p.ParameterMap
  335. }
  336. func (p *ChannelException) Read(ctx context.Context, iprot thrift.TProtocol) error {
  337. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  338. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  339. }
  340. for {
  341. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  342. if err != nil {
  343. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  344. }
  345. if fieldTypeId == thrift.STOP { break; }
  346. switch fieldId {
  347. case 1:
  348. if fieldTypeId == thrift.I32 {
  349. if err := p.ReadField1(ctx, iprot); err != nil {
  350. return err
  351. }
  352. } else {
  353. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  354. return err
  355. }
  356. }
  357. case 2:
  358. if fieldTypeId == thrift.STRING {
  359. if err := p.ReadField2(ctx, iprot); err != nil {
  360. return err
  361. }
  362. } else {
  363. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  364. return err
  365. }
  366. }
  367. case 3:
  368. if fieldTypeId == thrift.MAP {
  369. if err := p.ReadField3(ctx, iprot); err != nil {
  370. return err
  371. }
  372. } else {
  373. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  374. return err
  375. }
  376. }
  377. default:
  378. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  379. return err
  380. }
  381. }
  382. if err := iprot.ReadFieldEnd(ctx); err != nil {
  383. return err
  384. }
  385. }
  386. if err := iprot.ReadStructEnd(ctx); err != nil {
  387. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  388. }
  389. return nil
  390. }
  391. func (p *ChannelException) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  392. if v, err := iprot.ReadI32(ctx); err != nil {
  393. return thrift.PrependError("error reading field 1: ", err)
  394. } else {
  395. temp := ChannelErrorCode(v)
  396. p.Code = temp
  397. }
  398. return nil
  399. }
  400. func (p *ChannelException) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  401. if v, err := iprot.ReadString(ctx); err != nil {
  402. return thrift.PrependError("error reading field 2: ", err)
  403. } else {
  404. p.Reason = v
  405. }
  406. return nil
  407. }
  408. func (p *ChannelException) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  409. _, _, size, err := iprot.ReadMapBegin(ctx)
  410. if err != nil {
  411. return thrift.PrependError("error reading map begin: ", err)
  412. }
  413. tMap := make(map[string]string, size)
  414. p.ParameterMap = tMap
  415. for i := 0; i < size; i ++ {
  416. var _key0 string
  417. if v, err := iprot.ReadString(ctx); err != nil {
  418. return thrift.PrependError("error reading field 0: ", err)
  419. } else {
  420. _key0 = v
  421. }
  422. var _val1 string
  423. if v, err := iprot.ReadString(ctx); err != nil {
  424. return thrift.PrependError("error reading field 0: ", err)
  425. } else {
  426. _val1 = v
  427. }
  428. p.ParameterMap[_key0] = _val1
  429. }
  430. if err := iprot.ReadMapEnd(ctx); err != nil {
  431. return thrift.PrependError("error reading map end: ", err)
  432. }
  433. return nil
  434. }
  435. func (p *ChannelException) Write(ctx context.Context, oprot thrift.TProtocol) error {
  436. if err := oprot.WriteStructBegin(ctx, "ChannelException"); err != nil {
  437. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  438. if p != nil {
  439. if err := p.writeField1(ctx, oprot); err != nil { return err }
  440. if err := p.writeField2(ctx, oprot); err != nil { return err }
  441. if err := p.writeField3(ctx, oprot); err != nil { return err }
  442. }
  443. if err := oprot.WriteFieldStop(ctx); err != nil {
  444. return thrift.PrependError("write field stop error: ", err) }
  445. if err := oprot.WriteStructEnd(ctx); err != nil {
  446. return thrift.PrependError("write struct stop error: ", err) }
  447. return nil
  448. }
  449. func (p *ChannelException) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  450. if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil {
  451. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) }
  452. if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil {
  453. return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) }
  454. if err := oprot.WriteFieldEnd(ctx); err != nil {
  455. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) }
  456. return err
  457. }
  458. func (p *ChannelException) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  459. if err := oprot.WriteFieldBegin(ctx, "reason", thrift.STRING, 2); err != nil {
  460. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:reason: ", p), err) }
  461. if err := oprot.WriteString(ctx, string(p.Reason)); err != nil {
  462. return thrift.PrependError(fmt.Sprintf("%T.reason (2) field write error: ", p), err) }
  463. if err := oprot.WriteFieldEnd(ctx); err != nil {
  464. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:reason: ", p), err) }
  465. return err
  466. }
  467. func (p *ChannelException) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  468. if err := oprot.WriteFieldBegin(ctx, "parameterMap", thrift.MAP, 3); err != nil {
  469. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parameterMap: ", p), err) }
  470. if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ParameterMap)); err != nil {
  471. return thrift.PrependError("error writing map begin: ", err)
  472. }
  473. for k, v := range p.ParameterMap {
  474. if err := oprot.WriteString(ctx, string(k)); err != nil {
  475. return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  476. if err := oprot.WriteString(ctx, string(v)); err != nil {
  477. return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  478. }
  479. if err := oprot.WriteMapEnd(ctx); err != nil {
  480. return thrift.PrependError("error writing map end: ", err)
  481. }
  482. if err := oprot.WriteFieldEnd(ctx); err != nil {
  483. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parameterMap: ", p), err) }
  484. return err
  485. }
  486. func (p *ChannelException) Equals(other *ChannelException) bool {
  487. if p == other {
  488. return true
  489. } else if p == nil || other == nil {
  490. return false
  491. }
  492. if p.Code != other.Code { return false }
  493. if p.Reason != other.Reason { return false }
  494. if len(p.ParameterMap) != len(other.ParameterMap) { return false }
  495. for k, _tgt := range p.ParameterMap {
  496. _src2 := other.ParameterMap[k]
  497. if _tgt != _src2 { return false }
  498. }
  499. return true
  500. }
  501. func (p *ChannelException) String() string {
  502. if p == nil {
  503. return "<nil>"
  504. }
  505. return fmt.Sprintf("ChannelException(%+v)", *p)
  506. }
  507. func (p *ChannelException) Error() string {
  508. return p.String()
  509. }
  510. func (ChannelException) TExceptionType() thrift.TExceptionType {
  511. return thrift.TExceptionTypeCompiled
  512. }
  513. var _ thrift.TException = (*ChannelException)(nil)
  514. // Attributes:
  515. // - ChannelInfo
  516. // - ApprovedAt
  517. type ApprovedChannelInfo struct {
  518. ChannelInfo *ChannelInfo `thrift:"channelInfo,1" db:"channelInfo" json:"channelInfo"`
  519. ApprovedAt int64 `thrift:"approvedAt,2" db:"approvedAt" json:"approvedAt"`
  520. }
  521. func NewApprovedChannelInfo() *ApprovedChannelInfo {
  522. return &ApprovedChannelInfo{}
  523. }
  524. var ApprovedChannelInfo_ChannelInfo_DEFAULT *ChannelInfo
  525. func (p *ApprovedChannelInfo) GetChannelInfo() *ChannelInfo {
  526. if !p.IsSetChannelInfo() {
  527. return ApprovedChannelInfo_ChannelInfo_DEFAULT
  528. }
  529. return p.ChannelInfo
  530. }
  531. func (p *ApprovedChannelInfo) GetApprovedAt() int64 {
  532. return p.ApprovedAt
  533. }
  534. func (p *ApprovedChannelInfo) IsSetChannelInfo() bool {
  535. return p.ChannelInfo != nil
  536. }
  537. func (p *ApprovedChannelInfo) Read(ctx context.Context, iprot thrift.TProtocol) error {
  538. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  539. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  540. }
  541. for {
  542. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  543. if err != nil {
  544. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  545. }
  546. if fieldTypeId == thrift.STOP { break; }
  547. switch fieldId {
  548. case 1:
  549. if fieldTypeId == thrift.STRUCT {
  550. if err := p.ReadField1(ctx, iprot); err != nil {
  551. return err
  552. }
  553. } else {
  554. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  555. return err
  556. }
  557. }
  558. case 2:
  559. if fieldTypeId == thrift.I64 {
  560. if err := p.ReadField2(ctx, iprot); err != nil {
  561. return err
  562. }
  563. } else {
  564. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  565. return err
  566. }
  567. }
  568. default:
  569. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  570. return err
  571. }
  572. }
  573. if err := iprot.ReadFieldEnd(ctx); err != nil {
  574. return err
  575. }
  576. }
  577. if err := iprot.ReadStructEnd(ctx); err != nil {
  578. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  579. }
  580. return nil
  581. }
  582. func (p *ApprovedChannelInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  583. p.ChannelInfo = &ChannelInfo{}
  584. if err := p.ChannelInfo.Read(ctx, iprot); err != nil {
  585. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ChannelInfo), err)
  586. }
  587. return nil
  588. }
  589. func (p *ApprovedChannelInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  590. if v, err := iprot.ReadI64(ctx); err != nil {
  591. return thrift.PrependError("error reading field 2: ", err)
  592. } else {
  593. p.ApprovedAt = v
  594. }
  595. return nil
  596. }
  597. func (p *ApprovedChannelInfo) Write(ctx context.Context, oprot thrift.TProtocol) error {
  598. if err := oprot.WriteStructBegin(ctx, "ApprovedChannelInfo"); err != nil {
  599. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  600. if p != nil {
  601. if err := p.writeField1(ctx, oprot); err != nil { return err }
  602. if err := p.writeField2(ctx, oprot); err != nil { return err }
  603. }
  604. if err := oprot.WriteFieldStop(ctx); err != nil {
  605. return thrift.PrependError("write field stop error: ", err) }
  606. if err := oprot.WriteStructEnd(ctx); err != nil {
  607. return thrift.PrependError("write struct stop error: ", err) }
  608. return nil
  609. }
  610. func (p *ApprovedChannelInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  611. if err := oprot.WriteFieldBegin(ctx, "channelInfo", thrift.STRUCT, 1); err != nil {
  612. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelInfo: ", p), err) }
  613. if err := p.ChannelInfo.Write(ctx, oprot); err != nil {
  614. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ChannelInfo), err)
  615. }
  616. if err := oprot.WriteFieldEnd(ctx); err != nil {
  617. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelInfo: ", p), err) }
  618. return err
  619. }
  620. func (p *ApprovedChannelInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  621. if err := oprot.WriteFieldBegin(ctx, "approvedAt", thrift.I64, 2); err != nil {
  622. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:approvedAt: ", p), err) }
  623. if err := oprot.WriteI64(ctx, int64(p.ApprovedAt)); err != nil {
  624. return thrift.PrependError(fmt.Sprintf("%T.approvedAt (2) field write error: ", p), err) }
  625. if err := oprot.WriteFieldEnd(ctx); err != nil {
  626. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:approvedAt: ", p), err) }
  627. return err
  628. }
  629. func (p *ApprovedChannelInfo) Equals(other *ApprovedChannelInfo) bool {
  630. if p == other {
  631. return true
  632. } else if p == nil || other == nil {
  633. return false
  634. }
  635. if !p.ChannelInfo.Equals(other.ChannelInfo) { return false }
  636. if p.ApprovedAt != other.ApprovedAt { return false }
  637. return true
  638. }
  639. func (p *ApprovedChannelInfo) String() string {
  640. if p == nil {
  641. return "<nil>"
  642. }
  643. return fmt.Sprintf("ApprovedChannelInfo(%+v)", *p)
  644. }
  645. // Attributes:
  646. // - ApprovedChannelInfos
  647. // - Revision
  648. type ApprovedChannelInfos struct {
  649. ApprovedChannelInfos []*ApprovedChannelInfo `thrift:"approvedChannelInfos,1" db:"approvedChannelInfos" json:"approvedChannelInfos"`
  650. Revision int64 `thrift:"revision,2" db:"revision" json:"revision"`
  651. }
  652. func NewApprovedChannelInfos() *ApprovedChannelInfos {
  653. return &ApprovedChannelInfos{}
  654. }
  655. func (p *ApprovedChannelInfos) GetApprovedChannelInfos() []*ApprovedChannelInfo {
  656. return p.ApprovedChannelInfos
  657. }
  658. func (p *ApprovedChannelInfos) GetRevision() int64 {
  659. return p.Revision
  660. }
  661. func (p *ApprovedChannelInfos) Read(ctx context.Context, iprot thrift.TProtocol) error {
  662. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  663. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  664. }
  665. for {
  666. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  667. if err != nil {
  668. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  669. }
  670. if fieldTypeId == thrift.STOP { break; }
  671. switch fieldId {
  672. case 1:
  673. if fieldTypeId == thrift.LIST {
  674. if err := p.ReadField1(ctx, iprot); err != nil {
  675. return err
  676. }
  677. } else {
  678. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  679. return err
  680. }
  681. }
  682. case 2:
  683. if fieldTypeId == thrift.I64 {
  684. if err := p.ReadField2(ctx, iprot); err != nil {
  685. return err
  686. }
  687. } else {
  688. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  689. return err
  690. }
  691. }
  692. default:
  693. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  694. return err
  695. }
  696. }
  697. if err := iprot.ReadFieldEnd(ctx); err != nil {
  698. return err
  699. }
  700. }
  701. if err := iprot.ReadStructEnd(ctx); err != nil {
  702. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  703. }
  704. return nil
  705. }
  706. func (p *ApprovedChannelInfos) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  707. _, size, err := iprot.ReadListBegin(ctx)
  708. if err != nil {
  709. return thrift.PrependError("error reading list begin: ", err)
  710. }
  711. tSlice := make([]*ApprovedChannelInfo, 0, size)
  712. p.ApprovedChannelInfos = tSlice
  713. for i := 0; i < size; i ++ {
  714. _elem3 := &ApprovedChannelInfo{}
  715. if err := _elem3.Read(ctx, iprot); err != nil {
  716. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err)
  717. }
  718. p.ApprovedChannelInfos = append(p.ApprovedChannelInfos, _elem3)
  719. }
  720. if err := iprot.ReadListEnd(ctx); err != nil {
  721. return thrift.PrependError("error reading list end: ", err)
  722. }
  723. return nil
  724. }
  725. func (p *ApprovedChannelInfos) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  726. if v, err := iprot.ReadI64(ctx); err != nil {
  727. return thrift.PrependError("error reading field 2: ", err)
  728. } else {
  729. p.Revision = v
  730. }
  731. return nil
  732. }
  733. func (p *ApprovedChannelInfos) Write(ctx context.Context, oprot thrift.TProtocol) error {
  734. if err := oprot.WriteStructBegin(ctx, "ApprovedChannelInfos"); err != nil {
  735. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  736. if p != nil {
  737. if err := p.writeField1(ctx, oprot); err != nil { return err }
  738. if err := p.writeField2(ctx, oprot); err != nil { return err }
  739. }
  740. if err := oprot.WriteFieldStop(ctx); err != nil {
  741. return thrift.PrependError("write field stop error: ", err) }
  742. if err := oprot.WriteStructEnd(ctx); err != nil {
  743. return thrift.PrependError("write struct stop error: ", err) }
  744. return nil
  745. }
  746. func (p *ApprovedChannelInfos) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  747. if err := oprot.WriteFieldBegin(ctx, "approvedChannelInfos", thrift.LIST, 1); err != nil {
  748. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:approvedChannelInfos: ", p), err) }
  749. if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ApprovedChannelInfos)); err != nil {
  750. return thrift.PrependError("error writing list begin: ", err)
  751. }
  752. for _, v := range p.ApprovedChannelInfos {
  753. if err := v.Write(ctx, oprot); err != nil {
  754. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
  755. }
  756. }
  757. if err := oprot.WriteListEnd(ctx); err != nil {
  758. return thrift.PrependError("error writing list end: ", err)
  759. }
  760. if err := oprot.WriteFieldEnd(ctx); err != nil {
  761. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:approvedChannelInfos: ", p), err) }
  762. return err
  763. }
  764. func (p *ApprovedChannelInfos) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  765. if err := oprot.WriteFieldBegin(ctx, "revision", thrift.I64, 2); err != nil {
  766. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:revision: ", p), err) }
  767. if err := oprot.WriteI64(ctx, int64(p.Revision)); err != nil {
  768. return thrift.PrependError(fmt.Sprintf("%T.revision (2) field write error: ", p), err) }
  769. if err := oprot.WriteFieldEnd(ctx); err != nil {
  770. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:revision: ", p), err) }
  771. return err
  772. }
  773. func (p *ApprovedChannelInfos) Equals(other *ApprovedChannelInfos) bool {
  774. if p == other {
  775. return true
  776. } else if p == nil || other == nil {
  777. return false
  778. }
  779. if len(p.ApprovedChannelInfos) != len(other.ApprovedChannelInfos) { return false }
  780. for i, _tgt := range p.ApprovedChannelInfos {
  781. _src4 := other.ApprovedChannelInfos[i]
  782. if !_tgt.Equals(_src4) { return false }
  783. }
  784. if p.Revision != other.Revision { return false }
  785. return true
  786. }
  787. func (p *ApprovedChannelInfos) String() string {
  788. if p == nil {
  789. return "<nil>"
  790. }
  791. return fmt.Sprintf("ApprovedChannelInfos(%+v)", *p)
  792. }
  793. // Attributes:
  794. // - Host
  795. // - Removed
  796. type ChannelDomain struct {
  797. Host string `thrift:"host,1" db:"host" json:"host"`
  798. Removed bool `thrift:"removed,2" db:"removed" json:"removed"`
  799. }
  800. func NewChannelDomain() *ChannelDomain {
  801. return &ChannelDomain{}
  802. }
  803. func (p *ChannelDomain) GetHost() string {
  804. return p.Host
  805. }
  806. func (p *ChannelDomain) GetRemoved() bool {
  807. return p.Removed
  808. }
  809. func (p *ChannelDomain) Read(ctx context.Context, iprot thrift.TProtocol) error {
  810. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  811. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  812. }
  813. for {
  814. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  815. if err != nil {
  816. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  817. }
  818. if fieldTypeId == thrift.STOP { break; }
  819. switch fieldId {
  820. case 1:
  821. if fieldTypeId == thrift.STRING {
  822. if err := p.ReadField1(ctx, iprot); err != nil {
  823. return err
  824. }
  825. } else {
  826. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  827. return err
  828. }
  829. }
  830. case 2:
  831. if fieldTypeId == thrift.BOOL {
  832. if err := p.ReadField2(ctx, iprot); err != nil {
  833. return err
  834. }
  835. } else {
  836. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  837. return err
  838. }
  839. }
  840. default:
  841. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  842. return err
  843. }
  844. }
  845. if err := iprot.ReadFieldEnd(ctx); err != nil {
  846. return err
  847. }
  848. }
  849. if err := iprot.ReadStructEnd(ctx); err != nil {
  850. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  851. }
  852. return nil
  853. }
  854. func (p *ChannelDomain) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  855. if v, err := iprot.ReadString(ctx); err != nil {
  856. return thrift.PrependError("error reading field 1: ", err)
  857. } else {
  858. p.Host = v
  859. }
  860. return nil
  861. }
  862. func (p *ChannelDomain) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  863. if v, err := iprot.ReadBool(ctx); err != nil {
  864. return thrift.PrependError("error reading field 2: ", err)
  865. } else {
  866. p.Removed = v
  867. }
  868. return nil
  869. }
  870. func (p *ChannelDomain) Write(ctx context.Context, oprot thrift.TProtocol) error {
  871. if err := oprot.WriteStructBegin(ctx, "ChannelDomain"); err != nil {
  872. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  873. if p != nil {
  874. if err := p.writeField1(ctx, oprot); err != nil { return err }
  875. if err := p.writeField2(ctx, oprot); err != nil { return err }
  876. }
  877. if err := oprot.WriteFieldStop(ctx); err != nil {
  878. return thrift.PrependError("write field stop error: ", err) }
  879. if err := oprot.WriteStructEnd(ctx); err != nil {
  880. return thrift.PrependError("write struct stop error: ", err) }
  881. return nil
  882. }
  883. func (p *ChannelDomain) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  884. if err := oprot.WriteFieldBegin(ctx, "host", thrift.STRING, 1); err != nil {
  885. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) }
  886. if err := oprot.WriteString(ctx, string(p.Host)); err != nil {
  887. return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err) }
  888. if err := oprot.WriteFieldEnd(ctx); err != nil {
  889. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) }
  890. return err
  891. }
  892. func (p *ChannelDomain) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  893. if err := oprot.WriteFieldBegin(ctx, "removed", thrift.BOOL, 2); err != nil {
  894. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:removed: ", p), err) }
  895. if err := oprot.WriteBool(ctx, bool(p.Removed)); err != nil {
  896. return thrift.PrependError(fmt.Sprintf("%T.removed (2) field write error: ", p), err) }
  897. if err := oprot.WriteFieldEnd(ctx); err != nil {
  898. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:removed: ", p), err) }
  899. return err
  900. }
  901. func (p *ChannelDomain) Equals(other *ChannelDomain) bool {
  902. if p == other {
  903. return true
  904. } else if p == nil || other == nil {
  905. return false
  906. }
  907. if p.Host != other.Host { return false }
  908. if p.Removed != other.Removed { return false }
  909. return true
  910. }
  911. func (p *ChannelDomain) String() string {
  912. if p == nil {
  913. return "<nil>"
  914. }
  915. return fmt.Sprintf("ChannelDomain(%+v)", *p)
  916. }
  917. // Attributes:
  918. // - ChannelDomains
  919. // - Revision
  920. type ChannelDomains struct {
  921. ChannelDomains []*ChannelDomain `thrift:"channelDomains,1" db:"channelDomains" json:"channelDomains"`
  922. Revision int64 `thrift:"revision,2" db:"revision" json:"revision"`
  923. }
  924. func NewChannelDomains() *ChannelDomains {
  925. return &ChannelDomains{}
  926. }
  927. func (p *ChannelDomains) GetChannelDomains() []*ChannelDomain {
  928. return p.ChannelDomains
  929. }
  930. func (p *ChannelDomains) GetRevision() int64 {
  931. return p.Revision
  932. }
  933. func (p *ChannelDomains) Read(ctx context.Context, iprot thrift.TProtocol) error {
  934. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  935. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  936. }
  937. for {
  938. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  939. if err != nil {
  940. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  941. }
  942. if fieldTypeId == thrift.STOP { break; }
  943. switch fieldId {
  944. case 1:
  945. if fieldTypeId == thrift.LIST {
  946. if err := p.ReadField1(ctx, iprot); err != nil {
  947. return err
  948. }
  949. } else {
  950. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  951. return err
  952. }
  953. }
  954. case 2:
  955. if fieldTypeId == thrift.I64 {
  956. if err := p.ReadField2(ctx, iprot); err != nil {
  957. return err
  958. }
  959. } else {
  960. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  961. return err
  962. }
  963. }
  964. default:
  965. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  966. return err
  967. }
  968. }
  969. if err := iprot.ReadFieldEnd(ctx); err != nil {
  970. return err
  971. }
  972. }
  973. if err := iprot.ReadStructEnd(ctx); err != nil {
  974. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  975. }
  976. return nil
  977. }
  978. func (p *ChannelDomains) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  979. _, size, err := iprot.ReadListBegin(ctx)
  980. if err != nil {
  981. return thrift.PrependError("error reading list begin: ", err)
  982. }
  983. tSlice := make([]*ChannelDomain, 0, size)
  984. p.ChannelDomains = tSlice
  985. for i := 0; i < size; i ++ {
  986. _elem5 := &ChannelDomain{}
  987. if err := _elem5.Read(ctx, iprot); err != nil {
  988. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err)
  989. }
  990. p.ChannelDomains = append(p.ChannelDomains, _elem5)
  991. }
  992. if err := iprot.ReadListEnd(ctx); err != nil {
  993. return thrift.PrependError("error reading list end: ", err)
  994. }
  995. return nil
  996. }
  997. func (p *ChannelDomains) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  998. if v, err := iprot.ReadI64(ctx); err != nil {
  999. return thrift.PrependError("error reading field 2: ", err)
  1000. } else {
  1001. p.Revision = v
  1002. }
  1003. return nil
  1004. }
  1005. func (p *ChannelDomains) Write(ctx context.Context, oprot thrift.TProtocol) error {
  1006. if err := oprot.WriteStructBegin(ctx, "ChannelDomains"); err != nil {
  1007. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  1008. if p != nil {
  1009. if err := p.writeField1(ctx, oprot); err != nil { return err }
  1010. if err := p.writeField2(ctx, oprot); err != nil { return err }
  1011. }
  1012. if err := oprot.WriteFieldStop(ctx); err != nil {
  1013. return thrift.PrependError("write field stop error: ", err) }
  1014. if err := oprot.WriteStructEnd(ctx); err != nil {
  1015. return thrift.PrependError("write struct stop error: ", err) }
  1016. return nil
  1017. }
  1018. func (p *ChannelDomains) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1019. if err := oprot.WriteFieldBegin(ctx, "channelDomains", thrift.LIST, 1); err != nil {
  1020. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelDomains: ", p), err) }
  1021. if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ChannelDomains)); err != nil {
  1022. return thrift.PrependError("error writing list begin: ", err)
  1023. }
  1024. for _, v := range p.ChannelDomains {
  1025. if err := v.Write(ctx, oprot); err != nil {
  1026. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
  1027. }
  1028. }
  1029. if err := oprot.WriteListEnd(ctx); err != nil {
  1030. return thrift.PrependError("error writing list end: ", err)
  1031. }
  1032. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1033. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelDomains: ", p), err) }
  1034. return err
  1035. }
  1036. func (p *ChannelDomains) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1037. if err := oprot.WriteFieldBegin(ctx, "revision", thrift.I64, 2); err != nil {
  1038. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:revision: ", p), err) }
  1039. if err := oprot.WriteI64(ctx, int64(p.Revision)); err != nil {
  1040. return thrift.PrependError(fmt.Sprintf("%T.revision (2) field write error: ", p), err) }
  1041. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1042. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:revision: ", p), err) }
  1043. return err
  1044. }
  1045. func (p *ChannelDomains) Equals(other *ChannelDomains) bool {
  1046. if p == other {
  1047. return true
  1048. } else if p == nil || other == nil {
  1049. return false
  1050. }
  1051. if len(p.ChannelDomains) != len(other.ChannelDomains) { return false }
  1052. for i, _tgt := range p.ChannelDomains {
  1053. _src6 := other.ChannelDomains[i]
  1054. if !_tgt.Equals(_src6) { return false }
  1055. }
  1056. if p.Revision != other.Revision { return false }
  1057. return true
  1058. }
  1059. func (p *ChannelDomains) String() string {
  1060. if p == nil {
  1061. return "<nil>"
  1062. }
  1063. return fmt.Sprintf("ChannelDomains(%+v)", *p)
  1064. }
  1065. // Attributes:
  1066. // - ChannelId
  1067. // - LastUpdated
  1068. type ChannelIdWithLastUpdated struct {
  1069. ChannelId string `thrift:"channelId,1" db:"channelId" json:"channelId"`
  1070. LastUpdated int64 `thrift:"lastUpdated,2" db:"lastUpdated" json:"lastUpdated"`
  1071. }
  1072. func NewChannelIdWithLastUpdated() *ChannelIdWithLastUpdated {
  1073. return &ChannelIdWithLastUpdated{}
  1074. }
  1075. func (p *ChannelIdWithLastUpdated) GetChannelId() string {
  1076. return p.ChannelId
  1077. }
  1078. func (p *ChannelIdWithLastUpdated) GetLastUpdated() int64 {
  1079. return p.LastUpdated
  1080. }
  1081. func (p *ChannelIdWithLastUpdated) Read(ctx context.Context, iprot thrift.TProtocol) error {
  1082. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  1083. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  1084. }
  1085. for {
  1086. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  1087. if err != nil {
  1088. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  1089. }
  1090. if fieldTypeId == thrift.STOP { break; }
  1091. switch fieldId {
  1092. case 1:
  1093. if fieldTypeId == thrift.STRING {
  1094. if err := p.ReadField1(ctx, iprot); err != nil {
  1095. return err
  1096. }
  1097. } else {
  1098. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1099. return err
  1100. }
  1101. }
  1102. case 2:
  1103. if fieldTypeId == thrift.I64 {
  1104. if err := p.ReadField2(ctx, iprot); err != nil {
  1105. return err
  1106. }
  1107. } else {
  1108. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1109. return err
  1110. }
  1111. }
  1112. default:
  1113. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1114. return err
  1115. }
  1116. }
  1117. if err := iprot.ReadFieldEnd(ctx); err != nil {
  1118. return err
  1119. }
  1120. }
  1121. if err := iprot.ReadStructEnd(ctx); err != nil {
  1122. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  1123. }
  1124. return nil
  1125. }
  1126. func (p *ChannelIdWithLastUpdated) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  1127. if v, err := iprot.ReadString(ctx); err != nil {
  1128. return thrift.PrependError("error reading field 1: ", err)
  1129. } else {
  1130. p.ChannelId = v
  1131. }
  1132. return nil
  1133. }
  1134. func (p *ChannelIdWithLastUpdated) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  1135. if v, err := iprot.ReadI64(ctx); err != nil {
  1136. return thrift.PrependError("error reading field 2: ", err)
  1137. } else {
  1138. p.LastUpdated = v
  1139. }
  1140. return nil
  1141. }
  1142. func (p *ChannelIdWithLastUpdated) Write(ctx context.Context, oprot thrift.TProtocol) error {
  1143. if err := oprot.WriteStructBegin(ctx, "ChannelIdWithLastUpdated"); err != nil {
  1144. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  1145. if p != nil {
  1146. if err := p.writeField1(ctx, oprot); err != nil { return err }
  1147. if err := p.writeField2(ctx, oprot); err != nil { return err }
  1148. }
  1149. if err := oprot.WriteFieldStop(ctx); err != nil {
  1150. return thrift.PrependError("write field stop error: ", err) }
  1151. if err := oprot.WriteStructEnd(ctx); err != nil {
  1152. return thrift.PrependError("write struct stop error: ", err) }
  1153. return nil
  1154. }
  1155. func (p *ChannelIdWithLastUpdated) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1156. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 1); err != nil {
  1157. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelId: ", p), err) }
  1158. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  1159. return thrift.PrependError(fmt.Sprintf("%T.channelId (1) field write error: ", p), err) }
  1160. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1161. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelId: ", p), err) }
  1162. return err
  1163. }
  1164. func (p *ChannelIdWithLastUpdated) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1165. if err := oprot.WriteFieldBegin(ctx, "lastUpdated", thrift.I64, 2); err != nil {
  1166. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:lastUpdated: ", p), err) }
  1167. if err := oprot.WriteI64(ctx, int64(p.LastUpdated)); err != nil {
  1168. return thrift.PrependError(fmt.Sprintf("%T.lastUpdated (2) field write error: ", p), err) }
  1169. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1170. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:lastUpdated: ", p), err) }
  1171. return err
  1172. }
  1173. func (p *ChannelIdWithLastUpdated) Equals(other *ChannelIdWithLastUpdated) bool {
  1174. if p == other {
  1175. return true
  1176. } else if p == nil || other == nil {
  1177. return false
  1178. }
  1179. if p.ChannelId != other.ChannelId { return false }
  1180. if p.LastUpdated != other.LastUpdated { return false }
  1181. return true
  1182. }
  1183. func (p *ChannelIdWithLastUpdated) String() string {
  1184. if p == nil {
  1185. return "<nil>"
  1186. }
  1187. return fmt.Sprintf("ChannelIdWithLastUpdated(%+v)", *p)
  1188. }
  1189. // Attributes:
  1190. // - ChannelId
  1191. // - Name
  1192. // - EntryPageUrl
  1193. // - DescriptionText
  1194. // - Provider
  1195. // - PublicType
  1196. // - IconImage
  1197. // - Permissions
  1198. // - IconThumbnailImage
  1199. // - ChannelConfigurations
  1200. // - LcsAllApiUsable
  1201. // - AllowedPermissions
  1202. // - ChannelDomains
  1203. // - UpdatedTimestamp
  1204. // - FeatureLicenses
  1205. type ChannelInfo struct {
  1206. ChannelId string `thrift:"channelId,1" db:"channelId" json:"channelId"`
  1207. // unused field # 2
  1208. Name string `thrift:"name,3" db:"name" json:"name"`
  1209. EntryPageUrl string `thrift:"entryPageUrl,4" db:"entryPageUrl" json:"entryPageUrl"`
  1210. DescriptionText string `thrift:"descriptionText,5" db:"descriptionText" json:"descriptionText"`
  1211. Provider *ChannelProvider `thrift:"provider,6" db:"provider" json:"provider"`
  1212. PublicType PublicType `thrift:"publicType,7" db:"publicType" json:"publicType"`
  1213. IconImage string `thrift:"iconImage,8" db:"iconImage" json:"iconImage"`
  1214. Permissions []string `thrift:"permissions,9" db:"permissions" json:"permissions"`
  1215. // unused field # 10
  1216. IconThumbnailImage string `thrift:"iconThumbnailImage,11" db:"iconThumbnailImage" json:"iconThumbnailImage"`
  1217. ChannelConfigurations []ChannelConfiguration `thrift:"channelConfigurations,12" db:"channelConfigurations" json:"channelConfigurations"`
  1218. LcsAllApiUsable bool `thrift:"lcsAllApiUsable,13" db:"lcsAllApiUsable" json:"lcsAllApiUsable"`
  1219. AllowedPermissions []ChannelAllowedPermission `thrift:"allowedPermissions,14" db:"allowedPermissions" json:"allowedPermissions"`
  1220. ChannelDomains []*ChannelDomain `thrift:"channelDomains,15" db:"channelDomains" json:"channelDomains"`
  1221. UpdatedTimestamp int64 `thrift:"updatedTimestamp,16" db:"updatedTimestamp" json:"updatedTimestamp"`
  1222. FeatureLicenses []ChannelFeatureLicense `thrift:"featureLicenses,17" db:"featureLicenses" json:"featureLicenses"`
  1223. }
  1224. func NewChannelInfo() *ChannelInfo {
  1225. return &ChannelInfo{}
  1226. }
  1227. func (p *ChannelInfo) GetChannelId() string {
  1228. return p.ChannelId
  1229. }
  1230. func (p *ChannelInfo) GetName() string {
  1231. return p.Name
  1232. }
  1233. func (p *ChannelInfo) GetEntryPageUrl() string {
  1234. return p.EntryPageUrl
  1235. }
  1236. func (p *ChannelInfo) GetDescriptionText() string {
  1237. return p.DescriptionText
  1238. }
  1239. var ChannelInfo_Provider_DEFAULT *ChannelProvider
  1240. func (p *ChannelInfo) GetProvider() *ChannelProvider {
  1241. if !p.IsSetProvider() {
  1242. return ChannelInfo_Provider_DEFAULT
  1243. }
  1244. return p.Provider
  1245. }
  1246. func (p *ChannelInfo) GetPublicType() PublicType {
  1247. return p.PublicType
  1248. }
  1249. func (p *ChannelInfo) GetIconImage() string {
  1250. return p.IconImage
  1251. }
  1252. func (p *ChannelInfo) GetPermissions() []string {
  1253. return p.Permissions
  1254. }
  1255. func (p *ChannelInfo) GetIconThumbnailImage() string {
  1256. return p.IconThumbnailImage
  1257. }
  1258. func (p *ChannelInfo) GetChannelConfigurations() []ChannelConfiguration {
  1259. return p.ChannelConfigurations
  1260. }
  1261. func (p *ChannelInfo) GetLcsAllApiUsable() bool {
  1262. return p.LcsAllApiUsable
  1263. }
  1264. func (p *ChannelInfo) GetAllowedPermissions() []ChannelAllowedPermission {
  1265. return p.AllowedPermissions
  1266. }
  1267. func (p *ChannelInfo) GetChannelDomains() []*ChannelDomain {
  1268. return p.ChannelDomains
  1269. }
  1270. func (p *ChannelInfo) GetUpdatedTimestamp() int64 {
  1271. return p.UpdatedTimestamp
  1272. }
  1273. func (p *ChannelInfo) GetFeatureLicenses() []ChannelFeatureLicense {
  1274. return p.FeatureLicenses
  1275. }
  1276. func (p *ChannelInfo) IsSetProvider() bool {
  1277. return p.Provider != nil
  1278. }
  1279. func (p *ChannelInfo) Read(ctx context.Context, iprot thrift.TProtocol) error {
  1280. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  1281. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  1282. }
  1283. for {
  1284. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  1285. if err != nil {
  1286. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  1287. }
  1288. if fieldTypeId == thrift.STOP { break; }
  1289. switch fieldId {
  1290. case 1:
  1291. if fieldTypeId == thrift.STRING {
  1292. if err := p.ReadField1(ctx, iprot); err != nil {
  1293. return err
  1294. }
  1295. } else {
  1296. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1297. return err
  1298. }
  1299. }
  1300. case 3:
  1301. if fieldTypeId == thrift.STRING {
  1302. if err := p.ReadField3(ctx, iprot); err != nil {
  1303. return err
  1304. }
  1305. } else {
  1306. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1307. return err
  1308. }
  1309. }
  1310. case 4:
  1311. if fieldTypeId == thrift.STRING {
  1312. if err := p.ReadField4(ctx, iprot); err != nil {
  1313. return err
  1314. }
  1315. } else {
  1316. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1317. return err
  1318. }
  1319. }
  1320. case 5:
  1321. if fieldTypeId == thrift.STRING {
  1322. if err := p.ReadField5(ctx, iprot); err != nil {
  1323. return err
  1324. }
  1325. } else {
  1326. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1327. return err
  1328. }
  1329. }
  1330. case 6:
  1331. if fieldTypeId == thrift.STRUCT {
  1332. if err := p.ReadField6(ctx, iprot); err != nil {
  1333. return err
  1334. }
  1335. } else {
  1336. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1337. return err
  1338. }
  1339. }
  1340. case 7:
  1341. if fieldTypeId == thrift.I32 {
  1342. if err := p.ReadField7(ctx, iprot); err != nil {
  1343. return err
  1344. }
  1345. } else {
  1346. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1347. return err
  1348. }
  1349. }
  1350. case 8:
  1351. if fieldTypeId == thrift.STRING {
  1352. if err := p.ReadField8(ctx, iprot); err != nil {
  1353. return err
  1354. }
  1355. } else {
  1356. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1357. return err
  1358. }
  1359. }
  1360. case 9:
  1361. if fieldTypeId == thrift.LIST {
  1362. if err := p.ReadField9(ctx, iprot); err != nil {
  1363. return err
  1364. }
  1365. } else {
  1366. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1367. return err
  1368. }
  1369. }
  1370. case 11:
  1371. if fieldTypeId == thrift.STRING {
  1372. if err := p.ReadField11(ctx, iprot); err != nil {
  1373. return err
  1374. }
  1375. } else {
  1376. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1377. return err
  1378. }
  1379. }
  1380. case 12:
  1381. if fieldTypeId == thrift.LIST {
  1382. if err := p.ReadField12(ctx, iprot); err != nil {
  1383. return err
  1384. }
  1385. } else {
  1386. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1387. return err
  1388. }
  1389. }
  1390. case 13:
  1391. if fieldTypeId == thrift.BOOL {
  1392. if err := p.ReadField13(ctx, iprot); err != nil {
  1393. return err
  1394. }
  1395. } else {
  1396. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1397. return err
  1398. }
  1399. }
  1400. case 14:
  1401. if fieldTypeId == thrift.SET {
  1402. if err := p.ReadField14(ctx, iprot); err != nil {
  1403. return err
  1404. }
  1405. } else {
  1406. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1407. return err
  1408. }
  1409. }
  1410. case 15:
  1411. if fieldTypeId == thrift.LIST {
  1412. if err := p.ReadField15(ctx, iprot); err != nil {
  1413. return err
  1414. }
  1415. } else {
  1416. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1417. return err
  1418. }
  1419. }
  1420. case 16:
  1421. if fieldTypeId == thrift.I64 {
  1422. if err := p.ReadField16(ctx, iprot); err != nil {
  1423. return err
  1424. }
  1425. } else {
  1426. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1427. return err
  1428. }
  1429. }
  1430. case 17:
  1431. if fieldTypeId == thrift.SET {
  1432. if err := p.ReadField17(ctx, iprot); err != nil {
  1433. return err
  1434. }
  1435. } else {
  1436. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1437. return err
  1438. }
  1439. }
  1440. default:
  1441. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1442. return err
  1443. }
  1444. }
  1445. if err := iprot.ReadFieldEnd(ctx); err != nil {
  1446. return err
  1447. }
  1448. }
  1449. if err := iprot.ReadStructEnd(ctx); err != nil {
  1450. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  1451. }
  1452. return nil
  1453. }
  1454. func (p *ChannelInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  1455. if v, err := iprot.ReadString(ctx); err != nil {
  1456. return thrift.PrependError("error reading field 1: ", err)
  1457. } else {
  1458. p.ChannelId = v
  1459. }
  1460. return nil
  1461. }
  1462. func (p *ChannelInfo) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  1463. if v, err := iprot.ReadString(ctx); err != nil {
  1464. return thrift.PrependError("error reading field 3: ", err)
  1465. } else {
  1466. p.Name = v
  1467. }
  1468. return nil
  1469. }
  1470. func (p *ChannelInfo) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
  1471. if v, err := iprot.ReadString(ctx); err != nil {
  1472. return thrift.PrependError("error reading field 4: ", err)
  1473. } else {
  1474. p.EntryPageUrl = v
  1475. }
  1476. return nil
  1477. }
  1478. func (p *ChannelInfo) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
  1479. if v, err := iprot.ReadString(ctx); err != nil {
  1480. return thrift.PrependError("error reading field 5: ", err)
  1481. } else {
  1482. p.DescriptionText = v
  1483. }
  1484. return nil
  1485. }
  1486. func (p *ChannelInfo) ReadField6(ctx context.Context, iprot thrift.TProtocol) error {
  1487. p.Provider = &ChannelProvider{}
  1488. if err := p.Provider.Read(ctx, iprot); err != nil {
  1489. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Provider), err)
  1490. }
  1491. return nil
  1492. }
  1493. func (p *ChannelInfo) ReadField7(ctx context.Context, iprot thrift.TProtocol) error {
  1494. if v, err := iprot.ReadI32(ctx); err != nil {
  1495. return thrift.PrependError("error reading field 7: ", err)
  1496. } else {
  1497. temp := PublicType(v)
  1498. p.PublicType = temp
  1499. }
  1500. return nil
  1501. }
  1502. func (p *ChannelInfo) ReadField8(ctx context.Context, iprot thrift.TProtocol) error {
  1503. if v, err := iprot.ReadString(ctx); err != nil {
  1504. return thrift.PrependError("error reading field 8: ", err)
  1505. } else {
  1506. p.IconImage = v
  1507. }
  1508. return nil
  1509. }
  1510. func (p *ChannelInfo) ReadField9(ctx context.Context, iprot thrift.TProtocol) error {
  1511. _, size, err := iprot.ReadListBegin(ctx)
  1512. if err != nil {
  1513. return thrift.PrependError("error reading list begin: ", err)
  1514. }
  1515. tSlice := make([]string, 0, size)
  1516. p.Permissions = tSlice
  1517. for i := 0; i < size; i ++ {
  1518. var _elem7 string
  1519. if v, err := iprot.ReadString(ctx); err != nil {
  1520. return thrift.PrependError("error reading field 0: ", err)
  1521. } else {
  1522. _elem7 = v
  1523. }
  1524. p.Permissions = append(p.Permissions, _elem7)
  1525. }
  1526. if err := iprot.ReadListEnd(ctx); err != nil {
  1527. return thrift.PrependError("error reading list end: ", err)
  1528. }
  1529. return nil
  1530. }
  1531. func (p *ChannelInfo) ReadField11(ctx context.Context, iprot thrift.TProtocol) error {
  1532. if v, err := iprot.ReadString(ctx); err != nil {
  1533. return thrift.PrependError("error reading field 11: ", err)
  1534. } else {
  1535. p.IconThumbnailImage = v
  1536. }
  1537. return nil
  1538. }
  1539. func (p *ChannelInfo) ReadField12(ctx context.Context, iprot thrift.TProtocol) error {
  1540. _, size, err := iprot.ReadListBegin(ctx)
  1541. if err != nil {
  1542. return thrift.PrependError("error reading list begin: ", err)
  1543. }
  1544. tSlice := make([]ChannelConfiguration, 0, size)
  1545. p.ChannelConfigurations = tSlice
  1546. for i := 0; i < size; i ++ {
  1547. var _elem8 ChannelConfiguration
  1548. if v, err := iprot.ReadI32(ctx); err != nil {
  1549. return thrift.PrependError("error reading field 0: ", err)
  1550. } else {
  1551. temp := ChannelConfiguration(v)
  1552. _elem8 = temp
  1553. }
  1554. p.ChannelConfigurations = append(p.ChannelConfigurations, _elem8)
  1555. }
  1556. if err := iprot.ReadListEnd(ctx); err != nil {
  1557. return thrift.PrependError("error reading list end: ", err)
  1558. }
  1559. return nil
  1560. }
  1561. func (p *ChannelInfo) ReadField13(ctx context.Context, iprot thrift.TProtocol) error {
  1562. if v, err := iprot.ReadBool(ctx); err != nil {
  1563. return thrift.PrependError("error reading field 13: ", err)
  1564. } else {
  1565. p.LcsAllApiUsable = v
  1566. }
  1567. return nil
  1568. }
  1569. func (p *ChannelInfo) ReadField14(ctx context.Context, iprot thrift.TProtocol) error {
  1570. _, size, err := iprot.ReadSetBegin(ctx)
  1571. if err != nil {
  1572. return thrift.PrependError("error reading set begin: ", err)
  1573. }
  1574. tSet := make([]ChannelAllowedPermission, 0, size)
  1575. p.AllowedPermissions = tSet
  1576. for i := 0; i < size; i ++ {
  1577. var _elem9 ChannelAllowedPermission
  1578. if v, err := iprot.ReadI32(ctx); err != nil {
  1579. return thrift.PrependError("error reading field 0: ", err)
  1580. } else {
  1581. temp := ChannelAllowedPermission(v)
  1582. _elem9 = temp
  1583. }
  1584. p.AllowedPermissions = append(p.AllowedPermissions, _elem9)
  1585. }
  1586. if err := iprot.ReadSetEnd(ctx); err != nil {
  1587. return thrift.PrependError("error reading set end: ", err)
  1588. }
  1589. return nil
  1590. }
  1591. func (p *ChannelInfo) ReadField15(ctx context.Context, iprot thrift.TProtocol) error {
  1592. _, size, err := iprot.ReadListBegin(ctx)
  1593. if err != nil {
  1594. return thrift.PrependError("error reading list begin: ", err)
  1595. }
  1596. tSlice := make([]*ChannelDomain, 0, size)
  1597. p.ChannelDomains = tSlice
  1598. for i := 0; i < size; i ++ {
  1599. _elem10 := &ChannelDomain{}
  1600. if err := _elem10.Read(ctx, iprot); err != nil {
  1601. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err)
  1602. }
  1603. p.ChannelDomains = append(p.ChannelDomains, _elem10)
  1604. }
  1605. if err := iprot.ReadListEnd(ctx); err != nil {
  1606. return thrift.PrependError("error reading list end: ", err)
  1607. }
  1608. return nil
  1609. }
  1610. func (p *ChannelInfo) ReadField16(ctx context.Context, iprot thrift.TProtocol) error {
  1611. if v, err := iprot.ReadI64(ctx); err != nil {
  1612. return thrift.PrependError("error reading field 16: ", err)
  1613. } else {
  1614. p.UpdatedTimestamp = v
  1615. }
  1616. return nil
  1617. }
  1618. func (p *ChannelInfo) ReadField17(ctx context.Context, iprot thrift.TProtocol) error {
  1619. _, size, err := iprot.ReadSetBegin(ctx)
  1620. if err != nil {
  1621. return thrift.PrependError("error reading set begin: ", err)
  1622. }
  1623. tSet := make([]ChannelFeatureLicense, 0, size)
  1624. p.FeatureLicenses = tSet
  1625. for i := 0; i < size; i ++ {
  1626. var _elem11 ChannelFeatureLicense
  1627. if v, err := iprot.ReadI32(ctx); err != nil {
  1628. return thrift.PrependError("error reading field 0: ", err)
  1629. } else {
  1630. temp := ChannelFeatureLicense(v)
  1631. _elem11 = temp
  1632. }
  1633. p.FeatureLicenses = append(p.FeatureLicenses, _elem11)
  1634. }
  1635. if err := iprot.ReadSetEnd(ctx); err != nil {
  1636. return thrift.PrependError("error reading set end: ", err)
  1637. }
  1638. return nil
  1639. }
  1640. func (p *ChannelInfo) Write(ctx context.Context, oprot thrift.TProtocol) error {
  1641. if err := oprot.WriteStructBegin(ctx, "ChannelInfo"); err != nil {
  1642. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  1643. if p != nil {
  1644. if err := p.writeField1(ctx, oprot); err != nil { return err }
  1645. if err := p.writeField3(ctx, oprot); err != nil { return err }
  1646. if err := p.writeField4(ctx, oprot); err != nil { return err }
  1647. if err := p.writeField5(ctx, oprot); err != nil { return err }
  1648. if err := p.writeField6(ctx, oprot); err != nil { return err }
  1649. if err := p.writeField7(ctx, oprot); err != nil { return err }
  1650. if err := p.writeField8(ctx, oprot); err != nil { return err }
  1651. if err := p.writeField9(ctx, oprot); err != nil { return err }
  1652. if err := p.writeField11(ctx, oprot); err != nil { return err }
  1653. if err := p.writeField12(ctx, oprot); err != nil { return err }
  1654. if err := p.writeField13(ctx, oprot); err != nil { return err }
  1655. if err := p.writeField14(ctx, oprot); err != nil { return err }
  1656. if err := p.writeField15(ctx, oprot); err != nil { return err }
  1657. if err := p.writeField16(ctx, oprot); err != nil { return err }
  1658. if err := p.writeField17(ctx, oprot); err != nil { return err }
  1659. }
  1660. if err := oprot.WriteFieldStop(ctx); err != nil {
  1661. return thrift.PrependError("write field stop error: ", err) }
  1662. if err := oprot.WriteStructEnd(ctx); err != nil {
  1663. return thrift.PrependError("write struct stop error: ", err) }
  1664. return nil
  1665. }
  1666. func (p *ChannelInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1667. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 1); err != nil {
  1668. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelId: ", p), err) }
  1669. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  1670. return thrift.PrependError(fmt.Sprintf("%T.channelId (1) field write error: ", p), err) }
  1671. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1672. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelId: ", p), err) }
  1673. return err
  1674. }
  1675. func (p *ChannelInfo) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1676. if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 3); err != nil {
  1677. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) }
  1678. if err := oprot.WriteString(ctx, string(p.Name)); err != nil {
  1679. return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) }
  1680. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1681. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) }
  1682. return err
  1683. }
  1684. func (p *ChannelInfo) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1685. if err := oprot.WriteFieldBegin(ctx, "entryPageUrl", thrift.STRING, 4); err != nil {
  1686. return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:entryPageUrl: ", p), err) }
  1687. if err := oprot.WriteString(ctx, string(p.EntryPageUrl)); err != nil {
  1688. return thrift.PrependError(fmt.Sprintf("%T.entryPageUrl (4) field write error: ", p), err) }
  1689. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1690. return thrift.PrependError(fmt.Sprintf("%T write field end error 4:entryPageUrl: ", p), err) }
  1691. return err
  1692. }
  1693. func (p *ChannelInfo) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1694. if err := oprot.WriteFieldBegin(ctx, "descriptionText", thrift.STRING, 5); err != nil {
  1695. return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:descriptionText: ", p), err) }
  1696. if err := oprot.WriteString(ctx, string(p.DescriptionText)); err != nil {
  1697. return thrift.PrependError(fmt.Sprintf("%T.descriptionText (5) field write error: ", p), err) }
  1698. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1699. return thrift.PrependError(fmt.Sprintf("%T write field end error 5:descriptionText: ", p), err) }
  1700. return err
  1701. }
  1702. func (p *ChannelInfo) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1703. if err := oprot.WriteFieldBegin(ctx, "provider", thrift.STRUCT, 6); err != nil {
  1704. return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:provider: ", p), err) }
  1705. if err := p.Provider.Write(ctx, oprot); err != nil {
  1706. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Provider), err)
  1707. }
  1708. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1709. return thrift.PrependError(fmt.Sprintf("%T write field end error 6:provider: ", p), err) }
  1710. return err
  1711. }
  1712. func (p *ChannelInfo) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1713. if err := oprot.WriteFieldBegin(ctx, "publicType", thrift.I32, 7); err != nil {
  1714. return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:publicType: ", p), err) }
  1715. if err := oprot.WriteI32(ctx, int32(p.PublicType)); err != nil {
  1716. return thrift.PrependError(fmt.Sprintf("%T.publicType (7) field write error: ", p), err) }
  1717. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1718. return thrift.PrependError(fmt.Sprintf("%T write field end error 7:publicType: ", p), err) }
  1719. return err
  1720. }
  1721. func (p *ChannelInfo) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1722. if err := oprot.WriteFieldBegin(ctx, "iconImage", thrift.STRING, 8); err != nil {
  1723. return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:iconImage: ", p), err) }
  1724. if err := oprot.WriteString(ctx, string(p.IconImage)); err != nil {
  1725. return thrift.PrependError(fmt.Sprintf("%T.iconImage (8) field write error: ", p), err) }
  1726. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1727. return thrift.PrependError(fmt.Sprintf("%T write field end error 8:iconImage: ", p), err) }
  1728. return err
  1729. }
  1730. func (p *ChannelInfo) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1731. if err := oprot.WriteFieldBegin(ctx, "permissions", thrift.LIST, 9); err != nil {
  1732. return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:permissions: ", p), err) }
  1733. if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Permissions)); err != nil {
  1734. return thrift.PrependError("error writing list begin: ", err)
  1735. }
  1736. for _, v := range p.Permissions {
  1737. if err := oprot.WriteString(ctx, string(v)); err != nil {
  1738. return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  1739. }
  1740. if err := oprot.WriteListEnd(ctx); err != nil {
  1741. return thrift.PrependError("error writing list end: ", err)
  1742. }
  1743. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1744. return thrift.PrependError(fmt.Sprintf("%T write field end error 9:permissions: ", p), err) }
  1745. return err
  1746. }
  1747. func (p *ChannelInfo) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1748. if err := oprot.WriteFieldBegin(ctx, "iconThumbnailImage", thrift.STRING, 11); err != nil {
  1749. return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:iconThumbnailImage: ", p), err) }
  1750. if err := oprot.WriteString(ctx, string(p.IconThumbnailImage)); err != nil {
  1751. return thrift.PrependError(fmt.Sprintf("%T.iconThumbnailImage (11) field write error: ", p), err) }
  1752. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1753. return thrift.PrependError(fmt.Sprintf("%T write field end error 11:iconThumbnailImage: ", p), err) }
  1754. return err
  1755. }
  1756. func (p *ChannelInfo) writeField12(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1757. if err := oprot.WriteFieldBegin(ctx, "channelConfigurations", thrift.LIST, 12); err != nil {
  1758. return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:channelConfigurations: ", p), err) }
  1759. if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.ChannelConfigurations)); err != nil {
  1760. return thrift.PrependError("error writing list begin: ", err)
  1761. }
  1762. for _, v := range p.ChannelConfigurations {
  1763. if err := oprot.WriteI32(ctx, int32(v)); err != nil {
  1764. return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  1765. }
  1766. if err := oprot.WriteListEnd(ctx); err != nil {
  1767. return thrift.PrependError("error writing list end: ", err)
  1768. }
  1769. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1770. return thrift.PrependError(fmt.Sprintf("%T write field end error 12:channelConfigurations: ", p), err) }
  1771. return err
  1772. }
  1773. func (p *ChannelInfo) writeField13(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1774. if err := oprot.WriteFieldBegin(ctx, "lcsAllApiUsable", thrift.BOOL, 13); err != nil {
  1775. return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:lcsAllApiUsable: ", p), err) }
  1776. if err := oprot.WriteBool(ctx, bool(p.LcsAllApiUsable)); err != nil {
  1777. return thrift.PrependError(fmt.Sprintf("%T.lcsAllApiUsable (13) field write error: ", p), err) }
  1778. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1779. return thrift.PrependError(fmt.Sprintf("%T write field end error 13:lcsAllApiUsable: ", p), err) }
  1780. return err
  1781. }
  1782. func (p *ChannelInfo) writeField14(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1783. if err := oprot.WriteFieldBegin(ctx, "allowedPermissions", thrift.SET, 14); err != nil {
  1784. return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:allowedPermissions: ", p), err) }
  1785. if err := oprot.WriteSetBegin(ctx, thrift.I32, len(p.AllowedPermissions)); err != nil {
  1786. return thrift.PrependError("error writing set begin: ", err)
  1787. }
  1788. for i := 0; i<len(p.AllowedPermissions); i++ {
  1789. for j := i+1; j<len(p.AllowedPermissions); j++ {
  1790. if func(tgt, src ChannelAllowedPermission) bool {
  1791. if tgt != src { return false }
  1792. return true
  1793. }(p.AllowedPermissions[i], p.AllowedPermissions[j]) {
  1794. return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.AllowedPermissions))
  1795. }
  1796. }
  1797. }
  1798. for _, v := range p.AllowedPermissions {
  1799. if err := oprot.WriteI32(ctx, int32(v)); err != nil {
  1800. return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  1801. }
  1802. if err := oprot.WriteSetEnd(ctx); err != nil {
  1803. return thrift.PrependError("error writing set end: ", err)
  1804. }
  1805. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1806. return thrift.PrependError(fmt.Sprintf("%T write field end error 14:allowedPermissions: ", p), err) }
  1807. return err
  1808. }
  1809. func (p *ChannelInfo) writeField15(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1810. if err := oprot.WriteFieldBegin(ctx, "channelDomains", thrift.LIST, 15); err != nil {
  1811. return thrift.PrependError(fmt.Sprintf("%T write field begin error 15:channelDomains: ", p), err) }
  1812. if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ChannelDomains)); err != nil {
  1813. return thrift.PrependError("error writing list begin: ", err)
  1814. }
  1815. for _, v := range p.ChannelDomains {
  1816. if err := v.Write(ctx, oprot); err != nil {
  1817. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
  1818. }
  1819. }
  1820. if err := oprot.WriteListEnd(ctx); err != nil {
  1821. return thrift.PrependError("error writing list end: ", err)
  1822. }
  1823. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1824. return thrift.PrependError(fmt.Sprintf("%T write field end error 15:channelDomains: ", p), err) }
  1825. return err
  1826. }
  1827. func (p *ChannelInfo) writeField16(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1828. if err := oprot.WriteFieldBegin(ctx, "updatedTimestamp", thrift.I64, 16); err != nil {
  1829. return thrift.PrependError(fmt.Sprintf("%T write field begin error 16:updatedTimestamp: ", p), err) }
  1830. if err := oprot.WriteI64(ctx, int64(p.UpdatedTimestamp)); err != nil {
  1831. return thrift.PrependError(fmt.Sprintf("%T.updatedTimestamp (16) field write error: ", p), err) }
  1832. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1833. return thrift.PrependError(fmt.Sprintf("%T write field end error 16:updatedTimestamp: ", p), err) }
  1834. return err
  1835. }
  1836. func (p *ChannelInfo) writeField17(ctx context.Context, oprot thrift.TProtocol) (err error) {
  1837. if err := oprot.WriteFieldBegin(ctx, "featureLicenses", thrift.SET, 17); err != nil {
  1838. return thrift.PrependError(fmt.Sprintf("%T write field begin error 17:featureLicenses: ", p), err) }
  1839. if err := oprot.WriteSetBegin(ctx, thrift.I32, len(p.FeatureLicenses)); err != nil {
  1840. return thrift.PrependError("error writing set begin: ", err)
  1841. }
  1842. for i := 0; i<len(p.FeatureLicenses); i++ {
  1843. for j := i+1; j<len(p.FeatureLicenses); j++ {
  1844. if func(tgt, src ChannelFeatureLicense) bool {
  1845. if tgt != src { return false }
  1846. return true
  1847. }(p.FeatureLicenses[i], p.FeatureLicenses[j]) {
  1848. return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.FeatureLicenses))
  1849. }
  1850. }
  1851. }
  1852. for _, v := range p.FeatureLicenses {
  1853. if err := oprot.WriteI32(ctx, int32(v)); err != nil {
  1854. return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  1855. }
  1856. if err := oprot.WriteSetEnd(ctx); err != nil {
  1857. return thrift.PrependError("error writing set end: ", err)
  1858. }
  1859. if err := oprot.WriteFieldEnd(ctx); err != nil {
  1860. return thrift.PrependError(fmt.Sprintf("%T write field end error 17:featureLicenses: ", p), err) }
  1861. return err
  1862. }
  1863. func (p *ChannelInfo) Equals(other *ChannelInfo) bool {
  1864. if p == other {
  1865. return true
  1866. } else if p == nil || other == nil {
  1867. return false
  1868. }
  1869. if p.ChannelId != other.ChannelId { return false }
  1870. if p.Name != other.Name { return false }
  1871. if p.EntryPageUrl != other.EntryPageUrl { return false }
  1872. if p.DescriptionText != other.DescriptionText { return false }
  1873. if !p.Provider.Equals(other.Provider) { return false }
  1874. if p.PublicType != other.PublicType { return false }
  1875. if p.IconImage != other.IconImage { return false }
  1876. if len(p.Permissions) != len(other.Permissions) { return false }
  1877. for i, _tgt := range p.Permissions {
  1878. _src12 := other.Permissions[i]
  1879. if _tgt != _src12 { return false }
  1880. }
  1881. if p.IconThumbnailImage != other.IconThumbnailImage { return false }
  1882. if len(p.ChannelConfigurations) != len(other.ChannelConfigurations) { return false }
  1883. for i, _tgt := range p.ChannelConfigurations {
  1884. _src13 := other.ChannelConfigurations[i]
  1885. if _tgt != _src13 { return false }
  1886. }
  1887. if p.LcsAllApiUsable != other.LcsAllApiUsable { return false }
  1888. if len(p.AllowedPermissions) != len(other.AllowedPermissions) { return false }
  1889. for i, _tgt := range p.AllowedPermissions {
  1890. _src14 := other.AllowedPermissions[i]
  1891. if _tgt != _src14 { return false }
  1892. }
  1893. if len(p.ChannelDomains) != len(other.ChannelDomains) { return false }
  1894. for i, _tgt := range p.ChannelDomains {
  1895. _src15 := other.ChannelDomains[i]
  1896. if !_tgt.Equals(_src15) { return false }
  1897. }
  1898. if p.UpdatedTimestamp != other.UpdatedTimestamp { return false }
  1899. if len(p.FeatureLicenses) != len(other.FeatureLicenses) { return false }
  1900. for i, _tgt := range p.FeatureLicenses {
  1901. _src16 := other.FeatureLicenses[i]
  1902. if _tgt != _src16 { return false }
  1903. }
  1904. return true
  1905. }
  1906. func (p *ChannelInfo) String() string {
  1907. if p == nil {
  1908. return "<nil>"
  1909. }
  1910. return fmt.Sprintf("ChannelInfo(%+v)", *p)
  1911. }
  1912. // Attributes:
  1913. // - ChannelId
  1914. // - Name
  1915. // - NotificationReceivable
  1916. // - MessageReceivable
  1917. // - ShowDefault
  1918. type ChannelNotificationSetting struct {
  1919. ChannelId string `thrift:"channelId,1" db:"channelId" json:"channelId"`
  1920. Name string `thrift:"name,2" db:"name" json:"name"`
  1921. NotificationReceivable bool `thrift:"notificationReceivable,3" db:"notificationReceivable" json:"notificationReceivable"`
  1922. MessageReceivable bool `thrift:"messageReceivable,4" db:"messageReceivable" json:"messageReceivable"`
  1923. ShowDefault bool `thrift:"showDefault,5" db:"showDefault" json:"showDefault"`
  1924. }
  1925. func NewChannelNotificationSetting() *ChannelNotificationSetting {
  1926. return &ChannelNotificationSetting{}
  1927. }
  1928. func (p *ChannelNotificationSetting) GetChannelId() string {
  1929. return p.ChannelId
  1930. }
  1931. func (p *ChannelNotificationSetting) GetName() string {
  1932. return p.Name
  1933. }
  1934. func (p *ChannelNotificationSetting) GetNotificationReceivable() bool {
  1935. return p.NotificationReceivable
  1936. }
  1937. func (p *ChannelNotificationSetting) GetMessageReceivable() bool {
  1938. return p.MessageReceivable
  1939. }
  1940. func (p *ChannelNotificationSetting) GetShowDefault() bool {
  1941. return p.ShowDefault
  1942. }
  1943. func (p *ChannelNotificationSetting) Read(ctx context.Context, iprot thrift.TProtocol) error {
  1944. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  1945. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  1946. }
  1947. for {
  1948. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  1949. if err != nil {
  1950. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  1951. }
  1952. if fieldTypeId == thrift.STOP { break; }
  1953. switch fieldId {
  1954. case 1:
  1955. if fieldTypeId == thrift.STRING {
  1956. if err := p.ReadField1(ctx, iprot); err != nil {
  1957. return err
  1958. }
  1959. } else {
  1960. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1961. return err
  1962. }
  1963. }
  1964. case 2:
  1965. if fieldTypeId == thrift.STRING {
  1966. if err := p.ReadField2(ctx, iprot); err != nil {
  1967. return err
  1968. }
  1969. } else {
  1970. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1971. return err
  1972. }
  1973. }
  1974. case 3:
  1975. if fieldTypeId == thrift.BOOL {
  1976. if err := p.ReadField3(ctx, iprot); err != nil {
  1977. return err
  1978. }
  1979. } else {
  1980. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1981. return err
  1982. }
  1983. }
  1984. case 4:
  1985. if fieldTypeId == thrift.BOOL {
  1986. if err := p.ReadField4(ctx, iprot); err != nil {
  1987. return err
  1988. }
  1989. } else {
  1990. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  1991. return err
  1992. }
  1993. }
  1994. case 5:
  1995. if fieldTypeId == thrift.BOOL {
  1996. if err := p.ReadField5(ctx, iprot); err != nil {
  1997. return err
  1998. }
  1999. } else {
  2000. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2001. return err
  2002. }
  2003. }
  2004. default:
  2005. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2006. return err
  2007. }
  2008. }
  2009. if err := iprot.ReadFieldEnd(ctx); err != nil {
  2010. return err
  2011. }
  2012. }
  2013. if err := iprot.ReadStructEnd(ctx); err != nil {
  2014. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  2015. }
  2016. return nil
  2017. }
  2018. func (p *ChannelNotificationSetting) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  2019. if v, err := iprot.ReadString(ctx); err != nil {
  2020. return thrift.PrependError("error reading field 1: ", err)
  2021. } else {
  2022. p.ChannelId = v
  2023. }
  2024. return nil
  2025. }
  2026. func (p *ChannelNotificationSetting) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  2027. if v, err := iprot.ReadString(ctx); err != nil {
  2028. return thrift.PrependError("error reading field 2: ", err)
  2029. } else {
  2030. p.Name = v
  2031. }
  2032. return nil
  2033. }
  2034. func (p *ChannelNotificationSetting) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  2035. if v, err := iprot.ReadBool(ctx); err != nil {
  2036. return thrift.PrependError("error reading field 3: ", err)
  2037. } else {
  2038. p.NotificationReceivable = v
  2039. }
  2040. return nil
  2041. }
  2042. func (p *ChannelNotificationSetting) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
  2043. if v, err := iprot.ReadBool(ctx); err != nil {
  2044. return thrift.PrependError("error reading field 4: ", err)
  2045. } else {
  2046. p.MessageReceivable = v
  2047. }
  2048. return nil
  2049. }
  2050. func (p *ChannelNotificationSetting) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
  2051. if v, err := iprot.ReadBool(ctx); err != nil {
  2052. return thrift.PrependError("error reading field 5: ", err)
  2053. } else {
  2054. p.ShowDefault = v
  2055. }
  2056. return nil
  2057. }
  2058. func (p *ChannelNotificationSetting) Write(ctx context.Context, oprot thrift.TProtocol) error {
  2059. if err := oprot.WriteStructBegin(ctx, "ChannelNotificationSetting"); err != nil {
  2060. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  2061. if p != nil {
  2062. if err := p.writeField1(ctx, oprot); err != nil { return err }
  2063. if err := p.writeField2(ctx, oprot); err != nil { return err }
  2064. if err := p.writeField3(ctx, oprot); err != nil { return err }
  2065. if err := p.writeField4(ctx, oprot); err != nil { return err }
  2066. if err := p.writeField5(ctx, oprot); err != nil { return err }
  2067. }
  2068. if err := oprot.WriteFieldStop(ctx); err != nil {
  2069. return thrift.PrependError("write field stop error: ", err) }
  2070. if err := oprot.WriteStructEnd(ctx); err != nil {
  2071. return thrift.PrependError("write struct stop error: ", err) }
  2072. return nil
  2073. }
  2074. func (p *ChannelNotificationSetting) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2075. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 1); err != nil {
  2076. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelId: ", p), err) }
  2077. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  2078. return thrift.PrependError(fmt.Sprintf("%T.channelId (1) field write error: ", p), err) }
  2079. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2080. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelId: ", p), err) }
  2081. return err
  2082. }
  2083. func (p *ChannelNotificationSetting) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2084. if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil {
  2085. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) }
  2086. if err := oprot.WriteString(ctx, string(p.Name)); err != nil {
  2087. return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) }
  2088. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2089. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) }
  2090. return err
  2091. }
  2092. func (p *ChannelNotificationSetting) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2093. if err := oprot.WriteFieldBegin(ctx, "notificationReceivable", thrift.BOOL, 3); err != nil {
  2094. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:notificationReceivable: ", p), err) }
  2095. if err := oprot.WriteBool(ctx, bool(p.NotificationReceivable)); err != nil {
  2096. return thrift.PrependError(fmt.Sprintf("%T.notificationReceivable (3) field write error: ", p), err) }
  2097. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2098. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:notificationReceivable: ", p), err) }
  2099. return err
  2100. }
  2101. func (p *ChannelNotificationSetting) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2102. if err := oprot.WriteFieldBegin(ctx, "messageReceivable", thrift.BOOL, 4); err != nil {
  2103. return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:messageReceivable: ", p), err) }
  2104. if err := oprot.WriteBool(ctx, bool(p.MessageReceivable)); err != nil {
  2105. return thrift.PrependError(fmt.Sprintf("%T.messageReceivable (4) field write error: ", p), err) }
  2106. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2107. return thrift.PrependError(fmt.Sprintf("%T write field end error 4:messageReceivable: ", p), err) }
  2108. return err
  2109. }
  2110. func (p *ChannelNotificationSetting) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2111. if err := oprot.WriteFieldBegin(ctx, "showDefault", thrift.BOOL, 5); err != nil {
  2112. return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:showDefault: ", p), err) }
  2113. if err := oprot.WriteBool(ctx, bool(p.ShowDefault)); err != nil {
  2114. return thrift.PrependError(fmt.Sprintf("%T.showDefault (5) field write error: ", p), err) }
  2115. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2116. return thrift.PrependError(fmt.Sprintf("%T write field end error 5:showDefault: ", p), err) }
  2117. return err
  2118. }
  2119. func (p *ChannelNotificationSetting) Equals(other *ChannelNotificationSetting) bool {
  2120. if p == other {
  2121. return true
  2122. } else if p == nil || other == nil {
  2123. return false
  2124. }
  2125. if p.ChannelId != other.ChannelId { return false }
  2126. if p.Name != other.Name { return false }
  2127. if p.NotificationReceivable != other.NotificationReceivable { return false }
  2128. if p.MessageReceivable != other.MessageReceivable { return false }
  2129. if p.ShowDefault != other.ShowDefault { return false }
  2130. return true
  2131. }
  2132. func (p *ChannelNotificationSetting) String() string {
  2133. if p == nil {
  2134. return "<nil>"
  2135. }
  2136. return fmt.Sprintf("ChannelNotificationSetting(%+v)", *p)
  2137. }
  2138. // Attributes:
  2139. // - Name
  2140. type ChannelProvider struct {
  2141. Name string `thrift:"name,1" db:"name" json:"name"`
  2142. }
  2143. func NewChannelProvider() *ChannelProvider {
  2144. return &ChannelProvider{}
  2145. }
  2146. func (p *ChannelProvider) GetName() string {
  2147. return p.Name
  2148. }
  2149. func (p *ChannelProvider) Read(ctx context.Context, iprot thrift.TProtocol) error {
  2150. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  2151. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  2152. }
  2153. for {
  2154. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  2155. if err != nil {
  2156. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  2157. }
  2158. if fieldTypeId == thrift.STOP { break; }
  2159. switch fieldId {
  2160. case 1:
  2161. if fieldTypeId == thrift.STRING {
  2162. if err := p.ReadField1(ctx, iprot); err != nil {
  2163. return err
  2164. }
  2165. } else {
  2166. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2167. return err
  2168. }
  2169. }
  2170. default:
  2171. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2172. return err
  2173. }
  2174. }
  2175. if err := iprot.ReadFieldEnd(ctx); err != nil {
  2176. return err
  2177. }
  2178. }
  2179. if err := iprot.ReadStructEnd(ctx); err != nil {
  2180. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  2181. }
  2182. return nil
  2183. }
  2184. func (p *ChannelProvider) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  2185. if v, err := iprot.ReadString(ctx); err != nil {
  2186. return thrift.PrependError("error reading field 1: ", err)
  2187. } else {
  2188. p.Name = v
  2189. }
  2190. return nil
  2191. }
  2192. func (p *ChannelProvider) Write(ctx context.Context, oprot thrift.TProtocol) error {
  2193. if err := oprot.WriteStructBegin(ctx, "ChannelProvider"); err != nil {
  2194. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  2195. if p != nil {
  2196. if err := p.writeField1(ctx, oprot); err != nil { return err }
  2197. }
  2198. if err := oprot.WriteFieldStop(ctx); err != nil {
  2199. return thrift.PrependError("write field stop error: ", err) }
  2200. if err := oprot.WriteStructEnd(ctx); err != nil {
  2201. return thrift.PrependError("write struct stop error: ", err) }
  2202. return nil
  2203. }
  2204. func (p *ChannelProvider) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2205. if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 1); err != nil {
  2206. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  2207. if err := oprot.WriteString(ctx, string(p.Name)); err != nil {
  2208. return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  2209. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2210. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  2211. return err
  2212. }
  2213. func (p *ChannelProvider) Equals(other *ChannelProvider) bool {
  2214. if p == other {
  2215. return true
  2216. } else if p == nil || other == nil {
  2217. return false
  2218. }
  2219. if p.Name != other.Name { return false }
  2220. return true
  2221. }
  2222. func (p *ChannelProvider) String() string {
  2223. if p == nil {
  2224. return "<nil>"
  2225. }
  2226. return fmt.Sprintf("ChannelProvider(%+v)", *p)
  2227. }
  2228. // Attributes:
  2229. // - UnapprovedMessageReceivable
  2230. type ChannelSettings struct {
  2231. UnapprovedMessageReceivable bool `thrift:"unapprovedMessageReceivable,1" db:"unapprovedMessageReceivable" json:"unapprovedMessageReceivable"`
  2232. }
  2233. func NewChannelSettings() *ChannelSettings {
  2234. return &ChannelSettings{}
  2235. }
  2236. func (p *ChannelSettings) GetUnapprovedMessageReceivable() bool {
  2237. return p.UnapprovedMessageReceivable
  2238. }
  2239. func (p *ChannelSettings) Read(ctx context.Context, iprot thrift.TProtocol) error {
  2240. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  2241. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  2242. }
  2243. for {
  2244. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  2245. if err != nil {
  2246. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  2247. }
  2248. if fieldTypeId == thrift.STOP { break; }
  2249. switch fieldId {
  2250. case 1:
  2251. if fieldTypeId == thrift.BOOL {
  2252. if err := p.ReadField1(ctx, iprot); err != nil {
  2253. return err
  2254. }
  2255. } else {
  2256. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2257. return err
  2258. }
  2259. }
  2260. default:
  2261. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2262. return err
  2263. }
  2264. }
  2265. if err := iprot.ReadFieldEnd(ctx); err != nil {
  2266. return err
  2267. }
  2268. }
  2269. if err := iprot.ReadStructEnd(ctx); err != nil {
  2270. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  2271. }
  2272. return nil
  2273. }
  2274. func (p *ChannelSettings) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  2275. if v, err := iprot.ReadBool(ctx); err != nil {
  2276. return thrift.PrependError("error reading field 1: ", err)
  2277. } else {
  2278. p.UnapprovedMessageReceivable = v
  2279. }
  2280. return nil
  2281. }
  2282. func (p *ChannelSettings) Write(ctx context.Context, oprot thrift.TProtocol) error {
  2283. if err := oprot.WriteStructBegin(ctx, "ChannelSettings"); err != nil {
  2284. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  2285. if p != nil {
  2286. if err := p.writeField1(ctx, oprot); err != nil { return err }
  2287. }
  2288. if err := oprot.WriteFieldStop(ctx); err != nil {
  2289. return thrift.PrependError("write field stop error: ", err) }
  2290. if err := oprot.WriteStructEnd(ctx); err != nil {
  2291. return thrift.PrependError("write struct stop error: ", err) }
  2292. return nil
  2293. }
  2294. func (p *ChannelSettings) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2295. if err := oprot.WriteFieldBegin(ctx, "unapprovedMessageReceivable", thrift.BOOL, 1); err != nil {
  2296. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:unapprovedMessageReceivable: ", p), err) }
  2297. if err := oprot.WriteBool(ctx, bool(p.UnapprovedMessageReceivable)); err != nil {
  2298. return thrift.PrependError(fmt.Sprintf("%T.unapprovedMessageReceivable (1) field write error: ", p), err) }
  2299. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2300. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:unapprovedMessageReceivable: ", p), err) }
  2301. return err
  2302. }
  2303. func (p *ChannelSettings) Equals(other *ChannelSettings) bool {
  2304. if p == other {
  2305. return true
  2306. } else if p == nil || other == nil {
  2307. return false
  2308. }
  2309. if p.UnapprovedMessageReceivable != other.UnapprovedMessageReceivable { return false }
  2310. return true
  2311. }
  2312. func (p *ChannelSettings) String() string {
  2313. if p == nil {
  2314. return "<nil>"
  2315. }
  2316. return fmt.Sprintf("ChannelSettings(%+v)", *p)
  2317. }
  2318. // Attributes:
  2319. // - Token
  2320. // - ObsToken
  2321. // - Expiration
  2322. // - RefreshToken
  2323. // - ChannelAccessToken
  2324. type ChannelToken struct {
  2325. Token string `thrift:"token,1" db:"token" json:"token"`
  2326. ObsToken string `thrift:"obsToken,2" db:"obsToken" json:"obsToken"`
  2327. Expiration int64 `thrift:"expiration,3" db:"expiration" json:"expiration"`
  2328. RefreshToken string `thrift:"refreshToken,4" db:"refreshToken" json:"refreshToken"`
  2329. ChannelAccessToken string `thrift:"channelAccessToken,5" db:"channelAccessToken" json:"channelAccessToken"`
  2330. }
  2331. func NewChannelToken() *ChannelToken {
  2332. return &ChannelToken{}
  2333. }
  2334. func (p *ChannelToken) GetToken() string {
  2335. return p.Token
  2336. }
  2337. func (p *ChannelToken) GetObsToken() string {
  2338. return p.ObsToken
  2339. }
  2340. func (p *ChannelToken) GetExpiration() int64 {
  2341. return p.Expiration
  2342. }
  2343. func (p *ChannelToken) GetRefreshToken() string {
  2344. return p.RefreshToken
  2345. }
  2346. func (p *ChannelToken) GetChannelAccessToken() string {
  2347. return p.ChannelAccessToken
  2348. }
  2349. func (p *ChannelToken) Read(ctx context.Context, iprot thrift.TProtocol) error {
  2350. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  2351. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  2352. }
  2353. for {
  2354. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  2355. if err != nil {
  2356. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  2357. }
  2358. if fieldTypeId == thrift.STOP { break; }
  2359. switch fieldId {
  2360. case 1:
  2361. if fieldTypeId == thrift.STRING {
  2362. if err := p.ReadField1(ctx, iprot); err != nil {
  2363. return err
  2364. }
  2365. } else {
  2366. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2367. return err
  2368. }
  2369. }
  2370. case 2:
  2371. if fieldTypeId == thrift.STRING {
  2372. if err := p.ReadField2(ctx, iprot); err != nil {
  2373. return err
  2374. }
  2375. } else {
  2376. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2377. return err
  2378. }
  2379. }
  2380. case 3:
  2381. if fieldTypeId == thrift.I64 {
  2382. if err := p.ReadField3(ctx, iprot); err != nil {
  2383. return err
  2384. }
  2385. } else {
  2386. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2387. return err
  2388. }
  2389. }
  2390. case 4:
  2391. if fieldTypeId == thrift.STRING {
  2392. if err := p.ReadField4(ctx, iprot); err != nil {
  2393. return err
  2394. }
  2395. } else {
  2396. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2397. return err
  2398. }
  2399. }
  2400. case 5:
  2401. if fieldTypeId == thrift.STRING {
  2402. if err := p.ReadField5(ctx, iprot); err != nil {
  2403. return err
  2404. }
  2405. } else {
  2406. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2407. return err
  2408. }
  2409. }
  2410. default:
  2411. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2412. return err
  2413. }
  2414. }
  2415. if err := iprot.ReadFieldEnd(ctx); err != nil {
  2416. return err
  2417. }
  2418. }
  2419. if err := iprot.ReadStructEnd(ctx); err != nil {
  2420. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  2421. }
  2422. return nil
  2423. }
  2424. func (p *ChannelToken) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  2425. if v, err := iprot.ReadString(ctx); err != nil {
  2426. return thrift.PrependError("error reading field 1: ", err)
  2427. } else {
  2428. p.Token = v
  2429. }
  2430. return nil
  2431. }
  2432. func (p *ChannelToken) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  2433. if v, err := iprot.ReadString(ctx); err != nil {
  2434. return thrift.PrependError("error reading field 2: ", err)
  2435. } else {
  2436. p.ObsToken = v
  2437. }
  2438. return nil
  2439. }
  2440. func (p *ChannelToken) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  2441. if v, err := iprot.ReadI64(ctx); err != nil {
  2442. return thrift.PrependError("error reading field 3: ", err)
  2443. } else {
  2444. p.Expiration = v
  2445. }
  2446. return nil
  2447. }
  2448. func (p *ChannelToken) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
  2449. if v, err := iprot.ReadString(ctx); err != nil {
  2450. return thrift.PrependError("error reading field 4: ", err)
  2451. } else {
  2452. p.RefreshToken = v
  2453. }
  2454. return nil
  2455. }
  2456. func (p *ChannelToken) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
  2457. if v, err := iprot.ReadString(ctx); err != nil {
  2458. return thrift.PrependError("error reading field 5: ", err)
  2459. } else {
  2460. p.ChannelAccessToken = v
  2461. }
  2462. return nil
  2463. }
  2464. func (p *ChannelToken) Write(ctx context.Context, oprot thrift.TProtocol) error {
  2465. if err := oprot.WriteStructBegin(ctx, "ChannelToken"); err != nil {
  2466. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  2467. if p != nil {
  2468. if err := p.writeField1(ctx, oprot); err != nil { return err }
  2469. if err := p.writeField2(ctx, oprot); err != nil { return err }
  2470. if err := p.writeField3(ctx, oprot); err != nil { return err }
  2471. if err := p.writeField4(ctx, oprot); err != nil { return err }
  2472. if err := p.writeField5(ctx, oprot); err != nil { return err }
  2473. }
  2474. if err := oprot.WriteFieldStop(ctx); err != nil {
  2475. return thrift.PrependError("write field stop error: ", err) }
  2476. if err := oprot.WriteStructEnd(ctx); err != nil {
  2477. return thrift.PrependError("write struct stop error: ", err) }
  2478. return nil
  2479. }
  2480. func (p *ChannelToken) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2481. if err := oprot.WriteFieldBegin(ctx, "token", thrift.STRING, 1); err != nil {
  2482. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:token: ", p), err) }
  2483. if err := oprot.WriteString(ctx, string(p.Token)); err != nil {
  2484. return thrift.PrependError(fmt.Sprintf("%T.token (1) field write error: ", p), err) }
  2485. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2486. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:token: ", p), err) }
  2487. return err
  2488. }
  2489. func (p *ChannelToken) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2490. if err := oprot.WriteFieldBegin(ctx, "obsToken", thrift.STRING, 2); err != nil {
  2491. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:obsToken: ", p), err) }
  2492. if err := oprot.WriteString(ctx, string(p.ObsToken)); err != nil {
  2493. return thrift.PrependError(fmt.Sprintf("%T.obsToken (2) field write error: ", p), err) }
  2494. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2495. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:obsToken: ", p), err) }
  2496. return err
  2497. }
  2498. func (p *ChannelToken) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2499. if err := oprot.WriteFieldBegin(ctx, "expiration", thrift.I64, 3); err != nil {
  2500. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:expiration: ", p), err) }
  2501. if err := oprot.WriteI64(ctx, int64(p.Expiration)); err != nil {
  2502. return thrift.PrependError(fmt.Sprintf("%T.expiration (3) field write error: ", p), err) }
  2503. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2504. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:expiration: ", p), err) }
  2505. return err
  2506. }
  2507. func (p *ChannelToken) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2508. if err := oprot.WriteFieldBegin(ctx, "refreshToken", thrift.STRING, 4); err != nil {
  2509. return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:refreshToken: ", p), err) }
  2510. if err := oprot.WriteString(ctx, string(p.RefreshToken)); err != nil {
  2511. return thrift.PrependError(fmt.Sprintf("%T.refreshToken (4) field write error: ", p), err) }
  2512. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2513. return thrift.PrependError(fmt.Sprintf("%T write field end error 4:refreshToken: ", p), err) }
  2514. return err
  2515. }
  2516. func (p *ChannelToken) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2517. if err := oprot.WriteFieldBegin(ctx, "channelAccessToken", thrift.STRING, 5); err != nil {
  2518. return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:channelAccessToken: ", p), err) }
  2519. if err := oprot.WriteString(ctx, string(p.ChannelAccessToken)); err != nil {
  2520. return thrift.PrependError(fmt.Sprintf("%T.channelAccessToken (5) field write error: ", p), err) }
  2521. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2522. return thrift.PrependError(fmt.Sprintf("%T write field end error 5:channelAccessToken: ", p), err) }
  2523. return err
  2524. }
  2525. func (p *ChannelToken) Equals(other *ChannelToken) bool {
  2526. if p == other {
  2527. return true
  2528. } else if p == nil || other == nil {
  2529. return false
  2530. }
  2531. if p.Token != other.Token { return false }
  2532. if p.ObsToken != other.ObsToken { return false }
  2533. if p.Expiration != other.Expiration { return false }
  2534. if p.RefreshToken != other.RefreshToken { return false }
  2535. if p.ChannelAccessToken != other.ChannelAccessToken { return false }
  2536. return true
  2537. }
  2538. func (p *ChannelToken) String() string {
  2539. if p == nil {
  2540. return "<nil>"
  2541. }
  2542. return fmt.Sprintf("ChannelToken(%+v)", *p)
  2543. }
  2544. // Attributes:
  2545. // - ChannelId
  2546. // - ShopOrderId
  2547. // - AppStoreCode
  2548. // - Items
  2549. // - Country
  2550. type CoinUseReservation struct {
  2551. ChannelId string `thrift:"channelId,1" db:"channelId" json:"channelId"`
  2552. ShopOrderId string `thrift:"shopOrderId,2" db:"shopOrderId" json:"shopOrderId"`
  2553. AppStoreCode AppStoreCode `thrift:"appStoreCode,3" db:"appStoreCode" json:"appStoreCode"`
  2554. Items []*CoinUseReservationItem `thrift:"items,4" db:"items" json:"items"`
  2555. Country string `thrift:"country,5" db:"country" json:"country"`
  2556. }
  2557. func NewCoinUseReservation() *CoinUseReservation {
  2558. return &CoinUseReservation{}
  2559. }
  2560. func (p *CoinUseReservation) GetChannelId() string {
  2561. return p.ChannelId
  2562. }
  2563. func (p *CoinUseReservation) GetShopOrderId() string {
  2564. return p.ShopOrderId
  2565. }
  2566. func (p *CoinUseReservation) GetAppStoreCode() AppStoreCode {
  2567. return p.AppStoreCode
  2568. }
  2569. func (p *CoinUseReservation) GetItems() []*CoinUseReservationItem {
  2570. return p.Items
  2571. }
  2572. func (p *CoinUseReservation) GetCountry() string {
  2573. return p.Country
  2574. }
  2575. func (p *CoinUseReservation) Read(ctx context.Context, iprot thrift.TProtocol) error {
  2576. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  2577. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  2578. }
  2579. for {
  2580. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  2581. if err != nil {
  2582. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  2583. }
  2584. if fieldTypeId == thrift.STOP { break; }
  2585. switch fieldId {
  2586. case 1:
  2587. if fieldTypeId == thrift.STRING {
  2588. if err := p.ReadField1(ctx, iprot); err != nil {
  2589. return err
  2590. }
  2591. } else {
  2592. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2593. return err
  2594. }
  2595. }
  2596. case 2:
  2597. if fieldTypeId == thrift.STRING {
  2598. if err := p.ReadField2(ctx, iprot); err != nil {
  2599. return err
  2600. }
  2601. } else {
  2602. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2603. return err
  2604. }
  2605. }
  2606. case 3:
  2607. if fieldTypeId == thrift.I32 {
  2608. if err := p.ReadField3(ctx, iprot); err != nil {
  2609. return err
  2610. }
  2611. } else {
  2612. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2613. return err
  2614. }
  2615. }
  2616. case 4:
  2617. if fieldTypeId == thrift.LIST {
  2618. if err := p.ReadField4(ctx, iprot); err != nil {
  2619. return err
  2620. }
  2621. } else {
  2622. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2623. return err
  2624. }
  2625. }
  2626. case 5:
  2627. if fieldTypeId == thrift.STRING {
  2628. if err := p.ReadField5(ctx, iprot); err != nil {
  2629. return err
  2630. }
  2631. } else {
  2632. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2633. return err
  2634. }
  2635. }
  2636. default:
  2637. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2638. return err
  2639. }
  2640. }
  2641. if err := iprot.ReadFieldEnd(ctx); err != nil {
  2642. return err
  2643. }
  2644. }
  2645. if err := iprot.ReadStructEnd(ctx); err != nil {
  2646. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  2647. }
  2648. return nil
  2649. }
  2650. func (p *CoinUseReservation) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  2651. if v, err := iprot.ReadString(ctx); err != nil {
  2652. return thrift.PrependError("error reading field 1: ", err)
  2653. } else {
  2654. p.ChannelId = v
  2655. }
  2656. return nil
  2657. }
  2658. func (p *CoinUseReservation) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  2659. if v, err := iprot.ReadString(ctx); err != nil {
  2660. return thrift.PrependError("error reading field 2: ", err)
  2661. } else {
  2662. p.ShopOrderId = v
  2663. }
  2664. return nil
  2665. }
  2666. func (p *CoinUseReservation) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  2667. if v, err := iprot.ReadI32(ctx); err != nil {
  2668. return thrift.PrependError("error reading field 3: ", err)
  2669. } else {
  2670. temp := AppStoreCode(v)
  2671. p.AppStoreCode = temp
  2672. }
  2673. return nil
  2674. }
  2675. func (p *CoinUseReservation) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
  2676. _, size, err := iprot.ReadListBegin(ctx)
  2677. if err != nil {
  2678. return thrift.PrependError("error reading list begin: ", err)
  2679. }
  2680. tSlice := make([]*CoinUseReservationItem, 0, size)
  2681. p.Items = tSlice
  2682. for i := 0; i < size; i ++ {
  2683. _elem17 := &CoinUseReservationItem{}
  2684. if err := _elem17.Read(ctx, iprot); err != nil {
  2685. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err)
  2686. }
  2687. p.Items = append(p.Items, _elem17)
  2688. }
  2689. if err := iprot.ReadListEnd(ctx); err != nil {
  2690. return thrift.PrependError("error reading list end: ", err)
  2691. }
  2692. return nil
  2693. }
  2694. func (p *CoinUseReservation) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
  2695. if v, err := iprot.ReadString(ctx); err != nil {
  2696. return thrift.PrependError("error reading field 5: ", err)
  2697. } else {
  2698. p.Country = v
  2699. }
  2700. return nil
  2701. }
  2702. func (p *CoinUseReservation) Write(ctx context.Context, oprot thrift.TProtocol) error {
  2703. if err := oprot.WriteStructBegin(ctx, "CoinUseReservation"); err != nil {
  2704. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  2705. if p != nil {
  2706. if err := p.writeField1(ctx, oprot); err != nil { return err }
  2707. if err := p.writeField2(ctx, oprot); err != nil { return err }
  2708. if err := p.writeField3(ctx, oprot); err != nil { return err }
  2709. if err := p.writeField4(ctx, oprot); err != nil { return err }
  2710. if err := p.writeField5(ctx, oprot); err != nil { return err }
  2711. }
  2712. if err := oprot.WriteFieldStop(ctx); err != nil {
  2713. return thrift.PrependError("write field stop error: ", err) }
  2714. if err := oprot.WriteStructEnd(ctx); err != nil {
  2715. return thrift.PrependError("write struct stop error: ", err) }
  2716. return nil
  2717. }
  2718. func (p *CoinUseReservation) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2719. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 1); err != nil {
  2720. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelId: ", p), err) }
  2721. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  2722. return thrift.PrependError(fmt.Sprintf("%T.channelId (1) field write error: ", p), err) }
  2723. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2724. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelId: ", p), err) }
  2725. return err
  2726. }
  2727. func (p *CoinUseReservation) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2728. if err := oprot.WriteFieldBegin(ctx, "shopOrderId", thrift.STRING, 2); err != nil {
  2729. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:shopOrderId: ", p), err) }
  2730. if err := oprot.WriteString(ctx, string(p.ShopOrderId)); err != nil {
  2731. return thrift.PrependError(fmt.Sprintf("%T.shopOrderId (2) field write error: ", p), err) }
  2732. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2733. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:shopOrderId: ", p), err) }
  2734. return err
  2735. }
  2736. func (p *CoinUseReservation) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2737. if err := oprot.WriteFieldBegin(ctx, "appStoreCode", thrift.I32, 3); err != nil {
  2738. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:appStoreCode: ", p), err) }
  2739. if err := oprot.WriteI32(ctx, int32(p.AppStoreCode)); err != nil {
  2740. return thrift.PrependError(fmt.Sprintf("%T.appStoreCode (3) field write error: ", p), err) }
  2741. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2742. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:appStoreCode: ", p), err) }
  2743. return err
  2744. }
  2745. func (p *CoinUseReservation) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2746. if err := oprot.WriteFieldBegin(ctx, "items", thrift.LIST, 4); err != nil {
  2747. return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:items: ", p), err) }
  2748. if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Items)); err != nil {
  2749. return thrift.PrependError("error writing list begin: ", err)
  2750. }
  2751. for _, v := range p.Items {
  2752. if err := v.Write(ctx, oprot); err != nil {
  2753. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
  2754. }
  2755. }
  2756. if err := oprot.WriteListEnd(ctx); err != nil {
  2757. return thrift.PrependError("error writing list end: ", err)
  2758. }
  2759. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2760. return thrift.PrependError(fmt.Sprintf("%T write field end error 4:items: ", p), err) }
  2761. return err
  2762. }
  2763. func (p *CoinUseReservation) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2764. if err := oprot.WriteFieldBegin(ctx, "country", thrift.STRING, 5); err != nil {
  2765. return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:country: ", p), err) }
  2766. if err := oprot.WriteString(ctx, string(p.Country)); err != nil {
  2767. return thrift.PrependError(fmt.Sprintf("%T.country (5) field write error: ", p), err) }
  2768. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2769. return thrift.PrependError(fmt.Sprintf("%T write field end error 5:country: ", p), err) }
  2770. return err
  2771. }
  2772. func (p *CoinUseReservation) Equals(other *CoinUseReservation) bool {
  2773. if p == other {
  2774. return true
  2775. } else if p == nil || other == nil {
  2776. return false
  2777. }
  2778. if p.ChannelId != other.ChannelId { return false }
  2779. if p.ShopOrderId != other.ShopOrderId { return false }
  2780. if p.AppStoreCode != other.AppStoreCode { return false }
  2781. if len(p.Items) != len(other.Items) { return false }
  2782. for i, _tgt := range p.Items {
  2783. _src18 := other.Items[i]
  2784. if !_tgt.Equals(_src18) { return false }
  2785. }
  2786. if p.Country != other.Country { return false }
  2787. return true
  2788. }
  2789. func (p *CoinUseReservation) String() string {
  2790. if p == nil {
  2791. return "<nil>"
  2792. }
  2793. return fmt.Sprintf("CoinUseReservation(%+v)", *p)
  2794. }
  2795. // Attributes:
  2796. // - ItemId
  2797. // - ItemName
  2798. // - Amount
  2799. type CoinUseReservationItem struct {
  2800. ItemId string `thrift:"itemId,1" db:"itemId" json:"itemId"`
  2801. ItemName string `thrift:"itemName,2" db:"itemName" json:"itemName"`
  2802. Amount int32 `thrift:"amount,3" db:"amount" json:"amount"`
  2803. }
  2804. func NewCoinUseReservationItem() *CoinUseReservationItem {
  2805. return &CoinUseReservationItem{}
  2806. }
  2807. func (p *CoinUseReservationItem) GetItemId() string {
  2808. return p.ItemId
  2809. }
  2810. func (p *CoinUseReservationItem) GetItemName() string {
  2811. return p.ItemName
  2812. }
  2813. func (p *CoinUseReservationItem) GetAmount() int32 {
  2814. return p.Amount
  2815. }
  2816. func (p *CoinUseReservationItem) Read(ctx context.Context, iprot thrift.TProtocol) error {
  2817. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  2818. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  2819. }
  2820. for {
  2821. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  2822. if err != nil {
  2823. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  2824. }
  2825. if fieldTypeId == thrift.STOP { break; }
  2826. switch fieldId {
  2827. case 1:
  2828. if fieldTypeId == thrift.STRING {
  2829. if err := p.ReadField1(ctx, iprot); err != nil {
  2830. return err
  2831. }
  2832. } else {
  2833. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2834. return err
  2835. }
  2836. }
  2837. case 2:
  2838. if fieldTypeId == thrift.STRING {
  2839. if err := p.ReadField2(ctx, iprot); err != nil {
  2840. return err
  2841. }
  2842. } else {
  2843. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2844. return err
  2845. }
  2846. }
  2847. case 3:
  2848. if fieldTypeId == thrift.I32 {
  2849. if err := p.ReadField3(ctx, iprot); err != nil {
  2850. return err
  2851. }
  2852. } else {
  2853. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2854. return err
  2855. }
  2856. }
  2857. default:
  2858. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2859. return err
  2860. }
  2861. }
  2862. if err := iprot.ReadFieldEnd(ctx); err != nil {
  2863. return err
  2864. }
  2865. }
  2866. if err := iprot.ReadStructEnd(ctx); err != nil {
  2867. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  2868. }
  2869. return nil
  2870. }
  2871. func (p *CoinUseReservationItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  2872. if v, err := iprot.ReadString(ctx); err != nil {
  2873. return thrift.PrependError("error reading field 1: ", err)
  2874. } else {
  2875. p.ItemId = v
  2876. }
  2877. return nil
  2878. }
  2879. func (p *CoinUseReservationItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  2880. if v, err := iprot.ReadString(ctx); err != nil {
  2881. return thrift.PrependError("error reading field 2: ", err)
  2882. } else {
  2883. p.ItemName = v
  2884. }
  2885. return nil
  2886. }
  2887. func (p *CoinUseReservationItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  2888. if v, err := iprot.ReadI32(ctx); err != nil {
  2889. return thrift.PrependError("error reading field 3: ", err)
  2890. } else {
  2891. p.Amount = v
  2892. }
  2893. return nil
  2894. }
  2895. func (p *CoinUseReservationItem) Write(ctx context.Context, oprot thrift.TProtocol) error {
  2896. if err := oprot.WriteStructBegin(ctx, "CoinUseReservationItem"); err != nil {
  2897. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  2898. if p != nil {
  2899. if err := p.writeField1(ctx, oprot); err != nil { return err }
  2900. if err := p.writeField2(ctx, oprot); err != nil { return err }
  2901. if err := p.writeField3(ctx, oprot); err != nil { return err }
  2902. }
  2903. if err := oprot.WriteFieldStop(ctx); err != nil {
  2904. return thrift.PrependError("write field stop error: ", err) }
  2905. if err := oprot.WriteStructEnd(ctx); err != nil {
  2906. return thrift.PrependError("write struct stop error: ", err) }
  2907. return nil
  2908. }
  2909. func (p *CoinUseReservationItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2910. if err := oprot.WriteFieldBegin(ctx, "itemId", thrift.STRING, 1); err != nil {
  2911. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:itemId: ", p), err) }
  2912. if err := oprot.WriteString(ctx, string(p.ItemId)); err != nil {
  2913. return thrift.PrependError(fmt.Sprintf("%T.itemId (1) field write error: ", p), err) }
  2914. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2915. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:itemId: ", p), err) }
  2916. return err
  2917. }
  2918. func (p *CoinUseReservationItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2919. if err := oprot.WriteFieldBegin(ctx, "itemName", thrift.STRING, 2); err != nil {
  2920. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:itemName: ", p), err) }
  2921. if err := oprot.WriteString(ctx, string(p.ItemName)); err != nil {
  2922. return thrift.PrependError(fmt.Sprintf("%T.itemName (2) field write error: ", p), err) }
  2923. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2924. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:itemName: ", p), err) }
  2925. return err
  2926. }
  2927. func (p *CoinUseReservationItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  2928. if err := oprot.WriteFieldBegin(ctx, "amount", thrift.I32, 3); err != nil {
  2929. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:amount: ", p), err) }
  2930. if err := oprot.WriteI32(ctx, int32(p.Amount)); err != nil {
  2931. return thrift.PrependError(fmt.Sprintf("%T.amount (3) field write error: ", p), err) }
  2932. if err := oprot.WriteFieldEnd(ctx); err != nil {
  2933. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:amount: ", p), err) }
  2934. return err
  2935. }
  2936. func (p *CoinUseReservationItem) Equals(other *CoinUseReservationItem) bool {
  2937. if p == other {
  2938. return true
  2939. } else if p == nil || other == nil {
  2940. return false
  2941. }
  2942. if p.ItemId != other.ItemId { return false }
  2943. if p.ItemName != other.ItemName { return false }
  2944. if p.Amount != other.Amount { return false }
  2945. return true
  2946. }
  2947. func (p *CoinUseReservationItem) String() string {
  2948. if p == nil {
  2949. return "<nil>"
  2950. }
  2951. return fmt.Sprintf("CoinUseReservationItem(%+v)", *p)
  2952. }
  2953. // Attributes:
  2954. // - RequestToken
  2955. // - ReturnUrl
  2956. type RequestTokenResponse struct {
  2957. RequestToken string `thrift:"requestToken,1" db:"requestToken" json:"requestToken"`
  2958. ReturnUrl string `thrift:"returnUrl,2" db:"returnUrl" json:"returnUrl"`
  2959. }
  2960. func NewRequestTokenResponse() *RequestTokenResponse {
  2961. return &RequestTokenResponse{}
  2962. }
  2963. func (p *RequestTokenResponse) GetRequestToken() string {
  2964. return p.RequestToken
  2965. }
  2966. func (p *RequestTokenResponse) GetReturnUrl() string {
  2967. return p.ReturnUrl
  2968. }
  2969. func (p *RequestTokenResponse) Read(ctx context.Context, iprot thrift.TProtocol) error {
  2970. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  2971. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  2972. }
  2973. for {
  2974. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  2975. if err != nil {
  2976. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  2977. }
  2978. if fieldTypeId == thrift.STOP { break; }
  2979. switch fieldId {
  2980. case 1:
  2981. if fieldTypeId == thrift.STRING {
  2982. if err := p.ReadField1(ctx, iprot); err != nil {
  2983. return err
  2984. }
  2985. } else {
  2986. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2987. return err
  2988. }
  2989. }
  2990. case 2:
  2991. if fieldTypeId == thrift.STRING {
  2992. if err := p.ReadField2(ctx, iprot); err != nil {
  2993. return err
  2994. }
  2995. } else {
  2996. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  2997. return err
  2998. }
  2999. }
  3000. default:
  3001. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  3002. return err
  3003. }
  3004. }
  3005. if err := iprot.ReadFieldEnd(ctx); err != nil {
  3006. return err
  3007. }
  3008. }
  3009. if err := iprot.ReadStructEnd(ctx); err != nil {
  3010. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  3011. }
  3012. return nil
  3013. }
  3014. func (p *RequestTokenResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  3015. if v, err := iprot.ReadString(ctx); err != nil {
  3016. return thrift.PrependError("error reading field 1: ", err)
  3017. } else {
  3018. p.RequestToken = v
  3019. }
  3020. return nil
  3021. }
  3022. func (p *RequestTokenResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  3023. if v, err := iprot.ReadString(ctx); err != nil {
  3024. return thrift.PrependError("error reading field 2: ", err)
  3025. } else {
  3026. p.ReturnUrl = v
  3027. }
  3028. return nil
  3029. }
  3030. func (p *RequestTokenResponse) Write(ctx context.Context, oprot thrift.TProtocol) error {
  3031. if err := oprot.WriteStructBegin(ctx, "RequestTokenResponse"); err != nil {
  3032. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  3033. if p != nil {
  3034. if err := p.writeField1(ctx, oprot); err != nil { return err }
  3035. if err := p.writeField2(ctx, oprot); err != nil { return err }
  3036. }
  3037. if err := oprot.WriteFieldStop(ctx); err != nil {
  3038. return thrift.PrependError("write field stop error: ", err) }
  3039. if err := oprot.WriteStructEnd(ctx); err != nil {
  3040. return thrift.PrependError("write struct stop error: ", err) }
  3041. return nil
  3042. }
  3043. func (p *RequestTokenResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  3044. if err := oprot.WriteFieldBegin(ctx, "requestToken", thrift.STRING, 1); err != nil {
  3045. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:requestToken: ", p), err) }
  3046. if err := oprot.WriteString(ctx, string(p.RequestToken)); err != nil {
  3047. return thrift.PrependError(fmt.Sprintf("%T.requestToken (1) field write error: ", p), err) }
  3048. if err := oprot.WriteFieldEnd(ctx); err != nil {
  3049. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:requestToken: ", p), err) }
  3050. return err
  3051. }
  3052. func (p *RequestTokenResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  3053. if err := oprot.WriteFieldBegin(ctx, "returnUrl", thrift.STRING, 2); err != nil {
  3054. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:returnUrl: ", p), err) }
  3055. if err := oprot.WriteString(ctx, string(p.ReturnUrl)); err != nil {
  3056. return thrift.PrependError(fmt.Sprintf("%T.returnUrl (2) field write error: ", p), err) }
  3057. if err := oprot.WriteFieldEnd(ctx); err != nil {
  3058. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:returnUrl: ", p), err) }
  3059. return err
  3060. }
  3061. func (p *RequestTokenResponse) Equals(other *RequestTokenResponse) bool {
  3062. if p == other {
  3063. return true
  3064. } else if p == nil || other == nil {
  3065. return false
  3066. }
  3067. if p.RequestToken != other.RequestToken { return false }
  3068. if p.ReturnUrl != other.ReturnUrl { return false }
  3069. return true
  3070. }
  3071. func (p *RequestTokenResponse) String() string {
  3072. if p == nil {
  3073. return "<nil>"
  3074. }
  3075. return fmt.Sprintf("RequestTokenResponse(%+v)", *p)
  3076. }
  3077. // Attributes:
  3078. // - HookedFullUrl
  3079. // - SessionString
  3080. // - FromIAB
  3081. type WebLoginRequest struct {
  3082. HookedFullUrl string `thrift:"hookedFullUrl,1" db:"hookedFullUrl" json:"hookedFullUrl"`
  3083. SessionString string `thrift:"sessionString,2" db:"sessionString" json:"sessionString"`
  3084. FromIAB bool `thrift:"fromIAB,3" db:"fromIAB" json:"fromIAB"`
  3085. }
  3086. func NewWebLoginRequest() *WebLoginRequest {
  3087. return &WebLoginRequest{}
  3088. }
  3089. func (p *WebLoginRequest) GetHookedFullUrl() string {
  3090. return p.HookedFullUrl
  3091. }
  3092. func (p *WebLoginRequest) GetSessionString() string {
  3093. return p.SessionString
  3094. }
  3095. func (p *WebLoginRequest) GetFromIAB() bool {
  3096. return p.FromIAB
  3097. }
  3098. func (p *WebLoginRequest) Read(ctx context.Context, iprot thrift.TProtocol) error {
  3099. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  3100. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  3101. }
  3102. for {
  3103. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  3104. if err != nil {
  3105. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  3106. }
  3107. if fieldTypeId == thrift.STOP { break; }
  3108. switch fieldId {
  3109. case 1:
  3110. if fieldTypeId == thrift.STRING {
  3111. if err := p.ReadField1(ctx, iprot); err != nil {
  3112. return err
  3113. }
  3114. } else {
  3115. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  3116. return err
  3117. }
  3118. }
  3119. case 2:
  3120. if fieldTypeId == thrift.STRING {
  3121. if err := p.ReadField2(ctx, iprot); err != nil {
  3122. return err
  3123. }
  3124. } else {
  3125. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  3126. return err
  3127. }
  3128. }
  3129. case 3:
  3130. if fieldTypeId == thrift.BOOL {
  3131. if err := p.ReadField3(ctx, iprot); err != nil {
  3132. return err
  3133. }
  3134. } else {
  3135. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  3136. return err
  3137. }
  3138. }
  3139. default:
  3140. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  3141. return err
  3142. }
  3143. }
  3144. if err := iprot.ReadFieldEnd(ctx); err != nil {
  3145. return err
  3146. }
  3147. }
  3148. if err := iprot.ReadStructEnd(ctx); err != nil {
  3149. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  3150. }
  3151. return nil
  3152. }
  3153. func (p *WebLoginRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  3154. if v, err := iprot.ReadString(ctx); err != nil {
  3155. return thrift.PrependError("error reading field 1: ", err)
  3156. } else {
  3157. p.HookedFullUrl = v
  3158. }
  3159. return nil
  3160. }
  3161. func (p *WebLoginRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  3162. if v, err := iprot.ReadString(ctx); err != nil {
  3163. return thrift.PrependError("error reading field 2: ", err)
  3164. } else {
  3165. p.SessionString = v
  3166. }
  3167. return nil
  3168. }
  3169. func (p *WebLoginRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  3170. if v, err := iprot.ReadBool(ctx); err != nil {
  3171. return thrift.PrependError("error reading field 3: ", err)
  3172. } else {
  3173. p.FromIAB = v
  3174. }
  3175. return nil
  3176. }
  3177. func (p *WebLoginRequest) Write(ctx context.Context, oprot thrift.TProtocol) error {
  3178. if err := oprot.WriteStructBegin(ctx, "WebLoginRequest"); err != nil {
  3179. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  3180. if p != nil {
  3181. if err := p.writeField1(ctx, oprot); err != nil { return err }
  3182. if err := p.writeField2(ctx, oprot); err != nil { return err }
  3183. if err := p.writeField3(ctx, oprot); err != nil { return err }
  3184. }
  3185. if err := oprot.WriteFieldStop(ctx); err != nil {
  3186. return thrift.PrependError("write field stop error: ", err) }
  3187. if err := oprot.WriteStructEnd(ctx); err != nil {
  3188. return thrift.PrependError("write struct stop error: ", err) }
  3189. return nil
  3190. }
  3191. func (p *WebLoginRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  3192. if err := oprot.WriteFieldBegin(ctx, "hookedFullUrl", thrift.STRING, 1); err != nil {
  3193. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hookedFullUrl: ", p), err) }
  3194. if err := oprot.WriteString(ctx, string(p.HookedFullUrl)); err != nil {
  3195. return thrift.PrependError(fmt.Sprintf("%T.hookedFullUrl (1) field write error: ", p), err) }
  3196. if err := oprot.WriteFieldEnd(ctx); err != nil {
  3197. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hookedFullUrl: ", p), err) }
  3198. return err
  3199. }
  3200. func (p *WebLoginRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  3201. if err := oprot.WriteFieldBegin(ctx, "sessionString", thrift.STRING, 2); err != nil {
  3202. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sessionString: ", p), err) }
  3203. if err := oprot.WriteString(ctx, string(p.SessionString)); err != nil {
  3204. return thrift.PrependError(fmt.Sprintf("%T.sessionString (2) field write error: ", p), err) }
  3205. if err := oprot.WriteFieldEnd(ctx); err != nil {
  3206. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sessionString: ", p), err) }
  3207. return err
  3208. }
  3209. func (p *WebLoginRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  3210. if err := oprot.WriteFieldBegin(ctx, "fromIAB", thrift.BOOL, 3); err != nil {
  3211. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:fromIAB: ", p), err) }
  3212. if err := oprot.WriteBool(ctx, bool(p.FromIAB)); err != nil {
  3213. return thrift.PrependError(fmt.Sprintf("%T.fromIAB (3) field write error: ", p), err) }
  3214. if err := oprot.WriteFieldEnd(ctx); err != nil {
  3215. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:fromIAB: ", p), err) }
  3216. return err
  3217. }
  3218. func (p *WebLoginRequest) Equals(other *WebLoginRequest) bool {
  3219. if p == other {
  3220. return true
  3221. } else if p == nil || other == nil {
  3222. return false
  3223. }
  3224. if p.HookedFullUrl != other.HookedFullUrl { return false }
  3225. if p.SessionString != other.SessionString { return false }
  3226. if p.FromIAB != other.FromIAB { return false }
  3227. return true
  3228. }
  3229. func (p *WebLoginRequest) String() string {
  3230. if p == nil {
  3231. return "<nil>"
  3232. }
  3233. return fmt.Sprintf("WebLoginRequest(%+v)", *p)
  3234. }
  3235. // Attributes:
  3236. // - ReturnUrl
  3237. // - OptionalReturnUrl
  3238. type WebLoginResponse struct {
  3239. ReturnUrl string `thrift:"returnUrl,1" db:"returnUrl" json:"returnUrl"`
  3240. OptionalReturnUrl string `thrift:"optionalReturnUrl,2" db:"optionalReturnUrl" json:"optionalReturnUrl"`
  3241. }
  3242. func NewWebLoginResponse() *WebLoginResponse {
  3243. return &WebLoginResponse{}
  3244. }
  3245. func (p *WebLoginResponse) GetReturnUrl() string {
  3246. return p.ReturnUrl
  3247. }
  3248. func (p *WebLoginResponse) GetOptionalReturnUrl() string {
  3249. return p.OptionalReturnUrl
  3250. }
  3251. func (p *WebLoginResponse) Read(ctx context.Context, iprot thrift.TProtocol) error {
  3252. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  3253. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  3254. }
  3255. for {
  3256. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  3257. if err != nil {
  3258. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  3259. }
  3260. if fieldTypeId == thrift.STOP { break; }
  3261. switch fieldId {
  3262. case 1:
  3263. if fieldTypeId == thrift.STRING {
  3264. if err := p.ReadField1(ctx, iprot); err != nil {
  3265. return err
  3266. }
  3267. } else {
  3268. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  3269. return err
  3270. }
  3271. }
  3272. case 2:
  3273. if fieldTypeId == thrift.STRING {
  3274. if err := p.ReadField2(ctx, iprot); err != nil {
  3275. return err
  3276. }
  3277. } else {
  3278. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  3279. return err
  3280. }
  3281. }
  3282. default:
  3283. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  3284. return err
  3285. }
  3286. }
  3287. if err := iprot.ReadFieldEnd(ctx); err != nil {
  3288. return err
  3289. }
  3290. }
  3291. if err := iprot.ReadStructEnd(ctx); err != nil {
  3292. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  3293. }
  3294. return nil
  3295. }
  3296. func (p *WebLoginResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  3297. if v, err := iprot.ReadString(ctx); err != nil {
  3298. return thrift.PrependError("error reading field 1: ", err)
  3299. } else {
  3300. p.ReturnUrl = v
  3301. }
  3302. return nil
  3303. }
  3304. func (p *WebLoginResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  3305. if v, err := iprot.ReadString(ctx); err != nil {
  3306. return thrift.PrependError("error reading field 2: ", err)
  3307. } else {
  3308. p.OptionalReturnUrl = v
  3309. }
  3310. return nil
  3311. }
  3312. func (p *WebLoginResponse) Write(ctx context.Context, oprot thrift.TProtocol) error {
  3313. if err := oprot.WriteStructBegin(ctx, "WebLoginResponse"); err != nil {
  3314. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  3315. if p != nil {
  3316. if err := p.writeField1(ctx, oprot); err != nil { return err }
  3317. if err := p.writeField2(ctx, oprot); err != nil { return err }
  3318. }
  3319. if err := oprot.WriteFieldStop(ctx); err != nil {
  3320. return thrift.PrependError("write field stop error: ", err) }
  3321. if err := oprot.WriteStructEnd(ctx); err != nil {
  3322. return thrift.PrependError("write struct stop error: ", err) }
  3323. return nil
  3324. }
  3325. func (p *WebLoginResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  3326. if err := oprot.WriteFieldBegin(ctx, "returnUrl", thrift.STRING, 1); err != nil {
  3327. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:returnUrl: ", p), err) }
  3328. if err := oprot.WriteString(ctx, string(p.ReturnUrl)); err != nil {
  3329. return thrift.PrependError(fmt.Sprintf("%T.returnUrl (1) field write error: ", p), err) }
  3330. if err := oprot.WriteFieldEnd(ctx); err != nil {
  3331. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:returnUrl: ", p), err) }
  3332. return err
  3333. }
  3334. func (p *WebLoginResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  3335. if err := oprot.WriteFieldBegin(ctx, "optionalReturnUrl", thrift.STRING, 2); err != nil {
  3336. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:optionalReturnUrl: ", p), err) }
  3337. if err := oprot.WriteString(ctx, string(p.OptionalReturnUrl)); err != nil {
  3338. return thrift.PrependError(fmt.Sprintf("%T.optionalReturnUrl (2) field write error: ", p), err) }
  3339. if err := oprot.WriteFieldEnd(ctx); err != nil {
  3340. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:optionalReturnUrl: ", p), err) }
  3341. return err
  3342. }
  3343. func (p *WebLoginResponse) Equals(other *WebLoginResponse) bool {
  3344. if p == other {
  3345. return true
  3346. } else if p == nil || other == nil {
  3347. return false
  3348. }
  3349. if p.ReturnUrl != other.ReturnUrl { return false }
  3350. if p.OptionalReturnUrl != other.OptionalReturnUrl { return false }
  3351. return true
  3352. }
  3353. func (p *WebLoginResponse) String() string {
  3354. if p == nil {
  3355. return "<nil>"
  3356. }
  3357. return fmt.Sprintf("WebLoginResponse(%+v)", *p)
  3358. }
  3359. type ChannelService interface {
  3360. // Parameters:
  3361. // - ChannelId
  3362. ApproveChannelAndIssueChannelToken(ctx context.Context, channelId string) (_r *ChannelToken, _err error)
  3363. // Parameters:
  3364. // - LastSynced
  3365. // - Locale
  3366. GetApprovedChannels(ctx context.Context, lastSynced int64, locale string) (_r *ApprovedChannelInfos, _err error)
  3367. // Parameters:
  3368. // - ChannelId
  3369. // - Locale
  3370. GetChannelInfo(ctx context.Context, channelId string, locale string) (_r *ChannelInfo, _err error)
  3371. // Parameters:
  3372. // - ChannelId
  3373. // - Locale
  3374. GetChannelNotificationSetting(ctx context.Context, channelId string, locale string) (_r *ChannelNotificationSetting, _err error)
  3375. // Parameters:
  3376. // - Locale
  3377. GetChannelNotificationSettings(ctx context.Context, locale string) (_r []*ChannelNotificationSetting, _err error)
  3378. GetChannelSettings(ctx context.Context) (_r *ChannelSettings, _err error)
  3379. // Parameters:
  3380. // - LastSynced
  3381. GetCommonDomains(ctx context.Context, lastSynced int64) (_r *ChannelDomains, _err error)
  3382. // Parameters:
  3383. // - WebLoginRequest
  3384. GetReturnUrlWithRequestTokenForAutoLogin(ctx context.Context, webLoginRequest *WebLoginRequest) (_r *WebLoginResponse, _err error)
  3385. // Parameters:
  3386. // - ChannelIds
  3387. GetUpdatedChannelIds(ctx context.Context, channelIds []*ChannelIdWithLastUpdated) (_r []string, _err error)
  3388. // Parameters:
  3389. // - WebLoginRequest
  3390. GetWebLoginDisallowedUrl(ctx context.Context, webLoginRequest *WebLoginRequest) (_r *WebLoginResponse, _err error)
  3391. // Parameters:
  3392. // - ChannelId
  3393. IssueChannelToken(ctx context.Context, channelId string) (_r *ChannelToken, _err error)
  3394. // Parameters:
  3395. // - ChannelId
  3396. // - OtpId
  3397. // - AuthScheme
  3398. // - ReturnUrl
  3399. IssueRequestTokenWithAuthScheme(ctx context.Context, channelId string, otpId string, authScheme []string, returnUrl string) (_r *RequestTokenResponse, _err error)
  3400. // Parameters:
  3401. // - Request
  3402. // - Locale
  3403. ReserveCoinUse(ctx context.Context, request *CoinUseReservation, locale string) (_r string, _err error)
  3404. // Parameters:
  3405. // - ChannelId
  3406. RevokeChannel(ctx context.Context, channelId string) (_err error)
  3407. // Parameters:
  3408. // - Setting
  3409. UpdateChannelNotificationSetting(ctx context.Context, setting []*ChannelNotificationSetting) (_err error)
  3410. // Parameters:
  3411. // - ChannelSettings
  3412. UpdateChannelSettings(ctx context.Context, channelSettings *ChannelSettings) (_r bool, _err error)
  3413. }
  3414. type ChannelServiceClient struct {
  3415. c thrift.TClient
  3416. meta thrift.ResponseMeta
  3417. }
  3418. func NewChannelServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ChannelServiceClient {
  3419. return &ChannelServiceClient{
  3420. c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
  3421. }
  3422. }
  3423. func NewChannelServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ChannelServiceClient {
  3424. return &ChannelServiceClient{
  3425. c: thrift.NewTStandardClient(iprot, oprot),
  3426. }
  3427. }
  3428. func NewChannelServiceClient(c thrift.TClient) *ChannelServiceClient {
  3429. return &ChannelServiceClient{
  3430. c: c,
  3431. }
  3432. }
  3433. func (p *ChannelServiceClient) Client_() thrift.TClient {
  3434. return p.c
  3435. }
  3436. func (p *ChannelServiceClient) LastResponseMeta_() thrift.ResponseMeta {
  3437. return p.meta
  3438. }
  3439. func (p *ChannelServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) {
  3440. p.meta = meta
  3441. }
  3442. // Parameters:
  3443. // - ChannelId
  3444. func (p *ChannelServiceClient) ApproveChannelAndIssueChannelToken(ctx context.Context, channelId string) (_r *ChannelToken, _err error) {
  3445. var _args19 ChannelServiceApproveChannelAndIssueChannelTokenArgs
  3446. _args19.ChannelId = channelId
  3447. var _result21 ChannelServiceApproveChannelAndIssueChannelTokenResult
  3448. var _meta20 thrift.ResponseMeta
  3449. _meta20, _err = p.Client_().Call(ctx, "approveChannelAndIssueChannelToken", &_args19, &_result21)
  3450. p.SetLastResponseMeta_(_meta20)
  3451. if _err != nil {
  3452. return
  3453. }
  3454. switch {
  3455. case _result21.E!= nil:
  3456. return _r, _result21.E
  3457. }
  3458. if _ret22 := _result21.GetSuccess(); _ret22 != nil {
  3459. return _ret22, nil
  3460. }
  3461. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "approveChannelAndIssueChannelToken failed: unknown result")
  3462. }
  3463. // Parameters:
  3464. // - LastSynced
  3465. // - Locale
  3466. func (p *ChannelServiceClient) GetApprovedChannels(ctx context.Context, lastSynced int64, locale string) (_r *ApprovedChannelInfos, _err error) {
  3467. var _args23 ChannelServiceGetApprovedChannelsArgs
  3468. _args23.LastSynced = lastSynced
  3469. _args23.Locale = locale
  3470. var _result25 ChannelServiceGetApprovedChannelsResult
  3471. var _meta24 thrift.ResponseMeta
  3472. _meta24, _err = p.Client_().Call(ctx, "getApprovedChannels", &_args23, &_result25)
  3473. p.SetLastResponseMeta_(_meta24)
  3474. if _err != nil {
  3475. return
  3476. }
  3477. switch {
  3478. case _result25.E!= nil:
  3479. return _r, _result25.E
  3480. }
  3481. if _ret26 := _result25.GetSuccess(); _ret26 != nil {
  3482. return _ret26, nil
  3483. }
  3484. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getApprovedChannels failed: unknown result")
  3485. }
  3486. // Parameters:
  3487. // - ChannelId
  3488. // - Locale
  3489. func (p *ChannelServiceClient) GetChannelInfo(ctx context.Context, channelId string, locale string) (_r *ChannelInfo, _err error) {
  3490. var _args27 ChannelServiceGetChannelInfoArgs
  3491. _args27.ChannelId = channelId
  3492. _args27.Locale = locale
  3493. var _result29 ChannelServiceGetChannelInfoResult
  3494. var _meta28 thrift.ResponseMeta
  3495. _meta28, _err = p.Client_().Call(ctx, "getChannelInfo", &_args27, &_result29)
  3496. p.SetLastResponseMeta_(_meta28)
  3497. if _err != nil {
  3498. return
  3499. }
  3500. switch {
  3501. case _result29.E!= nil:
  3502. return _r, _result29.E
  3503. }
  3504. if _ret30 := _result29.GetSuccess(); _ret30 != nil {
  3505. return _ret30, nil
  3506. }
  3507. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getChannelInfo failed: unknown result")
  3508. }
  3509. // Parameters:
  3510. // - ChannelId
  3511. // - Locale
  3512. func (p *ChannelServiceClient) GetChannelNotificationSetting(ctx context.Context, channelId string, locale string) (_r *ChannelNotificationSetting, _err error) {
  3513. var _args31 ChannelServiceGetChannelNotificationSettingArgs
  3514. _args31.ChannelId = channelId
  3515. _args31.Locale = locale
  3516. var _result33 ChannelServiceGetChannelNotificationSettingResult
  3517. var _meta32 thrift.ResponseMeta
  3518. _meta32, _err = p.Client_().Call(ctx, "getChannelNotificationSetting", &_args31, &_result33)
  3519. p.SetLastResponseMeta_(_meta32)
  3520. if _err != nil {
  3521. return
  3522. }
  3523. switch {
  3524. case _result33.E!= nil:
  3525. return _r, _result33.E
  3526. }
  3527. if _ret34 := _result33.GetSuccess(); _ret34 != nil {
  3528. return _ret34, nil
  3529. }
  3530. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getChannelNotificationSetting failed: unknown result")
  3531. }
  3532. // Parameters:
  3533. // - Locale
  3534. func (p *ChannelServiceClient) GetChannelNotificationSettings(ctx context.Context, locale string) (_r []*ChannelNotificationSetting, _err error) {
  3535. var _args35 ChannelServiceGetChannelNotificationSettingsArgs
  3536. _args35.Locale = locale
  3537. var _result37 ChannelServiceGetChannelNotificationSettingsResult
  3538. var _meta36 thrift.ResponseMeta
  3539. _meta36, _err = p.Client_().Call(ctx, "getChannelNotificationSettings", &_args35, &_result37)
  3540. p.SetLastResponseMeta_(_meta36)
  3541. if _err != nil {
  3542. return
  3543. }
  3544. switch {
  3545. case _result37.E!= nil:
  3546. return _r, _result37.E
  3547. }
  3548. return _result37.GetSuccess(), nil
  3549. }
  3550. func (p *ChannelServiceClient) GetChannelSettings(ctx context.Context) (_r *ChannelSettings, _err error) {
  3551. var _args38 ChannelServiceGetChannelSettingsArgs
  3552. var _result40 ChannelServiceGetChannelSettingsResult
  3553. var _meta39 thrift.ResponseMeta
  3554. _meta39, _err = p.Client_().Call(ctx, "getChannelSettings", &_args38, &_result40)
  3555. p.SetLastResponseMeta_(_meta39)
  3556. if _err != nil {
  3557. return
  3558. }
  3559. switch {
  3560. case _result40.E!= nil:
  3561. return _r, _result40.E
  3562. }
  3563. if _ret41 := _result40.GetSuccess(); _ret41 != nil {
  3564. return _ret41, nil
  3565. }
  3566. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getChannelSettings failed: unknown result")
  3567. }
  3568. // Parameters:
  3569. // - LastSynced
  3570. func (p *ChannelServiceClient) GetCommonDomains(ctx context.Context, lastSynced int64) (_r *ChannelDomains, _err error) {
  3571. var _args42 ChannelServiceGetCommonDomainsArgs
  3572. _args42.LastSynced = lastSynced
  3573. var _result44 ChannelServiceGetCommonDomainsResult
  3574. var _meta43 thrift.ResponseMeta
  3575. _meta43, _err = p.Client_().Call(ctx, "getCommonDomains", &_args42, &_result44)
  3576. p.SetLastResponseMeta_(_meta43)
  3577. if _err != nil {
  3578. return
  3579. }
  3580. switch {
  3581. case _result44.E!= nil:
  3582. return _r, _result44.E
  3583. }
  3584. if _ret45 := _result44.GetSuccess(); _ret45 != nil {
  3585. return _ret45, nil
  3586. }
  3587. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getCommonDomains failed: unknown result")
  3588. }
  3589. // Parameters:
  3590. // - WebLoginRequest
  3591. func (p *ChannelServiceClient) GetReturnUrlWithRequestTokenForAutoLogin(ctx context.Context, webLoginRequest *WebLoginRequest) (_r *WebLoginResponse, _err error) {
  3592. var _args46 ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs
  3593. _args46.WebLoginRequest = webLoginRequest
  3594. var _result48 ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult
  3595. var _meta47 thrift.ResponseMeta
  3596. _meta47, _err = p.Client_().Call(ctx, "getReturnUrlWithRequestTokenForAutoLogin", &_args46, &_result48)
  3597. p.SetLastResponseMeta_(_meta47)
  3598. if _err != nil {
  3599. return
  3600. }
  3601. switch {
  3602. case _result48.E!= nil:
  3603. return _r, _result48.E
  3604. }
  3605. if _ret49 := _result48.GetSuccess(); _ret49 != nil {
  3606. return _ret49, nil
  3607. }
  3608. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getReturnUrlWithRequestTokenForAutoLogin failed: unknown result")
  3609. }
  3610. // Parameters:
  3611. // - ChannelIds
  3612. func (p *ChannelServiceClient) GetUpdatedChannelIds(ctx context.Context, channelIds []*ChannelIdWithLastUpdated) (_r []string, _err error) {
  3613. var _args50 ChannelServiceGetUpdatedChannelIdsArgs
  3614. _args50.ChannelIds = channelIds
  3615. var _result52 ChannelServiceGetUpdatedChannelIdsResult
  3616. var _meta51 thrift.ResponseMeta
  3617. _meta51, _err = p.Client_().Call(ctx, "getUpdatedChannelIds", &_args50, &_result52)
  3618. p.SetLastResponseMeta_(_meta51)
  3619. if _err != nil {
  3620. return
  3621. }
  3622. switch {
  3623. case _result52.E!= nil:
  3624. return _r, _result52.E
  3625. }
  3626. return _result52.GetSuccess(), nil
  3627. }
  3628. // Parameters:
  3629. // - WebLoginRequest
  3630. func (p *ChannelServiceClient) GetWebLoginDisallowedUrl(ctx context.Context, webLoginRequest *WebLoginRequest) (_r *WebLoginResponse, _err error) {
  3631. var _args53 ChannelServiceGetWebLoginDisallowedUrlArgs
  3632. _args53.WebLoginRequest = webLoginRequest
  3633. var _result55 ChannelServiceGetWebLoginDisallowedUrlResult
  3634. var _meta54 thrift.ResponseMeta
  3635. _meta54, _err = p.Client_().Call(ctx, "getWebLoginDisallowedUrl", &_args53, &_result55)
  3636. p.SetLastResponseMeta_(_meta54)
  3637. if _err != nil {
  3638. return
  3639. }
  3640. switch {
  3641. case _result55.E!= nil:
  3642. return _r, _result55.E
  3643. }
  3644. if _ret56 := _result55.GetSuccess(); _ret56 != nil {
  3645. return _ret56, nil
  3646. }
  3647. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getWebLoginDisallowedUrl failed: unknown result")
  3648. }
  3649. // Parameters:
  3650. // - ChannelId
  3651. func (p *ChannelServiceClient) IssueChannelToken(ctx context.Context, channelId string) (_r *ChannelToken, _err error) {
  3652. var _args57 ChannelServiceIssueChannelTokenArgs
  3653. _args57.ChannelId = channelId
  3654. var _result59 ChannelServiceIssueChannelTokenResult
  3655. var _meta58 thrift.ResponseMeta
  3656. _meta58, _err = p.Client_().Call(ctx, "issueChannelToken", &_args57, &_result59)
  3657. p.SetLastResponseMeta_(_meta58)
  3658. if _err != nil {
  3659. return
  3660. }
  3661. switch {
  3662. case _result59.E!= nil:
  3663. return _r, _result59.E
  3664. }
  3665. if _ret60 := _result59.GetSuccess(); _ret60 != nil {
  3666. return _ret60, nil
  3667. }
  3668. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "issueChannelToken failed: unknown result")
  3669. }
  3670. // Parameters:
  3671. // - ChannelId
  3672. // - OtpId
  3673. // - AuthScheme
  3674. // - ReturnUrl
  3675. func (p *ChannelServiceClient) IssueRequestTokenWithAuthScheme(ctx context.Context, channelId string, otpId string, authScheme []string, returnUrl string) (_r *RequestTokenResponse, _err error) {
  3676. var _args61 ChannelServiceIssueRequestTokenWithAuthSchemeArgs
  3677. _args61.ChannelId = channelId
  3678. _args61.OtpId = otpId
  3679. _args61.AuthScheme = authScheme
  3680. _args61.ReturnUrl = returnUrl
  3681. var _result63 ChannelServiceIssueRequestTokenWithAuthSchemeResult
  3682. var _meta62 thrift.ResponseMeta
  3683. _meta62, _err = p.Client_().Call(ctx, "issueRequestTokenWithAuthScheme", &_args61, &_result63)
  3684. p.SetLastResponseMeta_(_meta62)
  3685. if _err != nil {
  3686. return
  3687. }
  3688. switch {
  3689. case _result63.E!= nil:
  3690. return _r, _result63.E
  3691. }
  3692. if _ret64 := _result63.GetSuccess(); _ret64 != nil {
  3693. return _ret64, nil
  3694. }
  3695. return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "issueRequestTokenWithAuthScheme failed: unknown result")
  3696. }
  3697. // Parameters:
  3698. // - Request
  3699. // - Locale
  3700. func (p *ChannelServiceClient) ReserveCoinUse(ctx context.Context, request *CoinUseReservation, locale string) (_r string, _err error) {
  3701. var _args65 ChannelServiceReserveCoinUseArgs
  3702. _args65.Request = request
  3703. _args65.Locale = locale
  3704. var _result67 ChannelServiceReserveCoinUseResult
  3705. var _meta66 thrift.ResponseMeta
  3706. _meta66, _err = p.Client_().Call(ctx, "reserveCoinUse", &_args65, &_result67)
  3707. p.SetLastResponseMeta_(_meta66)
  3708. if _err != nil {
  3709. return
  3710. }
  3711. switch {
  3712. case _result67.E!= nil:
  3713. return _r, _result67.E
  3714. }
  3715. return _result67.GetSuccess(), nil
  3716. }
  3717. // Parameters:
  3718. // - ChannelId
  3719. func (p *ChannelServiceClient) RevokeChannel(ctx context.Context, channelId string) (_err error) {
  3720. var _args68 ChannelServiceRevokeChannelArgs
  3721. _args68.ChannelId = channelId
  3722. var _result70 ChannelServiceRevokeChannelResult
  3723. var _meta69 thrift.ResponseMeta
  3724. _meta69, _err = p.Client_().Call(ctx, "revokeChannel", &_args68, &_result70)
  3725. p.SetLastResponseMeta_(_meta69)
  3726. if _err != nil {
  3727. return
  3728. }
  3729. switch {
  3730. case _result70.E!= nil:
  3731. return _result70.E
  3732. }
  3733. return nil
  3734. }
  3735. // Parameters:
  3736. // - Setting
  3737. func (p *ChannelServiceClient) UpdateChannelNotificationSetting(ctx context.Context, setting []*ChannelNotificationSetting) (_err error) {
  3738. var _args71 ChannelServiceUpdateChannelNotificationSettingArgs
  3739. _args71.Setting = setting
  3740. var _result73 ChannelServiceUpdateChannelNotificationSettingResult
  3741. var _meta72 thrift.ResponseMeta
  3742. _meta72, _err = p.Client_().Call(ctx, "updateChannelNotificationSetting", &_args71, &_result73)
  3743. p.SetLastResponseMeta_(_meta72)
  3744. if _err != nil {
  3745. return
  3746. }
  3747. switch {
  3748. case _result73.E!= nil:
  3749. return _result73.E
  3750. }
  3751. return nil
  3752. }
  3753. // Parameters:
  3754. // - ChannelSettings
  3755. func (p *ChannelServiceClient) UpdateChannelSettings(ctx context.Context, channelSettings *ChannelSettings) (_r bool, _err error) {
  3756. var _args74 ChannelServiceUpdateChannelSettingsArgs
  3757. _args74.ChannelSettings = channelSettings
  3758. var _result76 ChannelServiceUpdateChannelSettingsResult
  3759. var _meta75 thrift.ResponseMeta
  3760. _meta75, _err = p.Client_().Call(ctx, "updateChannelSettings", &_args74, &_result76)
  3761. p.SetLastResponseMeta_(_meta75)
  3762. if _err != nil {
  3763. return
  3764. }
  3765. switch {
  3766. case _result76.E!= nil:
  3767. return _r, _result76.E
  3768. }
  3769. return _result76.GetSuccess(), nil
  3770. }
  3771. type ChannelServiceProcessor struct {
  3772. processorMap map[string]thrift.TProcessorFunction
  3773. handler ChannelService
  3774. }
  3775. func (p *ChannelServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
  3776. p.processorMap[key] = processor
  3777. }
  3778. func (p *ChannelServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
  3779. processor, ok = p.processorMap[key]
  3780. return processor, ok
  3781. }
  3782. func (p *ChannelServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
  3783. return p.processorMap
  3784. }
  3785. func NewChannelServiceProcessor(handler ChannelService) *ChannelServiceProcessor {
  3786. self77 := &ChannelServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)}
  3787. self77.processorMap["approveChannelAndIssueChannelToken"] = &channelServiceProcessorApproveChannelAndIssueChannelToken{handler:handler}
  3788. self77.processorMap["getApprovedChannels"] = &channelServiceProcessorGetApprovedChannels{handler:handler}
  3789. self77.processorMap["getChannelInfo"] = &channelServiceProcessorGetChannelInfo{handler:handler}
  3790. self77.processorMap["getChannelNotificationSetting"] = &channelServiceProcessorGetChannelNotificationSetting{handler:handler}
  3791. self77.processorMap["getChannelNotificationSettings"] = &channelServiceProcessorGetChannelNotificationSettings{handler:handler}
  3792. self77.processorMap["getChannelSettings"] = &channelServiceProcessorGetChannelSettings{handler:handler}
  3793. self77.processorMap["getCommonDomains"] = &channelServiceProcessorGetCommonDomains{handler:handler}
  3794. self77.processorMap["getReturnUrlWithRequestTokenForAutoLogin"] = &channelServiceProcessorGetReturnUrlWithRequestTokenForAutoLogin{handler:handler}
  3795. self77.processorMap["getUpdatedChannelIds"] = &channelServiceProcessorGetUpdatedChannelIds{handler:handler}
  3796. self77.processorMap["getWebLoginDisallowedUrl"] = &channelServiceProcessorGetWebLoginDisallowedUrl{handler:handler}
  3797. self77.processorMap["issueChannelToken"] = &channelServiceProcessorIssueChannelToken{handler:handler}
  3798. self77.processorMap["issueRequestTokenWithAuthScheme"] = &channelServiceProcessorIssueRequestTokenWithAuthScheme{handler:handler}
  3799. self77.processorMap["reserveCoinUse"] = &channelServiceProcessorReserveCoinUse{handler:handler}
  3800. self77.processorMap["revokeChannel"] = &channelServiceProcessorRevokeChannel{handler:handler}
  3801. self77.processorMap["updateChannelNotificationSetting"] = &channelServiceProcessorUpdateChannelNotificationSetting{handler:handler}
  3802. self77.processorMap["updateChannelSettings"] = &channelServiceProcessorUpdateChannelSettings{handler:handler}
  3803. return self77
  3804. }
  3805. func (p *ChannelServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  3806. name, _, seqId, err2 := iprot.ReadMessageBegin(ctx)
  3807. if err2 != nil { return false, thrift.WrapTException(err2) }
  3808. if processor, ok := p.GetProcessorFunction(name); ok {
  3809. return processor.Process(ctx, seqId, iprot, oprot)
  3810. }
  3811. iprot.Skip(ctx, thrift.STRUCT)
  3812. iprot.ReadMessageEnd(ctx)
  3813. x78 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name)
  3814. oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId)
  3815. x78.Write(ctx, oprot)
  3816. oprot.WriteMessageEnd(ctx)
  3817. oprot.Flush(ctx)
  3818. return false, x78
  3819. }
  3820. type channelServiceProcessorApproveChannelAndIssueChannelToken struct {
  3821. handler ChannelService
  3822. }
  3823. func (p *channelServiceProcessorApproveChannelAndIssueChannelToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  3824. args := ChannelServiceApproveChannelAndIssueChannelTokenArgs{}
  3825. var err2 error
  3826. if err2 = args.Read(ctx, iprot); err2 != nil {
  3827. iprot.ReadMessageEnd(ctx)
  3828. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  3829. oprot.WriteMessageBegin(ctx, "approveChannelAndIssueChannelToken", thrift.EXCEPTION, seqId)
  3830. x.Write(ctx, oprot)
  3831. oprot.WriteMessageEnd(ctx)
  3832. oprot.Flush(ctx)
  3833. return false, thrift.WrapTException(err2)
  3834. }
  3835. iprot.ReadMessageEnd(ctx)
  3836. tickerCancel := func() {}
  3837. // Start a goroutine to do server side connectivity check.
  3838. if thrift.ServerConnectivityCheckInterval > 0 {
  3839. var cancel context.CancelFunc
  3840. ctx, cancel = context.WithCancel(ctx)
  3841. defer cancel()
  3842. var tickerCtx context.Context
  3843. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  3844. defer tickerCancel()
  3845. go func(ctx context.Context, cancel context.CancelFunc) {
  3846. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  3847. defer ticker.Stop()
  3848. for {
  3849. select {
  3850. case <-ctx.Done():
  3851. return
  3852. case <-ticker.C:
  3853. if !iprot.Transport().IsOpen() {
  3854. cancel()
  3855. return
  3856. }
  3857. }
  3858. }
  3859. }(tickerCtx, cancel)
  3860. }
  3861. result := ChannelServiceApproveChannelAndIssueChannelTokenResult{}
  3862. var retval *ChannelToken
  3863. if retval, err2 = p.handler.ApproveChannelAndIssueChannelToken(ctx, args.ChannelId); err2 != nil {
  3864. tickerCancel()
  3865. switch v := err2.(type) {
  3866. case *ChannelException:
  3867. result.E = v
  3868. default:
  3869. if err2 == thrift.ErrAbandonRequest {
  3870. return false, thrift.WrapTException(err2)
  3871. }
  3872. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing approveChannelAndIssueChannelToken: " + err2.Error())
  3873. oprot.WriteMessageBegin(ctx, "approveChannelAndIssueChannelToken", thrift.EXCEPTION, seqId)
  3874. x.Write(ctx, oprot)
  3875. oprot.WriteMessageEnd(ctx)
  3876. oprot.Flush(ctx)
  3877. return true, thrift.WrapTException(err2)
  3878. }
  3879. } else {
  3880. result.Success = retval
  3881. }
  3882. tickerCancel()
  3883. if err2 = oprot.WriteMessageBegin(ctx, "approveChannelAndIssueChannelToken", thrift.REPLY, seqId); err2 != nil {
  3884. err = thrift.WrapTException(err2)
  3885. }
  3886. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  3887. err = thrift.WrapTException(err2)
  3888. }
  3889. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  3890. err = thrift.WrapTException(err2)
  3891. }
  3892. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  3893. err = thrift.WrapTException(err2)
  3894. }
  3895. if err != nil {
  3896. return
  3897. }
  3898. return true, err
  3899. }
  3900. type channelServiceProcessorGetApprovedChannels struct {
  3901. handler ChannelService
  3902. }
  3903. func (p *channelServiceProcessorGetApprovedChannels) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  3904. args := ChannelServiceGetApprovedChannelsArgs{}
  3905. var err2 error
  3906. if err2 = args.Read(ctx, iprot); err2 != nil {
  3907. iprot.ReadMessageEnd(ctx)
  3908. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  3909. oprot.WriteMessageBegin(ctx, "getApprovedChannels", thrift.EXCEPTION, seqId)
  3910. x.Write(ctx, oprot)
  3911. oprot.WriteMessageEnd(ctx)
  3912. oprot.Flush(ctx)
  3913. return false, thrift.WrapTException(err2)
  3914. }
  3915. iprot.ReadMessageEnd(ctx)
  3916. tickerCancel := func() {}
  3917. // Start a goroutine to do server side connectivity check.
  3918. if thrift.ServerConnectivityCheckInterval > 0 {
  3919. var cancel context.CancelFunc
  3920. ctx, cancel = context.WithCancel(ctx)
  3921. defer cancel()
  3922. var tickerCtx context.Context
  3923. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  3924. defer tickerCancel()
  3925. go func(ctx context.Context, cancel context.CancelFunc) {
  3926. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  3927. defer ticker.Stop()
  3928. for {
  3929. select {
  3930. case <-ctx.Done():
  3931. return
  3932. case <-ticker.C:
  3933. if !iprot.Transport().IsOpen() {
  3934. cancel()
  3935. return
  3936. }
  3937. }
  3938. }
  3939. }(tickerCtx, cancel)
  3940. }
  3941. result := ChannelServiceGetApprovedChannelsResult{}
  3942. var retval *ApprovedChannelInfos
  3943. if retval, err2 = p.handler.GetApprovedChannels(ctx, args.LastSynced, args.Locale); err2 != nil {
  3944. tickerCancel()
  3945. switch v := err2.(type) {
  3946. case *ChannelException:
  3947. result.E = v
  3948. default:
  3949. if err2 == thrift.ErrAbandonRequest {
  3950. return false, thrift.WrapTException(err2)
  3951. }
  3952. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getApprovedChannels: " + err2.Error())
  3953. oprot.WriteMessageBegin(ctx, "getApprovedChannels", thrift.EXCEPTION, seqId)
  3954. x.Write(ctx, oprot)
  3955. oprot.WriteMessageEnd(ctx)
  3956. oprot.Flush(ctx)
  3957. return true, thrift.WrapTException(err2)
  3958. }
  3959. } else {
  3960. result.Success = retval
  3961. }
  3962. tickerCancel()
  3963. if err2 = oprot.WriteMessageBegin(ctx, "getApprovedChannels", thrift.REPLY, seqId); err2 != nil {
  3964. err = thrift.WrapTException(err2)
  3965. }
  3966. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  3967. err = thrift.WrapTException(err2)
  3968. }
  3969. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  3970. err = thrift.WrapTException(err2)
  3971. }
  3972. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  3973. err = thrift.WrapTException(err2)
  3974. }
  3975. if err != nil {
  3976. return
  3977. }
  3978. return true, err
  3979. }
  3980. type channelServiceProcessorGetChannelInfo struct {
  3981. handler ChannelService
  3982. }
  3983. func (p *channelServiceProcessorGetChannelInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  3984. args := ChannelServiceGetChannelInfoArgs{}
  3985. var err2 error
  3986. if err2 = args.Read(ctx, iprot); err2 != nil {
  3987. iprot.ReadMessageEnd(ctx)
  3988. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  3989. oprot.WriteMessageBegin(ctx, "getChannelInfo", thrift.EXCEPTION, seqId)
  3990. x.Write(ctx, oprot)
  3991. oprot.WriteMessageEnd(ctx)
  3992. oprot.Flush(ctx)
  3993. return false, thrift.WrapTException(err2)
  3994. }
  3995. iprot.ReadMessageEnd(ctx)
  3996. tickerCancel := func() {}
  3997. // Start a goroutine to do server side connectivity check.
  3998. if thrift.ServerConnectivityCheckInterval > 0 {
  3999. var cancel context.CancelFunc
  4000. ctx, cancel = context.WithCancel(ctx)
  4001. defer cancel()
  4002. var tickerCtx context.Context
  4003. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4004. defer tickerCancel()
  4005. go func(ctx context.Context, cancel context.CancelFunc) {
  4006. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4007. defer ticker.Stop()
  4008. for {
  4009. select {
  4010. case <-ctx.Done():
  4011. return
  4012. case <-ticker.C:
  4013. if !iprot.Transport().IsOpen() {
  4014. cancel()
  4015. return
  4016. }
  4017. }
  4018. }
  4019. }(tickerCtx, cancel)
  4020. }
  4021. result := ChannelServiceGetChannelInfoResult{}
  4022. var retval *ChannelInfo
  4023. if retval, err2 = p.handler.GetChannelInfo(ctx, args.ChannelId, args.Locale); err2 != nil {
  4024. tickerCancel()
  4025. switch v := err2.(type) {
  4026. case *ChannelException:
  4027. result.E = v
  4028. default:
  4029. if err2 == thrift.ErrAbandonRequest {
  4030. return false, thrift.WrapTException(err2)
  4031. }
  4032. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getChannelInfo: " + err2.Error())
  4033. oprot.WriteMessageBegin(ctx, "getChannelInfo", thrift.EXCEPTION, seqId)
  4034. x.Write(ctx, oprot)
  4035. oprot.WriteMessageEnd(ctx)
  4036. oprot.Flush(ctx)
  4037. return true, thrift.WrapTException(err2)
  4038. }
  4039. } else {
  4040. result.Success = retval
  4041. }
  4042. tickerCancel()
  4043. if err2 = oprot.WriteMessageBegin(ctx, "getChannelInfo", thrift.REPLY, seqId); err2 != nil {
  4044. err = thrift.WrapTException(err2)
  4045. }
  4046. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4047. err = thrift.WrapTException(err2)
  4048. }
  4049. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4050. err = thrift.WrapTException(err2)
  4051. }
  4052. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4053. err = thrift.WrapTException(err2)
  4054. }
  4055. if err != nil {
  4056. return
  4057. }
  4058. return true, err
  4059. }
  4060. type channelServiceProcessorGetChannelNotificationSetting struct {
  4061. handler ChannelService
  4062. }
  4063. func (p *channelServiceProcessorGetChannelNotificationSetting) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4064. args := ChannelServiceGetChannelNotificationSettingArgs{}
  4065. var err2 error
  4066. if err2 = args.Read(ctx, iprot); err2 != nil {
  4067. iprot.ReadMessageEnd(ctx)
  4068. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4069. oprot.WriteMessageBegin(ctx, "getChannelNotificationSetting", thrift.EXCEPTION, seqId)
  4070. x.Write(ctx, oprot)
  4071. oprot.WriteMessageEnd(ctx)
  4072. oprot.Flush(ctx)
  4073. return false, thrift.WrapTException(err2)
  4074. }
  4075. iprot.ReadMessageEnd(ctx)
  4076. tickerCancel := func() {}
  4077. // Start a goroutine to do server side connectivity check.
  4078. if thrift.ServerConnectivityCheckInterval > 0 {
  4079. var cancel context.CancelFunc
  4080. ctx, cancel = context.WithCancel(ctx)
  4081. defer cancel()
  4082. var tickerCtx context.Context
  4083. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4084. defer tickerCancel()
  4085. go func(ctx context.Context, cancel context.CancelFunc) {
  4086. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4087. defer ticker.Stop()
  4088. for {
  4089. select {
  4090. case <-ctx.Done():
  4091. return
  4092. case <-ticker.C:
  4093. if !iprot.Transport().IsOpen() {
  4094. cancel()
  4095. return
  4096. }
  4097. }
  4098. }
  4099. }(tickerCtx, cancel)
  4100. }
  4101. result := ChannelServiceGetChannelNotificationSettingResult{}
  4102. var retval *ChannelNotificationSetting
  4103. if retval, err2 = p.handler.GetChannelNotificationSetting(ctx, args.ChannelId, args.Locale); err2 != nil {
  4104. tickerCancel()
  4105. switch v := err2.(type) {
  4106. case *ChannelException:
  4107. result.E = v
  4108. default:
  4109. if err2 == thrift.ErrAbandonRequest {
  4110. return false, thrift.WrapTException(err2)
  4111. }
  4112. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getChannelNotificationSetting: " + err2.Error())
  4113. oprot.WriteMessageBegin(ctx, "getChannelNotificationSetting", thrift.EXCEPTION, seqId)
  4114. x.Write(ctx, oprot)
  4115. oprot.WriteMessageEnd(ctx)
  4116. oprot.Flush(ctx)
  4117. return true, thrift.WrapTException(err2)
  4118. }
  4119. } else {
  4120. result.Success = retval
  4121. }
  4122. tickerCancel()
  4123. if err2 = oprot.WriteMessageBegin(ctx, "getChannelNotificationSetting", thrift.REPLY, seqId); err2 != nil {
  4124. err = thrift.WrapTException(err2)
  4125. }
  4126. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4127. err = thrift.WrapTException(err2)
  4128. }
  4129. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4130. err = thrift.WrapTException(err2)
  4131. }
  4132. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4133. err = thrift.WrapTException(err2)
  4134. }
  4135. if err != nil {
  4136. return
  4137. }
  4138. return true, err
  4139. }
  4140. type channelServiceProcessorGetChannelNotificationSettings struct {
  4141. handler ChannelService
  4142. }
  4143. func (p *channelServiceProcessorGetChannelNotificationSettings) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4144. args := ChannelServiceGetChannelNotificationSettingsArgs{}
  4145. var err2 error
  4146. if err2 = args.Read(ctx, iprot); err2 != nil {
  4147. iprot.ReadMessageEnd(ctx)
  4148. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4149. oprot.WriteMessageBegin(ctx, "getChannelNotificationSettings", thrift.EXCEPTION, seqId)
  4150. x.Write(ctx, oprot)
  4151. oprot.WriteMessageEnd(ctx)
  4152. oprot.Flush(ctx)
  4153. return false, thrift.WrapTException(err2)
  4154. }
  4155. iprot.ReadMessageEnd(ctx)
  4156. tickerCancel := func() {}
  4157. // Start a goroutine to do server side connectivity check.
  4158. if thrift.ServerConnectivityCheckInterval > 0 {
  4159. var cancel context.CancelFunc
  4160. ctx, cancel = context.WithCancel(ctx)
  4161. defer cancel()
  4162. var tickerCtx context.Context
  4163. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4164. defer tickerCancel()
  4165. go func(ctx context.Context, cancel context.CancelFunc) {
  4166. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4167. defer ticker.Stop()
  4168. for {
  4169. select {
  4170. case <-ctx.Done():
  4171. return
  4172. case <-ticker.C:
  4173. if !iprot.Transport().IsOpen() {
  4174. cancel()
  4175. return
  4176. }
  4177. }
  4178. }
  4179. }(tickerCtx, cancel)
  4180. }
  4181. result := ChannelServiceGetChannelNotificationSettingsResult{}
  4182. var retval []*ChannelNotificationSetting
  4183. if retval, err2 = p.handler.GetChannelNotificationSettings(ctx, args.Locale); err2 != nil {
  4184. tickerCancel()
  4185. switch v := err2.(type) {
  4186. case *ChannelException:
  4187. result.E = v
  4188. default:
  4189. if err2 == thrift.ErrAbandonRequest {
  4190. return false, thrift.WrapTException(err2)
  4191. }
  4192. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getChannelNotificationSettings: " + err2.Error())
  4193. oprot.WriteMessageBegin(ctx, "getChannelNotificationSettings", thrift.EXCEPTION, seqId)
  4194. x.Write(ctx, oprot)
  4195. oprot.WriteMessageEnd(ctx)
  4196. oprot.Flush(ctx)
  4197. return true, thrift.WrapTException(err2)
  4198. }
  4199. } else {
  4200. result.Success = retval
  4201. }
  4202. tickerCancel()
  4203. if err2 = oprot.WriteMessageBegin(ctx, "getChannelNotificationSettings", thrift.REPLY, seqId); err2 != nil {
  4204. err = thrift.WrapTException(err2)
  4205. }
  4206. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4207. err = thrift.WrapTException(err2)
  4208. }
  4209. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4210. err = thrift.WrapTException(err2)
  4211. }
  4212. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4213. err = thrift.WrapTException(err2)
  4214. }
  4215. if err != nil {
  4216. return
  4217. }
  4218. return true, err
  4219. }
  4220. type channelServiceProcessorGetChannelSettings struct {
  4221. handler ChannelService
  4222. }
  4223. func (p *channelServiceProcessorGetChannelSettings) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4224. args := ChannelServiceGetChannelSettingsArgs{}
  4225. var err2 error
  4226. if err2 = args.Read(ctx, iprot); err2 != nil {
  4227. iprot.ReadMessageEnd(ctx)
  4228. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4229. oprot.WriteMessageBegin(ctx, "getChannelSettings", thrift.EXCEPTION, seqId)
  4230. x.Write(ctx, oprot)
  4231. oprot.WriteMessageEnd(ctx)
  4232. oprot.Flush(ctx)
  4233. return false, thrift.WrapTException(err2)
  4234. }
  4235. iprot.ReadMessageEnd(ctx)
  4236. tickerCancel := func() {}
  4237. // Start a goroutine to do server side connectivity check.
  4238. if thrift.ServerConnectivityCheckInterval > 0 {
  4239. var cancel context.CancelFunc
  4240. ctx, cancel = context.WithCancel(ctx)
  4241. defer cancel()
  4242. var tickerCtx context.Context
  4243. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4244. defer tickerCancel()
  4245. go func(ctx context.Context, cancel context.CancelFunc) {
  4246. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4247. defer ticker.Stop()
  4248. for {
  4249. select {
  4250. case <-ctx.Done():
  4251. return
  4252. case <-ticker.C:
  4253. if !iprot.Transport().IsOpen() {
  4254. cancel()
  4255. return
  4256. }
  4257. }
  4258. }
  4259. }(tickerCtx, cancel)
  4260. }
  4261. result := ChannelServiceGetChannelSettingsResult{}
  4262. var retval *ChannelSettings
  4263. if retval, err2 = p.handler.GetChannelSettings(ctx); err2 != nil {
  4264. tickerCancel()
  4265. switch v := err2.(type) {
  4266. case *ChannelException:
  4267. result.E = v
  4268. default:
  4269. if err2 == thrift.ErrAbandonRequest {
  4270. return false, thrift.WrapTException(err2)
  4271. }
  4272. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getChannelSettings: " + err2.Error())
  4273. oprot.WriteMessageBegin(ctx, "getChannelSettings", thrift.EXCEPTION, seqId)
  4274. x.Write(ctx, oprot)
  4275. oprot.WriteMessageEnd(ctx)
  4276. oprot.Flush(ctx)
  4277. return true, thrift.WrapTException(err2)
  4278. }
  4279. } else {
  4280. result.Success = retval
  4281. }
  4282. tickerCancel()
  4283. if err2 = oprot.WriteMessageBegin(ctx, "getChannelSettings", thrift.REPLY, seqId); err2 != nil {
  4284. err = thrift.WrapTException(err2)
  4285. }
  4286. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4287. err = thrift.WrapTException(err2)
  4288. }
  4289. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4290. err = thrift.WrapTException(err2)
  4291. }
  4292. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4293. err = thrift.WrapTException(err2)
  4294. }
  4295. if err != nil {
  4296. return
  4297. }
  4298. return true, err
  4299. }
  4300. type channelServiceProcessorGetCommonDomains struct {
  4301. handler ChannelService
  4302. }
  4303. func (p *channelServiceProcessorGetCommonDomains) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4304. args := ChannelServiceGetCommonDomainsArgs{}
  4305. var err2 error
  4306. if err2 = args.Read(ctx, iprot); err2 != nil {
  4307. iprot.ReadMessageEnd(ctx)
  4308. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4309. oprot.WriteMessageBegin(ctx, "getCommonDomains", thrift.EXCEPTION, seqId)
  4310. x.Write(ctx, oprot)
  4311. oprot.WriteMessageEnd(ctx)
  4312. oprot.Flush(ctx)
  4313. return false, thrift.WrapTException(err2)
  4314. }
  4315. iprot.ReadMessageEnd(ctx)
  4316. tickerCancel := func() {}
  4317. // Start a goroutine to do server side connectivity check.
  4318. if thrift.ServerConnectivityCheckInterval > 0 {
  4319. var cancel context.CancelFunc
  4320. ctx, cancel = context.WithCancel(ctx)
  4321. defer cancel()
  4322. var tickerCtx context.Context
  4323. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4324. defer tickerCancel()
  4325. go func(ctx context.Context, cancel context.CancelFunc) {
  4326. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4327. defer ticker.Stop()
  4328. for {
  4329. select {
  4330. case <-ctx.Done():
  4331. return
  4332. case <-ticker.C:
  4333. if !iprot.Transport().IsOpen() {
  4334. cancel()
  4335. return
  4336. }
  4337. }
  4338. }
  4339. }(tickerCtx, cancel)
  4340. }
  4341. result := ChannelServiceGetCommonDomainsResult{}
  4342. var retval *ChannelDomains
  4343. if retval, err2 = p.handler.GetCommonDomains(ctx, args.LastSynced); err2 != nil {
  4344. tickerCancel()
  4345. switch v := err2.(type) {
  4346. case *ChannelException:
  4347. result.E = v
  4348. default:
  4349. if err2 == thrift.ErrAbandonRequest {
  4350. return false, thrift.WrapTException(err2)
  4351. }
  4352. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getCommonDomains: " + err2.Error())
  4353. oprot.WriteMessageBegin(ctx, "getCommonDomains", thrift.EXCEPTION, seqId)
  4354. x.Write(ctx, oprot)
  4355. oprot.WriteMessageEnd(ctx)
  4356. oprot.Flush(ctx)
  4357. return true, thrift.WrapTException(err2)
  4358. }
  4359. } else {
  4360. result.Success = retval
  4361. }
  4362. tickerCancel()
  4363. if err2 = oprot.WriteMessageBegin(ctx, "getCommonDomains", thrift.REPLY, seqId); err2 != nil {
  4364. err = thrift.WrapTException(err2)
  4365. }
  4366. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4367. err = thrift.WrapTException(err2)
  4368. }
  4369. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4370. err = thrift.WrapTException(err2)
  4371. }
  4372. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4373. err = thrift.WrapTException(err2)
  4374. }
  4375. if err != nil {
  4376. return
  4377. }
  4378. return true, err
  4379. }
  4380. type channelServiceProcessorGetReturnUrlWithRequestTokenForAutoLogin struct {
  4381. handler ChannelService
  4382. }
  4383. func (p *channelServiceProcessorGetReturnUrlWithRequestTokenForAutoLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4384. args := ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs{}
  4385. var err2 error
  4386. if err2 = args.Read(ctx, iprot); err2 != nil {
  4387. iprot.ReadMessageEnd(ctx)
  4388. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4389. oprot.WriteMessageBegin(ctx, "getReturnUrlWithRequestTokenForAutoLogin", thrift.EXCEPTION, seqId)
  4390. x.Write(ctx, oprot)
  4391. oprot.WriteMessageEnd(ctx)
  4392. oprot.Flush(ctx)
  4393. return false, thrift.WrapTException(err2)
  4394. }
  4395. iprot.ReadMessageEnd(ctx)
  4396. tickerCancel := func() {}
  4397. // Start a goroutine to do server side connectivity check.
  4398. if thrift.ServerConnectivityCheckInterval > 0 {
  4399. var cancel context.CancelFunc
  4400. ctx, cancel = context.WithCancel(ctx)
  4401. defer cancel()
  4402. var tickerCtx context.Context
  4403. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4404. defer tickerCancel()
  4405. go func(ctx context.Context, cancel context.CancelFunc) {
  4406. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4407. defer ticker.Stop()
  4408. for {
  4409. select {
  4410. case <-ctx.Done():
  4411. return
  4412. case <-ticker.C:
  4413. if !iprot.Transport().IsOpen() {
  4414. cancel()
  4415. return
  4416. }
  4417. }
  4418. }
  4419. }(tickerCtx, cancel)
  4420. }
  4421. result := ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult{}
  4422. var retval *WebLoginResponse
  4423. if retval, err2 = p.handler.GetReturnUrlWithRequestTokenForAutoLogin(ctx, args.WebLoginRequest); err2 != nil {
  4424. tickerCancel()
  4425. switch v := err2.(type) {
  4426. case *ChannelException:
  4427. result.E = v
  4428. default:
  4429. if err2 == thrift.ErrAbandonRequest {
  4430. return false, thrift.WrapTException(err2)
  4431. }
  4432. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getReturnUrlWithRequestTokenForAutoLogin: " + err2.Error())
  4433. oprot.WriteMessageBegin(ctx, "getReturnUrlWithRequestTokenForAutoLogin", thrift.EXCEPTION, seqId)
  4434. x.Write(ctx, oprot)
  4435. oprot.WriteMessageEnd(ctx)
  4436. oprot.Flush(ctx)
  4437. return true, thrift.WrapTException(err2)
  4438. }
  4439. } else {
  4440. result.Success = retval
  4441. }
  4442. tickerCancel()
  4443. if err2 = oprot.WriteMessageBegin(ctx, "getReturnUrlWithRequestTokenForAutoLogin", thrift.REPLY, seqId); err2 != nil {
  4444. err = thrift.WrapTException(err2)
  4445. }
  4446. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4447. err = thrift.WrapTException(err2)
  4448. }
  4449. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4450. err = thrift.WrapTException(err2)
  4451. }
  4452. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4453. err = thrift.WrapTException(err2)
  4454. }
  4455. if err != nil {
  4456. return
  4457. }
  4458. return true, err
  4459. }
  4460. type channelServiceProcessorGetUpdatedChannelIds struct {
  4461. handler ChannelService
  4462. }
  4463. func (p *channelServiceProcessorGetUpdatedChannelIds) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4464. args := ChannelServiceGetUpdatedChannelIdsArgs{}
  4465. var err2 error
  4466. if err2 = args.Read(ctx, iprot); err2 != nil {
  4467. iprot.ReadMessageEnd(ctx)
  4468. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4469. oprot.WriteMessageBegin(ctx, "getUpdatedChannelIds", thrift.EXCEPTION, seqId)
  4470. x.Write(ctx, oprot)
  4471. oprot.WriteMessageEnd(ctx)
  4472. oprot.Flush(ctx)
  4473. return false, thrift.WrapTException(err2)
  4474. }
  4475. iprot.ReadMessageEnd(ctx)
  4476. tickerCancel := func() {}
  4477. // Start a goroutine to do server side connectivity check.
  4478. if thrift.ServerConnectivityCheckInterval > 0 {
  4479. var cancel context.CancelFunc
  4480. ctx, cancel = context.WithCancel(ctx)
  4481. defer cancel()
  4482. var tickerCtx context.Context
  4483. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4484. defer tickerCancel()
  4485. go func(ctx context.Context, cancel context.CancelFunc) {
  4486. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4487. defer ticker.Stop()
  4488. for {
  4489. select {
  4490. case <-ctx.Done():
  4491. return
  4492. case <-ticker.C:
  4493. if !iprot.Transport().IsOpen() {
  4494. cancel()
  4495. return
  4496. }
  4497. }
  4498. }
  4499. }(tickerCtx, cancel)
  4500. }
  4501. result := ChannelServiceGetUpdatedChannelIdsResult{}
  4502. var retval []string
  4503. if retval, err2 = p.handler.GetUpdatedChannelIds(ctx, args.ChannelIds); err2 != nil {
  4504. tickerCancel()
  4505. switch v := err2.(type) {
  4506. case *ChannelException:
  4507. result.E = v
  4508. default:
  4509. if err2 == thrift.ErrAbandonRequest {
  4510. return false, thrift.WrapTException(err2)
  4511. }
  4512. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUpdatedChannelIds: " + err2.Error())
  4513. oprot.WriteMessageBegin(ctx, "getUpdatedChannelIds", thrift.EXCEPTION, seqId)
  4514. x.Write(ctx, oprot)
  4515. oprot.WriteMessageEnd(ctx)
  4516. oprot.Flush(ctx)
  4517. return true, thrift.WrapTException(err2)
  4518. }
  4519. } else {
  4520. result.Success = retval
  4521. }
  4522. tickerCancel()
  4523. if err2 = oprot.WriteMessageBegin(ctx, "getUpdatedChannelIds", thrift.REPLY, seqId); err2 != nil {
  4524. err = thrift.WrapTException(err2)
  4525. }
  4526. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4527. err = thrift.WrapTException(err2)
  4528. }
  4529. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4530. err = thrift.WrapTException(err2)
  4531. }
  4532. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4533. err = thrift.WrapTException(err2)
  4534. }
  4535. if err != nil {
  4536. return
  4537. }
  4538. return true, err
  4539. }
  4540. type channelServiceProcessorGetWebLoginDisallowedUrl struct {
  4541. handler ChannelService
  4542. }
  4543. func (p *channelServiceProcessorGetWebLoginDisallowedUrl) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4544. args := ChannelServiceGetWebLoginDisallowedUrlArgs{}
  4545. var err2 error
  4546. if err2 = args.Read(ctx, iprot); err2 != nil {
  4547. iprot.ReadMessageEnd(ctx)
  4548. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4549. oprot.WriteMessageBegin(ctx, "getWebLoginDisallowedUrl", thrift.EXCEPTION, seqId)
  4550. x.Write(ctx, oprot)
  4551. oprot.WriteMessageEnd(ctx)
  4552. oprot.Flush(ctx)
  4553. return false, thrift.WrapTException(err2)
  4554. }
  4555. iprot.ReadMessageEnd(ctx)
  4556. tickerCancel := func() {}
  4557. // Start a goroutine to do server side connectivity check.
  4558. if thrift.ServerConnectivityCheckInterval > 0 {
  4559. var cancel context.CancelFunc
  4560. ctx, cancel = context.WithCancel(ctx)
  4561. defer cancel()
  4562. var tickerCtx context.Context
  4563. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4564. defer tickerCancel()
  4565. go func(ctx context.Context, cancel context.CancelFunc) {
  4566. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4567. defer ticker.Stop()
  4568. for {
  4569. select {
  4570. case <-ctx.Done():
  4571. return
  4572. case <-ticker.C:
  4573. if !iprot.Transport().IsOpen() {
  4574. cancel()
  4575. return
  4576. }
  4577. }
  4578. }
  4579. }(tickerCtx, cancel)
  4580. }
  4581. result := ChannelServiceGetWebLoginDisallowedUrlResult{}
  4582. var retval *WebLoginResponse
  4583. if retval, err2 = p.handler.GetWebLoginDisallowedUrl(ctx, args.WebLoginRequest); err2 != nil {
  4584. tickerCancel()
  4585. switch v := err2.(type) {
  4586. case *ChannelException:
  4587. result.E = v
  4588. default:
  4589. if err2 == thrift.ErrAbandonRequest {
  4590. return false, thrift.WrapTException(err2)
  4591. }
  4592. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getWebLoginDisallowedUrl: " + err2.Error())
  4593. oprot.WriteMessageBegin(ctx, "getWebLoginDisallowedUrl", thrift.EXCEPTION, seqId)
  4594. x.Write(ctx, oprot)
  4595. oprot.WriteMessageEnd(ctx)
  4596. oprot.Flush(ctx)
  4597. return true, thrift.WrapTException(err2)
  4598. }
  4599. } else {
  4600. result.Success = retval
  4601. }
  4602. tickerCancel()
  4603. if err2 = oprot.WriteMessageBegin(ctx, "getWebLoginDisallowedUrl", thrift.REPLY, seqId); err2 != nil {
  4604. err = thrift.WrapTException(err2)
  4605. }
  4606. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4607. err = thrift.WrapTException(err2)
  4608. }
  4609. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4610. err = thrift.WrapTException(err2)
  4611. }
  4612. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4613. err = thrift.WrapTException(err2)
  4614. }
  4615. if err != nil {
  4616. return
  4617. }
  4618. return true, err
  4619. }
  4620. type channelServiceProcessorIssueChannelToken struct {
  4621. handler ChannelService
  4622. }
  4623. func (p *channelServiceProcessorIssueChannelToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4624. args := ChannelServiceIssueChannelTokenArgs{}
  4625. var err2 error
  4626. if err2 = args.Read(ctx, iprot); err2 != nil {
  4627. iprot.ReadMessageEnd(ctx)
  4628. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4629. oprot.WriteMessageBegin(ctx, "issueChannelToken", thrift.EXCEPTION, seqId)
  4630. x.Write(ctx, oprot)
  4631. oprot.WriteMessageEnd(ctx)
  4632. oprot.Flush(ctx)
  4633. return false, thrift.WrapTException(err2)
  4634. }
  4635. iprot.ReadMessageEnd(ctx)
  4636. tickerCancel := func() {}
  4637. // Start a goroutine to do server side connectivity check.
  4638. if thrift.ServerConnectivityCheckInterval > 0 {
  4639. var cancel context.CancelFunc
  4640. ctx, cancel = context.WithCancel(ctx)
  4641. defer cancel()
  4642. var tickerCtx context.Context
  4643. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4644. defer tickerCancel()
  4645. go func(ctx context.Context, cancel context.CancelFunc) {
  4646. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4647. defer ticker.Stop()
  4648. for {
  4649. select {
  4650. case <-ctx.Done():
  4651. return
  4652. case <-ticker.C:
  4653. if !iprot.Transport().IsOpen() {
  4654. cancel()
  4655. return
  4656. }
  4657. }
  4658. }
  4659. }(tickerCtx, cancel)
  4660. }
  4661. result := ChannelServiceIssueChannelTokenResult{}
  4662. var retval *ChannelToken
  4663. if retval, err2 = p.handler.IssueChannelToken(ctx, args.ChannelId); err2 != nil {
  4664. tickerCancel()
  4665. switch v := err2.(type) {
  4666. case *ChannelException:
  4667. result.E = v
  4668. default:
  4669. if err2 == thrift.ErrAbandonRequest {
  4670. return false, thrift.WrapTException(err2)
  4671. }
  4672. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing issueChannelToken: " + err2.Error())
  4673. oprot.WriteMessageBegin(ctx, "issueChannelToken", thrift.EXCEPTION, seqId)
  4674. x.Write(ctx, oprot)
  4675. oprot.WriteMessageEnd(ctx)
  4676. oprot.Flush(ctx)
  4677. return true, thrift.WrapTException(err2)
  4678. }
  4679. } else {
  4680. result.Success = retval
  4681. }
  4682. tickerCancel()
  4683. if err2 = oprot.WriteMessageBegin(ctx, "issueChannelToken", thrift.REPLY, seqId); err2 != nil {
  4684. err = thrift.WrapTException(err2)
  4685. }
  4686. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4687. err = thrift.WrapTException(err2)
  4688. }
  4689. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4690. err = thrift.WrapTException(err2)
  4691. }
  4692. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4693. err = thrift.WrapTException(err2)
  4694. }
  4695. if err != nil {
  4696. return
  4697. }
  4698. return true, err
  4699. }
  4700. type channelServiceProcessorIssueRequestTokenWithAuthScheme struct {
  4701. handler ChannelService
  4702. }
  4703. func (p *channelServiceProcessorIssueRequestTokenWithAuthScheme) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4704. args := ChannelServiceIssueRequestTokenWithAuthSchemeArgs{}
  4705. var err2 error
  4706. if err2 = args.Read(ctx, iprot); err2 != nil {
  4707. iprot.ReadMessageEnd(ctx)
  4708. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4709. oprot.WriteMessageBegin(ctx, "issueRequestTokenWithAuthScheme", thrift.EXCEPTION, seqId)
  4710. x.Write(ctx, oprot)
  4711. oprot.WriteMessageEnd(ctx)
  4712. oprot.Flush(ctx)
  4713. return false, thrift.WrapTException(err2)
  4714. }
  4715. iprot.ReadMessageEnd(ctx)
  4716. tickerCancel := func() {}
  4717. // Start a goroutine to do server side connectivity check.
  4718. if thrift.ServerConnectivityCheckInterval > 0 {
  4719. var cancel context.CancelFunc
  4720. ctx, cancel = context.WithCancel(ctx)
  4721. defer cancel()
  4722. var tickerCtx context.Context
  4723. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4724. defer tickerCancel()
  4725. go func(ctx context.Context, cancel context.CancelFunc) {
  4726. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4727. defer ticker.Stop()
  4728. for {
  4729. select {
  4730. case <-ctx.Done():
  4731. return
  4732. case <-ticker.C:
  4733. if !iprot.Transport().IsOpen() {
  4734. cancel()
  4735. return
  4736. }
  4737. }
  4738. }
  4739. }(tickerCtx, cancel)
  4740. }
  4741. result := ChannelServiceIssueRequestTokenWithAuthSchemeResult{}
  4742. var retval *RequestTokenResponse
  4743. if retval, err2 = p.handler.IssueRequestTokenWithAuthScheme(ctx, args.ChannelId, args.OtpId, args.AuthScheme, args.ReturnUrl); err2 != nil {
  4744. tickerCancel()
  4745. switch v := err2.(type) {
  4746. case *ChannelException:
  4747. result.E = v
  4748. default:
  4749. if err2 == thrift.ErrAbandonRequest {
  4750. return false, thrift.WrapTException(err2)
  4751. }
  4752. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing issueRequestTokenWithAuthScheme: " + err2.Error())
  4753. oprot.WriteMessageBegin(ctx, "issueRequestTokenWithAuthScheme", thrift.EXCEPTION, seqId)
  4754. x.Write(ctx, oprot)
  4755. oprot.WriteMessageEnd(ctx)
  4756. oprot.Flush(ctx)
  4757. return true, thrift.WrapTException(err2)
  4758. }
  4759. } else {
  4760. result.Success = retval
  4761. }
  4762. tickerCancel()
  4763. if err2 = oprot.WriteMessageBegin(ctx, "issueRequestTokenWithAuthScheme", thrift.REPLY, seqId); err2 != nil {
  4764. err = thrift.WrapTException(err2)
  4765. }
  4766. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4767. err = thrift.WrapTException(err2)
  4768. }
  4769. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4770. err = thrift.WrapTException(err2)
  4771. }
  4772. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4773. err = thrift.WrapTException(err2)
  4774. }
  4775. if err != nil {
  4776. return
  4777. }
  4778. return true, err
  4779. }
  4780. type channelServiceProcessorReserveCoinUse struct {
  4781. handler ChannelService
  4782. }
  4783. func (p *channelServiceProcessorReserveCoinUse) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4784. args := ChannelServiceReserveCoinUseArgs{}
  4785. var err2 error
  4786. if err2 = args.Read(ctx, iprot); err2 != nil {
  4787. iprot.ReadMessageEnd(ctx)
  4788. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4789. oprot.WriteMessageBegin(ctx, "reserveCoinUse", thrift.EXCEPTION, seqId)
  4790. x.Write(ctx, oprot)
  4791. oprot.WriteMessageEnd(ctx)
  4792. oprot.Flush(ctx)
  4793. return false, thrift.WrapTException(err2)
  4794. }
  4795. iprot.ReadMessageEnd(ctx)
  4796. tickerCancel := func() {}
  4797. // Start a goroutine to do server side connectivity check.
  4798. if thrift.ServerConnectivityCheckInterval > 0 {
  4799. var cancel context.CancelFunc
  4800. ctx, cancel = context.WithCancel(ctx)
  4801. defer cancel()
  4802. var tickerCtx context.Context
  4803. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4804. defer tickerCancel()
  4805. go func(ctx context.Context, cancel context.CancelFunc) {
  4806. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4807. defer ticker.Stop()
  4808. for {
  4809. select {
  4810. case <-ctx.Done():
  4811. return
  4812. case <-ticker.C:
  4813. if !iprot.Transport().IsOpen() {
  4814. cancel()
  4815. return
  4816. }
  4817. }
  4818. }
  4819. }(tickerCtx, cancel)
  4820. }
  4821. result := ChannelServiceReserveCoinUseResult{}
  4822. var retval string
  4823. if retval, err2 = p.handler.ReserveCoinUse(ctx, args.Request, args.Locale); err2 != nil {
  4824. tickerCancel()
  4825. switch v := err2.(type) {
  4826. case *ChannelException:
  4827. result.E = v
  4828. default:
  4829. if err2 == thrift.ErrAbandonRequest {
  4830. return false, thrift.WrapTException(err2)
  4831. }
  4832. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing reserveCoinUse: " + err2.Error())
  4833. oprot.WriteMessageBegin(ctx, "reserveCoinUse", thrift.EXCEPTION, seqId)
  4834. x.Write(ctx, oprot)
  4835. oprot.WriteMessageEnd(ctx)
  4836. oprot.Flush(ctx)
  4837. return true, thrift.WrapTException(err2)
  4838. }
  4839. } else {
  4840. result.Success = &retval
  4841. }
  4842. tickerCancel()
  4843. if err2 = oprot.WriteMessageBegin(ctx, "reserveCoinUse", thrift.REPLY, seqId); err2 != nil {
  4844. err = thrift.WrapTException(err2)
  4845. }
  4846. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4847. err = thrift.WrapTException(err2)
  4848. }
  4849. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4850. err = thrift.WrapTException(err2)
  4851. }
  4852. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4853. err = thrift.WrapTException(err2)
  4854. }
  4855. if err != nil {
  4856. return
  4857. }
  4858. return true, err
  4859. }
  4860. type channelServiceProcessorRevokeChannel struct {
  4861. handler ChannelService
  4862. }
  4863. func (p *channelServiceProcessorRevokeChannel) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4864. args := ChannelServiceRevokeChannelArgs{}
  4865. var err2 error
  4866. if err2 = args.Read(ctx, iprot); err2 != nil {
  4867. iprot.ReadMessageEnd(ctx)
  4868. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4869. oprot.WriteMessageBegin(ctx, "revokeChannel", thrift.EXCEPTION, seqId)
  4870. x.Write(ctx, oprot)
  4871. oprot.WriteMessageEnd(ctx)
  4872. oprot.Flush(ctx)
  4873. return false, thrift.WrapTException(err2)
  4874. }
  4875. iprot.ReadMessageEnd(ctx)
  4876. tickerCancel := func() {}
  4877. // Start a goroutine to do server side connectivity check.
  4878. if thrift.ServerConnectivityCheckInterval > 0 {
  4879. var cancel context.CancelFunc
  4880. ctx, cancel = context.WithCancel(ctx)
  4881. defer cancel()
  4882. var tickerCtx context.Context
  4883. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4884. defer tickerCancel()
  4885. go func(ctx context.Context, cancel context.CancelFunc) {
  4886. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4887. defer ticker.Stop()
  4888. for {
  4889. select {
  4890. case <-ctx.Done():
  4891. return
  4892. case <-ticker.C:
  4893. if !iprot.Transport().IsOpen() {
  4894. cancel()
  4895. return
  4896. }
  4897. }
  4898. }
  4899. }(tickerCtx, cancel)
  4900. }
  4901. result := ChannelServiceRevokeChannelResult{}
  4902. if err2 = p.handler.RevokeChannel(ctx, args.ChannelId); err2 != nil {
  4903. tickerCancel()
  4904. switch v := err2.(type) {
  4905. case *ChannelException:
  4906. result.E = v
  4907. default:
  4908. if err2 == thrift.ErrAbandonRequest {
  4909. return false, thrift.WrapTException(err2)
  4910. }
  4911. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revokeChannel: " + err2.Error())
  4912. oprot.WriteMessageBegin(ctx, "revokeChannel", thrift.EXCEPTION, seqId)
  4913. x.Write(ctx, oprot)
  4914. oprot.WriteMessageEnd(ctx)
  4915. oprot.Flush(ctx)
  4916. return true, thrift.WrapTException(err2)
  4917. }
  4918. }
  4919. tickerCancel()
  4920. if err2 = oprot.WriteMessageBegin(ctx, "revokeChannel", thrift.REPLY, seqId); err2 != nil {
  4921. err = thrift.WrapTException(err2)
  4922. }
  4923. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  4924. err = thrift.WrapTException(err2)
  4925. }
  4926. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  4927. err = thrift.WrapTException(err2)
  4928. }
  4929. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  4930. err = thrift.WrapTException(err2)
  4931. }
  4932. if err != nil {
  4933. return
  4934. }
  4935. return true, err
  4936. }
  4937. type channelServiceProcessorUpdateChannelNotificationSetting struct {
  4938. handler ChannelService
  4939. }
  4940. func (p *channelServiceProcessorUpdateChannelNotificationSetting) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  4941. args := ChannelServiceUpdateChannelNotificationSettingArgs{}
  4942. var err2 error
  4943. if err2 = args.Read(ctx, iprot); err2 != nil {
  4944. iprot.ReadMessageEnd(ctx)
  4945. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  4946. oprot.WriteMessageBegin(ctx, "updateChannelNotificationSetting", thrift.EXCEPTION, seqId)
  4947. x.Write(ctx, oprot)
  4948. oprot.WriteMessageEnd(ctx)
  4949. oprot.Flush(ctx)
  4950. return false, thrift.WrapTException(err2)
  4951. }
  4952. iprot.ReadMessageEnd(ctx)
  4953. tickerCancel := func() {}
  4954. // Start a goroutine to do server side connectivity check.
  4955. if thrift.ServerConnectivityCheckInterval > 0 {
  4956. var cancel context.CancelFunc
  4957. ctx, cancel = context.WithCancel(ctx)
  4958. defer cancel()
  4959. var tickerCtx context.Context
  4960. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  4961. defer tickerCancel()
  4962. go func(ctx context.Context, cancel context.CancelFunc) {
  4963. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  4964. defer ticker.Stop()
  4965. for {
  4966. select {
  4967. case <-ctx.Done():
  4968. return
  4969. case <-ticker.C:
  4970. if !iprot.Transport().IsOpen() {
  4971. cancel()
  4972. return
  4973. }
  4974. }
  4975. }
  4976. }(tickerCtx, cancel)
  4977. }
  4978. result := ChannelServiceUpdateChannelNotificationSettingResult{}
  4979. if err2 = p.handler.UpdateChannelNotificationSetting(ctx, args.Setting); err2 != nil {
  4980. tickerCancel()
  4981. switch v := err2.(type) {
  4982. case *ChannelException:
  4983. result.E = v
  4984. default:
  4985. if err2 == thrift.ErrAbandonRequest {
  4986. return false, thrift.WrapTException(err2)
  4987. }
  4988. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateChannelNotificationSetting: " + err2.Error())
  4989. oprot.WriteMessageBegin(ctx, "updateChannelNotificationSetting", thrift.EXCEPTION, seqId)
  4990. x.Write(ctx, oprot)
  4991. oprot.WriteMessageEnd(ctx)
  4992. oprot.Flush(ctx)
  4993. return true, thrift.WrapTException(err2)
  4994. }
  4995. }
  4996. tickerCancel()
  4997. if err2 = oprot.WriteMessageBegin(ctx, "updateChannelNotificationSetting", thrift.REPLY, seqId); err2 != nil {
  4998. err = thrift.WrapTException(err2)
  4999. }
  5000. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  5001. err = thrift.WrapTException(err2)
  5002. }
  5003. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  5004. err = thrift.WrapTException(err2)
  5005. }
  5006. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  5007. err = thrift.WrapTException(err2)
  5008. }
  5009. if err != nil {
  5010. return
  5011. }
  5012. return true, err
  5013. }
  5014. type channelServiceProcessorUpdateChannelSettings struct {
  5015. handler ChannelService
  5016. }
  5017. func (p *channelServiceProcessorUpdateChannelSettings) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  5018. args := ChannelServiceUpdateChannelSettingsArgs{}
  5019. var err2 error
  5020. if err2 = args.Read(ctx, iprot); err2 != nil {
  5021. iprot.ReadMessageEnd(ctx)
  5022. x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
  5023. oprot.WriteMessageBegin(ctx, "updateChannelSettings", thrift.EXCEPTION, seqId)
  5024. x.Write(ctx, oprot)
  5025. oprot.WriteMessageEnd(ctx)
  5026. oprot.Flush(ctx)
  5027. return false, thrift.WrapTException(err2)
  5028. }
  5029. iprot.ReadMessageEnd(ctx)
  5030. tickerCancel := func() {}
  5031. // Start a goroutine to do server side connectivity check.
  5032. if thrift.ServerConnectivityCheckInterval > 0 {
  5033. var cancel context.CancelFunc
  5034. ctx, cancel = context.WithCancel(ctx)
  5035. defer cancel()
  5036. var tickerCtx context.Context
  5037. tickerCtx, tickerCancel = context.WithCancel(context.Background())
  5038. defer tickerCancel()
  5039. go func(ctx context.Context, cancel context.CancelFunc) {
  5040. ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
  5041. defer ticker.Stop()
  5042. for {
  5043. select {
  5044. case <-ctx.Done():
  5045. return
  5046. case <-ticker.C:
  5047. if !iprot.Transport().IsOpen() {
  5048. cancel()
  5049. return
  5050. }
  5051. }
  5052. }
  5053. }(tickerCtx, cancel)
  5054. }
  5055. result := ChannelServiceUpdateChannelSettingsResult{}
  5056. var retval bool
  5057. if retval, err2 = p.handler.UpdateChannelSettings(ctx, args.ChannelSettings); err2 != nil {
  5058. tickerCancel()
  5059. switch v := err2.(type) {
  5060. case *ChannelException:
  5061. result.E = v
  5062. default:
  5063. if err2 == thrift.ErrAbandonRequest {
  5064. return false, thrift.WrapTException(err2)
  5065. }
  5066. x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateChannelSettings: " + err2.Error())
  5067. oprot.WriteMessageBegin(ctx, "updateChannelSettings", thrift.EXCEPTION, seqId)
  5068. x.Write(ctx, oprot)
  5069. oprot.WriteMessageEnd(ctx)
  5070. oprot.Flush(ctx)
  5071. return true, thrift.WrapTException(err2)
  5072. }
  5073. } else {
  5074. result.Success = &retval
  5075. }
  5076. tickerCancel()
  5077. if err2 = oprot.WriteMessageBegin(ctx, "updateChannelSettings", thrift.REPLY, seqId); err2 != nil {
  5078. err = thrift.WrapTException(err2)
  5079. }
  5080. if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
  5081. err = thrift.WrapTException(err2)
  5082. }
  5083. if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
  5084. err = thrift.WrapTException(err2)
  5085. }
  5086. if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
  5087. err = thrift.WrapTException(err2)
  5088. }
  5089. if err != nil {
  5090. return
  5091. }
  5092. return true, err
  5093. }
  5094. // HELPER FUNCTIONS AND STRUCTURES
  5095. // Attributes:
  5096. // - ChannelId
  5097. type ChannelServiceApproveChannelAndIssueChannelTokenArgs struct {
  5098. ChannelId string `thrift:"channelId,1" db:"channelId" json:"channelId"`
  5099. }
  5100. func NewChannelServiceApproveChannelAndIssueChannelTokenArgs() *ChannelServiceApproveChannelAndIssueChannelTokenArgs {
  5101. return &ChannelServiceApproveChannelAndIssueChannelTokenArgs{}
  5102. }
  5103. func (p *ChannelServiceApproveChannelAndIssueChannelTokenArgs) GetChannelId() string {
  5104. return p.ChannelId
  5105. }
  5106. func (p *ChannelServiceApproveChannelAndIssueChannelTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  5107. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  5108. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  5109. }
  5110. for {
  5111. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  5112. if err != nil {
  5113. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  5114. }
  5115. if fieldTypeId == thrift.STOP { break; }
  5116. switch fieldId {
  5117. case 1:
  5118. if fieldTypeId == thrift.STRING {
  5119. if err := p.ReadField1(ctx, iprot); err != nil {
  5120. return err
  5121. }
  5122. } else {
  5123. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5124. return err
  5125. }
  5126. }
  5127. default:
  5128. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5129. return err
  5130. }
  5131. }
  5132. if err := iprot.ReadFieldEnd(ctx); err != nil {
  5133. return err
  5134. }
  5135. }
  5136. if err := iprot.ReadStructEnd(ctx); err != nil {
  5137. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  5138. }
  5139. return nil
  5140. }
  5141. func (p *ChannelServiceApproveChannelAndIssueChannelTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  5142. if v, err := iprot.ReadString(ctx); err != nil {
  5143. return thrift.PrependError("error reading field 1: ", err)
  5144. } else {
  5145. p.ChannelId = v
  5146. }
  5147. return nil
  5148. }
  5149. func (p *ChannelServiceApproveChannelAndIssueChannelTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  5150. if err := oprot.WriteStructBegin(ctx, "approveChannelAndIssueChannelToken_args"); err != nil {
  5151. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  5152. if p != nil {
  5153. if err := p.writeField1(ctx, oprot); err != nil { return err }
  5154. }
  5155. if err := oprot.WriteFieldStop(ctx); err != nil {
  5156. return thrift.PrependError("write field stop error: ", err) }
  5157. if err := oprot.WriteStructEnd(ctx); err != nil {
  5158. return thrift.PrependError("write struct stop error: ", err) }
  5159. return nil
  5160. }
  5161. func (p *ChannelServiceApproveChannelAndIssueChannelTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5162. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 1); err != nil {
  5163. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelId: ", p), err) }
  5164. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  5165. return thrift.PrependError(fmt.Sprintf("%T.channelId (1) field write error: ", p), err) }
  5166. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5167. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelId: ", p), err) }
  5168. return err
  5169. }
  5170. func (p *ChannelServiceApproveChannelAndIssueChannelTokenArgs) String() string {
  5171. if p == nil {
  5172. return "<nil>"
  5173. }
  5174. return fmt.Sprintf("ChannelServiceApproveChannelAndIssueChannelTokenArgs(%+v)", *p)
  5175. }
  5176. // Attributes:
  5177. // - Success
  5178. // - E
  5179. type ChannelServiceApproveChannelAndIssueChannelTokenResult struct {
  5180. Success *ChannelToken `thrift:"success,0" db:"success" json:"success,omitempty"`
  5181. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  5182. }
  5183. func NewChannelServiceApproveChannelAndIssueChannelTokenResult() *ChannelServiceApproveChannelAndIssueChannelTokenResult {
  5184. return &ChannelServiceApproveChannelAndIssueChannelTokenResult{}
  5185. }
  5186. var ChannelServiceApproveChannelAndIssueChannelTokenResult_Success_DEFAULT *ChannelToken
  5187. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) GetSuccess() *ChannelToken {
  5188. if !p.IsSetSuccess() {
  5189. return ChannelServiceApproveChannelAndIssueChannelTokenResult_Success_DEFAULT
  5190. }
  5191. return p.Success
  5192. }
  5193. var ChannelServiceApproveChannelAndIssueChannelTokenResult_E_DEFAULT *ChannelException
  5194. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) GetE() *ChannelException {
  5195. if !p.IsSetE() {
  5196. return ChannelServiceApproveChannelAndIssueChannelTokenResult_E_DEFAULT
  5197. }
  5198. return p.E
  5199. }
  5200. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) IsSetSuccess() bool {
  5201. return p.Success != nil
  5202. }
  5203. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) IsSetE() bool {
  5204. return p.E != nil
  5205. }
  5206. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  5207. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  5208. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  5209. }
  5210. for {
  5211. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  5212. if err != nil {
  5213. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  5214. }
  5215. if fieldTypeId == thrift.STOP { break; }
  5216. switch fieldId {
  5217. case 0:
  5218. if fieldTypeId == thrift.STRUCT {
  5219. if err := p.ReadField0(ctx, iprot); err != nil {
  5220. return err
  5221. }
  5222. } else {
  5223. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5224. return err
  5225. }
  5226. }
  5227. case 1:
  5228. if fieldTypeId == thrift.STRUCT {
  5229. if err := p.ReadField1(ctx, iprot); err != nil {
  5230. return err
  5231. }
  5232. } else {
  5233. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5234. return err
  5235. }
  5236. }
  5237. default:
  5238. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5239. return err
  5240. }
  5241. }
  5242. if err := iprot.ReadFieldEnd(ctx); err != nil {
  5243. return err
  5244. }
  5245. }
  5246. if err := iprot.ReadStructEnd(ctx); err != nil {
  5247. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  5248. }
  5249. return nil
  5250. }
  5251. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  5252. p.Success = &ChannelToken{}
  5253. if err := p.Success.Read(ctx, iprot); err != nil {
  5254. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  5255. }
  5256. return nil
  5257. }
  5258. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  5259. p.E = &ChannelException{}
  5260. if err := p.E.Read(ctx, iprot); err != nil {
  5261. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  5262. }
  5263. return nil
  5264. }
  5265. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  5266. if err := oprot.WriteStructBegin(ctx, "approveChannelAndIssueChannelToken_result"); err != nil {
  5267. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  5268. if p != nil {
  5269. if err := p.writeField0(ctx, oprot); err != nil { return err }
  5270. if err := p.writeField1(ctx, oprot); err != nil { return err }
  5271. }
  5272. if err := oprot.WriteFieldStop(ctx); err != nil {
  5273. return thrift.PrependError("write field stop error: ", err) }
  5274. if err := oprot.WriteStructEnd(ctx); err != nil {
  5275. return thrift.PrependError("write struct stop error: ", err) }
  5276. return nil
  5277. }
  5278. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5279. if p.IsSetSuccess() {
  5280. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  5281. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  5282. if err := p.Success.Write(ctx, oprot); err != nil {
  5283. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  5284. }
  5285. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5286. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  5287. }
  5288. return err
  5289. }
  5290. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5291. if p.IsSetE() {
  5292. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  5293. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  5294. if err := p.E.Write(ctx, oprot); err != nil {
  5295. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  5296. }
  5297. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5298. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  5299. }
  5300. return err
  5301. }
  5302. func (p *ChannelServiceApproveChannelAndIssueChannelTokenResult) String() string {
  5303. if p == nil {
  5304. return "<nil>"
  5305. }
  5306. return fmt.Sprintf("ChannelServiceApproveChannelAndIssueChannelTokenResult(%+v)", *p)
  5307. }
  5308. // Attributes:
  5309. // - LastSynced
  5310. // - Locale
  5311. type ChannelServiceGetApprovedChannelsArgs struct {
  5312. // unused field # 1
  5313. LastSynced int64 `thrift:"lastSynced,2" db:"lastSynced" json:"lastSynced"`
  5314. Locale string `thrift:"locale,3" db:"locale" json:"locale"`
  5315. }
  5316. func NewChannelServiceGetApprovedChannelsArgs() *ChannelServiceGetApprovedChannelsArgs {
  5317. return &ChannelServiceGetApprovedChannelsArgs{}
  5318. }
  5319. func (p *ChannelServiceGetApprovedChannelsArgs) GetLastSynced() int64 {
  5320. return p.LastSynced
  5321. }
  5322. func (p *ChannelServiceGetApprovedChannelsArgs) GetLocale() string {
  5323. return p.Locale
  5324. }
  5325. func (p *ChannelServiceGetApprovedChannelsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  5326. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  5327. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  5328. }
  5329. for {
  5330. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  5331. if err != nil {
  5332. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  5333. }
  5334. if fieldTypeId == thrift.STOP { break; }
  5335. switch fieldId {
  5336. case 2:
  5337. if fieldTypeId == thrift.I64 {
  5338. if err := p.ReadField2(ctx, iprot); err != nil {
  5339. return err
  5340. }
  5341. } else {
  5342. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5343. return err
  5344. }
  5345. }
  5346. case 3:
  5347. if fieldTypeId == thrift.STRING {
  5348. if err := p.ReadField3(ctx, iprot); err != nil {
  5349. return err
  5350. }
  5351. } else {
  5352. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5353. return err
  5354. }
  5355. }
  5356. default:
  5357. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5358. return err
  5359. }
  5360. }
  5361. if err := iprot.ReadFieldEnd(ctx); err != nil {
  5362. return err
  5363. }
  5364. }
  5365. if err := iprot.ReadStructEnd(ctx); err != nil {
  5366. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  5367. }
  5368. return nil
  5369. }
  5370. func (p *ChannelServiceGetApprovedChannelsArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  5371. if v, err := iprot.ReadI64(ctx); err != nil {
  5372. return thrift.PrependError("error reading field 2: ", err)
  5373. } else {
  5374. p.LastSynced = v
  5375. }
  5376. return nil
  5377. }
  5378. func (p *ChannelServiceGetApprovedChannelsArgs) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  5379. if v, err := iprot.ReadString(ctx); err != nil {
  5380. return thrift.PrependError("error reading field 3: ", err)
  5381. } else {
  5382. p.Locale = v
  5383. }
  5384. return nil
  5385. }
  5386. func (p *ChannelServiceGetApprovedChannelsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  5387. if err := oprot.WriteStructBegin(ctx, "getApprovedChannels_args"); err != nil {
  5388. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  5389. if p != nil {
  5390. if err := p.writeField2(ctx, oprot); err != nil { return err }
  5391. if err := p.writeField3(ctx, oprot); err != nil { return err }
  5392. }
  5393. if err := oprot.WriteFieldStop(ctx); err != nil {
  5394. return thrift.PrependError("write field stop error: ", err) }
  5395. if err := oprot.WriteStructEnd(ctx); err != nil {
  5396. return thrift.PrependError("write struct stop error: ", err) }
  5397. return nil
  5398. }
  5399. func (p *ChannelServiceGetApprovedChannelsArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5400. if err := oprot.WriteFieldBegin(ctx, "lastSynced", thrift.I64, 2); err != nil {
  5401. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:lastSynced: ", p), err) }
  5402. if err := oprot.WriteI64(ctx, int64(p.LastSynced)); err != nil {
  5403. return thrift.PrependError(fmt.Sprintf("%T.lastSynced (2) field write error: ", p), err) }
  5404. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5405. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:lastSynced: ", p), err) }
  5406. return err
  5407. }
  5408. func (p *ChannelServiceGetApprovedChannelsArgs) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5409. if err := oprot.WriteFieldBegin(ctx, "locale", thrift.STRING, 3); err != nil {
  5410. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:locale: ", p), err) }
  5411. if err := oprot.WriteString(ctx, string(p.Locale)); err != nil {
  5412. return thrift.PrependError(fmt.Sprintf("%T.locale (3) field write error: ", p), err) }
  5413. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5414. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:locale: ", p), err) }
  5415. return err
  5416. }
  5417. func (p *ChannelServiceGetApprovedChannelsArgs) String() string {
  5418. if p == nil {
  5419. return "<nil>"
  5420. }
  5421. return fmt.Sprintf("ChannelServiceGetApprovedChannelsArgs(%+v)", *p)
  5422. }
  5423. // Attributes:
  5424. // - Success
  5425. // - E
  5426. type ChannelServiceGetApprovedChannelsResult struct {
  5427. Success *ApprovedChannelInfos `thrift:"success,0" db:"success" json:"success,omitempty"`
  5428. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  5429. }
  5430. func NewChannelServiceGetApprovedChannelsResult() *ChannelServiceGetApprovedChannelsResult {
  5431. return &ChannelServiceGetApprovedChannelsResult{}
  5432. }
  5433. var ChannelServiceGetApprovedChannelsResult_Success_DEFAULT *ApprovedChannelInfos
  5434. func (p *ChannelServiceGetApprovedChannelsResult) GetSuccess() *ApprovedChannelInfos {
  5435. if !p.IsSetSuccess() {
  5436. return ChannelServiceGetApprovedChannelsResult_Success_DEFAULT
  5437. }
  5438. return p.Success
  5439. }
  5440. var ChannelServiceGetApprovedChannelsResult_E_DEFAULT *ChannelException
  5441. func (p *ChannelServiceGetApprovedChannelsResult) GetE() *ChannelException {
  5442. if !p.IsSetE() {
  5443. return ChannelServiceGetApprovedChannelsResult_E_DEFAULT
  5444. }
  5445. return p.E
  5446. }
  5447. func (p *ChannelServiceGetApprovedChannelsResult) IsSetSuccess() bool {
  5448. return p.Success != nil
  5449. }
  5450. func (p *ChannelServiceGetApprovedChannelsResult) IsSetE() bool {
  5451. return p.E != nil
  5452. }
  5453. func (p *ChannelServiceGetApprovedChannelsResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  5454. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  5455. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  5456. }
  5457. for {
  5458. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  5459. if err != nil {
  5460. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  5461. }
  5462. if fieldTypeId == thrift.STOP { break; }
  5463. switch fieldId {
  5464. case 0:
  5465. if fieldTypeId == thrift.STRUCT {
  5466. if err := p.ReadField0(ctx, iprot); err != nil {
  5467. return err
  5468. }
  5469. } else {
  5470. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5471. return err
  5472. }
  5473. }
  5474. case 1:
  5475. if fieldTypeId == thrift.STRUCT {
  5476. if err := p.ReadField1(ctx, iprot); err != nil {
  5477. return err
  5478. }
  5479. } else {
  5480. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5481. return err
  5482. }
  5483. }
  5484. default:
  5485. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5486. return err
  5487. }
  5488. }
  5489. if err := iprot.ReadFieldEnd(ctx); err != nil {
  5490. return err
  5491. }
  5492. }
  5493. if err := iprot.ReadStructEnd(ctx); err != nil {
  5494. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  5495. }
  5496. return nil
  5497. }
  5498. func (p *ChannelServiceGetApprovedChannelsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  5499. p.Success = &ApprovedChannelInfos{}
  5500. if err := p.Success.Read(ctx, iprot); err != nil {
  5501. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  5502. }
  5503. return nil
  5504. }
  5505. func (p *ChannelServiceGetApprovedChannelsResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  5506. p.E = &ChannelException{}
  5507. if err := p.E.Read(ctx, iprot); err != nil {
  5508. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  5509. }
  5510. return nil
  5511. }
  5512. func (p *ChannelServiceGetApprovedChannelsResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  5513. if err := oprot.WriteStructBegin(ctx, "getApprovedChannels_result"); err != nil {
  5514. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  5515. if p != nil {
  5516. if err := p.writeField0(ctx, oprot); err != nil { return err }
  5517. if err := p.writeField1(ctx, oprot); err != nil { return err }
  5518. }
  5519. if err := oprot.WriteFieldStop(ctx); err != nil {
  5520. return thrift.PrependError("write field stop error: ", err) }
  5521. if err := oprot.WriteStructEnd(ctx); err != nil {
  5522. return thrift.PrependError("write struct stop error: ", err) }
  5523. return nil
  5524. }
  5525. func (p *ChannelServiceGetApprovedChannelsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5526. if p.IsSetSuccess() {
  5527. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  5528. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  5529. if err := p.Success.Write(ctx, oprot); err != nil {
  5530. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  5531. }
  5532. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5533. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  5534. }
  5535. return err
  5536. }
  5537. func (p *ChannelServiceGetApprovedChannelsResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5538. if p.IsSetE() {
  5539. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  5540. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  5541. if err := p.E.Write(ctx, oprot); err != nil {
  5542. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  5543. }
  5544. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5545. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  5546. }
  5547. return err
  5548. }
  5549. func (p *ChannelServiceGetApprovedChannelsResult) String() string {
  5550. if p == nil {
  5551. return "<nil>"
  5552. }
  5553. return fmt.Sprintf("ChannelServiceGetApprovedChannelsResult(%+v)", *p)
  5554. }
  5555. // Attributes:
  5556. // - ChannelId
  5557. // - Locale
  5558. type ChannelServiceGetChannelInfoArgs struct {
  5559. // unused field # 1
  5560. ChannelId string `thrift:"channelId,2" db:"channelId" json:"channelId"`
  5561. Locale string `thrift:"locale,3" db:"locale" json:"locale"`
  5562. }
  5563. func NewChannelServiceGetChannelInfoArgs() *ChannelServiceGetChannelInfoArgs {
  5564. return &ChannelServiceGetChannelInfoArgs{}
  5565. }
  5566. func (p *ChannelServiceGetChannelInfoArgs) GetChannelId() string {
  5567. return p.ChannelId
  5568. }
  5569. func (p *ChannelServiceGetChannelInfoArgs) GetLocale() string {
  5570. return p.Locale
  5571. }
  5572. func (p *ChannelServiceGetChannelInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  5573. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  5574. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  5575. }
  5576. for {
  5577. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  5578. if err != nil {
  5579. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  5580. }
  5581. if fieldTypeId == thrift.STOP { break; }
  5582. switch fieldId {
  5583. case 2:
  5584. if fieldTypeId == thrift.STRING {
  5585. if err := p.ReadField2(ctx, iprot); err != nil {
  5586. return err
  5587. }
  5588. } else {
  5589. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5590. return err
  5591. }
  5592. }
  5593. case 3:
  5594. if fieldTypeId == thrift.STRING {
  5595. if err := p.ReadField3(ctx, iprot); err != nil {
  5596. return err
  5597. }
  5598. } else {
  5599. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5600. return err
  5601. }
  5602. }
  5603. default:
  5604. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5605. return err
  5606. }
  5607. }
  5608. if err := iprot.ReadFieldEnd(ctx); err != nil {
  5609. return err
  5610. }
  5611. }
  5612. if err := iprot.ReadStructEnd(ctx); err != nil {
  5613. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  5614. }
  5615. return nil
  5616. }
  5617. func (p *ChannelServiceGetChannelInfoArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  5618. if v, err := iprot.ReadString(ctx); err != nil {
  5619. return thrift.PrependError("error reading field 2: ", err)
  5620. } else {
  5621. p.ChannelId = v
  5622. }
  5623. return nil
  5624. }
  5625. func (p *ChannelServiceGetChannelInfoArgs) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  5626. if v, err := iprot.ReadString(ctx); err != nil {
  5627. return thrift.PrependError("error reading field 3: ", err)
  5628. } else {
  5629. p.Locale = v
  5630. }
  5631. return nil
  5632. }
  5633. func (p *ChannelServiceGetChannelInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  5634. if err := oprot.WriteStructBegin(ctx, "getChannelInfo_args"); err != nil {
  5635. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  5636. if p != nil {
  5637. if err := p.writeField2(ctx, oprot); err != nil { return err }
  5638. if err := p.writeField3(ctx, oprot); err != nil { return err }
  5639. }
  5640. if err := oprot.WriteFieldStop(ctx); err != nil {
  5641. return thrift.PrependError("write field stop error: ", err) }
  5642. if err := oprot.WriteStructEnd(ctx); err != nil {
  5643. return thrift.PrependError("write struct stop error: ", err) }
  5644. return nil
  5645. }
  5646. func (p *ChannelServiceGetChannelInfoArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5647. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 2); err != nil {
  5648. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:channelId: ", p), err) }
  5649. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  5650. return thrift.PrependError(fmt.Sprintf("%T.channelId (2) field write error: ", p), err) }
  5651. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5652. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:channelId: ", p), err) }
  5653. return err
  5654. }
  5655. func (p *ChannelServiceGetChannelInfoArgs) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5656. if err := oprot.WriteFieldBegin(ctx, "locale", thrift.STRING, 3); err != nil {
  5657. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:locale: ", p), err) }
  5658. if err := oprot.WriteString(ctx, string(p.Locale)); err != nil {
  5659. return thrift.PrependError(fmt.Sprintf("%T.locale (3) field write error: ", p), err) }
  5660. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5661. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:locale: ", p), err) }
  5662. return err
  5663. }
  5664. func (p *ChannelServiceGetChannelInfoArgs) String() string {
  5665. if p == nil {
  5666. return "<nil>"
  5667. }
  5668. return fmt.Sprintf("ChannelServiceGetChannelInfoArgs(%+v)", *p)
  5669. }
  5670. // Attributes:
  5671. // - Success
  5672. // - E
  5673. type ChannelServiceGetChannelInfoResult struct {
  5674. Success *ChannelInfo `thrift:"success,0" db:"success" json:"success,omitempty"`
  5675. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  5676. }
  5677. func NewChannelServiceGetChannelInfoResult() *ChannelServiceGetChannelInfoResult {
  5678. return &ChannelServiceGetChannelInfoResult{}
  5679. }
  5680. var ChannelServiceGetChannelInfoResult_Success_DEFAULT *ChannelInfo
  5681. func (p *ChannelServiceGetChannelInfoResult) GetSuccess() *ChannelInfo {
  5682. if !p.IsSetSuccess() {
  5683. return ChannelServiceGetChannelInfoResult_Success_DEFAULT
  5684. }
  5685. return p.Success
  5686. }
  5687. var ChannelServiceGetChannelInfoResult_E_DEFAULT *ChannelException
  5688. func (p *ChannelServiceGetChannelInfoResult) GetE() *ChannelException {
  5689. if !p.IsSetE() {
  5690. return ChannelServiceGetChannelInfoResult_E_DEFAULT
  5691. }
  5692. return p.E
  5693. }
  5694. func (p *ChannelServiceGetChannelInfoResult) IsSetSuccess() bool {
  5695. return p.Success != nil
  5696. }
  5697. func (p *ChannelServiceGetChannelInfoResult) IsSetE() bool {
  5698. return p.E != nil
  5699. }
  5700. func (p *ChannelServiceGetChannelInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  5701. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  5702. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  5703. }
  5704. for {
  5705. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  5706. if err != nil {
  5707. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  5708. }
  5709. if fieldTypeId == thrift.STOP { break; }
  5710. switch fieldId {
  5711. case 0:
  5712. if fieldTypeId == thrift.STRUCT {
  5713. if err := p.ReadField0(ctx, iprot); err != nil {
  5714. return err
  5715. }
  5716. } else {
  5717. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5718. return err
  5719. }
  5720. }
  5721. case 1:
  5722. if fieldTypeId == thrift.STRUCT {
  5723. if err := p.ReadField1(ctx, iprot); err != nil {
  5724. return err
  5725. }
  5726. } else {
  5727. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5728. return err
  5729. }
  5730. }
  5731. default:
  5732. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5733. return err
  5734. }
  5735. }
  5736. if err := iprot.ReadFieldEnd(ctx); err != nil {
  5737. return err
  5738. }
  5739. }
  5740. if err := iprot.ReadStructEnd(ctx); err != nil {
  5741. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  5742. }
  5743. return nil
  5744. }
  5745. func (p *ChannelServiceGetChannelInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  5746. p.Success = &ChannelInfo{}
  5747. if err := p.Success.Read(ctx, iprot); err != nil {
  5748. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  5749. }
  5750. return nil
  5751. }
  5752. func (p *ChannelServiceGetChannelInfoResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  5753. p.E = &ChannelException{}
  5754. if err := p.E.Read(ctx, iprot); err != nil {
  5755. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  5756. }
  5757. return nil
  5758. }
  5759. func (p *ChannelServiceGetChannelInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  5760. if err := oprot.WriteStructBegin(ctx, "getChannelInfo_result"); err != nil {
  5761. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  5762. if p != nil {
  5763. if err := p.writeField0(ctx, oprot); err != nil { return err }
  5764. if err := p.writeField1(ctx, oprot); err != nil { return err }
  5765. }
  5766. if err := oprot.WriteFieldStop(ctx); err != nil {
  5767. return thrift.PrependError("write field stop error: ", err) }
  5768. if err := oprot.WriteStructEnd(ctx); err != nil {
  5769. return thrift.PrependError("write struct stop error: ", err) }
  5770. return nil
  5771. }
  5772. func (p *ChannelServiceGetChannelInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5773. if p.IsSetSuccess() {
  5774. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  5775. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  5776. if err := p.Success.Write(ctx, oprot); err != nil {
  5777. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  5778. }
  5779. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5780. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  5781. }
  5782. return err
  5783. }
  5784. func (p *ChannelServiceGetChannelInfoResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5785. if p.IsSetE() {
  5786. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  5787. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  5788. if err := p.E.Write(ctx, oprot); err != nil {
  5789. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  5790. }
  5791. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5792. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  5793. }
  5794. return err
  5795. }
  5796. func (p *ChannelServiceGetChannelInfoResult) String() string {
  5797. if p == nil {
  5798. return "<nil>"
  5799. }
  5800. return fmt.Sprintf("ChannelServiceGetChannelInfoResult(%+v)", *p)
  5801. }
  5802. // Attributes:
  5803. // - ChannelId
  5804. // - Locale
  5805. type ChannelServiceGetChannelNotificationSettingArgs struct {
  5806. ChannelId string `thrift:"channelId,1" db:"channelId" json:"channelId"`
  5807. Locale string `thrift:"locale,2" db:"locale" json:"locale"`
  5808. }
  5809. func NewChannelServiceGetChannelNotificationSettingArgs() *ChannelServiceGetChannelNotificationSettingArgs {
  5810. return &ChannelServiceGetChannelNotificationSettingArgs{}
  5811. }
  5812. func (p *ChannelServiceGetChannelNotificationSettingArgs) GetChannelId() string {
  5813. return p.ChannelId
  5814. }
  5815. func (p *ChannelServiceGetChannelNotificationSettingArgs) GetLocale() string {
  5816. return p.Locale
  5817. }
  5818. func (p *ChannelServiceGetChannelNotificationSettingArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  5819. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  5820. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  5821. }
  5822. for {
  5823. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  5824. if err != nil {
  5825. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  5826. }
  5827. if fieldTypeId == thrift.STOP { break; }
  5828. switch fieldId {
  5829. case 1:
  5830. if fieldTypeId == thrift.STRING {
  5831. if err := p.ReadField1(ctx, iprot); err != nil {
  5832. return err
  5833. }
  5834. } else {
  5835. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5836. return err
  5837. }
  5838. }
  5839. case 2:
  5840. if fieldTypeId == thrift.STRING {
  5841. if err := p.ReadField2(ctx, iprot); err != nil {
  5842. return err
  5843. }
  5844. } else {
  5845. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5846. return err
  5847. }
  5848. }
  5849. default:
  5850. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5851. return err
  5852. }
  5853. }
  5854. if err := iprot.ReadFieldEnd(ctx); err != nil {
  5855. return err
  5856. }
  5857. }
  5858. if err := iprot.ReadStructEnd(ctx); err != nil {
  5859. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  5860. }
  5861. return nil
  5862. }
  5863. func (p *ChannelServiceGetChannelNotificationSettingArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  5864. if v, err := iprot.ReadString(ctx); err != nil {
  5865. return thrift.PrependError("error reading field 1: ", err)
  5866. } else {
  5867. p.ChannelId = v
  5868. }
  5869. return nil
  5870. }
  5871. func (p *ChannelServiceGetChannelNotificationSettingArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  5872. if v, err := iprot.ReadString(ctx); err != nil {
  5873. return thrift.PrependError("error reading field 2: ", err)
  5874. } else {
  5875. p.Locale = v
  5876. }
  5877. return nil
  5878. }
  5879. func (p *ChannelServiceGetChannelNotificationSettingArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  5880. if err := oprot.WriteStructBegin(ctx, "getChannelNotificationSetting_args"); err != nil {
  5881. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  5882. if p != nil {
  5883. if err := p.writeField1(ctx, oprot); err != nil { return err }
  5884. if err := p.writeField2(ctx, oprot); err != nil { return err }
  5885. }
  5886. if err := oprot.WriteFieldStop(ctx); err != nil {
  5887. return thrift.PrependError("write field stop error: ", err) }
  5888. if err := oprot.WriteStructEnd(ctx); err != nil {
  5889. return thrift.PrependError("write struct stop error: ", err) }
  5890. return nil
  5891. }
  5892. func (p *ChannelServiceGetChannelNotificationSettingArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5893. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 1); err != nil {
  5894. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelId: ", p), err) }
  5895. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  5896. return thrift.PrependError(fmt.Sprintf("%T.channelId (1) field write error: ", p), err) }
  5897. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5898. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelId: ", p), err) }
  5899. return err
  5900. }
  5901. func (p *ChannelServiceGetChannelNotificationSettingArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  5902. if err := oprot.WriteFieldBegin(ctx, "locale", thrift.STRING, 2); err != nil {
  5903. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:locale: ", p), err) }
  5904. if err := oprot.WriteString(ctx, string(p.Locale)); err != nil {
  5905. return thrift.PrependError(fmt.Sprintf("%T.locale (2) field write error: ", p), err) }
  5906. if err := oprot.WriteFieldEnd(ctx); err != nil {
  5907. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:locale: ", p), err) }
  5908. return err
  5909. }
  5910. func (p *ChannelServiceGetChannelNotificationSettingArgs) String() string {
  5911. if p == nil {
  5912. return "<nil>"
  5913. }
  5914. return fmt.Sprintf("ChannelServiceGetChannelNotificationSettingArgs(%+v)", *p)
  5915. }
  5916. // Attributes:
  5917. // - Success
  5918. // - E
  5919. type ChannelServiceGetChannelNotificationSettingResult struct {
  5920. Success *ChannelNotificationSetting `thrift:"success,0" db:"success" json:"success,omitempty"`
  5921. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  5922. }
  5923. func NewChannelServiceGetChannelNotificationSettingResult() *ChannelServiceGetChannelNotificationSettingResult {
  5924. return &ChannelServiceGetChannelNotificationSettingResult{}
  5925. }
  5926. var ChannelServiceGetChannelNotificationSettingResult_Success_DEFAULT *ChannelNotificationSetting
  5927. func (p *ChannelServiceGetChannelNotificationSettingResult) GetSuccess() *ChannelNotificationSetting {
  5928. if !p.IsSetSuccess() {
  5929. return ChannelServiceGetChannelNotificationSettingResult_Success_DEFAULT
  5930. }
  5931. return p.Success
  5932. }
  5933. var ChannelServiceGetChannelNotificationSettingResult_E_DEFAULT *ChannelException
  5934. func (p *ChannelServiceGetChannelNotificationSettingResult) GetE() *ChannelException {
  5935. if !p.IsSetE() {
  5936. return ChannelServiceGetChannelNotificationSettingResult_E_DEFAULT
  5937. }
  5938. return p.E
  5939. }
  5940. func (p *ChannelServiceGetChannelNotificationSettingResult) IsSetSuccess() bool {
  5941. return p.Success != nil
  5942. }
  5943. func (p *ChannelServiceGetChannelNotificationSettingResult) IsSetE() bool {
  5944. return p.E != nil
  5945. }
  5946. func (p *ChannelServiceGetChannelNotificationSettingResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  5947. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  5948. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  5949. }
  5950. for {
  5951. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  5952. if err != nil {
  5953. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  5954. }
  5955. if fieldTypeId == thrift.STOP { break; }
  5956. switch fieldId {
  5957. case 0:
  5958. if fieldTypeId == thrift.STRUCT {
  5959. if err := p.ReadField0(ctx, iprot); err != nil {
  5960. return err
  5961. }
  5962. } else {
  5963. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5964. return err
  5965. }
  5966. }
  5967. case 1:
  5968. if fieldTypeId == thrift.STRUCT {
  5969. if err := p.ReadField1(ctx, iprot); err != nil {
  5970. return err
  5971. }
  5972. } else {
  5973. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5974. return err
  5975. }
  5976. }
  5977. default:
  5978. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  5979. return err
  5980. }
  5981. }
  5982. if err := iprot.ReadFieldEnd(ctx); err != nil {
  5983. return err
  5984. }
  5985. }
  5986. if err := iprot.ReadStructEnd(ctx); err != nil {
  5987. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  5988. }
  5989. return nil
  5990. }
  5991. func (p *ChannelServiceGetChannelNotificationSettingResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  5992. p.Success = &ChannelNotificationSetting{}
  5993. if err := p.Success.Read(ctx, iprot); err != nil {
  5994. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  5995. }
  5996. return nil
  5997. }
  5998. func (p *ChannelServiceGetChannelNotificationSettingResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  5999. p.E = &ChannelException{}
  6000. if err := p.E.Read(ctx, iprot); err != nil {
  6001. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  6002. }
  6003. return nil
  6004. }
  6005. func (p *ChannelServiceGetChannelNotificationSettingResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6006. if err := oprot.WriteStructBegin(ctx, "getChannelNotificationSetting_result"); err != nil {
  6007. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6008. if p != nil {
  6009. if err := p.writeField0(ctx, oprot); err != nil { return err }
  6010. if err := p.writeField1(ctx, oprot); err != nil { return err }
  6011. }
  6012. if err := oprot.WriteFieldStop(ctx); err != nil {
  6013. return thrift.PrependError("write field stop error: ", err) }
  6014. if err := oprot.WriteStructEnd(ctx); err != nil {
  6015. return thrift.PrependError("write struct stop error: ", err) }
  6016. return nil
  6017. }
  6018. func (p *ChannelServiceGetChannelNotificationSettingResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6019. if p.IsSetSuccess() {
  6020. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  6021. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  6022. if err := p.Success.Write(ctx, oprot); err != nil {
  6023. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  6024. }
  6025. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6026. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  6027. }
  6028. return err
  6029. }
  6030. func (p *ChannelServiceGetChannelNotificationSettingResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6031. if p.IsSetE() {
  6032. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  6033. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  6034. if err := p.E.Write(ctx, oprot); err != nil {
  6035. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  6036. }
  6037. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6038. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  6039. }
  6040. return err
  6041. }
  6042. func (p *ChannelServiceGetChannelNotificationSettingResult) String() string {
  6043. if p == nil {
  6044. return "<nil>"
  6045. }
  6046. return fmt.Sprintf("ChannelServiceGetChannelNotificationSettingResult(%+v)", *p)
  6047. }
  6048. // Attributes:
  6049. // - Locale
  6050. type ChannelServiceGetChannelNotificationSettingsArgs struct {
  6051. Locale string `thrift:"locale,1" db:"locale" json:"locale"`
  6052. }
  6053. func NewChannelServiceGetChannelNotificationSettingsArgs() *ChannelServiceGetChannelNotificationSettingsArgs {
  6054. return &ChannelServiceGetChannelNotificationSettingsArgs{}
  6055. }
  6056. func (p *ChannelServiceGetChannelNotificationSettingsArgs) GetLocale() string {
  6057. return p.Locale
  6058. }
  6059. func (p *ChannelServiceGetChannelNotificationSettingsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  6060. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  6061. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  6062. }
  6063. for {
  6064. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  6065. if err != nil {
  6066. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  6067. }
  6068. if fieldTypeId == thrift.STOP { break; }
  6069. switch fieldId {
  6070. case 1:
  6071. if fieldTypeId == thrift.STRING {
  6072. if err := p.ReadField1(ctx, iprot); err != nil {
  6073. return err
  6074. }
  6075. } else {
  6076. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6077. return err
  6078. }
  6079. }
  6080. default:
  6081. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6082. return err
  6083. }
  6084. }
  6085. if err := iprot.ReadFieldEnd(ctx); err != nil {
  6086. return err
  6087. }
  6088. }
  6089. if err := iprot.ReadStructEnd(ctx); err != nil {
  6090. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  6091. }
  6092. return nil
  6093. }
  6094. func (p *ChannelServiceGetChannelNotificationSettingsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  6095. if v, err := iprot.ReadString(ctx); err != nil {
  6096. return thrift.PrependError("error reading field 1: ", err)
  6097. } else {
  6098. p.Locale = v
  6099. }
  6100. return nil
  6101. }
  6102. func (p *ChannelServiceGetChannelNotificationSettingsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6103. if err := oprot.WriteStructBegin(ctx, "getChannelNotificationSettings_args"); err != nil {
  6104. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6105. if p != nil {
  6106. if err := p.writeField1(ctx, oprot); err != nil { return err }
  6107. }
  6108. if err := oprot.WriteFieldStop(ctx); err != nil {
  6109. return thrift.PrependError("write field stop error: ", err) }
  6110. if err := oprot.WriteStructEnd(ctx); err != nil {
  6111. return thrift.PrependError("write struct stop error: ", err) }
  6112. return nil
  6113. }
  6114. func (p *ChannelServiceGetChannelNotificationSettingsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6115. if err := oprot.WriteFieldBegin(ctx, "locale", thrift.STRING, 1); err != nil {
  6116. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:locale: ", p), err) }
  6117. if err := oprot.WriteString(ctx, string(p.Locale)); err != nil {
  6118. return thrift.PrependError(fmt.Sprintf("%T.locale (1) field write error: ", p), err) }
  6119. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6120. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:locale: ", p), err) }
  6121. return err
  6122. }
  6123. func (p *ChannelServiceGetChannelNotificationSettingsArgs) String() string {
  6124. if p == nil {
  6125. return "<nil>"
  6126. }
  6127. return fmt.Sprintf("ChannelServiceGetChannelNotificationSettingsArgs(%+v)", *p)
  6128. }
  6129. // Attributes:
  6130. // - Success
  6131. // - E
  6132. type ChannelServiceGetChannelNotificationSettingsResult struct {
  6133. Success []*ChannelNotificationSetting `thrift:"success,0" db:"success" json:"success,omitempty"`
  6134. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  6135. }
  6136. func NewChannelServiceGetChannelNotificationSettingsResult() *ChannelServiceGetChannelNotificationSettingsResult {
  6137. return &ChannelServiceGetChannelNotificationSettingsResult{}
  6138. }
  6139. var ChannelServiceGetChannelNotificationSettingsResult_Success_DEFAULT []*ChannelNotificationSetting
  6140. func (p *ChannelServiceGetChannelNotificationSettingsResult) GetSuccess() []*ChannelNotificationSetting {
  6141. return p.Success
  6142. }
  6143. var ChannelServiceGetChannelNotificationSettingsResult_E_DEFAULT *ChannelException
  6144. func (p *ChannelServiceGetChannelNotificationSettingsResult) GetE() *ChannelException {
  6145. if !p.IsSetE() {
  6146. return ChannelServiceGetChannelNotificationSettingsResult_E_DEFAULT
  6147. }
  6148. return p.E
  6149. }
  6150. func (p *ChannelServiceGetChannelNotificationSettingsResult) IsSetSuccess() bool {
  6151. return p.Success != nil
  6152. }
  6153. func (p *ChannelServiceGetChannelNotificationSettingsResult) IsSetE() bool {
  6154. return p.E != nil
  6155. }
  6156. func (p *ChannelServiceGetChannelNotificationSettingsResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  6157. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  6158. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  6159. }
  6160. for {
  6161. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  6162. if err != nil {
  6163. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  6164. }
  6165. if fieldTypeId == thrift.STOP { break; }
  6166. switch fieldId {
  6167. case 0:
  6168. if fieldTypeId == thrift.LIST {
  6169. if err := p.ReadField0(ctx, iprot); err != nil {
  6170. return err
  6171. }
  6172. } else {
  6173. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6174. return err
  6175. }
  6176. }
  6177. case 1:
  6178. if fieldTypeId == thrift.STRUCT {
  6179. if err := p.ReadField1(ctx, iprot); err != nil {
  6180. return err
  6181. }
  6182. } else {
  6183. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6184. return err
  6185. }
  6186. }
  6187. default:
  6188. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6189. return err
  6190. }
  6191. }
  6192. if err := iprot.ReadFieldEnd(ctx); err != nil {
  6193. return err
  6194. }
  6195. }
  6196. if err := iprot.ReadStructEnd(ctx); err != nil {
  6197. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  6198. }
  6199. return nil
  6200. }
  6201. func (p *ChannelServiceGetChannelNotificationSettingsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  6202. _, size, err := iprot.ReadListBegin(ctx)
  6203. if err != nil {
  6204. return thrift.PrependError("error reading list begin: ", err)
  6205. }
  6206. tSlice := make([]*ChannelNotificationSetting, 0, size)
  6207. p.Success = tSlice
  6208. for i := 0; i < size; i ++ {
  6209. _elem79 := &ChannelNotificationSetting{}
  6210. if err := _elem79.Read(ctx, iprot); err != nil {
  6211. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem79), err)
  6212. }
  6213. p.Success = append(p.Success, _elem79)
  6214. }
  6215. if err := iprot.ReadListEnd(ctx); err != nil {
  6216. return thrift.PrependError("error reading list end: ", err)
  6217. }
  6218. return nil
  6219. }
  6220. func (p *ChannelServiceGetChannelNotificationSettingsResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  6221. p.E = &ChannelException{}
  6222. if err := p.E.Read(ctx, iprot); err != nil {
  6223. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  6224. }
  6225. return nil
  6226. }
  6227. func (p *ChannelServiceGetChannelNotificationSettingsResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6228. if err := oprot.WriteStructBegin(ctx, "getChannelNotificationSettings_result"); err != nil {
  6229. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6230. if p != nil {
  6231. if err := p.writeField0(ctx, oprot); err != nil { return err }
  6232. if err := p.writeField1(ctx, oprot); err != nil { return err }
  6233. }
  6234. if err := oprot.WriteFieldStop(ctx); err != nil {
  6235. return thrift.PrependError("write field stop error: ", err) }
  6236. if err := oprot.WriteStructEnd(ctx); err != nil {
  6237. return thrift.PrependError("write struct stop error: ", err) }
  6238. return nil
  6239. }
  6240. func (p *ChannelServiceGetChannelNotificationSettingsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6241. if p.IsSetSuccess() {
  6242. if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil {
  6243. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  6244. if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil {
  6245. return thrift.PrependError("error writing list begin: ", err)
  6246. }
  6247. for _, v := range p.Success {
  6248. if err := v.Write(ctx, oprot); err != nil {
  6249. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
  6250. }
  6251. }
  6252. if err := oprot.WriteListEnd(ctx); err != nil {
  6253. return thrift.PrependError("error writing list end: ", err)
  6254. }
  6255. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6256. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  6257. }
  6258. return err
  6259. }
  6260. func (p *ChannelServiceGetChannelNotificationSettingsResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6261. if p.IsSetE() {
  6262. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  6263. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  6264. if err := p.E.Write(ctx, oprot); err != nil {
  6265. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  6266. }
  6267. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6268. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  6269. }
  6270. return err
  6271. }
  6272. func (p *ChannelServiceGetChannelNotificationSettingsResult) String() string {
  6273. if p == nil {
  6274. return "<nil>"
  6275. }
  6276. return fmt.Sprintf("ChannelServiceGetChannelNotificationSettingsResult(%+v)", *p)
  6277. }
  6278. type ChannelServiceGetChannelSettingsArgs struct {
  6279. }
  6280. func NewChannelServiceGetChannelSettingsArgs() *ChannelServiceGetChannelSettingsArgs {
  6281. return &ChannelServiceGetChannelSettingsArgs{}
  6282. }
  6283. func (p *ChannelServiceGetChannelSettingsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  6284. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  6285. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  6286. }
  6287. for {
  6288. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  6289. if err != nil {
  6290. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  6291. }
  6292. if fieldTypeId == thrift.STOP { break; }
  6293. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6294. return err
  6295. }
  6296. if err := iprot.ReadFieldEnd(ctx); err != nil {
  6297. return err
  6298. }
  6299. }
  6300. if err := iprot.ReadStructEnd(ctx); err != nil {
  6301. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  6302. }
  6303. return nil
  6304. }
  6305. func (p *ChannelServiceGetChannelSettingsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6306. if err := oprot.WriteStructBegin(ctx, "getChannelSettings_args"); err != nil {
  6307. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6308. if p != nil {
  6309. }
  6310. if err := oprot.WriteFieldStop(ctx); err != nil {
  6311. return thrift.PrependError("write field stop error: ", err) }
  6312. if err := oprot.WriteStructEnd(ctx); err != nil {
  6313. return thrift.PrependError("write struct stop error: ", err) }
  6314. return nil
  6315. }
  6316. func (p *ChannelServiceGetChannelSettingsArgs) String() string {
  6317. if p == nil {
  6318. return "<nil>"
  6319. }
  6320. return fmt.Sprintf("ChannelServiceGetChannelSettingsArgs(%+v)", *p)
  6321. }
  6322. // Attributes:
  6323. // - Success
  6324. // - E
  6325. type ChannelServiceGetChannelSettingsResult struct {
  6326. Success *ChannelSettings `thrift:"success,0" db:"success" json:"success,omitempty"`
  6327. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  6328. }
  6329. func NewChannelServiceGetChannelSettingsResult() *ChannelServiceGetChannelSettingsResult {
  6330. return &ChannelServiceGetChannelSettingsResult{}
  6331. }
  6332. var ChannelServiceGetChannelSettingsResult_Success_DEFAULT *ChannelSettings
  6333. func (p *ChannelServiceGetChannelSettingsResult) GetSuccess() *ChannelSettings {
  6334. if !p.IsSetSuccess() {
  6335. return ChannelServiceGetChannelSettingsResult_Success_DEFAULT
  6336. }
  6337. return p.Success
  6338. }
  6339. var ChannelServiceGetChannelSettingsResult_E_DEFAULT *ChannelException
  6340. func (p *ChannelServiceGetChannelSettingsResult) GetE() *ChannelException {
  6341. if !p.IsSetE() {
  6342. return ChannelServiceGetChannelSettingsResult_E_DEFAULT
  6343. }
  6344. return p.E
  6345. }
  6346. func (p *ChannelServiceGetChannelSettingsResult) IsSetSuccess() bool {
  6347. return p.Success != nil
  6348. }
  6349. func (p *ChannelServiceGetChannelSettingsResult) IsSetE() bool {
  6350. return p.E != nil
  6351. }
  6352. func (p *ChannelServiceGetChannelSettingsResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  6353. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  6354. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  6355. }
  6356. for {
  6357. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  6358. if err != nil {
  6359. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  6360. }
  6361. if fieldTypeId == thrift.STOP { break; }
  6362. switch fieldId {
  6363. case 0:
  6364. if fieldTypeId == thrift.STRUCT {
  6365. if err := p.ReadField0(ctx, iprot); err != nil {
  6366. return err
  6367. }
  6368. } else {
  6369. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6370. return err
  6371. }
  6372. }
  6373. case 1:
  6374. if fieldTypeId == thrift.STRUCT {
  6375. if err := p.ReadField1(ctx, iprot); err != nil {
  6376. return err
  6377. }
  6378. } else {
  6379. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6380. return err
  6381. }
  6382. }
  6383. default:
  6384. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6385. return err
  6386. }
  6387. }
  6388. if err := iprot.ReadFieldEnd(ctx); err != nil {
  6389. return err
  6390. }
  6391. }
  6392. if err := iprot.ReadStructEnd(ctx); err != nil {
  6393. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  6394. }
  6395. return nil
  6396. }
  6397. func (p *ChannelServiceGetChannelSettingsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  6398. p.Success = &ChannelSettings{}
  6399. if err := p.Success.Read(ctx, iprot); err != nil {
  6400. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  6401. }
  6402. return nil
  6403. }
  6404. func (p *ChannelServiceGetChannelSettingsResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  6405. p.E = &ChannelException{}
  6406. if err := p.E.Read(ctx, iprot); err != nil {
  6407. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  6408. }
  6409. return nil
  6410. }
  6411. func (p *ChannelServiceGetChannelSettingsResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6412. if err := oprot.WriteStructBegin(ctx, "getChannelSettings_result"); err != nil {
  6413. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6414. if p != nil {
  6415. if err := p.writeField0(ctx, oprot); err != nil { return err }
  6416. if err := p.writeField1(ctx, oprot); err != nil { return err }
  6417. }
  6418. if err := oprot.WriteFieldStop(ctx); err != nil {
  6419. return thrift.PrependError("write field stop error: ", err) }
  6420. if err := oprot.WriteStructEnd(ctx); err != nil {
  6421. return thrift.PrependError("write struct stop error: ", err) }
  6422. return nil
  6423. }
  6424. func (p *ChannelServiceGetChannelSettingsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6425. if p.IsSetSuccess() {
  6426. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  6427. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  6428. if err := p.Success.Write(ctx, oprot); err != nil {
  6429. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  6430. }
  6431. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6432. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  6433. }
  6434. return err
  6435. }
  6436. func (p *ChannelServiceGetChannelSettingsResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6437. if p.IsSetE() {
  6438. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  6439. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  6440. if err := p.E.Write(ctx, oprot); err != nil {
  6441. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  6442. }
  6443. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6444. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  6445. }
  6446. return err
  6447. }
  6448. func (p *ChannelServiceGetChannelSettingsResult) String() string {
  6449. if p == nil {
  6450. return "<nil>"
  6451. }
  6452. return fmt.Sprintf("ChannelServiceGetChannelSettingsResult(%+v)", *p)
  6453. }
  6454. // Attributes:
  6455. // - LastSynced
  6456. type ChannelServiceGetCommonDomainsArgs struct {
  6457. LastSynced int64 `thrift:"lastSynced,1" db:"lastSynced" json:"lastSynced"`
  6458. }
  6459. func NewChannelServiceGetCommonDomainsArgs() *ChannelServiceGetCommonDomainsArgs {
  6460. return &ChannelServiceGetCommonDomainsArgs{}
  6461. }
  6462. func (p *ChannelServiceGetCommonDomainsArgs) GetLastSynced() int64 {
  6463. return p.LastSynced
  6464. }
  6465. func (p *ChannelServiceGetCommonDomainsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  6466. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  6467. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  6468. }
  6469. for {
  6470. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  6471. if err != nil {
  6472. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  6473. }
  6474. if fieldTypeId == thrift.STOP { break; }
  6475. switch fieldId {
  6476. case 1:
  6477. if fieldTypeId == thrift.I64 {
  6478. if err := p.ReadField1(ctx, iprot); err != nil {
  6479. return err
  6480. }
  6481. } else {
  6482. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6483. return err
  6484. }
  6485. }
  6486. default:
  6487. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6488. return err
  6489. }
  6490. }
  6491. if err := iprot.ReadFieldEnd(ctx); err != nil {
  6492. return err
  6493. }
  6494. }
  6495. if err := iprot.ReadStructEnd(ctx); err != nil {
  6496. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  6497. }
  6498. return nil
  6499. }
  6500. func (p *ChannelServiceGetCommonDomainsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  6501. if v, err := iprot.ReadI64(ctx); err != nil {
  6502. return thrift.PrependError("error reading field 1: ", err)
  6503. } else {
  6504. p.LastSynced = v
  6505. }
  6506. return nil
  6507. }
  6508. func (p *ChannelServiceGetCommonDomainsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6509. if err := oprot.WriteStructBegin(ctx, "getCommonDomains_args"); err != nil {
  6510. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6511. if p != nil {
  6512. if err := p.writeField1(ctx, oprot); err != nil { return err }
  6513. }
  6514. if err := oprot.WriteFieldStop(ctx); err != nil {
  6515. return thrift.PrependError("write field stop error: ", err) }
  6516. if err := oprot.WriteStructEnd(ctx); err != nil {
  6517. return thrift.PrependError("write struct stop error: ", err) }
  6518. return nil
  6519. }
  6520. func (p *ChannelServiceGetCommonDomainsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6521. if err := oprot.WriteFieldBegin(ctx, "lastSynced", thrift.I64, 1); err != nil {
  6522. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:lastSynced: ", p), err) }
  6523. if err := oprot.WriteI64(ctx, int64(p.LastSynced)); err != nil {
  6524. return thrift.PrependError(fmt.Sprintf("%T.lastSynced (1) field write error: ", p), err) }
  6525. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6526. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:lastSynced: ", p), err) }
  6527. return err
  6528. }
  6529. func (p *ChannelServiceGetCommonDomainsArgs) String() string {
  6530. if p == nil {
  6531. return "<nil>"
  6532. }
  6533. return fmt.Sprintf("ChannelServiceGetCommonDomainsArgs(%+v)", *p)
  6534. }
  6535. // Attributes:
  6536. // - Success
  6537. // - E
  6538. type ChannelServiceGetCommonDomainsResult struct {
  6539. Success *ChannelDomains `thrift:"success,0" db:"success" json:"success,omitempty"`
  6540. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  6541. }
  6542. func NewChannelServiceGetCommonDomainsResult() *ChannelServiceGetCommonDomainsResult {
  6543. return &ChannelServiceGetCommonDomainsResult{}
  6544. }
  6545. var ChannelServiceGetCommonDomainsResult_Success_DEFAULT *ChannelDomains
  6546. func (p *ChannelServiceGetCommonDomainsResult) GetSuccess() *ChannelDomains {
  6547. if !p.IsSetSuccess() {
  6548. return ChannelServiceGetCommonDomainsResult_Success_DEFAULT
  6549. }
  6550. return p.Success
  6551. }
  6552. var ChannelServiceGetCommonDomainsResult_E_DEFAULT *ChannelException
  6553. func (p *ChannelServiceGetCommonDomainsResult) GetE() *ChannelException {
  6554. if !p.IsSetE() {
  6555. return ChannelServiceGetCommonDomainsResult_E_DEFAULT
  6556. }
  6557. return p.E
  6558. }
  6559. func (p *ChannelServiceGetCommonDomainsResult) IsSetSuccess() bool {
  6560. return p.Success != nil
  6561. }
  6562. func (p *ChannelServiceGetCommonDomainsResult) IsSetE() bool {
  6563. return p.E != nil
  6564. }
  6565. func (p *ChannelServiceGetCommonDomainsResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  6566. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  6567. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  6568. }
  6569. for {
  6570. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  6571. if err != nil {
  6572. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  6573. }
  6574. if fieldTypeId == thrift.STOP { break; }
  6575. switch fieldId {
  6576. case 0:
  6577. if fieldTypeId == thrift.STRUCT {
  6578. if err := p.ReadField0(ctx, iprot); err != nil {
  6579. return err
  6580. }
  6581. } else {
  6582. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6583. return err
  6584. }
  6585. }
  6586. case 1:
  6587. if fieldTypeId == thrift.STRUCT {
  6588. if err := p.ReadField1(ctx, iprot); err != nil {
  6589. return err
  6590. }
  6591. } else {
  6592. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6593. return err
  6594. }
  6595. }
  6596. default:
  6597. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6598. return err
  6599. }
  6600. }
  6601. if err := iprot.ReadFieldEnd(ctx); err != nil {
  6602. return err
  6603. }
  6604. }
  6605. if err := iprot.ReadStructEnd(ctx); err != nil {
  6606. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  6607. }
  6608. return nil
  6609. }
  6610. func (p *ChannelServiceGetCommonDomainsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  6611. p.Success = &ChannelDomains{}
  6612. if err := p.Success.Read(ctx, iprot); err != nil {
  6613. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  6614. }
  6615. return nil
  6616. }
  6617. func (p *ChannelServiceGetCommonDomainsResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  6618. p.E = &ChannelException{}
  6619. if err := p.E.Read(ctx, iprot); err != nil {
  6620. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  6621. }
  6622. return nil
  6623. }
  6624. func (p *ChannelServiceGetCommonDomainsResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6625. if err := oprot.WriteStructBegin(ctx, "getCommonDomains_result"); err != nil {
  6626. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6627. if p != nil {
  6628. if err := p.writeField0(ctx, oprot); err != nil { return err }
  6629. if err := p.writeField1(ctx, oprot); err != nil { return err }
  6630. }
  6631. if err := oprot.WriteFieldStop(ctx); err != nil {
  6632. return thrift.PrependError("write field stop error: ", err) }
  6633. if err := oprot.WriteStructEnd(ctx); err != nil {
  6634. return thrift.PrependError("write struct stop error: ", err) }
  6635. return nil
  6636. }
  6637. func (p *ChannelServiceGetCommonDomainsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6638. if p.IsSetSuccess() {
  6639. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  6640. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  6641. if err := p.Success.Write(ctx, oprot); err != nil {
  6642. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  6643. }
  6644. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6645. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  6646. }
  6647. return err
  6648. }
  6649. func (p *ChannelServiceGetCommonDomainsResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6650. if p.IsSetE() {
  6651. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  6652. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  6653. if err := p.E.Write(ctx, oprot); err != nil {
  6654. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  6655. }
  6656. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6657. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  6658. }
  6659. return err
  6660. }
  6661. func (p *ChannelServiceGetCommonDomainsResult) String() string {
  6662. if p == nil {
  6663. return "<nil>"
  6664. }
  6665. return fmt.Sprintf("ChannelServiceGetCommonDomainsResult(%+v)", *p)
  6666. }
  6667. // Attributes:
  6668. // - WebLoginRequest
  6669. type ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs struct {
  6670. // unused field # 1
  6671. WebLoginRequest *WebLoginRequest `thrift:"webLoginRequest,2" db:"webLoginRequest" json:"webLoginRequest"`
  6672. }
  6673. func NewChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs() *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs {
  6674. return &ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs{}
  6675. }
  6676. var ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs_WebLoginRequest_DEFAULT *WebLoginRequest
  6677. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs) GetWebLoginRequest() *WebLoginRequest {
  6678. if !p.IsSetWebLoginRequest() {
  6679. return ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs_WebLoginRequest_DEFAULT
  6680. }
  6681. return p.WebLoginRequest
  6682. }
  6683. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs) IsSetWebLoginRequest() bool {
  6684. return p.WebLoginRequest != nil
  6685. }
  6686. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  6687. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  6688. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  6689. }
  6690. for {
  6691. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  6692. if err != nil {
  6693. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  6694. }
  6695. if fieldTypeId == thrift.STOP { break; }
  6696. switch fieldId {
  6697. case 2:
  6698. if fieldTypeId == thrift.STRUCT {
  6699. if err := p.ReadField2(ctx, iprot); err != nil {
  6700. return err
  6701. }
  6702. } else {
  6703. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6704. return err
  6705. }
  6706. }
  6707. default:
  6708. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6709. return err
  6710. }
  6711. }
  6712. if err := iprot.ReadFieldEnd(ctx); err != nil {
  6713. return err
  6714. }
  6715. }
  6716. if err := iprot.ReadStructEnd(ctx); err != nil {
  6717. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  6718. }
  6719. return nil
  6720. }
  6721. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  6722. p.WebLoginRequest = &WebLoginRequest{}
  6723. if err := p.WebLoginRequest.Read(ctx, iprot); err != nil {
  6724. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.WebLoginRequest), err)
  6725. }
  6726. return nil
  6727. }
  6728. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6729. if err := oprot.WriteStructBegin(ctx, "getReturnUrlWithRequestTokenForAutoLogin_args"); err != nil {
  6730. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6731. if p != nil {
  6732. if err := p.writeField2(ctx, oprot); err != nil { return err }
  6733. }
  6734. if err := oprot.WriteFieldStop(ctx); err != nil {
  6735. return thrift.PrependError("write field stop error: ", err) }
  6736. if err := oprot.WriteStructEnd(ctx); err != nil {
  6737. return thrift.PrependError("write struct stop error: ", err) }
  6738. return nil
  6739. }
  6740. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6741. if err := oprot.WriteFieldBegin(ctx, "webLoginRequest", thrift.STRUCT, 2); err != nil {
  6742. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:webLoginRequest: ", p), err) }
  6743. if err := p.WebLoginRequest.Write(ctx, oprot); err != nil {
  6744. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.WebLoginRequest), err)
  6745. }
  6746. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6747. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:webLoginRequest: ", p), err) }
  6748. return err
  6749. }
  6750. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs) String() string {
  6751. if p == nil {
  6752. return "<nil>"
  6753. }
  6754. return fmt.Sprintf("ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginArgs(%+v)", *p)
  6755. }
  6756. // Attributes:
  6757. // - Success
  6758. // - E
  6759. type ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult struct {
  6760. Success *WebLoginResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
  6761. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  6762. }
  6763. func NewChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult() *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult {
  6764. return &ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult{}
  6765. }
  6766. var ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult_Success_DEFAULT *WebLoginResponse
  6767. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) GetSuccess() *WebLoginResponse {
  6768. if !p.IsSetSuccess() {
  6769. return ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult_Success_DEFAULT
  6770. }
  6771. return p.Success
  6772. }
  6773. var ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult_E_DEFAULT *ChannelException
  6774. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) GetE() *ChannelException {
  6775. if !p.IsSetE() {
  6776. return ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult_E_DEFAULT
  6777. }
  6778. return p.E
  6779. }
  6780. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) IsSetSuccess() bool {
  6781. return p.Success != nil
  6782. }
  6783. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) IsSetE() bool {
  6784. return p.E != nil
  6785. }
  6786. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  6787. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  6788. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  6789. }
  6790. for {
  6791. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  6792. if err != nil {
  6793. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  6794. }
  6795. if fieldTypeId == thrift.STOP { break; }
  6796. switch fieldId {
  6797. case 0:
  6798. if fieldTypeId == thrift.STRUCT {
  6799. if err := p.ReadField0(ctx, iprot); err != nil {
  6800. return err
  6801. }
  6802. } else {
  6803. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6804. return err
  6805. }
  6806. }
  6807. case 1:
  6808. if fieldTypeId == thrift.STRUCT {
  6809. if err := p.ReadField1(ctx, iprot); err != nil {
  6810. return err
  6811. }
  6812. } else {
  6813. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6814. return err
  6815. }
  6816. }
  6817. default:
  6818. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6819. return err
  6820. }
  6821. }
  6822. if err := iprot.ReadFieldEnd(ctx); err != nil {
  6823. return err
  6824. }
  6825. }
  6826. if err := iprot.ReadStructEnd(ctx); err != nil {
  6827. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  6828. }
  6829. return nil
  6830. }
  6831. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  6832. p.Success = &WebLoginResponse{}
  6833. if err := p.Success.Read(ctx, iprot); err != nil {
  6834. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  6835. }
  6836. return nil
  6837. }
  6838. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  6839. p.E = &ChannelException{}
  6840. if err := p.E.Read(ctx, iprot); err != nil {
  6841. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  6842. }
  6843. return nil
  6844. }
  6845. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6846. if err := oprot.WriteStructBegin(ctx, "getReturnUrlWithRequestTokenForAutoLogin_result"); err != nil {
  6847. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6848. if p != nil {
  6849. if err := p.writeField0(ctx, oprot); err != nil { return err }
  6850. if err := p.writeField1(ctx, oprot); err != nil { return err }
  6851. }
  6852. if err := oprot.WriteFieldStop(ctx); err != nil {
  6853. return thrift.PrependError("write field stop error: ", err) }
  6854. if err := oprot.WriteStructEnd(ctx); err != nil {
  6855. return thrift.PrependError("write struct stop error: ", err) }
  6856. return nil
  6857. }
  6858. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6859. if p.IsSetSuccess() {
  6860. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  6861. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  6862. if err := p.Success.Write(ctx, oprot); err != nil {
  6863. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  6864. }
  6865. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6866. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  6867. }
  6868. return err
  6869. }
  6870. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6871. if p.IsSetE() {
  6872. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  6873. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  6874. if err := p.E.Write(ctx, oprot); err != nil {
  6875. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  6876. }
  6877. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6878. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  6879. }
  6880. return err
  6881. }
  6882. func (p *ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult) String() string {
  6883. if p == nil {
  6884. return "<nil>"
  6885. }
  6886. return fmt.Sprintf("ChannelServiceGetReturnUrlWithRequestTokenForAutoLoginResult(%+v)", *p)
  6887. }
  6888. // Attributes:
  6889. // - ChannelIds
  6890. type ChannelServiceGetUpdatedChannelIdsArgs struct {
  6891. ChannelIds []*ChannelIdWithLastUpdated `thrift:"channelIds,1" db:"channelIds" json:"channelIds"`
  6892. }
  6893. func NewChannelServiceGetUpdatedChannelIdsArgs() *ChannelServiceGetUpdatedChannelIdsArgs {
  6894. return &ChannelServiceGetUpdatedChannelIdsArgs{}
  6895. }
  6896. func (p *ChannelServiceGetUpdatedChannelIdsArgs) GetChannelIds() []*ChannelIdWithLastUpdated {
  6897. return p.ChannelIds
  6898. }
  6899. func (p *ChannelServiceGetUpdatedChannelIdsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  6900. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  6901. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  6902. }
  6903. for {
  6904. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  6905. if err != nil {
  6906. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  6907. }
  6908. if fieldTypeId == thrift.STOP { break; }
  6909. switch fieldId {
  6910. case 1:
  6911. if fieldTypeId == thrift.LIST {
  6912. if err := p.ReadField1(ctx, iprot); err != nil {
  6913. return err
  6914. }
  6915. } else {
  6916. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6917. return err
  6918. }
  6919. }
  6920. default:
  6921. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  6922. return err
  6923. }
  6924. }
  6925. if err := iprot.ReadFieldEnd(ctx); err != nil {
  6926. return err
  6927. }
  6928. }
  6929. if err := iprot.ReadStructEnd(ctx); err != nil {
  6930. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  6931. }
  6932. return nil
  6933. }
  6934. func (p *ChannelServiceGetUpdatedChannelIdsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  6935. _, size, err := iprot.ReadListBegin(ctx)
  6936. if err != nil {
  6937. return thrift.PrependError("error reading list begin: ", err)
  6938. }
  6939. tSlice := make([]*ChannelIdWithLastUpdated, 0, size)
  6940. p.ChannelIds = tSlice
  6941. for i := 0; i < size; i ++ {
  6942. _elem80 := &ChannelIdWithLastUpdated{}
  6943. if err := _elem80.Read(ctx, iprot); err != nil {
  6944. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem80), err)
  6945. }
  6946. p.ChannelIds = append(p.ChannelIds, _elem80)
  6947. }
  6948. if err := iprot.ReadListEnd(ctx); err != nil {
  6949. return thrift.PrependError("error reading list end: ", err)
  6950. }
  6951. return nil
  6952. }
  6953. func (p *ChannelServiceGetUpdatedChannelIdsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  6954. if err := oprot.WriteStructBegin(ctx, "getUpdatedChannelIds_args"); err != nil {
  6955. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  6956. if p != nil {
  6957. if err := p.writeField1(ctx, oprot); err != nil { return err }
  6958. }
  6959. if err := oprot.WriteFieldStop(ctx); err != nil {
  6960. return thrift.PrependError("write field stop error: ", err) }
  6961. if err := oprot.WriteStructEnd(ctx); err != nil {
  6962. return thrift.PrependError("write struct stop error: ", err) }
  6963. return nil
  6964. }
  6965. func (p *ChannelServiceGetUpdatedChannelIdsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  6966. if err := oprot.WriteFieldBegin(ctx, "channelIds", thrift.LIST, 1); err != nil {
  6967. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelIds: ", p), err) }
  6968. if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ChannelIds)); err != nil {
  6969. return thrift.PrependError("error writing list begin: ", err)
  6970. }
  6971. for _, v := range p.ChannelIds {
  6972. if err := v.Write(ctx, oprot); err != nil {
  6973. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
  6974. }
  6975. }
  6976. if err := oprot.WriteListEnd(ctx); err != nil {
  6977. return thrift.PrependError("error writing list end: ", err)
  6978. }
  6979. if err := oprot.WriteFieldEnd(ctx); err != nil {
  6980. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelIds: ", p), err) }
  6981. return err
  6982. }
  6983. func (p *ChannelServiceGetUpdatedChannelIdsArgs) String() string {
  6984. if p == nil {
  6985. return "<nil>"
  6986. }
  6987. return fmt.Sprintf("ChannelServiceGetUpdatedChannelIdsArgs(%+v)", *p)
  6988. }
  6989. // Attributes:
  6990. // - Success
  6991. // - E
  6992. type ChannelServiceGetUpdatedChannelIdsResult struct {
  6993. Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  6994. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  6995. }
  6996. func NewChannelServiceGetUpdatedChannelIdsResult() *ChannelServiceGetUpdatedChannelIdsResult {
  6997. return &ChannelServiceGetUpdatedChannelIdsResult{}
  6998. }
  6999. var ChannelServiceGetUpdatedChannelIdsResult_Success_DEFAULT []string
  7000. func (p *ChannelServiceGetUpdatedChannelIdsResult) GetSuccess() []string {
  7001. return p.Success
  7002. }
  7003. var ChannelServiceGetUpdatedChannelIdsResult_E_DEFAULT *ChannelException
  7004. func (p *ChannelServiceGetUpdatedChannelIdsResult) GetE() *ChannelException {
  7005. if !p.IsSetE() {
  7006. return ChannelServiceGetUpdatedChannelIdsResult_E_DEFAULT
  7007. }
  7008. return p.E
  7009. }
  7010. func (p *ChannelServiceGetUpdatedChannelIdsResult) IsSetSuccess() bool {
  7011. return p.Success != nil
  7012. }
  7013. func (p *ChannelServiceGetUpdatedChannelIdsResult) IsSetE() bool {
  7014. return p.E != nil
  7015. }
  7016. func (p *ChannelServiceGetUpdatedChannelIdsResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  7017. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  7018. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  7019. }
  7020. for {
  7021. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  7022. if err != nil {
  7023. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  7024. }
  7025. if fieldTypeId == thrift.STOP { break; }
  7026. switch fieldId {
  7027. case 0:
  7028. if fieldTypeId == thrift.LIST {
  7029. if err := p.ReadField0(ctx, iprot); err != nil {
  7030. return err
  7031. }
  7032. } else {
  7033. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7034. return err
  7035. }
  7036. }
  7037. case 1:
  7038. if fieldTypeId == thrift.STRUCT {
  7039. if err := p.ReadField1(ctx, iprot); err != nil {
  7040. return err
  7041. }
  7042. } else {
  7043. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7044. return err
  7045. }
  7046. }
  7047. default:
  7048. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7049. return err
  7050. }
  7051. }
  7052. if err := iprot.ReadFieldEnd(ctx); err != nil {
  7053. return err
  7054. }
  7055. }
  7056. if err := iprot.ReadStructEnd(ctx); err != nil {
  7057. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  7058. }
  7059. return nil
  7060. }
  7061. func (p *ChannelServiceGetUpdatedChannelIdsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  7062. _, size, err := iprot.ReadListBegin(ctx)
  7063. if err != nil {
  7064. return thrift.PrependError("error reading list begin: ", err)
  7065. }
  7066. tSlice := make([]string, 0, size)
  7067. p.Success = tSlice
  7068. for i := 0; i < size; i ++ {
  7069. var _elem81 string
  7070. if v, err := iprot.ReadString(ctx); err != nil {
  7071. return thrift.PrependError("error reading field 0: ", err)
  7072. } else {
  7073. _elem81 = v
  7074. }
  7075. p.Success = append(p.Success, _elem81)
  7076. }
  7077. if err := iprot.ReadListEnd(ctx); err != nil {
  7078. return thrift.PrependError("error reading list end: ", err)
  7079. }
  7080. return nil
  7081. }
  7082. func (p *ChannelServiceGetUpdatedChannelIdsResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  7083. p.E = &ChannelException{}
  7084. if err := p.E.Read(ctx, iprot); err != nil {
  7085. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  7086. }
  7087. return nil
  7088. }
  7089. func (p *ChannelServiceGetUpdatedChannelIdsResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  7090. if err := oprot.WriteStructBegin(ctx, "getUpdatedChannelIds_result"); err != nil {
  7091. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  7092. if p != nil {
  7093. if err := p.writeField0(ctx, oprot); err != nil { return err }
  7094. if err := p.writeField1(ctx, oprot); err != nil { return err }
  7095. }
  7096. if err := oprot.WriteFieldStop(ctx); err != nil {
  7097. return thrift.PrependError("write field stop error: ", err) }
  7098. if err := oprot.WriteStructEnd(ctx); err != nil {
  7099. return thrift.PrependError("write struct stop error: ", err) }
  7100. return nil
  7101. }
  7102. func (p *ChannelServiceGetUpdatedChannelIdsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7103. if p.IsSetSuccess() {
  7104. if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil {
  7105. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  7106. if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Success)); err != nil {
  7107. return thrift.PrependError("error writing list begin: ", err)
  7108. }
  7109. for _, v := range p.Success {
  7110. if err := oprot.WriteString(ctx, string(v)); err != nil {
  7111. return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  7112. }
  7113. if err := oprot.WriteListEnd(ctx); err != nil {
  7114. return thrift.PrependError("error writing list end: ", err)
  7115. }
  7116. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7117. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  7118. }
  7119. return err
  7120. }
  7121. func (p *ChannelServiceGetUpdatedChannelIdsResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7122. if p.IsSetE() {
  7123. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  7124. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  7125. if err := p.E.Write(ctx, oprot); err != nil {
  7126. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  7127. }
  7128. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7129. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  7130. }
  7131. return err
  7132. }
  7133. func (p *ChannelServiceGetUpdatedChannelIdsResult) String() string {
  7134. if p == nil {
  7135. return "<nil>"
  7136. }
  7137. return fmt.Sprintf("ChannelServiceGetUpdatedChannelIdsResult(%+v)", *p)
  7138. }
  7139. // Attributes:
  7140. // - WebLoginRequest
  7141. type ChannelServiceGetWebLoginDisallowedUrlArgs struct {
  7142. // unused field # 1
  7143. WebLoginRequest *WebLoginRequest `thrift:"webLoginRequest,2" db:"webLoginRequest" json:"webLoginRequest"`
  7144. }
  7145. func NewChannelServiceGetWebLoginDisallowedUrlArgs() *ChannelServiceGetWebLoginDisallowedUrlArgs {
  7146. return &ChannelServiceGetWebLoginDisallowedUrlArgs{}
  7147. }
  7148. var ChannelServiceGetWebLoginDisallowedUrlArgs_WebLoginRequest_DEFAULT *WebLoginRequest
  7149. func (p *ChannelServiceGetWebLoginDisallowedUrlArgs) GetWebLoginRequest() *WebLoginRequest {
  7150. if !p.IsSetWebLoginRequest() {
  7151. return ChannelServiceGetWebLoginDisallowedUrlArgs_WebLoginRequest_DEFAULT
  7152. }
  7153. return p.WebLoginRequest
  7154. }
  7155. func (p *ChannelServiceGetWebLoginDisallowedUrlArgs) IsSetWebLoginRequest() bool {
  7156. return p.WebLoginRequest != nil
  7157. }
  7158. func (p *ChannelServiceGetWebLoginDisallowedUrlArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  7159. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  7160. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  7161. }
  7162. for {
  7163. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  7164. if err != nil {
  7165. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  7166. }
  7167. if fieldTypeId == thrift.STOP { break; }
  7168. switch fieldId {
  7169. case 2:
  7170. if fieldTypeId == thrift.STRUCT {
  7171. if err := p.ReadField2(ctx, iprot); err != nil {
  7172. return err
  7173. }
  7174. } else {
  7175. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7176. return err
  7177. }
  7178. }
  7179. default:
  7180. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7181. return err
  7182. }
  7183. }
  7184. if err := iprot.ReadFieldEnd(ctx); err != nil {
  7185. return err
  7186. }
  7187. }
  7188. if err := iprot.ReadStructEnd(ctx); err != nil {
  7189. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  7190. }
  7191. return nil
  7192. }
  7193. func (p *ChannelServiceGetWebLoginDisallowedUrlArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  7194. p.WebLoginRequest = &WebLoginRequest{}
  7195. if err := p.WebLoginRequest.Read(ctx, iprot); err != nil {
  7196. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.WebLoginRequest), err)
  7197. }
  7198. return nil
  7199. }
  7200. func (p *ChannelServiceGetWebLoginDisallowedUrlArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  7201. if err := oprot.WriteStructBegin(ctx, "getWebLoginDisallowedUrl_args"); err != nil {
  7202. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  7203. if p != nil {
  7204. if err := p.writeField2(ctx, oprot); err != nil { return err }
  7205. }
  7206. if err := oprot.WriteFieldStop(ctx); err != nil {
  7207. return thrift.PrependError("write field stop error: ", err) }
  7208. if err := oprot.WriteStructEnd(ctx); err != nil {
  7209. return thrift.PrependError("write struct stop error: ", err) }
  7210. return nil
  7211. }
  7212. func (p *ChannelServiceGetWebLoginDisallowedUrlArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7213. if err := oprot.WriteFieldBegin(ctx, "webLoginRequest", thrift.STRUCT, 2); err != nil {
  7214. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:webLoginRequest: ", p), err) }
  7215. if err := p.WebLoginRequest.Write(ctx, oprot); err != nil {
  7216. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.WebLoginRequest), err)
  7217. }
  7218. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7219. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:webLoginRequest: ", p), err) }
  7220. return err
  7221. }
  7222. func (p *ChannelServiceGetWebLoginDisallowedUrlArgs) String() string {
  7223. if p == nil {
  7224. return "<nil>"
  7225. }
  7226. return fmt.Sprintf("ChannelServiceGetWebLoginDisallowedUrlArgs(%+v)", *p)
  7227. }
  7228. // Attributes:
  7229. // - Success
  7230. // - E
  7231. type ChannelServiceGetWebLoginDisallowedUrlResult struct {
  7232. Success *WebLoginResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
  7233. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  7234. }
  7235. func NewChannelServiceGetWebLoginDisallowedUrlResult() *ChannelServiceGetWebLoginDisallowedUrlResult {
  7236. return &ChannelServiceGetWebLoginDisallowedUrlResult{}
  7237. }
  7238. var ChannelServiceGetWebLoginDisallowedUrlResult_Success_DEFAULT *WebLoginResponse
  7239. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) GetSuccess() *WebLoginResponse {
  7240. if !p.IsSetSuccess() {
  7241. return ChannelServiceGetWebLoginDisallowedUrlResult_Success_DEFAULT
  7242. }
  7243. return p.Success
  7244. }
  7245. var ChannelServiceGetWebLoginDisallowedUrlResult_E_DEFAULT *ChannelException
  7246. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) GetE() *ChannelException {
  7247. if !p.IsSetE() {
  7248. return ChannelServiceGetWebLoginDisallowedUrlResult_E_DEFAULT
  7249. }
  7250. return p.E
  7251. }
  7252. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) IsSetSuccess() bool {
  7253. return p.Success != nil
  7254. }
  7255. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) IsSetE() bool {
  7256. return p.E != nil
  7257. }
  7258. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  7259. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  7260. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  7261. }
  7262. for {
  7263. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  7264. if err != nil {
  7265. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  7266. }
  7267. if fieldTypeId == thrift.STOP { break; }
  7268. switch fieldId {
  7269. case 0:
  7270. if fieldTypeId == thrift.STRUCT {
  7271. if err := p.ReadField0(ctx, iprot); err != nil {
  7272. return err
  7273. }
  7274. } else {
  7275. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7276. return err
  7277. }
  7278. }
  7279. case 1:
  7280. if fieldTypeId == thrift.STRUCT {
  7281. if err := p.ReadField1(ctx, iprot); err != nil {
  7282. return err
  7283. }
  7284. } else {
  7285. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7286. return err
  7287. }
  7288. }
  7289. default:
  7290. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7291. return err
  7292. }
  7293. }
  7294. if err := iprot.ReadFieldEnd(ctx); err != nil {
  7295. return err
  7296. }
  7297. }
  7298. if err := iprot.ReadStructEnd(ctx); err != nil {
  7299. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  7300. }
  7301. return nil
  7302. }
  7303. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  7304. p.Success = &WebLoginResponse{}
  7305. if err := p.Success.Read(ctx, iprot); err != nil {
  7306. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  7307. }
  7308. return nil
  7309. }
  7310. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  7311. p.E = &ChannelException{}
  7312. if err := p.E.Read(ctx, iprot); err != nil {
  7313. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  7314. }
  7315. return nil
  7316. }
  7317. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  7318. if err := oprot.WriteStructBegin(ctx, "getWebLoginDisallowedUrl_result"); err != nil {
  7319. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  7320. if p != nil {
  7321. if err := p.writeField0(ctx, oprot); err != nil { return err }
  7322. if err := p.writeField1(ctx, oprot); err != nil { return err }
  7323. }
  7324. if err := oprot.WriteFieldStop(ctx); err != nil {
  7325. return thrift.PrependError("write field stop error: ", err) }
  7326. if err := oprot.WriteStructEnd(ctx); err != nil {
  7327. return thrift.PrependError("write struct stop error: ", err) }
  7328. return nil
  7329. }
  7330. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7331. if p.IsSetSuccess() {
  7332. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  7333. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  7334. if err := p.Success.Write(ctx, oprot); err != nil {
  7335. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  7336. }
  7337. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7338. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  7339. }
  7340. return err
  7341. }
  7342. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7343. if p.IsSetE() {
  7344. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  7345. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  7346. if err := p.E.Write(ctx, oprot); err != nil {
  7347. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  7348. }
  7349. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7350. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  7351. }
  7352. return err
  7353. }
  7354. func (p *ChannelServiceGetWebLoginDisallowedUrlResult) String() string {
  7355. if p == nil {
  7356. return "<nil>"
  7357. }
  7358. return fmt.Sprintf("ChannelServiceGetWebLoginDisallowedUrlResult(%+v)", *p)
  7359. }
  7360. // Attributes:
  7361. // - ChannelId
  7362. type ChannelServiceIssueChannelTokenArgs struct {
  7363. ChannelId string `thrift:"channelId,1" db:"channelId" json:"channelId"`
  7364. }
  7365. func NewChannelServiceIssueChannelTokenArgs() *ChannelServiceIssueChannelTokenArgs {
  7366. return &ChannelServiceIssueChannelTokenArgs{}
  7367. }
  7368. func (p *ChannelServiceIssueChannelTokenArgs) GetChannelId() string {
  7369. return p.ChannelId
  7370. }
  7371. func (p *ChannelServiceIssueChannelTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  7372. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  7373. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  7374. }
  7375. for {
  7376. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  7377. if err != nil {
  7378. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  7379. }
  7380. if fieldTypeId == thrift.STOP { break; }
  7381. switch fieldId {
  7382. case 1:
  7383. if fieldTypeId == thrift.STRING {
  7384. if err := p.ReadField1(ctx, iprot); err != nil {
  7385. return err
  7386. }
  7387. } else {
  7388. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7389. return err
  7390. }
  7391. }
  7392. default:
  7393. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7394. return err
  7395. }
  7396. }
  7397. if err := iprot.ReadFieldEnd(ctx); err != nil {
  7398. return err
  7399. }
  7400. }
  7401. if err := iprot.ReadStructEnd(ctx); err != nil {
  7402. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  7403. }
  7404. return nil
  7405. }
  7406. func (p *ChannelServiceIssueChannelTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  7407. if v, err := iprot.ReadString(ctx); err != nil {
  7408. return thrift.PrependError("error reading field 1: ", err)
  7409. } else {
  7410. p.ChannelId = v
  7411. }
  7412. return nil
  7413. }
  7414. func (p *ChannelServiceIssueChannelTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  7415. if err := oprot.WriteStructBegin(ctx, "issueChannelToken_args"); err != nil {
  7416. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  7417. if p != nil {
  7418. if err := p.writeField1(ctx, oprot); err != nil { return err }
  7419. }
  7420. if err := oprot.WriteFieldStop(ctx); err != nil {
  7421. return thrift.PrependError("write field stop error: ", err) }
  7422. if err := oprot.WriteStructEnd(ctx); err != nil {
  7423. return thrift.PrependError("write struct stop error: ", err) }
  7424. return nil
  7425. }
  7426. func (p *ChannelServiceIssueChannelTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7427. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 1); err != nil {
  7428. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelId: ", p), err) }
  7429. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  7430. return thrift.PrependError(fmt.Sprintf("%T.channelId (1) field write error: ", p), err) }
  7431. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7432. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelId: ", p), err) }
  7433. return err
  7434. }
  7435. func (p *ChannelServiceIssueChannelTokenArgs) String() string {
  7436. if p == nil {
  7437. return "<nil>"
  7438. }
  7439. return fmt.Sprintf("ChannelServiceIssueChannelTokenArgs(%+v)", *p)
  7440. }
  7441. // Attributes:
  7442. // - Success
  7443. // - E
  7444. type ChannelServiceIssueChannelTokenResult struct {
  7445. Success *ChannelToken `thrift:"success,0" db:"success" json:"success,omitempty"`
  7446. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  7447. }
  7448. func NewChannelServiceIssueChannelTokenResult() *ChannelServiceIssueChannelTokenResult {
  7449. return &ChannelServiceIssueChannelTokenResult{}
  7450. }
  7451. var ChannelServiceIssueChannelTokenResult_Success_DEFAULT *ChannelToken
  7452. func (p *ChannelServiceIssueChannelTokenResult) GetSuccess() *ChannelToken {
  7453. if !p.IsSetSuccess() {
  7454. return ChannelServiceIssueChannelTokenResult_Success_DEFAULT
  7455. }
  7456. return p.Success
  7457. }
  7458. var ChannelServiceIssueChannelTokenResult_E_DEFAULT *ChannelException
  7459. func (p *ChannelServiceIssueChannelTokenResult) GetE() *ChannelException {
  7460. if !p.IsSetE() {
  7461. return ChannelServiceIssueChannelTokenResult_E_DEFAULT
  7462. }
  7463. return p.E
  7464. }
  7465. func (p *ChannelServiceIssueChannelTokenResult) IsSetSuccess() bool {
  7466. return p.Success != nil
  7467. }
  7468. func (p *ChannelServiceIssueChannelTokenResult) IsSetE() bool {
  7469. return p.E != nil
  7470. }
  7471. func (p *ChannelServiceIssueChannelTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  7472. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  7473. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  7474. }
  7475. for {
  7476. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  7477. if err != nil {
  7478. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  7479. }
  7480. if fieldTypeId == thrift.STOP { break; }
  7481. switch fieldId {
  7482. case 0:
  7483. if fieldTypeId == thrift.STRUCT {
  7484. if err := p.ReadField0(ctx, iprot); err != nil {
  7485. return err
  7486. }
  7487. } else {
  7488. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7489. return err
  7490. }
  7491. }
  7492. case 1:
  7493. if fieldTypeId == thrift.STRUCT {
  7494. if err := p.ReadField1(ctx, iprot); err != nil {
  7495. return err
  7496. }
  7497. } else {
  7498. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7499. return err
  7500. }
  7501. }
  7502. default:
  7503. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7504. return err
  7505. }
  7506. }
  7507. if err := iprot.ReadFieldEnd(ctx); err != nil {
  7508. return err
  7509. }
  7510. }
  7511. if err := iprot.ReadStructEnd(ctx); err != nil {
  7512. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  7513. }
  7514. return nil
  7515. }
  7516. func (p *ChannelServiceIssueChannelTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  7517. p.Success = &ChannelToken{}
  7518. if err := p.Success.Read(ctx, iprot); err != nil {
  7519. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  7520. }
  7521. return nil
  7522. }
  7523. func (p *ChannelServiceIssueChannelTokenResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  7524. p.E = &ChannelException{}
  7525. if err := p.E.Read(ctx, iprot); err != nil {
  7526. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  7527. }
  7528. return nil
  7529. }
  7530. func (p *ChannelServiceIssueChannelTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  7531. if err := oprot.WriteStructBegin(ctx, "issueChannelToken_result"); err != nil {
  7532. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  7533. if p != nil {
  7534. if err := p.writeField0(ctx, oprot); err != nil { return err }
  7535. if err := p.writeField1(ctx, oprot); err != nil { return err }
  7536. }
  7537. if err := oprot.WriteFieldStop(ctx); err != nil {
  7538. return thrift.PrependError("write field stop error: ", err) }
  7539. if err := oprot.WriteStructEnd(ctx); err != nil {
  7540. return thrift.PrependError("write struct stop error: ", err) }
  7541. return nil
  7542. }
  7543. func (p *ChannelServiceIssueChannelTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7544. if p.IsSetSuccess() {
  7545. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  7546. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  7547. if err := p.Success.Write(ctx, oprot); err != nil {
  7548. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  7549. }
  7550. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7551. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  7552. }
  7553. return err
  7554. }
  7555. func (p *ChannelServiceIssueChannelTokenResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7556. if p.IsSetE() {
  7557. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  7558. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  7559. if err := p.E.Write(ctx, oprot); err != nil {
  7560. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  7561. }
  7562. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7563. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  7564. }
  7565. return err
  7566. }
  7567. func (p *ChannelServiceIssueChannelTokenResult) String() string {
  7568. if p == nil {
  7569. return "<nil>"
  7570. }
  7571. return fmt.Sprintf("ChannelServiceIssueChannelTokenResult(%+v)", *p)
  7572. }
  7573. // Attributes:
  7574. // - ChannelId
  7575. // - OtpId
  7576. // - AuthScheme
  7577. // - ReturnUrl
  7578. type ChannelServiceIssueRequestTokenWithAuthSchemeArgs struct {
  7579. ChannelId string `thrift:"channelId,1" db:"channelId" json:"channelId"`
  7580. OtpId string `thrift:"otpId,2" db:"otpId" json:"otpId"`
  7581. AuthScheme []string `thrift:"authScheme,3" db:"authScheme" json:"authScheme"`
  7582. ReturnUrl string `thrift:"returnUrl,4" db:"returnUrl" json:"returnUrl"`
  7583. }
  7584. func NewChannelServiceIssueRequestTokenWithAuthSchemeArgs() *ChannelServiceIssueRequestTokenWithAuthSchemeArgs {
  7585. return &ChannelServiceIssueRequestTokenWithAuthSchemeArgs{}
  7586. }
  7587. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) GetChannelId() string {
  7588. return p.ChannelId
  7589. }
  7590. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) GetOtpId() string {
  7591. return p.OtpId
  7592. }
  7593. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) GetAuthScheme() []string {
  7594. return p.AuthScheme
  7595. }
  7596. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) GetReturnUrl() string {
  7597. return p.ReturnUrl
  7598. }
  7599. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  7600. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  7601. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  7602. }
  7603. for {
  7604. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  7605. if err != nil {
  7606. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  7607. }
  7608. if fieldTypeId == thrift.STOP { break; }
  7609. switch fieldId {
  7610. case 1:
  7611. if fieldTypeId == thrift.STRING {
  7612. if err := p.ReadField1(ctx, iprot); err != nil {
  7613. return err
  7614. }
  7615. } else {
  7616. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7617. return err
  7618. }
  7619. }
  7620. case 2:
  7621. if fieldTypeId == thrift.STRING {
  7622. if err := p.ReadField2(ctx, iprot); err != nil {
  7623. return err
  7624. }
  7625. } else {
  7626. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7627. return err
  7628. }
  7629. }
  7630. case 3:
  7631. if fieldTypeId == thrift.LIST {
  7632. if err := p.ReadField3(ctx, iprot); err != nil {
  7633. return err
  7634. }
  7635. } else {
  7636. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7637. return err
  7638. }
  7639. }
  7640. case 4:
  7641. if fieldTypeId == thrift.STRING {
  7642. if err := p.ReadField4(ctx, iprot); err != nil {
  7643. return err
  7644. }
  7645. } else {
  7646. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7647. return err
  7648. }
  7649. }
  7650. default:
  7651. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7652. return err
  7653. }
  7654. }
  7655. if err := iprot.ReadFieldEnd(ctx); err != nil {
  7656. return err
  7657. }
  7658. }
  7659. if err := iprot.ReadStructEnd(ctx); err != nil {
  7660. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  7661. }
  7662. return nil
  7663. }
  7664. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  7665. if v, err := iprot.ReadString(ctx); err != nil {
  7666. return thrift.PrependError("error reading field 1: ", err)
  7667. } else {
  7668. p.ChannelId = v
  7669. }
  7670. return nil
  7671. }
  7672. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  7673. if v, err := iprot.ReadString(ctx); err != nil {
  7674. return thrift.PrependError("error reading field 2: ", err)
  7675. } else {
  7676. p.OtpId = v
  7677. }
  7678. return nil
  7679. }
  7680. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  7681. _, size, err := iprot.ReadListBegin(ctx)
  7682. if err != nil {
  7683. return thrift.PrependError("error reading list begin: ", err)
  7684. }
  7685. tSlice := make([]string, 0, size)
  7686. p.AuthScheme = tSlice
  7687. for i := 0; i < size; i ++ {
  7688. var _elem82 string
  7689. if v, err := iprot.ReadString(ctx); err != nil {
  7690. return thrift.PrependError("error reading field 0: ", err)
  7691. } else {
  7692. _elem82 = v
  7693. }
  7694. p.AuthScheme = append(p.AuthScheme, _elem82)
  7695. }
  7696. if err := iprot.ReadListEnd(ctx); err != nil {
  7697. return thrift.PrependError("error reading list end: ", err)
  7698. }
  7699. return nil
  7700. }
  7701. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
  7702. if v, err := iprot.ReadString(ctx); err != nil {
  7703. return thrift.PrependError("error reading field 4: ", err)
  7704. } else {
  7705. p.ReturnUrl = v
  7706. }
  7707. return nil
  7708. }
  7709. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  7710. if err := oprot.WriteStructBegin(ctx, "issueRequestTokenWithAuthScheme_args"); err != nil {
  7711. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  7712. if p != nil {
  7713. if err := p.writeField1(ctx, oprot); err != nil { return err }
  7714. if err := p.writeField2(ctx, oprot); err != nil { return err }
  7715. if err := p.writeField3(ctx, oprot); err != nil { return err }
  7716. if err := p.writeField4(ctx, oprot); err != nil { return err }
  7717. }
  7718. if err := oprot.WriteFieldStop(ctx); err != nil {
  7719. return thrift.PrependError("write field stop error: ", err) }
  7720. if err := oprot.WriteStructEnd(ctx); err != nil {
  7721. return thrift.PrependError("write struct stop error: ", err) }
  7722. return nil
  7723. }
  7724. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7725. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 1); err != nil {
  7726. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelId: ", p), err) }
  7727. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  7728. return thrift.PrependError(fmt.Sprintf("%T.channelId (1) field write error: ", p), err) }
  7729. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7730. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelId: ", p), err) }
  7731. return err
  7732. }
  7733. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7734. if err := oprot.WriteFieldBegin(ctx, "otpId", thrift.STRING, 2); err != nil {
  7735. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:otpId: ", p), err) }
  7736. if err := oprot.WriteString(ctx, string(p.OtpId)); err != nil {
  7737. return thrift.PrependError(fmt.Sprintf("%T.otpId (2) field write error: ", p), err) }
  7738. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7739. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:otpId: ", p), err) }
  7740. return err
  7741. }
  7742. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7743. if err := oprot.WriteFieldBegin(ctx, "authScheme", thrift.LIST, 3); err != nil {
  7744. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:authScheme: ", p), err) }
  7745. if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.AuthScheme)); err != nil {
  7746. return thrift.PrependError("error writing list begin: ", err)
  7747. }
  7748. for _, v := range p.AuthScheme {
  7749. if err := oprot.WriteString(ctx, string(v)); err != nil {
  7750. return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  7751. }
  7752. if err := oprot.WriteListEnd(ctx); err != nil {
  7753. return thrift.PrependError("error writing list end: ", err)
  7754. }
  7755. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7756. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:authScheme: ", p), err) }
  7757. return err
  7758. }
  7759. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7760. if err := oprot.WriteFieldBegin(ctx, "returnUrl", thrift.STRING, 4); err != nil {
  7761. return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:returnUrl: ", p), err) }
  7762. if err := oprot.WriteString(ctx, string(p.ReturnUrl)); err != nil {
  7763. return thrift.PrependError(fmt.Sprintf("%T.returnUrl (4) field write error: ", p), err) }
  7764. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7765. return thrift.PrependError(fmt.Sprintf("%T write field end error 4:returnUrl: ", p), err) }
  7766. return err
  7767. }
  7768. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeArgs) String() string {
  7769. if p == nil {
  7770. return "<nil>"
  7771. }
  7772. return fmt.Sprintf("ChannelServiceIssueRequestTokenWithAuthSchemeArgs(%+v)", *p)
  7773. }
  7774. // Attributes:
  7775. // - Success
  7776. // - E
  7777. type ChannelServiceIssueRequestTokenWithAuthSchemeResult struct {
  7778. Success *RequestTokenResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
  7779. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  7780. }
  7781. func NewChannelServiceIssueRequestTokenWithAuthSchemeResult() *ChannelServiceIssueRequestTokenWithAuthSchemeResult {
  7782. return &ChannelServiceIssueRequestTokenWithAuthSchemeResult{}
  7783. }
  7784. var ChannelServiceIssueRequestTokenWithAuthSchemeResult_Success_DEFAULT *RequestTokenResponse
  7785. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) GetSuccess() *RequestTokenResponse {
  7786. if !p.IsSetSuccess() {
  7787. return ChannelServiceIssueRequestTokenWithAuthSchemeResult_Success_DEFAULT
  7788. }
  7789. return p.Success
  7790. }
  7791. var ChannelServiceIssueRequestTokenWithAuthSchemeResult_E_DEFAULT *ChannelException
  7792. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) GetE() *ChannelException {
  7793. if !p.IsSetE() {
  7794. return ChannelServiceIssueRequestTokenWithAuthSchemeResult_E_DEFAULT
  7795. }
  7796. return p.E
  7797. }
  7798. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) IsSetSuccess() bool {
  7799. return p.Success != nil
  7800. }
  7801. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) IsSetE() bool {
  7802. return p.E != nil
  7803. }
  7804. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  7805. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  7806. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  7807. }
  7808. for {
  7809. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  7810. if err != nil {
  7811. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  7812. }
  7813. if fieldTypeId == thrift.STOP { break; }
  7814. switch fieldId {
  7815. case 0:
  7816. if fieldTypeId == thrift.STRUCT {
  7817. if err := p.ReadField0(ctx, iprot); err != nil {
  7818. return err
  7819. }
  7820. } else {
  7821. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7822. return err
  7823. }
  7824. }
  7825. case 1:
  7826. if fieldTypeId == thrift.STRUCT {
  7827. if err := p.ReadField1(ctx, iprot); err != nil {
  7828. return err
  7829. }
  7830. } else {
  7831. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7832. return err
  7833. }
  7834. }
  7835. default:
  7836. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7837. return err
  7838. }
  7839. }
  7840. if err := iprot.ReadFieldEnd(ctx); err != nil {
  7841. return err
  7842. }
  7843. }
  7844. if err := iprot.ReadStructEnd(ctx); err != nil {
  7845. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  7846. }
  7847. return nil
  7848. }
  7849. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  7850. p.Success = &RequestTokenResponse{}
  7851. if err := p.Success.Read(ctx, iprot); err != nil {
  7852. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  7853. }
  7854. return nil
  7855. }
  7856. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  7857. p.E = &ChannelException{}
  7858. if err := p.E.Read(ctx, iprot); err != nil {
  7859. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  7860. }
  7861. return nil
  7862. }
  7863. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  7864. if err := oprot.WriteStructBegin(ctx, "issueRequestTokenWithAuthScheme_result"); err != nil {
  7865. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  7866. if p != nil {
  7867. if err := p.writeField0(ctx, oprot); err != nil { return err }
  7868. if err := p.writeField1(ctx, oprot); err != nil { return err }
  7869. }
  7870. if err := oprot.WriteFieldStop(ctx); err != nil {
  7871. return thrift.PrependError("write field stop error: ", err) }
  7872. if err := oprot.WriteStructEnd(ctx); err != nil {
  7873. return thrift.PrependError("write struct stop error: ", err) }
  7874. return nil
  7875. }
  7876. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7877. if p.IsSetSuccess() {
  7878. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
  7879. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  7880. if err := p.Success.Write(ctx, oprot); err != nil {
  7881. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
  7882. }
  7883. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7884. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  7885. }
  7886. return err
  7887. }
  7888. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  7889. if p.IsSetE() {
  7890. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  7891. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  7892. if err := p.E.Write(ctx, oprot); err != nil {
  7893. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  7894. }
  7895. if err := oprot.WriteFieldEnd(ctx); err != nil {
  7896. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  7897. }
  7898. return err
  7899. }
  7900. func (p *ChannelServiceIssueRequestTokenWithAuthSchemeResult) String() string {
  7901. if p == nil {
  7902. return "<nil>"
  7903. }
  7904. return fmt.Sprintf("ChannelServiceIssueRequestTokenWithAuthSchemeResult(%+v)", *p)
  7905. }
  7906. // Attributes:
  7907. // - Request
  7908. // - Locale
  7909. type ChannelServiceReserveCoinUseArgs struct {
  7910. // unused field # 1
  7911. Request *CoinUseReservation `thrift:"request,2" db:"request" json:"request"`
  7912. Locale string `thrift:"locale,3" db:"locale" json:"locale"`
  7913. }
  7914. func NewChannelServiceReserveCoinUseArgs() *ChannelServiceReserveCoinUseArgs {
  7915. return &ChannelServiceReserveCoinUseArgs{}
  7916. }
  7917. var ChannelServiceReserveCoinUseArgs_Request_DEFAULT *CoinUseReservation
  7918. func (p *ChannelServiceReserveCoinUseArgs) GetRequest() *CoinUseReservation {
  7919. if !p.IsSetRequest() {
  7920. return ChannelServiceReserveCoinUseArgs_Request_DEFAULT
  7921. }
  7922. return p.Request
  7923. }
  7924. func (p *ChannelServiceReserveCoinUseArgs) GetLocale() string {
  7925. return p.Locale
  7926. }
  7927. func (p *ChannelServiceReserveCoinUseArgs) IsSetRequest() bool {
  7928. return p.Request != nil
  7929. }
  7930. func (p *ChannelServiceReserveCoinUseArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  7931. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  7932. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  7933. }
  7934. for {
  7935. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  7936. if err != nil {
  7937. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  7938. }
  7939. if fieldTypeId == thrift.STOP { break; }
  7940. switch fieldId {
  7941. case 2:
  7942. if fieldTypeId == thrift.STRUCT {
  7943. if err := p.ReadField2(ctx, iprot); err != nil {
  7944. return err
  7945. }
  7946. } else {
  7947. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7948. return err
  7949. }
  7950. }
  7951. case 3:
  7952. if fieldTypeId == thrift.STRING {
  7953. if err := p.ReadField3(ctx, iprot); err != nil {
  7954. return err
  7955. }
  7956. } else {
  7957. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7958. return err
  7959. }
  7960. }
  7961. default:
  7962. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  7963. return err
  7964. }
  7965. }
  7966. if err := iprot.ReadFieldEnd(ctx); err != nil {
  7967. return err
  7968. }
  7969. }
  7970. if err := iprot.ReadStructEnd(ctx); err != nil {
  7971. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  7972. }
  7973. return nil
  7974. }
  7975. func (p *ChannelServiceReserveCoinUseArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
  7976. p.Request = &CoinUseReservation{}
  7977. if err := p.Request.Read(ctx, iprot); err != nil {
  7978. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
  7979. }
  7980. return nil
  7981. }
  7982. func (p *ChannelServiceReserveCoinUseArgs) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
  7983. if v, err := iprot.ReadString(ctx); err != nil {
  7984. return thrift.PrependError("error reading field 3: ", err)
  7985. } else {
  7986. p.Locale = v
  7987. }
  7988. return nil
  7989. }
  7990. func (p *ChannelServiceReserveCoinUseArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  7991. if err := oprot.WriteStructBegin(ctx, "reserveCoinUse_args"); err != nil {
  7992. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  7993. if p != nil {
  7994. if err := p.writeField2(ctx, oprot); err != nil { return err }
  7995. if err := p.writeField3(ctx, oprot); err != nil { return err }
  7996. }
  7997. if err := oprot.WriteFieldStop(ctx); err != nil {
  7998. return thrift.PrependError("write field stop error: ", err) }
  7999. if err := oprot.WriteStructEnd(ctx); err != nil {
  8000. return thrift.PrependError("write struct stop error: ", err) }
  8001. return nil
  8002. }
  8003. func (p *ChannelServiceReserveCoinUseArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8004. if err := oprot.WriteFieldBegin(ctx, "request", thrift.STRUCT, 2); err != nil {
  8005. return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:request: ", p), err) }
  8006. if err := p.Request.Write(ctx, oprot); err != nil {
  8007. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
  8008. }
  8009. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8010. return thrift.PrependError(fmt.Sprintf("%T write field end error 2:request: ", p), err) }
  8011. return err
  8012. }
  8013. func (p *ChannelServiceReserveCoinUseArgs) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8014. if err := oprot.WriteFieldBegin(ctx, "locale", thrift.STRING, 3); err != nil {
  8015. return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:locale: ", p), err) }
  8016. if err := oprot.WriteString(ctx, string(p.Locale)); err != nil {
  8017. return thrift.PrependError(fmt.Sprintf("%T.locale (3) field write error: ", p), err) }
  8018. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8019. return thrift.PrependError(fmt.Sprintf("%T write field end error 3:locale: ", p), err) }
  8020. return err
  8021. }
  8022. func (p *ChannelServiceReserveCoinUseArgs) String() string {
  8023. if p == nil {
  8024. return "<nil>"
  8025. }
  8026. return fmt.Sprintf("ChannelServiceReserveCoinUseArgs(%+v)", *p)
  8027. }
  8028. // Attributes:
  8029. // - Success
  8030. // - E
  8031. type ChannelServiceReserveCoinUseResult struct {
  8032. Success *string `thrift:"success,0" db:"success" json:"success,omitempty"`
  8033. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  8034. }
  8035. func NewChannelServiceReserveCoinUseResult() *ChannelServiceReserveCoinUseResult {
  8036. return &ChannelServiceReserveCoinUseResult{}
  8037. }
  8038. var ChannelServiceReserveCoinUseResult_Success_DEFAULT string
  8039. func (p *ChannelServiceReserveCoinUseResult) GetSuccess() string {
  8040. if !p.IsSetSuccess() {
  8041. return ChannelServiceReserveCoinUseResult_Success_DEFAULT
  8042. }
  8043. return *p.Success
  8044. }
  8045. var ChannelServiceReserveCoinUseResult_E_DEFAULT *ChannelException
  8046. func (p *ChannelServiceReserveCoinUseResult) GetE() *ChannelException {
  8047. if !p.IsSetE() {
  8048. return ChannelServiceReserveCoinUseResult_E_DEFAULT
  8049. }
  8050. return p.E
  8051. }
  8052. func (p *ChannelServiceReserveCoinUseResult) IsSetSuccess() bool {
  8053. return p.Success != nil
  8054. }
  8055. func (p *ChannelServiceReserveCoinUseResult) IsSetE() bool {
  8056. return p.E != nil
  8057. }
  8058. func (p *ChannelServiceReserveCoinUseResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  8059. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  8060. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  8061. }
  8062. for {
  8063. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  8064. if err != nil {
  8065. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  8066. }
  8067. if fieldTypeId == thrift.STOP { break; }
  8068. switch fieldId {
  8069. case 0:
  8070. if fieldTypeId == thrift.STRING {
  8071. if err := p.ReadField0(ctx, iprot); err != nil {
  8072. return err
  8073. }
  8074. } else {
  8075. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8076. return err
  8077. }
  8078. }
  8079. case 1:
  8080. if fieldTypeId == thrift.STRUCT {
  8081. if err := p.ReadField1(ctx, iprot); err != nil {
  8082. return err
  8083. }
  8084. } else {
  8085. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8086. return err
  8087. }
  8088. }
  8089. default:
  8090. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8091. return err
  8092. }
  8093. }
  8094. if err := iprot.ReadFieldEnd(ctx); err != nil {
  8095. return err
  8096. }
  8097. }
  8098. if err := iprot.ReadStructEnd(ctx); err != nil {
  8099. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  8100. }
  8101. return nil
  8102. }
  8103. func (p *ChannelServiceReserveCoinUseResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  8104. if v, err := iprot.ReadString(ctx); err != nil {
  8105. return thrift.PrependError("error reading field 0: ", err)
  8106. } else {
  8107. p.Success = &v
  8108. }
  8109. return nil
  8110. }
  8111. func (p *ChannelServiceReserveCoinUseResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  8112. p.E = &ChannelException{}
  8113. if err := p.E.Read(ctx, iprot); err != nil {
  8114. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  8115. }
  8116. return nil
  8117. }
  8118. func (p *ChannelServiceReserveCoinUseResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  8119. if err := oprot.WriteStructBegin(ctx, "reserveCoinUse_result"); err != nil {
  8120. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  8121. if p != nil {
  8122. if err := p.writeField0(ctx, oprot); err != nil { return err }
  8123. if err := p.writeField1(ctx, oprot); err != nil { return err }
  8124. }
  8125. if err := oprot.WriteFieldStop(ctx); err != nil {
  8126. return thrift.PrependError("write field stop error: ", err) }
  8127. if err := oprot.WriteStructEnd(ctx); err != nil {
  8128. return thrift.PrependError("write struct stop error: ", err) }
  8129. return nil
  8130. }
  8131. func (p *ChannelServiceReserveCoinUseResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8132. if p.IsSetSuccess() {
  8133. if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRING, 0); err != nil {
  8134. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  8135. if err := oprot.WriteString(ctx, string(*p.Success)); err != nil {
  8136. return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
  8137. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8138. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  8139. }
  8140. return err
  8141. }
  8142. func (p *ChannelServiceReserveCoinUseResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8143. if p.IsSetE() {
  8144. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  8145. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  8146. if err := p.E.Write(ctx, oprot); err != nil {
  8147. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  8148. }
  8149. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8150. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  8151. }
  8152. return err
  8153. }
  8154. func (p *ChannelServiceReserveCoinUseResult) String() string {
  8155. if p == nil {
  8156. return "<nil>"
  8157. }
  8158. return fmt.Sprintf("ChannelServiceReserveCoinUseResult(%+v)", *p)
  8159. }
  8160. // Attributes:
  8161. // - ChannelId
  8162. type ChannelServiceRevokeChannelArgs struct {
  8163. ChannelId string `thrift:"channelId,1" db:"channelId" json:"channelId"`
  8164. }
  8165. func NewChannelServiceRevokeChannelArgs() *ChannelServiceRevokeChannelArgs {
  8166. return &ChannelServiceRevokeChannelArgs{}
  8167. }
  8168. func (p *ChannelServiceRevokeChannelArgs) GetChannelId() string {
  8169. return p.ChannelId
  8170. }
  8171. func (p *ChannelServiceRevokeChannelArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  8172. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  8173. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  8174. }
  8175. for {
  8176. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  8177. if err != nil {
  8178. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  8179. }
  8180. if fieldTypeId == thrift.STOP { break; }
  8181. switch fieldId {
  8182. case 1:
  8183. if fieldTypeId == thrift.STRING {
  8184. if err := p.ReadField1(ctx, iprot); err != nil {
  8185. return err
  8186. }
  8187. } else {
  8188. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8189. return err
  8190. }
  8191. }
  8192. default:
  8193. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8194. return err
  8195. }
  8196. }
  8197. if err := iprot.ReadFieldEnd(ctx); err != nil {
  8198. return err
  8199. }
  8200. }
  8201. if err := iprot.ReadStructEnd(ctx); err != nil {
  8202. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  8203. }
  8204. return nil
  8205. }
  8206. func (p *ChannelServiceRevokeChannelArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  8207. if v, err := iprot.ReadString(ctx); err != nil {
  8208. return thrift.PrependError("error reading field 1: ", err)
  8209. } else {
  8210. p.ChannelId = v
  8211. }
  8212. return nil
  8213. }
  8214. func (p *ChannelServiceRevokeChannelArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  8215. if err := oprot.WriteStructBegin(ctx, "revokeChannel_args"); err != nil {
  8216. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  8217. if p != nil {
  8218. if err := p.writeField1(ctx, oprot); err != nil { return err }
  8219. }
  8220. if err := oprot.WriteFieldStop(ctx); err != nil {
  8221. return thrift.PrependError("write field stop error: ", err) }
  8222. if err := oprot.WriteStructEnd(ctx); err != nil {
  8223. return thrift.PrependError("write struct stop error: ", err) }
  8224. return nil
  8225. }
  8226. func (p *ChannelServiceRevokeChannelArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8227. if err := oprot.WriteFieldBegin(ctx, "channelId", thrift.STRING, 1); err != nil {
  8228. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelId: ", p), err) }
  8229. if err := oprot.WriteString(ctx, string(p.ChannelId)); err != nil {
  8230. return thrift.PrependError(fmt.Sprintf("%T.channelId (1) field write error: ", p), err) }
  8231. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8232. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelId: ", p), err) }
  8233. return err
  8234. }
  8235. func (p *ChannelServiceRevokeChannelArgs) String() string {
  8236. if p == nil {
  8237. return "<nil>"
  8238. }
  8239. return fmt.Sprintf("ChannelServiceRevokeChannelArgs(%+v)", *p)
  8240. }
  8241. // Attributes:
  8242. // - E
  8243. type ChannelServiceRevokeChannelResult struct {
  8244. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  8245. }
  8246. func NewChannelServiceRevokeChannelResult() *ChannelServiceRevokeChannelResult {
  8247. return &ChannelServiceRevokeChannelResult{}
  8248. }
  8249. var ChannelServiceRevokeChannelResult_E_DEFAULT *ChannelException
  8250. func (p *ChannelServiceRevokeChannelResult) GetE() *ChannelException {
  8251. if !p.IsSetE() {
  8252. return ChannelServiceRevokeChannelResult_E_DEFAULT
  8253. }
  8254. return p.E
  8255. }
  8256. func (p *ChannelServiceRevokeChannelResult) IsSetE() bool {
  8257. return p.E != nil
  8258. }
  8259. func (p *ChannelServiceRevokeChannelResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  8260. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  8261. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  8262. }
  8263. for {
  8264. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  8265. if err != nil {
  8266. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  8267. }
  8268. if fieldTypeId == thrift.STOP { break; }
  8269. switch fieldId {
  8270. case 1:
  8271. if fieldTypeId == thrift.STRUCT {
  8272. if err := p.ReadField1(ctx, iprot); err != nil {
  8273. return err
  8274. }
  8275. } else {
  8276. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8277. return err
  8278. }
  8279. }
  8280. default:
  8281. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8282. return err
  8283. }
  8284. }
  8285. if err := iprot.ReadFieldEnd(ctx); err != nil {
  8286. return err
  8287. }
  8288. }
  8289. if err := iprot.ReadStructEnd(ctx); err != nil {
  8290. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  8291. }
  8292. return nil
  8293. }
  8294. func (p *ChannelServiceRevokeChannelResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  8295. p.E = &ChannelException{}
  8296. if err := p.E.Read(ctx, iprot); err != nil {
  8297. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  8298. }
  8299. return nil
  8300. }
  8301. func (p *ChannelServiceRevokeChannelResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  8302. if err := oprot.WriteStructBegin(ctx, "revokeChannel_result"); err != nil {
  8303. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  8304. if p != nil {
  8305. if err := p.writeField1(ctx, oprot); err != nil { return err }
  8306. }
  8307. if err := oprot.WriteFieldStop(ctx); err != nil {
  8308. return thrift.PrependError("write field stop error: ", err) }
  8309. if err := oprot.WriteStructEnd(ctx); err != nil {
  8310. return thrift.PrependError("write struct stop error: ", err) }
  8311. return nil
  8312. }
  8313. func (p *ChannelServiceRevokeChannelResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8314. if p.IsSetE() {
  8315. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  8316. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  8317. if err := p.E.Write(ctx, oprot); err != nil {
  8318. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  8319. }
  8320. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8321. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  8322. }
  8323. return err
  8324. }
  8325. func (p *ChannelServiceRevokeChannelResult) String() string {
  8326. if p == nil {
  8327. return "<nil>"
  8328. }
  8329. return fmt.Sprintf("ChannelServiceRevokeChannelResult(%+v)", *p)
  8330. }
  8331. // Attributes:
  8332. // - Setting
  8333. type ChannelServiceUpdateChannelNotificationSettingArgs struct {
  8334. Setting []*ChannelNotificationSetting `thrift:"setting,1" db:"setting" json:"setting"`
  8335. }
  8336. func NewChannelServiceUpdateChannelNotificationSettingArgs() *ChannelServiceUpdateChannelNotificationSettingArgs {
  8337. return &ChannelServiceUpdateChannelNotificationSettingArgs{}
  8338. }
  8339. func (p *ChannelServiceUpdateChannelNotificationSettingArgs) GetSetting() []*ChannelNotificationSetting {
  8340. return p.Setting
  8341. }
  8342. func (p *ChannelServiceUpdateChannelNotificationSettingArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  8343. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  8344. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  8345. }
  8346. for {
  8347. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  8348. if err != nil {
  8349. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  8350. }
  8351. if fieldTypeId == thrift.STOP { break; }
  8352. switch fieldId {
  8353. case 1:
  8354. if fieldTypeId == thrift.LIST {
  8355. if err := p.ReadField1(ctx, iprot); err != nil {
  8356. return err
  8357. }
  8358. } else {
  8359. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8360. return err
  8361. }
  8362. }
  8363. default:
  8364. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8365. return err
  8366. }
  8367. }
  8368. if err := iprot.ReadFieldEnd(ctx); err != nil {
  8369. return err
  8370. }
  8371. }
  8372. if err := iprot.ReadStructEnd(ctx); err != nil {
  8373. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  8374. }
  8375. return nil
  8376. }
  8377. func (p *ChannelServiceUpdateChannelNotificationSettingArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  8378. _, size, err := iprot.ReadListBegin(ctx)
  8379. if err != nil {
  8380. return thrift.PrependError("error reading list begin: ", err)
  8381. }
  8382. tSlice := make([]*ChannelNotificationSetting, 0, size)
  8383. p.Setting = tSlice
  8384. for i := 0; i < size; i ++ {
  8385. _elem83 := &ChannelNotificationSetting{}
  8386. if err := _elem83.Read(ctx, iprot); err != nil {
  8387. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem83), err)
  8388. }
  8389. p.Setting = append(p.Setting, _elem83)
  8390. }
  8391. if err := iprot.ReadListEnd(ctx); err != nil {
  8392. return thrift.PrependError("error reading list end: ", err)
  8393. }
  8394. return nil
  8395. }
  8396. func (p *ChannelServiceUpdateChannelNotificationSettingArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  8397. if err := oprot.WriteStructBegin(ctx, "updateChannelNotificationSetting_args"); err != nil {
  8398. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  8399. if p != nil {
  8400. if err := p.writeField1(ctx, oprot); err != nil { return err }
  8401. }
  8402. if err := oprot.WriteFieldStop(ctx); err != nil {
  8403. return thrift.PrependError("write field stop error: ", err) }
  8404. if err := oprot.WriteStructEnd(ctx); err != nil {
  8405. return thrift.PrependError("write struct stop error: ", err) }
  8406. return nil
  8407. }
  8408. func (p *ChannelServiceUpdateChannelNotificationSettingArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8409. if err := oprot.WriteFieldBegin(ctx, "setting", thrift.LIST, 1); err != nil {
  8410. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:setting: ", p), err) }
  8411. if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Setting)); err != nil {
  8412. return thrift.PrependError("error writing list begin: ", err)
  8413. }
  8414. for _, v := range p.Setting {
  8415. if err := v.Write(ctx, oprot); err != nil {
  8416. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
  8417. }
  8418. }
  8419. if err := oprot.WriteListEnd(ctx); err != nil {
  8420. return thrift.PrependError("error writing list end: ", err)
  8421. }
  8422. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8423. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:setting: ", p), err) }
  8424. return err
  8425. }
  8426. func (p *ChannelServiceUpdateChannelNotificationSettingArgs) String() string {
  8427. if p == nil {
  8428. return "<nil>"
  8429. }
  8430. return fmt.Sprintf("ChannelServiceUpdateChannelNotificationSettingArgs(%+v)", *p)
  8431. }
  8432. // Attributes:
  8433. // - E
  8434. type ChannelServiceUpdateChannelNotificationSettingResult struct {
  8435. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  8436. }
  8437. func NewChannelServiceUpdateChannelNotificationSettingResult() *ChannelServiceUpdateChannelNotificationSettingResult {
  8438. return &ChannelServiceUpdateChannelNotificationSettingResult{}
  8439. }
  8440. var ChannelServiceUpdateChannelNotificationSettingResult_E_DEFAULT *ChannelException
  8441. func (p *ChannelServiceUpdateChannelNotificationSettingResult) GetE() *ChannelException {
  8442. if !p.IsSetE() {
  8443. return ChannelServiceUpdateChannelNotificationSettingResult_E_DEFAULT
  8444. }
  8445. return p.E
  8446. }
  8447. func (p *ChannelServiceUpdateChannelNotificationSettingResult) IsSetE() bool {
  8448. return p.E != nil
  8449. }
  8450. func (p *ChannelServiceUpdateChannelNotificationSettingResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  8451. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  8452. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  8453. }
  8454. for {
  8455. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  8456. if err != nil {
  8457. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  8458. }
  8459. if fieldTypeId == thrift.STOP { break; }
  8460. switch fieldId {
  8461. case 1:
  8462. if fieldTypeId == thrift.STRUCT {
  8463. if err := p.ReadField1(ctx, iprot); err != nil {
  8464. return err
  8465. }
  8466. } else {
  8467. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8468. return err
  8469. }
  8470. }
  8471. default:
  8472. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8473. return err
  8474. }
  8475. }
  8476. if err := iprot.ReadFieldEnd(ctx); err != nil {
  8477. return err
  8478. }
  8479. }
  8480. if err := iprot.ReadStructEnd(ctx); err != nil {
  8481. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  8482. }
  8483. return nil
  8484. }
  8485. func (p *ChannelServiceUpdateChannelNotificationSettingResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  8486. p.E = &ChannelException{}
  8487. if err := p.E.Read(ctx, iprot); err != nil {
  8488. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  8489. }
  8490. return nil
  8491. }
  8492. func (p *ChannelServiceUpdateChannelNotificationSettingResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  8493. if err := oprot.WriteStructBegin(ctx, "updateChannelNotificationSetting_result"); err != nil {
  8494. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  8495. if p != nil {
  8496. if err := p.writeField1(ctx, oprot); err != nil { return err }
  8497. }
  8498. if err := oprot.WriteFieldStop(ctx); err != nil {
  8499. return thrift.PrependError("write field stop error: ", err) }
  8500. if err := oprot.WriteStructEnd(ctx); err != nil {
  8501. return thrift.PrependError("write struct stop error: ", err) }
  8502. return nil
  8503. }
  8504. func (p *ChannelServiceUpdateChannelNotificationSettingResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8505. if p.IsSetE() {
  8506. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  8507. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  8508. if err := p.E.Write(ctx, oprot); err != nil {
  8509. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  8510. }
  8511. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8512. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  8513. }
  8514. return err
  8515. }
  8516. func (p *ChannelServiceUpdateChannelNotificationSettingResult) String() string {
  8517. if p == nil {
  8518. return "<nil>"
  8519. }
  8520. return fmt.Sprintf("ChannelServiceUpdateChannelNotificationSettingResult(%+v)", *p)
  8521. }
  8522. // Attributes:
  8523. // - ChannelSettings
  8524. type ChannelServiceUpdateChannelSettingsArgs struct {
  8525. ChannelSettings *ChannelSettings `thrift:"channelSettings,1" db:"channelSettings" json:"channelSettings"`
  8526. }
  8527. func NewChannelServiceUpdateChannelSettingsArgs() *ChannelServiceUpdateChannelSettingsArgs {
  8528. return &ChannelServiceUpdateChannelSettingsArgs{}
  8529. }
  8530. var ChannelServiceUpdateChannelSettingsArgs_ChannelSettings_DEFAULT *ChannelSettings
  8531. func (p *ChannelServiceUpdateChannelSettingsArgs) GetChannelSettings() *ChannelSettings {
  8532. if !p.IsSetChannelSettings() {
  8533. return ChannelServiceUpdateChannelSettingsArgs_ChannelSettings_DEFAULT
  8534. }
  8535. return p.ChannelSettings
  8536. }
  8537. func (p *ChannelServiceUpdateChannelSettingsArgs) IsSetChannelSettings() bool {
  8538. return p.ChannelSettings != nil
  8539. }
  8540. func (p *ChannelServiceUpdateChannelSettingsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
  8541. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  8542. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  8543. }
  8544. for {
  8545. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  8546. if err != nil {
  8547. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  8548. }
  8549. if fieldTypeId == thrift.STOP { break; }
  8550. switch fieldId {
  8551. case 1:
  8552. if fieldTypeId == thrift.STRUCT {
  8553. if err := p.ReadField1(ctx, iprot); err != nil {
  8554. return err
  8555. }
  8556. } else {
  8557. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8558. return err
  8559. }
  8560. }
  8561. default:
  8562. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8563. return err
  8564. }
  8565. }
  8566. if err := iprot.ReadFieldEnd(ctx); err != nil {
  8567. return err
  8568. }
  8569. }
  8570. if err := iprot.ReadStructEnd(ctx); err != nil {
  8571. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  8572. }
  8573. return nil
  8574. }
  8575. func (p *ChannelServiceUpdateChannelSettingsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  8576. p.ChannelSettings = &ChannelSettings{}
  8577. if err := p.ChannelSettings.Read(ctx, iprot); err != nil {
  8578. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ChannelSettings), err)
  8579. }
  8580. return nil
  8581. }
  8582. func (p *ChannelServiceUpdateChannelSettingsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
  8583. if err := oprot.WriteStructBegin(ctx, "updateChannelSettings_args"); err != nil {
  8584. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  8585. if p != nil {
  8586. if err := p.writeField1(ctx, oprot); err != nil { return err }
  8587. }
  8588. if err := oprot.WriteFieldStop(ctx); err != nil {
  8589. return thrift.PrependError("write field stop error: ", err) }
  8590. if err := oprot.WriteStructEnd(ctx); err != nil {
  8591. return thrift.PrependError("write struct stop error: ", err) }
  8592. return nil
  8593. }
  8594. func (p *ChannelServiceUpdateChannelSettingsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8595. if err := oprot.WriteFieldBegin(ctx, "channelSettings", thrift.STRUCT, 1); err != nil {
  8596. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:channelSettings: ", p), err) }
  8597. if err := p.ChannelSettings.Write(ctx, oprot); err != nil {
  8598. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ChannelSettings), err)
  8599. }
  8600. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8601. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:channelSettings: ", p), err) }
  8602. return err
  8603. }
  8604. func (p *ChannelServiceUpdateChannelSettingsArgs) String() string {
  8605. if p == nil {
  8606. return "<nil>"
  8607. }
  8608. return fmt.Sprintf("ChannelServiceUpdateChannelSettingsArgs(%+v)", *p)
  8609. }
  8610. // Attributes:
  8611. // - Success
  8612. // - E
  8613. type ChannelServiceUpdateChannelSettingsResult struct {
  8614. Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  8615. E *ChannelException `thrift:"e,1" db:"e" json:"e,omitempty"`
  8616. }
  8617. func NewChannelServiceUpdateChannelSettingsResult() *ChannelServiceUpdateChannelSettingsResult {
  8618. return &ChannelServiceUpdateChannelSettingsResult{}
  8619. }
  8620. var ChannelServiceUpdateChannelSettingsResult_Success_DEFAULT bool
  8621. func (p *ChannelServiceUpdateChannelSettingsResult) GetSuccess() bool {
  8622. if !p.IsSetSuccess() {
  8623. return ChannelServiceUpdateChannelSettingsResult_Success_DEFAULT
  8624. }
  8625. return *p.Success
  8626. }
  8627. var ChannelServiceUpdateChannelSettingsResult_E_DEFAULT *ChannelException
  8628. func (p *ChannelServiceUpdateChannelSettingsResult) GetE() *ChannelException {
  8629. if !p.IsSetE() {
  8630. return ChannelServiceUpdateChannelSettingsResult_E_DEFAULT
  8631. }
  8632. return p.E
  8633. }
  8634. func (p *ChannelServiceUpdateChannelSettingsResult) IsSetSuccess() bool {
  8635. return p.Success != nil
  8636. }
  8637. func (p *ChannelServiceUpdateChannelSettingsResult) IsSetE() bool {
  8638. return p.E != nil
  8639. }
  8640. func (p *ChannelServiceUpdateChannelSettingsResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
  8641. if _, err := iprot.ReadStructBegin(ctx); err != nil {
  8642. return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  8643. }
  8644. for {
  8645. _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
  8646. if err != nil {
  8647. return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
  8648. }
  8649. if fieldTypeId == thrift.STOP { break; }
  8650. switch fieldId {
  8651. case 0:
  8652. if fieldTypeId == thrift.BOOL {
  8653. if err := p.ReadField0(ctx, iprot); err != nil {
  8654. return err
  8655. }
  8656. } else {
  8657. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8658. return err
  8659. }
  8660. }
  8661. case 1:
  8662. if fieldTypeId == thrift.STRUCT {
  8663. if err := p.ReadField1(ctx, iprot); err != nil {
  8664. return err
  8665. }
  8666. } else {
  8667. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8668. return err
  8669. }
  8670. }
  8671. default:
  8672. if err := iprot.Skip(ctx, fieldTypeId); err != nil {
  8673. return err
  8674. }
  8675. }
  8676. if err := iprot.ReadFieldEnd(ctx); err != nil {
  8677. return err
  8678. }
  8679. }
  8680. if err := iprot.ReadStructEnd(ctx); err != nil {
  8681. return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  8682. }
  8683. return nil
  8684. }
  8685. func (p *ChannelServiceUpdateChannelSettingsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
  8686. if v, err := iprot.ReadBool(ctx); err != nil {
  8687. return thrift.PrependError("error reading field 0: ", err)
  8688. } else {
  8689. p.Success = &v
  8690. }
  8691. return nil
  8692. }
  8693. func (p *ChannelServiceUpdateChannelSettingsResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
  8694. p.E = &ChannelException{}
  8695. if err := p.E.Read(ctx, iprot); err != nil {
  8696. return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.E), err)
  8697. }
  8698. return nil
  8699. }
  8700. func (p *ChannelServiceUpdateChannelSettingsResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
  8701. if err := oprot.WriteStructBegin(ctx, "updateChannelSettings_result"); err != nil {
  8702. return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  8703. if p != nil {
  8704. if err := p.writeField0(ctx, oprot); err != nil { return err }
  8705. if err := p.writeField1(ctx, oprot); err != nil { return err }
  8706. }
  8707. if err := oprot.WriteFieldStop(ctx); err != nil {
  8708. return thrift.PrependError("write field stop error: ", err) }
  8709. if err := oprot.WriteStructEnd(ctx); err != nil {
  8710. return thrift.PrependError("write struct stop error: ", err) }
  8711. return nil
  8712. }
  8713. func (p *ChannelServiceUpdateChannelSettingsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8714. if p.IsSetSuccess() {
  8715. if err := oprot.WriteFieldBegin(ctx, "success", thrift.BOOL, 0); err != nil {
  8716. return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
  8717. if err := oprot.WriteBool(ctx, bool(*p.Success)); err != nil {
  8718. return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
  8719. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8720. return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  8721. }
  8722. return err
  8723. }
  8724. func (p *ChannelServiceUpdateChannelSettingsResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
  8725. if p.IsSetE() {
  8726. if err := oprot.WriteFieldBegin(ctx, "e", thrift.STRUCT, 1); err != nil {
  8727. return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:e: ", p), err) }
  8728. if err := p.E.Write(ctx, oprot); err != nil {
  8729. return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.E), err)
  8730. }
  8731. if err := oprot.WriteFieldEnd(ctx); err != nil {
  8732. return thrift.PrependError(fmt.Sprintf("%T write field end error 1:e: ", p), err) }
  8733. }
  8734. return err
  8735. }
  8736. func (p *ChannelServiceUpdateChannelSettingsResult) String() string {
  8737. if p == nil {
  8738. return "<nil>"
  8739. }
  8740. return fmt.Sprintf("ChannelServiceUpdateChannelSettingsResult(%+v)", *p)
  8741. }