notification.m.dart 153 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552
  1. import 'package:fis_jsonrpc/utils.dart';
  2. enum NotificationTypeEnum {
  3. Unknown,
  4. ChatMsgNotification,
  5. TokenReplacedNotification,
  6. DisconnectNotification,
  7. ConnectionNotification,
  8. ExamRecordsFinishedNotification,
  9. RejectApplyConsultationNotification,
  10. CancelInvitingInLiveConsultationNotification,
  11. InviteInLiveConsultationNotification,
  12. ConsultationRemindNotification,
  13. PasswordExpiredWarningNotification,
  14. InviteLiveConsultationNotification,
  15. AcceptLiveConsultationNotification,
  16. RejectLiveConsultationNotification,
  17. InviteLiveConsultationToDeviceNotification,
  18. CancelLiveConsultationNotification,
  19. CloseLiveConsultationNotification,
  20. JoinLiveConsultationNotification,
  21. NetworkErrConsultationNotification,
  22. LeaveConsultationNotification,
  23. JoinInLiveConsultationNotification,
  24. RejectInviteLiveConsultationNotification,
  25. ApplyConsultationNotification,
  26. ApprovalApplyConsultationNotification,
  27. InviteeConsultationNotification,
  28. InviteeApproveApplyConsultationNotification,
  29. InviteeRejectApplyConsultationNotification,
  30. MuteLiveConsultationNotification,
  31. SwitchLiveConsultationVideoNotification,
  32. HeartRateJoinConsultationNotification,
  33. HeartRateLeaveConsultationNotification,
  34. CloseLiveConsultationToDeviceNotification,
  35. CancelLiveConsultationToDeviceNotification,
  36. AnnouncementPublishNotification,
  37. SendInteractiveBoardDataNotification,
  38. DeviceParametersNotification,
  39. DeviceControlledParametersNotification,
  40. EmergencyCallNotification,
  41. EmergencyCallFailedNotification,
  42. InviteLiveCourseNotification,
  43. JoinLiveCourseNotification,
  44. InviteLiveCourseToDeviceNotification,
  45. HeartRateJoinCoNotification,
  46. NetworkErrCourseNotification,
  47. CancelLiveCourseNotification,
  48. MuteLiveCourseNotification,
  49. CancelLiveCourseToDeviceNotification,
  50. CloseLiveCourseNotification,
  51. CloseLiveCourseToDeviceNotification,
  52. HeartRateLeaveCourseNotification,
  53. LeaveCoursenNotification,
  54. SwitchLiveCourseVideoNotification,
  55. ChangeConsultationNotification,
  56. ChangeConsultationToDeviceNotification,
  57. CourcePaySuccessNotification,
  58. CloseConsultationDueToChangeNotification,
  59. CloseConsultationDueToChangeToDeviceNotification,
  60. CourseStatusNotification,
  61. UpgradeNotification,
  62. EducationReStartNotification,
  63. ConsultationReStartNotification,
  64. VersionUpgradeNotification,
  65. StartLiveToDeviceNotification,
  66. CloseLiveToDeviceNotification,
  67. DeviceLiveFinishedNotification,
  68. ModifyDeviceMergedVideoSizeNotification,
  69. DeviceRejectRemoteControlNotification,
  70. DeviceDisconnectRemoteControlNotification,
  71. CancelInvitingInLiveCourseNotification,
  72. StartConsolutionHeartRateToDeviceNotification,
  73. CloseConsolutionHeartRateToDeviceNotification,
  74. ConnectStatusToDeviceNotification,
  75. ConnectStatusToClientNotification,
  76. GetRemoteLogToDeviceNotification,
  77. GetRemoteLogToClientNotification,
  78. StartCourseHeartRateToDeviceNotification,
  79. ExecuteResultNotification,
  80. ProgressBarNotification,
  81. SendCommandToDeviceNotification,
  82. SendResultToClientNotification,
  83. PushDevicePatchToDeviceNotification,
  84. DeviceDownloadPatchProgressToUserNotification,
  85. DevicePrinterResultNotification,
  86. DevicePrinterRequestNotification,
  87. GetRemoteConnectStatusToDeviceNotification,
  88. RestartDeviceNotification,
  89. CancelLogDownloadNotification,
  90. ApplyProbeApplicationSettingNotification,
  91. ProbeApplicationSettingResponseNotification,
  92. MeetingMemberNotification,
  93. MeetingHangupNotification,
  94. RejectMeetingNotification,
  95. StartEducationHeartRateToDeviceNotification,
  96. AcceptMeetingNotification,
  97. SendLiveInteractiveBoardDataNotification,
  98. DeviceJoinLiveCourseNotification,
  99. CloseCourseHeartRateToDeviceNotification,
  100. ChangeShareInLiveCourseNotification,
  101. CourseEntryNotification,
  102. MeetingPendingMemberTimeoutNotification,
  103. ConsultationAnswerTimeout,
  104. SystemSettingSaveAndExitToClientNotification,
  105. RealtimeConsultationMembersNotification,
  106. UploadConsultationDataNotification,
  107. }
  108. class NotificationDTO {
  109. NotificationTypeEnum notificationType;
  110. String? code;
  111. bool isResponse;
  112. NotificationDTO({
  113. this.notificationType = NotificationTypeEnum.Unknown,
  114. this.code,
  115. this.isResponse = false,
  116. });
  117. factory NotificationDTO.fromJson(Map<String, dynamic> map) {
  118. return NotificationDTO(
  119. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  120. code: map['Code'],
  121. isResponse: map['IsResponse'],
  122. );
  123. }
  124. Map<String, dynamic> toJson() {
  125. final map = Map<String, dynamic>();
  126. map['NotificationType'] = notificationType.index;
  127. if (code != null) {
  128. map['Code'] = code;
  129. }
  130. map['IsResponse'] = isResponse;
  131. return map;
  132. }
  133. }
  134. enum ControlDeviceParameterEnum {
  135. Start,
  136. End,
  137. RunExecuteApi,
  138. ExecuteProbeApplicationSetting,
  139. RejectConnect,
  140. EndRunExecuteApi,
  141. Get,
  142. UserTimeout,
  143. UpdateProbeApplication,
  144. UpdateAndExitProbeApplication,
  145. ExitProbeApplication,
  146. GetProbeApplication,
  147. }
  148. enum LoginSource {
  149. PC,
  150. Mobile,
  151. Pad,
  152. Web,
  153. US,
  154. }
  155. class ApplyProbeApplicationSettingNotification extends NotificationDTO{
  156. String? userCode;
  157. ControlDeviceParameterEnum controlType;
  158. LoginSource loginSource;
  159. String? deviceCode;
  160. String? controlUserName;
  161. ApplyProbeApplicationSettingNotification({
  162. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  163. this.userCode,
  164. this.controlType = ControlDeviceParameterEnum.Start,
  165. this.loginSource = LoginSource.PC,
  166. this.deviceCode,
  167. this.controlUserName,
  168. String? code,
  169. bool isResponse = false,
  170. }) : super(
  171. notificationType: notificationType,
  172. code: code,
  173. isResponse: isResponse,
  174. );
  175. factory ApplyProbeApplicationSettingNotification.fromJson(Map<String, dynamic> map) {
  176. return ApplyProbeApplicationSettingNotification(
  177. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  178. userCode: map['UserCode'],
  179. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  180. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  181. deviceCode: map['DeviceCode'],
  182. controlUserName: map['ControlUserName'],
  183. code: map['Code'],
  184. isResponse: map['IsResponse'],
  185. );
  186. }
  187. Map<String, dynamic> toJson() {
  188. final map = super.toJson();
  189. if (userCode != null)
  190. map['UserCode'] = userCode;
  191. map['ControlType'] = controlType.index;
  192. map['LoginSource'] = loginSource.index;
  193. if (deviceCode != null)
  194. map['DeviceCode'] = deviceCode;
  195. if (controlUserName != null)
  196. map['ControlUserName'] = controlUserName;
  197. return map;
  198. }
  199. }
  200. class SendCommandToDeviceNotification extends NotificationDTO{
  201. String? actionType;
  202. String? resultCode;
  203. String? sender;
  204. String? deviceCode;
  205. String? operatorCode;
  206. SendCommandToDeviceNotification({
  207. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  208. this.actionType,
  209. this.resultCode,
  210. this.sender,
  211. this.deviceCode,
  212. this.operatorCode,
  213. String? code,
  214. bool isResponse = false,
  215. }) : super(
  216. notificationType: notificationType,
  217. code: code,
  218. isResponse: isResponse,
  219. );
  220. factory SendCommandToDeviceNotification.fromJson(Map<String, dynamic> map) {
  221. return SendCommandToDeviceNotification(
  222. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  223. actionType: map['ActionType'],
  224. resultCode: map['ResultCode'],
  225. sender: map['Sender'],
  226. deviceCode: map['DeviceCode'],
  227. operatorCode: map['OperatorCode'],
  228. code: map['Code'],
  229. isResponse: map['IsResponse'],
  230. );
  231. }
  232. Map<String, dynamic> toJson() {
  233. final map = super.toJson();
  234. if (actionType != null)
  235. map['ActionType'] = actionType;
  236. if (resultCode != null)
  237. map['ResultCode'] = resultCode;
  238. if (sender != null)
  239. map['Sender'] = sender;
  240. if (deviceCode != null)
  241. map['DeviceCode'] = deviceCode;
  242. if (operatorCode != null)
  243. map['OperatorCode'] = operatorCode;
  244. return map;
  245. }
  246. }
  247. class SendResultToClientNotification extends NotificationDTO{
  248. String? resultCode;
  249. String? sender;
  250. SendResultToClientNotification({
  251. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  252. this.resultCode,
  253. this.sender,
  254. String? code,
  255. bool isResponse = false,
  256. }) : super(
  257. notificationType: notificationType,
  258. code: code,
  259. isResponse: isResponse,
  260. );
  261. factory SendResultToClientNotification.fromJson(Map<String, dynamic> map) {
  262. return SendResultToClientNotification(
  263. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  264. resultCode: map['ResultCode'],
  265. sender: map['Sender'],
  266. code: map['Code'],
  267. isResponse: map['IsResponse'],
  268. );
  269. }
  270. Map<String, dynamic> toJson() {
  271. final map = super.toJson();
  272. if (resultCode != null)
  273. map['ResultCode'] = resultCode;
  274. if (sender != null)
  275. map['Sender'] = sender;
  276. return map;
  277. }
  278. }
  279. class SystemSettingSaveAndExitToClientNotification extends NotificationDTO{
  280. String? resultCode;
  281. String? sender;
  282. SystemSettingSaveAndExitToClientNotification({
  283. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  284. this.resultCode,
  285. this.sender,
  286. String? code,
  287. bool isResponse = false,
  288. }) : super(
  289. notificationType: notificationType,
  290. code: code,
  291. isResponse: isResponse,
  292. );
  293. factory SystemSettingSaveAndExitToClientNotification.fromJson(Map<String, dynamic> map) {
  294. return SystemSettingSaveAndExitToClientNotification(
  295. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  296. resultCode: map['ResultCode'],
  297. sender: map['Sender'],
  298. code: map['Code'],
  299. isResponse: map['IsResponse'],
  300. );
  301. }
  302. Map<String, dynamic> toJson() {
  303. final map = super.toJson();
  304. if (resultCode != null)
  305. map['ResultCode'] = resultCode;
  306. if (sender != null)
  307. map['Sender'] = sender;
  308. return map;
  309. }
  310. }
  311. enum AnnouncementTypeEnum {
  312. placeHolder_0,
  313. Broadcast,
  314. Maintenance,
  315. Carousel,
  316. Information,
  317. OperateVideo,
  318. Question,
  319. }
  320. class AnnouncementLanguageConfigDTO {
  321. String? language;
  322. String? title;
  323. String? content;
  324. AnnouncementLanguageConfigDTO({
  325. this.language,
  326. this.title,
  327. this.content,
  328. });
  329. factory AnnouncementLanguageConfigDTO.fromJson(Map<String, dynamic> map) {
  330. return AnnouncementLanguageConfigDTO(
  331. language: map['Language'],
  332. title: map['Title'],
  333. content: map['Content'],
  334. );
  335. }
  336. Map<String, dynamic> toJson() {
  337. final map = Map<String, dynamic>();
  338. if (language != null) {
  339. map['Language'] = language;
  340. }
  341. if (title != null) {
  342. map['Title'] = title;
  343. }
  344. if (content != null) {
  345. map['Content'] = content;
  346. }
  347. return map;
  348. }
  349. }
  350. class AnnouncementNotification extends NotificationDTO{
  351. AnnouncementTypeEnum announcementType;
  352. List<AnnouncementLanguageConfigDTO>? announcementLanguageConfigs;
  353. AnnouncementNotification({
  354. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  355. this.announcementType = AnnouncementTypeEnum.Broadcast,
  356. this.announcementLanguageConfigs,
  357. String? code,
  358. bool isResponse = false,
  359. }) : super(
  360. notificationType: notificationType,
  361. code: code,
  362. isResponse: isResponse,
  363. );
  364. factory AnnouncementNotification.fromJson(Map<String, dynamic> map) {
  365. return AnnouncementNotification(
  366. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  367. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  368. announcementLanguageConfigs: map['AnnouncementLanguageConfigs'] != null ? (map['AnnouncementLanguageConfigs'] as List).map((e)=>AnnouncementLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  369. code: map['Code'],
  370. isResponse: map['IsResponse'],
  371. );
  372. }
  373. Map<String, dynamic> toJson() {
  374. final map = super.toJson();
  375. map['AnnouncementType'] = announcementType.index;
  376. if (announcementLanguageConfigs != null)
  377. map['AnnouncementLanguageConfigs'] = announcementLanguageConfigs;
  378. return map;
  379. }
  380. }
  381. enum ChatCmdEnum {
  382. Txt,
  383. Image,
  384. MP4,
  385. Voice,
  386. Cases,
  387. ShareLive,
  388. VideoCall,
  389. VoiceCall,
  390. }
  391. class ChatMsgNotification extends NotificationDTO{
  392. String? userCode;
  393. String? displayName;
  394. String? headImg;
  395. ChatCmdEnum chatCmd;
  396. DateTime? sendTime;
  397. String? message;
  398. ChatMsgNotification({
  399. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  400. this.userCode,
  401. this.displayName,
  402. this.headImg,
  403. this.chatCmd = ChatCmdEnum.Txt,
  404. this.sendTime,
  405. this.message,
  406. String? code,
  407. bool isResponse = false,
  408. }) : super(
  409. notificationType: notificationType,
  410. code: code,
  411. isResponse: isResponse,
  412. );
  413. factory ChatMsgNotification.fromJson(Map<String, dynamic> map) {
  414. return ChatMsgNotification(
  415. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  416. userCode: map['UserCode'],
  417. displayName: map['DisplayName'],
  418. headImg: map['HeadImg'],
  419. chatCmd: ChatCmdEnum.values.firstWhere((e) => e.index == map['ChatCmd']),
  420. sendTime: map['SendTime'] != null ? DateTime.parse(map['SendTime']) : null,
  421. message: map['Message'],
  422. code: map['Code'],
  423. isResponse: map['IsResponse'],
  424. );
  425. }
  426. Map<String, dynamic> toJson() {
  427. final map = super.toJson();
  428. if (userCode != null)
  429. map['UserCode'] = userCode;
  430. if (displayName != null)
  431. map['DisplayName'] = displayName;
  432. if (headImg != null)
  433. map['HeadImg'] = headImg;
  434. map['ChatCmd'] = chatCmd.index;
  435. if (sendTime != null)
  436. map['SendTime'] = JsonRpcUtils.dateFormat(sendTime!);
  437. if (message != null)
  438. map['Message'] = message;
  439. return map;
  440. }
  441. }
  442. class ConnectionNotification extends NotificationDTO{
  443. ConnectionNotification({
  444. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  445. String? code,
  446. bool isResponse = false,
  447. }) : super(
  448. notificationType: notificationType,
  449. code: code,
  450. isResponse: isResponse,
  451. );
  452. factory ConnectionNotification.fromJson(Map<String, dynamic> map) {
  453. return ConnectionNotification(
  454. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  455. code: map['Code'],
  456. isResponse: map['IsResponse'],
  457. );
  458. }
  459. Map<String, dynamic> toJson() {
  460. final map = super.toJson();
  461. return map;
  462. }
  463. }
  464. class AdditionParameterDTO {
  465. String? parameterName;
  466. String? parameterType;
  467. String? parameterValue;
  468. AdditionParameterDTO({
  469. this.parameterName,
  470. this.parameterType,
  471. this.parameterValue,
  472. });
  473. factory AdditionParameterDTO.fromJson(Map<String, dynamic> map) {
  474. return AdditionParameterDTO(
  475. parameterName: map['ParameterName'],
  476. parameterType: map['ParameterType'],
  477. parameterValue: map['ParameterValue'],
  478. );
  479. }
  480. Map<String, dynamic> toJson() {
  481. final map = Map<String, dynamic>();
  482. if (parameterName != null) {
  483. map['ParameterName'] = parameterName;
  484. }
  485. if (parameterType != null) {
  486. map['ParameterType'] = parameterType;
  487. }
  488. if (parameterValue != null) {
  489. map['ParameterValue'] = parameterValue;
  490. }
  491. return map;
  492. }
  493. }
  494. class DeviceControlledParametersNotification extends NotificationDTO{
  495. String? controlUserCode;
  496. String? controlUserName;
  497. ControlDeviceParameterEnum controlType;
  498. List<AdditionParameterDTO>? parameters;
  499. LoginSource loginSource;
  500. String? deviceCode;
  501. DeviceControlledParametersNotification({
  502. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  503. this.controlUserCode,
  504. this.controlUserName,
  505. this.controlType = ControlDeviceParameterEnum.Start,
  506. this.parameters,
  507. this.loginSource = LoginSource.PC,
  508. this.deviceCode,
  509. String? code,
  510. bool isResponse = false,
  511. }) : super(
  512. notificationType: notificationType,
  513. code: code,
  514. isResponse: isResponse,
  515. );
  516. factory DeviceControlledParametersNotification.fromJson(Map<String, dynamic> map) {
  517. return DeviceControlledParametersNotification(
  518. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  519. controlUserCode: map['ControlUserCode'],
  520. controlUserName: map['ControlUserName'],
  521. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  522. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  523. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  524. deviceCode: map['DeviceCode'],
  525. code: map['Code'],
  526. isResponse: map['IsResponse'],
  527. );
  528. }
  529. Map<String, dynamic> toJson() {
  530. final map = super.toJson();
  531. if (controlUserCode != null)
  532. map['ControlUserCode'] = controlUserCode;
  533. if (controlUserName != null)
  534. map['ControlUserName'] = controlUserName;
  535. map['ControlType'] = controlType.index;
  536. if (parameters != null)
  537. map['Parameters'] = parameters;
  538. map['LoginSource'] = loginSource.index;
  539. if (deviceCode != null)
  540. map['DeviceCode'] = deviceCode;
  541. return map;
  542. }
  543. }
  544. enum RemoteDeviceStateEnum {
  545. Unknown,
  546. Success,
  547. Fail,
  548. DownloadPatchFail,
  549. CancelDownloadPatch,
  550. LogDownloaddFail,
  551. DeviceCancelLogDownload,
  552. DeviceDisconnect,
  553. DeviceTimeOutDisconnect,
  554. DownloadPatching,
  555. UserTimeOutDisconnect,
  556. ProbeApplicationSettingFail,
  557. ChangeDeviceOrganization,
  558. }
  559. class DeviceDisconnectRemoteControlNotification extends NotificationDTO{
  560. String? deviceCode;
  561. RemoteDeviceStateEnum remoteDeviceState;
  562. DeviceDisconnectRemoteControlNotification({
  563. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  564. this.deviceCode,
  565. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  566. String? code,
  567. bool isResponse = false,
  568. }) : super(
  569. notificationType: notificationType,
  570. code: code,
  571. isResponse: isResponse,
  572. );
  573. factory DeviceDisconnectRemoteControlNotification.fromJson(Map<String, dynamic> map) {
  574. return DeviceDisconnectRemoteControlNotification(
  575. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  576. deviceCode: map['DeviceCode'],
  577. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  578. code: map['Code'],
  579. isResponse: map['IsResponse'],
  580. );
  581. }
  582. Map<String, dynamic> toJson() {
  583. final map = super.toJson();
  584. if (deviceCode != null)
  585. map['DeviceCode'] = deviceCode;
  586. map['RemoteDeviceState'] = remoteDeviceState.index;
  587. return map;
  588. }
  589. }
  590. class DeviceParametersNotification extends NotificationDTO{
  591. String? deviceCode;
  592. DeviceParametersNotification({
  593. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  594. this.deviceCode,
  595. String? code,
  596. bool isResponse = false,
  597. }) : super(
  598. notificationType: notificationType,
  599. code: code,
  600. isResponse: isResponse,
  601. );
  602. factory DeviceParametersNotification.fromJson(Map<String, dynamic> map) {
  603. return DeviceParametersNotification(
  604. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  605. deviceCode: map['DeviceCode'],
  606. code: map['Code'],
  607. isResponse: map['IsResponse'],
  608. );
  609. }
  610. Map<String, dynamic> toJson() {
  611. final map = super.toJson();
  612. if (deviceCode != null)
  613. map['DeviceCode'] = deviceCode;
  614. return map;
  615. }
  616. }
  617. class DeviceRejectRemoteControlNotification extends NotificationDTO{
  618. String? deviceCode;
  619. DeviceRejectRemoteControlNotification({
  620. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  621. this.deviceCode,
  622. String? code,
  623. bool isResponse = false,
  624. }) : super(
  625. notificationType: notificationType,
  626. code: code,
  627. isResponse: isResponse,
  628. );
  629. factory DeviceRejectRemoteControlNotification.fromJson(Map<String, dynamic> map) {
  630. return DeviceRejectRemoteControlNotification(
  631. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  632. deviceCode: map['DeviceCode'],
  633. code: map['Code'],
  634. isResponse: map['IsResponse'],
  635. );
  636. }
  637. Map<String, dynamic> toJson() {
  638. final map = super.toJson();
  639. if (deviceCode != null)
  640. map['DeviceCode'] = deviceCode;
  641. return map;
  642. }
  643. }
  644. class DisconnectNotification extends NotificationDTO{
  645. DisconnectNotification({
  646. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  647. String? code,
  648. bool isResponse = false,
  649. }) : super(
  650. notificationType: notificationType,
  651. code: code,
  652. isResponse: isResponse,
  653. );
  654. factory DisconnectNotification.fromJson(Map<String, dynamic> map) {
  655. return DisconnectNotification(
  656. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  657. code: map['Code'],
  658. isResponse: map['IsResponse'],
  659. );
  660. }
  661. Map<String, dynamic> toJson() {
  662. final map = super.toJson();
  663. return map;
  664. }
  665. }
  666. class ExamRecordsFinishedNotification extends NotificationDTO{
  667. List<String>? codes;
  668. ExamRecordsFinishedNotification({
  669. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  670. this.codes,
  671. String? code,
  672. bool isResponse = false,
  673. }) : super(
  674. notificationType: notificationType,
  675. code: code,
  676. isResponse: isResponse,
  677. );
  678. factory ExamRecordsFinishedNotification.fromJson(Map<String, dynamic> map) {
  679. return ExamRecordsFinishedNotification(
  680. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  681. codes: map['Codes']?.cast<String>().toList(),
  682. code: map['Code'],
  683. isResponse: map['IsResponse'],
  684. );
  685. }
  686. Map<String, dynamic> toJson() {
  687. final map = super.toJson();
  688. if (codes != null)
  689. map['Codes'] = codes;
  690. return map;
  691. }
  692. }
  693. class ExecuteResultNotification extends NotificationDTO{
  694. bool isSuccess;
  695. String? exportFileToken;
  696. ExecuteResultNotification({
  697. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  698. this.isSuccess = false,
  699. this.exportFileToken,
  700. String? code,
  701. bool isResponse = false,
  702. }) : super(
  703. notificationType: notificationType,
  704. code: code,
  705. isResponse: isResponse,
  706. );
  707. factory ExecuteResultNotification.fromJson(Map<String, dynamic> map) {
  708. return ExecuteResultNotification(
  709. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  710. isSuccess: map['IsSuccess'],
  711. exportFileToken: map['ExportFileToken'],
  712. code: map['Code'],
  713. isResponse: map['IsResponse'],
  714. );
  715. }
  716. Map<String, dynamic> toJson() {
  717. final map = super.toJson();
  718. map['IsSuccess'] = isSuccess;
  719. if (exportFileToken != null)
  720. map['ExportFileToken'] = exportFileToken;
  721. return map;
  722. }
  723. }
  724. enum VideoDeviceSourceTypeEnum {
  725. Desktop,
  726. Camera,
  727. }
  728. class VideoDeviceDTO {
  729. String? videoDeviceId;
  730. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  731. int width;
  732. int height;
  733. int outputWidth;
  734. int outputHeight;
  735. int videoFps;
  736. int videoBitrate;
  737. int minVideoBitrate;
  738. VideoDeviceDTO({
  739. this.videoDeviceId,
  740. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  741. this.width = 0,
  742. this.height = 0,
  743. this.outputWidth = 0,
  744. this.outputHeight = 0,
  745. this.videoFps = 0,
  746. this.videoBitrate = 0,
  747. this.minVideoBitrate = 0,
  748. });
  749. factory VideoDeviceDTO.fromJson(Map<String, dynamic> map) {
  750. return VideoDeviceDTO(
  751. videoDeviceId: map['VideoDeviceId'],
  752. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  753. width: map['Width'],
  754. height: map['Height'],
  755. outputWidth: map['OutputWidth'],
  756. outputHeight: map['OutputHeight'],
  757. videoFps: map['VideoFps'],
  758. videoBitrate: map['VideoBitrate'],
  759. minVideoBitrate: map['MinVideoBitrate'],
  760. );
  761. }
  762. Map<String, dynamic> toJson() {
  763. final map = Map<String, dynamic>();
  764. if (videoDeviceId != null) {
  765. map['VideoDeviceId'] = videoDeviceId;
  766. }
  767. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  768. map['Width'] = width;
  769. map['Height'] = height;
  770. map['OutputWidth'] = outputWidth;
  771. map['OutputHeight'] = outputHeight;
  772. map['VideoFps'] = videoFps;
  773. map['VideoBitrate'] = videoBitrate;
  774. map['MinVideoBitrate'] = minVideoBitrate;
  775. return map;
  776. }
  777. }
  778. class ModifyDeviceMergedVideoSizeNotification extends NotificationDTO{
  779. bool mergedChannel;
  780. String? deviceCode;
  781. int mergedVideoOutputWidth;
  782. int mergedVideoOutputHeight;
  783. List<VideoDeviceDTO>? videoDeviceInfos;
  784. ModifyDeviceMergedVideoSizeNotification({
  785. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  786. this.mergedChannel = false,
  787. this.deviceCode,
  788. this.mergedVideoOutputWidth = 0,
  789. this.mergedVideoOutputHeight = 0,
  790. this.videoDeviceInfos,
  791. String? code,
  792. bool isResponse = false,
  793. }) : super(
  794. notificationType: notificationType,
  795. code: code,
  796. isResponse: isResponse,
  797. );
  798. factory ModifyDeviceMergedVideoSizeNotification.fromJson(Map<String, dynamic> map) {
  799. return ModifyDeviceMergedVideoSizeNotification(
  800. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  801. mergedChannel: map['MergedChannel'],
  802. deviceCode: map['DeviceCode'],
  803. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  804. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  805. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  806. code: map['Code'],
  807. isResponse: map['IsResponse'],
  808. );
  809. }
  810. Map<String, dynamic> toJson() {
  811. final map = super.toJson();
  812. map['MergedChannel'] = mergedChannel;
  813. if (deviceCode != null)
  814. map['DeviceCode'] = deviceCode;
  815. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  816. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  817. if (videoDeviceInfos != null)
  818. map['VideoDeviceInfos'] = videoDeviceInfos;
  819. return map;
  820. }
  821. }
  822. class PasswordExpiredWarningNotification extends NotificationDTO{
  823. double surplusTime;
  824. PasswordExpiredWarningNotification({
  825. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  826. this.surplusTime = 0,
  827. String? code,
  828. bool isResponse = false,
  829. }) : super(
  830. notificationType: notificationType,
  831. code: code,
  832. isResponse: isResponse,
  833. );
  834. factory PasswordExpiredWarningNotification.fromJson(Map<String, dynamic> map) {
  835. return PasswordExpiredWarningNotification(
  836. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  837. surplusTime: double.parse(map['SurplusTime'].toString()),
  838. code: map['Code'],
  839. isResponse: map['IsResponse'],
  840. );
  841. }
  842. Map<String, dynamic> toJson() {
  843. final map = super.toJson();
  844. map['SurplusTime'] = surplusTime;
  845. return map;
  846. }
  847. }
  848. class ProgressBarNotification extends NotificationDTO{
  849. int rate;
  850. ProgressBarNotification({
  851. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  852. this.rate = 0,
  853. String? code,
  854. bool isResponse = false,
  855. }) : super(
  856. notificationType: notificationType,
  857. code: code,
  858. isResponse: isResponse,
  859. );
  860. factory ProgressBarNotification.fromJson(Map<String, dynamic> map) {
  861. return ProgressBarNotification(
  862. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  863. rate: map['Rate'],
  864. code: map['Code'],
  865. isResponse: map['IsResponse'],
  866. );
  867. }
  868. Map<String, dynamic> toJson() {
  869. final map = super.toJson();
  870. map['Rate'] = rate;
  871. return map;
  872. }
  873. }
  874. class TokenReplacedNotification extends NotificationDTO{
  875. String? userCode;
  876. TokenReplacedNotification({
  877. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  878. this.userCode,
  879. String? code,
  880. bool isResponse = false,
  881. }) : super(
  882. notificationType: notificationType,
  883. code: code,
  884. isResponse: isResponse,
  885. );
  886. factory TokenReplacedNotification.fromJson(Map<String, dynamic> map) {
  887. return TokenReplacedNotification(
  888. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  889. userCode: map['UserCode'],
  890. code: map['Code'],
  891. isResponse: map['IsResponse'],
  892. );
  893. }
  894. Map<String, dynamic> toJson() {
  895. final map = super.toJson();
  896. if (userCode != null)
  897. map['UserCode'] = userCode;
  898. return map;
  899. }
  900. }
  901. enum UpgradeTypeEnum {
  902. NoUpgrade,
  903. Normal,
  904. Force,
  905. AutoAfterRestart,
  906. }
  907. enum UpgradeUpdateTypeEnum {
  908. Part,
  909. All,
  910. }
  911. class DescriptionInfoDTO {
  912. String? description;
  913. String? languageCode;
  914. DescriptionInfoDTO({
  915. this.description,
  916. this.languageCode,
  917. });
  918. factory DescriptionInfoDTO.fromJson(Map<String, dynamic> map) {
  919. return DescriptionInfoDTO(
  920. description: map['Description'],
  921. languageCode: map['LanguageCode'],
  922. );
  923. }
  924. Map<String, dynamic> toJson() {
  925. final map = Map<String, dynamic>();
  926. if (description != null) {
  927. map['Description'] = description;
  928. }
  929. if (languageCode != null) {
  930. map['LanguageCode'] = languageCode;
  931. }
  932. return map;
  933. }
  934. }
  935. class UpgradeVersionNotification extends NotificationDTO{
  936. UpgradeTypeEnum upgradeType;
  937. String? upgradeCDNUrl;
  938. String? upgradeSourceUrl;
  939. String? backUpCDNUrl;
  940. String? backUpSourceUrl;
  941. UpgradeUpdateTypeEnum upgradeUpdateType;
  942. String? newVersion;
  943. List<DescriptionInfoDTO>? descriptions;
  944. UpgradeVersionNotification({
  945. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  946. this.upgradeType = UpgradeTypeEnum.NoUpgrade,
  947. this.upgradeCDNUrl,
  948. this.upgradeSourceUrl,
  949. this.backUpCDNUrl,
  950. this.backUpSourceUrl,
  951. this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part,
  952. this.newVersion,
  953. this.descriptions,
  954. String? code,
  955. bool isResponse = false,
  956. }) : super(
  957. notificationType: notificationType,
  958. code: code,
  959. isResponse: isResponse,
  960. );
  961. factory UpgradeVersionNotification.fromJson(Map<String, dynamic> map) {
  962. return UpgradeVersionNotification(
  963. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  964. upgradeType: UpgradeTypeEnum.values.firstWhere((e) => e.index == map['UpgradeType']),
  965. upgradeCDNUrl: map['UpgradeCDNUrl'],
  966. upgradeSourceUrl: map['UpgradeSourceUrl'],
  967. backUpCDNUrl: map['BackUpCDNUrl'],
  968. backUpSourceUrl: map['BackUpSourceUrl'],
  969. upgradeUpdateType: UpgradeUpdateTypeEnum.values.firstWhere((e) => e.index == map['UpgradeUpdateType']),
  970. newVersion: map['NewVersion'],
  971. descriptions: map['Descriptions'] != null ? (map['Descriptions'] as List).map((e)=>DescriptionInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  972. code: map['Code'],
  973. isResponse: map['IsResponse'],
  974. );
  975. }
  976. Map<String, dynamic> toJson() {
  977. final map = super.toJson();
  978. map['UpgradeType'] = upgradeType.index;
  979. if (upgradeCDNUrl != null)
  980. map['UpgradeCDNUrl'] = upgradeCDNUrl;
  981. if (upgradeSourceUrl != null)
  982. map['UpgradeSourceUrl'] = upgradeSourceUrl;
  983. if (backUpCDNUrl != null)
  984. map['BackUpCDNUrl'] = backUpCDNUrl;
  985. if (backUpSourceUrl != null)
  986. map['BackUpSourceUrl'] = backUpSourceUrl;
  987. map['UpgradeUpdateType'] = upgradeUpdateType.index;
  988. if (newVersion != null)
  989. map['NewVersion'] = newVersion;
  990. if (descriptions != null)
  991. map['Descriptions'] = descriptions;
  992. return map;
  993. }
  994. }
  995. class CloseLiveToDeviceNotification extends NotificationDTO{
  996. String? liveRoomCode;
  997. String? deviceCode;
  998. String? userCode;
  999. CloseLiveToDeviceNotification({
  1000. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1001. this.liveRoomCode,
  1002. this.deviceCode,
  1003. this.userCode,
  1004. String? code,
  1005. bool isResponse = false,
  1006. }) : super(
  1007. notificationType: notificationType,
  1008. code: code,
  1009. isResponse: isResponse,
  1010. );
  1011. factory CloseLiveToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1012. return CloseLiveToDeviceNotification(
  1013. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1014. liveRoomCode: map['LiveRoomCode'],
  1015. deviceCode: map['DeviceCode'],
  1016. userCode: map['UserCode'],
  1017. code: map['Code'],
  1018. isResponse: map['IsResponse'],
  1019. );
  1020. }
  1021. Map<String, dynamic> toJson() {
  1022. final map = super.toJson();
  1023. if (liveRoomCode != null)
  1024. map['LiveRoomCode'] = liveRoomCode;
  1025. if (deviceCode != null)
  1026. map['DeviceCode'] = deviceCode;
  1027. if (userCode != null)
  1028. map['UserCode'] = userCode;
  1029. return map;
  1030. }
  1031. }
  1032. class ConnectStatusToClientNotification extends NotificationDTO{
  1033. String? deviceCode;
  1034. String? deviceName;
  1035. ControlDeviceParameterEnum controlType;
  1036. RemoteDeviceStateEnum remoteDeviceState;
  1037. ConnectStatusToClientNotification({
  1038. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1039. this.deviceCode,
  1040. this.deviceName,
  1041. this.controlType = ControlDeviceParameterEnum.Start,
  1042. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  1043. String? code,
  1044. bool isResponse = false,
  1045. }) : super(
  1046. notificationType: notificationType,
  1047. code: code,
  1048. isResponse: isResponse,
  1049. );
  1050. factory ConnectStatusToClientNotification.fromJson(Map<String, dynamic> map) {
  1051. return ConnectStatusToClientNotification(
  1052. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1053. deviceCode: map['DeviceCode'],
  1054. deviceName: map['DeviceName'],
  1055. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1056. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  1057. code: map['Code'],
  1058. isResponse: map['IsResponse'],
  1059. );
  1060. }
  1061. Map<String, dynamic> toJson() {
  1062. final map = super.toJson();
  1063. if (deviceCode != null)
  1064. map['DeviceCode'] = deviceCode;
  1065. if (deviceName != null)
  1066. map['DeviceName'] = deviceName;
  1067. map['ControlType'] = controlType.index;
  1068. map['RemoteDeviceState'] = remoteDeviceState.index;
  1069. return map;
  1070. }
  1071. }
  1072. enum TransactionTypeEnum {
  1073. placeHolder_0,
  1074. Consultion,
  1075. Chat,
  1076. Announcement,
  1077. Session,
  1078. RemoteDia,
  1079. ControlParameter,
  1080. Education,
  1081. Upgrade,
  1082. Live,
  1083. AfterSales,
  1084. }
  1085. class ConnectStatusToDeviceNotification extends NotificationDTO{
  1086. String? controlUserCode;
  1087. String? controlUserName;
  1088. ControlDeviceParameterEnum controlType;
  1089. TransactionTypeEnum transactionType;
  1090. LoginSource loginSource;
  1091. String? deviceCode;
  1092. ConnectStatusToDeviceNotification({
  1093. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1094. this.controlUserCode,
  1095. this.controlUserName,
  1096. this.controlType = ControlDeviceParameterEnum.Start,
  1097. this.transactionType = TransactionTypeEnum.Consultion,
  1098. this.loginSource = LoginSource.PC,
  1099. this.deviceCode,
  1100. String? code,
  1101. bool isResponse = false,
  1102. }) : super(
  1103. notificationType: notificationType,
  1104. code: code,
  1105. isResponse: isResponse,
  1106. );
  1107. factory ConnectStatusToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1108. return ConnectStatusToDeviceNotification(
  1109. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1110. controlUserCode: map['ControlUserCode'],
  1111. controlUserName: map['ControlUserName'],
  1112. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1113. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  1114. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  1115. deviceCode: map['DeviceCode'],
  1116. code: map['Code'],
  1117. isResponse: map['IsResponse'],
  1118. );
  1119. }
  1120. Map<String, dynamic> toJson() {
  1121. final map = super.toJson();
  1122. if (controlUserCode != null)
  1123. map['ControlUserCode'] = controlUserCode;
  1124. if (controlUserName != null)
  1125. map['ControlUserName'] = controlUserName;
  1126. map['ControlType'] = controlType.index;
  1127. map['TransactionType'] = transactionType.index;
  1128. map['LoginSource'] = loginSource.index;
  1129. if (deviceCode != null)
  1130. map['DeviceCode'] = deviceCode;
  1131. return map;
  1132. }
  1133. }
  1134. class DeviceLiveFinishedNotification extends NotificationDTO{
  1135. String? liveRoomCode;
  1136. DeviceLiveFinishedNotification({
  1137. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1138. this.liveRoomCode,
  1139. String? code,
  1140. bool isResponse = false,
  1141. }) : super(
  1142. notificationType: notificationType,
  1143. code: code,
  1144. isResponse: isResponse,
  1145. );
  1146. factory DeviceLiveFinishedNotification.fromJson(Map<String, dynamic> map) {
  1147. return DeviceLiveFinishedNotification(
  1148. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1149. liveRoomCode: map['LiveRoomCode'],
  1150. code: map['Code'],
  1151. isResponse: map['IsResponse'],
  1152. );
  1153. }
  1154. Map<String, dynamic> toJson() {
  1155. final map = super.toJson();
  1156. if (liveRoomCode != null)
  1157. map['LiveRoomCode'] = liveRoomCode;
  1158. return map;
  1159. }
  1160. }
  1161. enum TransactionStatusEnum {
  1162. placeHolder_0,
  1163. Applied,
  1164. Withdrawn,
  1165. Rejected,
  1166. ToStart,
  1167. InProgress,
  1168. PendingReport,
  1169. End,
  1170. Embedded,
  1171. Common,
  1172. Tencent,
  1173. TRTC,
  1174. VRTC,
  1175. Expired,
  1176. }
  1177. class LiveData {
  1178. int height;
  1179. int width;
  1180. String? rtmpPushUrl;
  1181. String? rtmpPullUrl;
  1182. String? httpPullUrl;
  1183. String? hlsPullUrl;
  1184. LiveData({
  1185. this.height = 0,
  1186. this.width = 0,
  1187. this.rtmpPushUrl,
  1188. this.rtmpPullUrl,
  1189. this.httpPullUrl,
  1190. this.hlsPullUrl,
  1191. });
  1192. factory LiveData.fromJson(Map<String, dynamic> map) {
  1193. return LiveData(
  1194. height: map['Height'],
  1195. width: map['Width'],
  1196. rtmpPushUrl: map['RtmpPushUrl'],
  1197. rtmpPullUrl: map['RtmpPullUrl'],
  1198. httpPullUrl: map['HttpPullUrl'],
  1199. hlsPullUrl: map['HlsPullUrl'],
  1200. );
  1201. }
  1202. Map<String, dynamic> toJson() {
  1203. final map = Map<String, dynamic>();
  1204. map['Height'] = height;
  1205. map['Width'] = width;
  1206. if (rtmpPushUrl != null) {
  1207. map['RtmpPushUrl'] = rtmpPushUrl;
  1208. }
  1209. if (rtmpPullUrl != null) {
  1210. map['RtmpPullUrl'] = rtmpPullUrl;
  1211. }
  1212. if (httpPullUrl != null) {
  1213. map['HttpPullUrl'] = httpPullUrl;
  1214. }
  1215. if (hlsPullUrl != null) {
  1216. map['HlsPullUrl'] = hlsPullUrl;
  1217. }
  1218. return map;
  1219. }
  1220. }
  1221. class VideoDeviceOutputInfo {
  1222. String? videoDeviceId;
  1223. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  1224. int outputWidth;
  1225. int outputHeight;
  1226. int videoFps;
  1227. int videoBitrate;
  1228. int minVideoBitrate;
  1229. String? videoDeviceSign;
  1230. LiveData? liveData;
  1231. VideoDeviceOutputInfo({
  1232. this.videoDeviceId,
  1233. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  1234. this.outputWidth = 0,
  1235. this.outputHeight = 0,
  1236. this.videoFps = 0,
  1237. this.videoBitrate = 0,
  1238. this.minVideoBitrate = 0,
  1239. this.videoDeviceSign,
  1240. this.liveData,
  1241. });
  1242. factory VideoDeviceOutputInfo.fromJson(Map<String, dynamic> map) {
  1243. return VideoDeviceOutputInfo(
  1244. videoDeviceId: map['VideoDeviceId'],
  1245. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  1246. outputWidth: map['OutputWidth'],
  1247. outputHeight: map['OutputHeight'],
  1248. videoFps: map['VideoFps'],
  1249. videoBitrate: map['VideoBitrate'],
  1250. minVideoBitrate: map['MinVideoBitrate'],
  1251. videoDeviceSign: map['VideoDeviceSign'],
  1252. liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
  1253. );
  1254. }
  1255. Map<String, dynamic> toJson() {
  1256. final map = Map<String, dynamic>();
  1257. if (videoDeviceId != null) {
  1258. map['VideoDeviceId'] = videoDeviceId;
  1259. }
  1260. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  1261. map['OutputWidth'] = outputWidth;
  1262. map['OutputHeight'] = outputHeight;
  1263. map['VideoFps'] = videoFps;
  1264. map['VideoBitrate'] = videoBitrate;
  1265. map['MinVideoBitrate'] = minVideoBitrate;
  1266. if (videoDeviceSign != null) {
  1267. map['VideoDeviceSign'] = videoDeviceSign;
  1268. }
  1269. if (liveData != null) {
  1270. map['LiveData'] = liveData;
  1271. }
  1272. return map;
  1273. }
  1274. }
  1275. class StartLiveToDeviceNotification extends NotificationDTO{
  1276. String? liveRoomCode;
  1277. int roomNo;
  1278. TransactionStatusEnum liveProtocol;
  1279. int appId;
  1280. bool mergedChannel;
  1281. int mergedVideoOutputWidth;
  1282. int mergedVideoOutputHeight;
  1283. List<VideoDeviceOutputInfo>? videoDeviceOutputList;
  1284. String? deviceCode;
  1285. String? deviceSign;
  1286. String? initiatorCode;
  1287. StartLiveToDeviceNotification({
  1288. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1289. this.liveRoomCode,
  1290. this.roomNo = 0,
  1291. this.liveProtocol = TransactionStatusEnum.Applied,
  1292. this.appId = 0,
  1293. this.mergedChannel = false,
  1294. this.mergedVideoOutputWidth = 0,
  1295. this.mergedVideoOutputHeight = 0,
  1296. this.videoDeviceOutputList,
  1297. this.deviceCode,
  1298. this.deviceSign,
  1299. this.initiatorCode,
  1300. String? code,
  1301. bool isResponse = false,
  1302. }) : super(
  1303. notificationType: notificationType,
  1304. code: code,
  1305. isResponse: isResponse,
  1306. );
  1307. factory StartLiveToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1308. return StartLiveToDeviceNotification(
  1309. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1310. liveRoomCode: map['LiveRoomCode'],
  1311. roomNo: map['RoomNo'],
  1312. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  1313. appId: map['AppId'],
  1314. mergedChannel: map['MergedChannel'],
  1315. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  1316. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  1317. videoDeviceOutputList: map['VideoDeviceOutputList'] != null ? (map['VideoDeviceOutputList'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  1318. deviceCode: map['DeviceCode'],
  1319. deviceSign: map['DeviceSign'],
  1320. initiatorCode: map['InitiatorCode'],
  1321. code: map['Code'],
  1322. isResponse: map['IsResponse'],
  1323. );
  1324. }
  1325. Map<String, dynamic> toJson() {
  1326. final map = super.toJson();
  1327. if (liveRoomCode != null)
  1328. map['LiveRoomCode'] = liveRoomCode;
  1329. map['RoomNo'] = roomNo;
  1330. map['LiveProtocol'] = liveProtocol.index;
  1331. map['AppId'] = appId;
  1332. map['MergedChannel'] = mergedChannel;
  1333. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  1334. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  1335. if (videoDeviceOutputList != null)
  1336. map['VideoDeviceOutputList'] = videoDeviceOutputList;
  1337. if (deviceCode != null)
  1338. map['DeviceCode'] = deviceCode;
  1339. if (deviceSign != null)
  1340. map['DeviceSign'] = deviceSign;
  1341. if (initiatorCode != null)
  1342. map['InitiatorCode'] = initiatorCode;
  1343. return map;
  1344. }
  1345. }
  1346. class CancelInvitingInLiveCourseNotification extends NotificationDTO{
  1347. String? courseCode;
  1348. CancelInvitingInLiveCourseNotification({
  1349. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1350. this.courseCode,
  1351. String? code,
  1352. bool isResponse = false,
  1353. }) : super(
  1354. notificationType: notificationType,
  1355. code: code,
  1356. isResponse: isResponse,
  1357. );
  1358. factory CancelInvitingInLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  1359. return CancelInvitingInLiveCourseNotification(
  1360. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1361. courseCode: map['CourseCode'],
  1362. code: map['Code'],
  1363. isResponse: map['IsResponse'],
  1364. );
  1365. }
  1366. Map<String, dynamic> toJson() {
  1367. final map = super.toJson();
  1368. if (courseCode != null)
  1369. map['CourseCode'] = courseCode;
  1370. return map;
  1371. }
  1372. }
  1373. class CancelLiveCourseNotification extends NotificationDTO{
  1374. String? courseCode;
  1375. String? teacherCode;
  1376. CancelLiveCourseNotification({
  1377. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1378. this.courseCode,
  1379. this.teacherCode,
  1380. String? code,
  1381. bool isResponse = false,
  1382. }) : super(
  1383. notificationType: notificationType,
  1384. code: code,
  1385. isResponse: isResponse,
  1386. );
  1387. factory CancelLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  1388. return CancelLiveCourseNotification(
  1389. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1390. courseCode: map['CourseCode'],
  1391. teacherCode: map['TeacherCode'],
  1392. code: map['Code'],
  1393. isResponse: map['IsResponse'],
  1394. );
  1395. }
  1396. Map<String, dynamic> toJson() {
  1397. final map = super.toJson();
  1398. if (courseCode != null)
  1399. map['CourseCode'] = courseCode;
  1400. if (teacherCode != null)
  1401. map['TeacherCode'] = teacherCode;
  1402. return map;
  1403. }
  1404. }
  1405. enum CourseShareStates {
  1406. Opened,
  1407. Closed,
  1408. }
  1409. enum CourseShareType {
  1410. Window,
  1411. US,
  1412. }
  1413. class ShareInfoDTO {
  1414. CourseShareStates currentShareState;
  1415. CourseShareType currentShareType;
  1416. String? currentShareMemberCode;
  1417. String? currentShareMemberName;
  1418. ShareInfoDTO({
  1419. this.currentShareState = CourseShareStates.Opened,
  1420. this.currentShareType = CourseShareType.Window,
  1421. this.currentShareMemberCode,
  1422. this.currentShareMemberName,
  1423. });
  1424. factory ShareInfoDTO.fromJson(Map<String, dynamic> map) {
  1425. return ShareInfoDTO(
  1426. currentShareState: CourseShareStates.values.firstWhere((e) => e.index == map['CurrentShareState']),
  1427. currentShareType: CourseShareType.values.firstWhere((e) => e.index == map['CurrentShareType']),
  1428. currentShareMemberCode: map['CurrentShareMemberCode'],
  1429. currentShareMemberName: map['CurrentShareMemberName'],
  1430. );
  1431. }
  1432. Map<String, dynamic> toJson() {
  1433. final map = Map<String, dynamic>();
  1434. map['CurrentShareState'] = currentShareState.index;
  1435. map['CurrentShareType'] = currentShareType.index;
  1436. if (currentShareMemberCode != null) {
  1437. map['CurrentShareMemberCode'] = currentShareMemberCode;
  1438. }
  1439. if (currentShareMemberName != null) {
  1440. map['CurrentShareMemberName'] = currentShareMemberName;
  1441. }
  1442. return map;
  1443. }
  1444. }
  1445. class ChangeShareInLiveCourseNotification extends NotificationDTO{
  1446. ShareInfoDTO? shareInfo;
  1447. String? courseCode;
  1448. ChangeShareInLiveCourseNotification({
  1449. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1450. this.shareInfo,
  1451. this.courseCode,
  1452. String? code,
  1453. bool isResponse = false,
  1454. }) : super(
  1455. notificationType: notificationType,
  1456. code: code,
  1457. isResponse: isResponse,
  1458. );
  1459. factory ChangeShareInLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  1460. return ChangeShareInLiveCourseNotification(
  1461. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1462. shareInfo: map['ShareInfo'] != null ? ShareInfoDTO.fromJson(map['ShareInfo']) : null,
  1463. courseCode: map['CourseCode'],
  1464. code: map['Code'],
  1465. isResponse: map['IsResponse'],
  1466. );
  1467. }
  1468. Map<String, dynamic> toJson() {
  1469. final map = super.toJson();
  1470. if (shareInfo != null)
  1471. map['ShareInfo'] = shareInfo;
  1472. if (courseCode != null)
  1473. map['CourseCode'] = courseCode;
  1474. return map;
  1475. }
  1476. }
  1477. class CloseLiveCourseNotification extends NotificationDTO{
  1478. String? courseCode;
  1479. String? teacherCode;
  1480. CloseLiveCourseNotification({
  1481. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1482. this.courseCode,
  1483. this.teacherCode,
  1484. String? code,
  1485. bool isResponse = false,
  1486. }) : super(
  1487. notificationType: notificationType,
  1488. code: code,
  1489. isResponse: isResponse,
  1490. );
  1491. factory CloseLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  1492. return CloseLiveCourseNotification(
  1493. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1494. courseCode: map['CourseCode'],
  1495. teacherCode: map['TeacherCode'],
  1496. code: map['Code'],
  1497. isResponse: map['IsResponse'],
  1498. );
  1499. }
  1500. Map<String, dynamic> toJson() {
  1501. final map = super.toJson();
  1502. if (courseCode != null)
  1503. map['CourseCode'] = courseCode;
  1504. if (teacherCode != null)
  1505. map['TeacherCode'] = teacherCode;
  1506. return map;
  1507. }
  1508. }
  1509. class CloseCourseHeartRateToDeviceNotification extends NotificationDTO{
  1510. String? liveRoomCode;
  1511. CloseCourseHeartRateToDeviceNotification({
  1512. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1513. this.liveRoomCode,
  1514. String? code,
  1515. bool isResponse = false,
  1516. }) : super(
  1517. notificationType: notificationType,
  1518. code: code,
  1519. isResponse: isResponse,
  1520. );
  1521. factory CloseCourseHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1522. return CloseCourseHeartRateToDeviceNotification(
  1523. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1524. liveRoomCode: map['LiveRoomCode'],
  1525. code: map['Code'],
  1526. isResponse: map['IsResponse'],
  1527. );
  1528. }
  1529. Map<String, dynamic> toJson() {
  1530. final map = super.toJson();
  1531. if (liveRoomCode != null)
  1532. map['LiveRoomCode'] = liveRoomCode;
  1533. return map;
  1534. }
  1535. }
  1536. class StartEducationHeartRateToDeviceNotification extends NotificationDTO{
  1537. String? liveRoomCode;
  1538. TransactionStatusEnum liveProtocol;
  1539. int intervalSeconds;
  1540. StartEducationHeartRateToDeviceNotification({
  1541. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1542. this.liveRoomCode,
  1543. this.liveProtocol = TransactionStatusEnum.Applied,
  1544. this.intervalSeconds = 0,
  1545. String? code,
  1546. bool isResponse = false,
  1547. }) : super(
  1548. notificationType: notificationType,
  1549. code: code,
  1550. isResponse: isResponse,
  1551. );
  1552. factory StartEducationHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1553. return StartEducationHeartRateToDeviceNotification(
  1554. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1555. liveRoomCode: map['LiveRoomCode'],
  1556. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  1557. intervalSeconds: map['IntervalSeconds'],
  1558. code: map['Code'],
  1559. isResponse: map['IsResponse'],
  1560. );
  1561. }
  1562. Map<String, dynamic> toJson() {
  1563. final map = super.toJson();
  1564. if (liveRoomCode != null)
  1565. map['LiveRoomCode'] = liveRoomCode;
  1566. map['LiveProtocol'] = liveProtocol.index;
  1567. map['IntervalSeconds'] = intervalSeconds;
  1568. return map;
  1569. }
  1570. }
  1571. class CourcePaySuccessNotification extends NotificationDTO{
  1572. String? paymentOrderCode;
  1573. String? orderTitle;
  1574. double orderAmount;
  1575. DateTime? payTime;
  1576. CourcePaySuccessNotification({
  1577. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1578. this.paymentOrderCode,
  1579. this.orderTitle,
  1580. this.orderAmount = 0,
  1581. this.payTime,
  1582. String? code,
  1583. bool isResponse = false,
  1584. }) : super(
  1585. notificationType: notificationType,
  1586. code: code,
  1587. isResponse: isResponse,
  1588. );
  1589. factory CourcePaySuccessNotification.fromJson(Map<String, dynamic> map) {
  1590. return CourcePaySuccessNotification(
  1591. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1592. paymentOrderCode: map['PaymentOrderCode'],
  1593. orderTitle: map['OrderTitle'],
  1594. orderAmount: double.parse(map['OrderAmount'].toString()),
  1595. payTime: map['PayTime'] != null ? DateTime.parse(map['PayTime']) : null,
  1596. code: map['Code'],
  1597. isResponse: map['IsResponse'],
  1598. );
  1599. }
  1600. Map<String, dynamic> toJson() {
  1601. final map = super.toJson();
  1602. if (paymentOrderCode != null)
  1603. map['PaymentOrderCode'] = paymentOrderCode;
  1604. if (orderTitle != null)
  1605. map['OrderTitle'] = orderTitle;
  1606. map['OrderAmount'] = orderAmount;
  1607. if (payTime != null)
  1608. map['PayTime'] = JsonRpcUtils.dateFormat(payTime!);
  1609. return map;
  1610. }
  1611. }
  1612. class CourseEntryNotification extends NotificationDTO{
  1613. String? noticeData;
  1614. CourseEntryNotification({
  1615. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1616. this.noticeData,
  1617. String? code,
  1618. bool isResponse = false,
  1619. }) : super(
  1620. notificationType: notificationType,
  1621. code: code,
  1622. isResponse: isResponse,
  1623. );
  1624. factory CourseEntryNotification.fromJson(Map<String, dynamic> map) {
  1625. return CourseEntryNotification(
  1626. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1627. noticeData: map['NoticeData'],
  1628. code: map['Code'],
  1629. isResponse: map['IsResponse'],
  1630. );
  1631. }
  1632. Map<String, dynamic> toJson() {
  1633. final map = super.toJson();
  1634. if (noticeData != null)
  1635. map['NoticeData'] = noticeData;
  1636. return map;
  1637. }
  1638. }
  1639. enum CourseStatusEnum {
  1640. Unknown,
  1641. NoApproval,
  1642. Approved,
  1643. RejectApproval,
  1644. Started,
  1645. HasEnded,
  1646. HasCancelled,
  1647. Overdue,
  1648. Offline,
  1649. }
  1650. class CourseStatusNotification extends NotificationDTO{
  1651. CourseStatusEnum status;
  1652. String? courseCode;
  1653. String? courseName;
  1654. CourseStatusNotification({
  1655. this.status = CourseStatusEnum.Unknown,
  1656. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1657. this.courseCode,
  1658. this.courseName,
  1659. String? code,
  1660. bool isResponse = false,
  1661. }) : super(
  1662. notificationType: notificationType,
  1663. code: code,
  1664. isResponse: isResponse,
  1665. );
  1666. factory CourseStatusNotification.fromJson(Map<String, dynamic> map) {
  1667. return CourseStatusNotification(
  1668. status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  1669. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1670. courseCode: map['CourseCode'],
  1671. courseName: map['CourseName'],
  1672. code: map['Code'],
  1673. isResponse: map['IsResponse'],
  1674. );
  1675. }
  1676. Map<String, dynamic> toJson() {
  1677. final map = super.toJson();
  1678. map['Status'] = status.index;
  1679. if (courseCode != null)
  1680. map['CourseCode'] = courseCode;
  1681. if (courseName != null)
  1682. map['CourseName'] = courseName;
  1683. return map;
  1684. }
  1685. }
  1686. enum LiveMemberEnum {
  1687. placeHolder_0,
  1688. User,
  1689. Device,
  1690. }
  1691. enum UserStatusEnum {
  1692. placeHolder_0,
  1693. NotOnline,
  1694. IsBusy,
  1695. Idle,
  1696. }
  1697. enum LiveMemberStatus {
  1698. Default,
  1699. Accepted,
  1700. Rejected,
  1701. Joined,
  1702. Left,
  1703. }
  1704. class LiveDataDTO {
  1705. int width;
  1706. int height;
  1707. String? rtmpPushUrl;
  1708. String? rtmpPullUrl;
  1709. String? httpPullUrl;
  1710. String? hlsPullUrl;
  1711. LiveDataDTO({
  1712. this.width = 0,
  1713. this.height = 0,
  1714. this.rtmpPushUrl,
  1715. this.rtmpPullUrl,
  1716. this.httpPullUrl,
  1717. this.hlsPullUrl,
  1718. });
  1719. factory LiveDataDTO.fromJson(Map<String, dynamic> map) {
  1720. return LiveDataDTO(
  1721. width: map['Width'],
  1722. height: map['Height'],
  1723. rtmpPushUrl: map['RtmpPushUrl'],
  1724. rtmpPullUrl: map['RtmpPullUrl'],
  1725. httpPullUrl: map['HttpPullUrl'],
  1726. hlsPullUrl: map['HlsPullUrl'],
  1727. );
  1728. }
  1729. Map<String, dynamic> toJson() {
  1730. final map = Map<String, dynamic>();
  1731. map['Width'] = width;
  1732. map['Height'] = height;
  1733. if (rtmpPushUrl != null) {
  1734. map['RtmpPushUrl'] = rtmpPushUrl;
  1735. }
  1736. if (rtmpPullUrl != null) {
  1737. map['RtmpPullUrl'] = rtmpPullUrl;
  1738. }
  1739. if (httpPullUrl != null) {
  1740. map['HttpPullUrl'] = httpPullUrl;
  1741. }
  1742. if (hlsPullUrl != null) {
  1743. map['HlsPullUrl'] = hlsPullUrl;
  1744. }
  1745. return map;
  1746. }
  1747. }
  1748. class LiveCourseMember {
  1749. String? id;
  1750. String? name;
  1751. LiveMemberEnum memberType;
  1752. String? headImageToken;
  1753. UserStatusEnum userStatusType;
  1754. bool mute;
  1755. bool videoOpend;
  1756. bool isTeacher;
  1757. bool isExpertUser;
  1758. bool isAssistantUser;
  1759. LiveMemberStatus status;
  1760. String? loginServerUrl;
  1761. LoginSource loginSource;
  1762. LiveDataDTO? liveData;
  1763. List<VideoDeviceOutputInfo>? videoDeviceInfos;
  1764. bool isControllingParameter;
  1765. bool mergedChannel;
  1766. int mergedVideoOutputWidth;
  1767. int mergedVideoOutputHeight;
  1768. TransactionStatusEnum liveProtocol;
  1769. bool backgroundRole;
  1770. LiveCourseMember({
  1771. this.id,
  1772. this.name,
  1773. this.memberType = LiveMemberEnum.User,
  1774. this.headImageToken,
  1775. this.userStatusType = UserStatusEnum.NotOnline,
  1776. this.mute = false,
  1777. this.videoOpend = false,
  1778. this.isTeacher = false,
  1779. this.isExpertUser = false,
  1780. this.isAssistantUser = false,
  1781. this.status = LiveMemberStatus.Default,
  1782. this.loginServerUrl,
  1783. this.loginSource = LoginSource.PC,
  1784. this.liveData,
  1785. this.videoDeviceInfos,
  1786. this.isControllingParameter = false,
  1787. this.mergedChannel = false,
  1788. this.mergedVideoOutputWidth = 0,
  1789. this.mergedVideoOutputHeight = 0,
  1790. this.liveProtocol = TransactionStatusEnum.Applied,
  1791. this.backgroundRole = false,
  1792. });
  1793. factory LiveCourseMember.fromJson(Map<String, dynamic> map) {
  1794. return LiveCourseMember(
  1795. id: map['Id'],
  1796. name: map['Name'],
  1797. memberType: LiveMemberEnum.values.firstWhere((e) => e.index == map['MemberType']),
  1798. headImageToken: map['HeadImageToken'],
  1799. userStatusType: UserStatusEnum.values.firstWhere((e) => e.index == map['UserStatusType']),
  1800. mute: map['Mute'],
  1801. videoOpend: map['VideoOpend'],
  1802. isTeacher: map['IsTeacher'],
  1803. isExpertUser: map['IsExpertUser'],
  1804. isAssistantUser: map['IsAssistantUser'],
  1805. status: LiveMemberStatus.values.firstWhere((e) => e.index == map['Status']),
  1806. loginServerUrl: map['LoginServerUrl'],
  1807. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  1808. liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null,
  1809. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  1810. isControllingParameter: map['IsControllingParameter'],
  1811. mergedChannel: map['MergedChannel'],
  1812. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  1813. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  1814. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  1815. backgroundRole: map['BackgroundRole'],
  1816. );
  1817. }
  1818. Map<String, dynamic> toJson() {
  1819. final map = Map<String, dynamic>();
  1820. if (id != null) {
  1821. map['Id'] = id;
  1822. }
  1823. if (name != null) {
  1824. map['Name'] = name;
  1825. }
  1826. map['MemberType'] = memberType.index;
  1827. if (headImageToken != null) {
  1828. map['HeadImageToken'] = headImageToken;
  1829. }
  1830. map['UserStatusType'] = userStatusType.index;
  1831. map['Mute'] = mute;
  1832. map['VideoOpend'] = videoOpend;
  1833. map['IsTeacher'] = isTeacher;
  1834. map['IsExpertUser'] = isExpertUser;
  1835. map['IsAssistantUser'] = isAssistantUser;
  1836. map['Status'] = status.index;
  1837. if (loginServerUrl != null) {
  1838. map['LoginServerUrl'] = loginServerUrl;
  1839. }
  1840. map['LoginSource'] = loginSource.index;
  1841. if (liveData != null) {
  1842. map['LiveData'] = liveData;
  1843. }
  1844. if (videoDeviceInfos != null) {
  1845. map['VideoDeviceInfos'] = videoDeviceInfos;
  1846. }
  1847. map['IsControllingParameter'] = isControllingParameter;
  1848. map['MergedChannel'] = mergedChannel;
  1849. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  1850. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  1851. map['LiveProtocol'] = liveProtocol.index;
  1852. map['BackgroundRole'] = backgroundRole;
  1853. return map;
  1854. }
  1855. }
  1856. class HeartRateJoinCourseNotification extends NotificationDTO{
  1857. String? courseCode;
  1858. LiveCourseMember? joiner;
  1859. HeartRateJoinCourseNotification({
  1860. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1861. this.courseCode,
  1862. this.joiner,
  1863. String? code,
  1864. bool isResponse = false,
  1865. }) : super(
  1866. notificationType: notificationType,
  1867. code: code,
  1868. isResponse: isResponse,
  1869. );
  1870. factory HeartRateJoinCourseNotification.fromJson(Map<String, dynamic> map) {
  1871. return HeartRateJoinCourseNotification(
  1872. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1873. courseCode: map['CourseCode'],
  1874. joiner: map['Joiner'] != null ? LiveCourseMember.fromJson(map['Joiner']) : null,
  1875. code: map['Code'],
  1876. isResponse: map['IsResponse'],
  1877. );
  1878. }
  1879. Map<String, dynamic> toJson() {
  1880. final map = super.toJson();
  1881. if (courseCode != null)
  1882. map['CourseCode'] = courseCode;
  1883. if (joiner != null)
  1884. map['Joiner'] = joiner;
  1885. return map;
  1886. }
  1887. }
  1888. class HeartRateLeaveCourseNotification extends NotificationDTO{
  1889. String? courseCode;
  1890. LiveCourseMember? leaverInfo;
  1891. HeartRateLeaveCourseNotification({
  1892. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1893. this.courseCode,
  1894. this.leaverInfo,
  1895. String? code,
  1896. bool isResponse = false,
  1897. }) : super(
  1898. notificationType: notificationType,
  1899. code: code,
  1900. isResponse: isResponse,
  1901. );
  1902. factory HeartRateLeaveCourseNotification.fromJson(Map<String, dynamic> map) {
  1903. return HeartRateLeaveCourseNotification(
  1904. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1905. courseCode: map['CourseCode'],
  1906. leaverInfo: map['LeaverInfo'] != null ? LiveCourseMember.fromJson(map['LeaverInfo']) : null,
  1907. code: map['Code'],
  1908. isResponse: map['IsResponse'],
  1909. );
  1910. }
  1911. Map<String, dynamic> toJson() {
  1912. final map = super.toJson();
  1913. if (courseCode != null)
  1914. map['CourseCode'] = courseCode;
  1915. if (leaverInfo != null)
  1916. map['LeaverInfo'] = leaverInfo;
  1917. return map;
  1918. }
  1919. }
  1920. class InviteLiveCourseNotification extends NotificationDTO{
  1921. String? courseCode;
  1922. int roomNo;
  1923. TransactionStatusEnum liveProtocol;
  1924. LiveCourseMember? initiator;
  1925. InviteLiveCourseNotification({
  1926. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1927. this.courseCode,
  1928. this.roomNo = 0,
  1929. this.liveProtocol = TransactionStatusEnum.Applied,
  1930. this.initiator,
  1931. String? code,
  1932. bool isResponse = false,
  1933. }) : super(
  1934. notificationType: notificationType,
  1935. code: code,
  1936. isResponse: isResponse,
  1937. );
  1938. factory InviteLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  1939. return InviteLiveCourseNotification(
  1940. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1941. courseCode: map['CourseCode'],
  1942. roomNo: map['RoomNo'],
  1943. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  1944. initiator: map['Initiator'] != null ? LiveCourseMember.fromJson(map['Initiator']) : null,
  1945. code: map['Code'],
  1946. isResponse: map['IsResponse'],
  1947. );
  1948. }
  1949. Map<String, dynamic> toJson() {
  1950. final map = super.toJson();
  1951. if (courseCode != null)
  1952. map['CourseCode'] = courseCode;
  1953. map['RoomNo'] = roomNo;
  1954. map['LiveProtocol'] = liveProtocol.index;
  1955. if (initiator != null)
  1956. map['Initiator'] = initiator;
  1957. return map;
  1958. }
  1959. }
  1960. class JoinLiveCourseNotification extends NotificationDTO{
  1961. String? courseCode;
  1962. LiveCourseMember? joiner;
  1963. bool isOldPlatform;
  1964. JoinLiveCourseNotification({
  1965. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1966. this.courseCode,
  1967. this.joiner,
  1968. this.isOldPlatform = false,
  1969. String? code,
  1970. bool isResponse = false,
  1971. }) : super(
  1972. notificationType: notificationType,
  1973. code: code,
  1974. isResponse: isResponse,
  1975. );
  1976. factory JoinLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  1977. return JoinLiveCourseNotification(
  1978. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1979. courseCode: map['CourseCode'],
  1980. joiner: map['Joiner'] != null ? LiveCourseMember.fromJson(map['Joiner']) : null,
  1981. isOldPlatform: map['IsOldPlatform'],
  1982. code: map['Code'],
  1983. isResponse: map['IsResponse'],
  1984. );
  1985. }
  1986. Map<String, dynamic> toJson() {
  1987. final map = super.toJson();
  1988. if (courseCode != null)
  1989. map['CourseCode'] = courseCode;
  1990. if (joiner != null)
  1991. map['Joiner'] = joiner;
  1992. map['IsOldPlatform'] = isOldPlatform;
  1993. return map;
  1994. }
  1995. }
  1996. class DeviceJoinLiveCourseNotification extends NotificationDTO{
  1997. String? courseCode;
  1998. LiveCourseMember? joiner;
  1999. bool isOldPlatform;
  2000. DeviceJoinLiveCourseNotification({
  2001. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2002. this.courseCode,
  2003. this.joiner,
  2004. this.isOldPlatform = false,
  2005. String? code,
  2006. bool isResponse = false,
  2007. }) : super(
  2008. notificationType: notificationType,
  2009. code: code,
  2010. isResponse: isResponse,
  2011. );
  2012. factory DeviceJoinLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  2013. return DeviceJoinLiveCourseNotification(
  2014. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2015. courseCode: map['CourseCode'],
  2016. joiner: map['Joiner'] != null ? LiveCourseMember.fromJson(map['Joiner']) : null,
  2017. isOldPlatform: map['IsOldPlatform'],
  2018. code: map['Code'],
  2019. isResponse: map['IsResponse'],
  2020. );
  2021. }
  2022. Map<String, dynamic> toJson() {
  2023. final map = super.toJson();
  2024. if (courseCode != null)
  2025. map['CourseCode'] = courseCode;
  2026. if (joiner != null)
  2027. map['Joiner'] = joiner;
  2028. map['IsOldPlatform'] = isOldPlatform;
  2029. return map;
  2030. }
  2031. }
  2032. class LeaveLiveCourseNotification extends NotificationDTO{
  2033. String? courseCode;
  2034. LiveCourseMember? leaverInfo;
  2035. LeaveLiveCourseNotification({
  2036. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2037. this.courseCode,
  2038. this.leaverInfo,
  2039. String? code,
  2040. bool isResponse = false,
  2041. }) : super(
  2042. notificationType: notificationType,
  2043. code: code,
  2044. isResponse: isResponse,
  2045. );
  2046. factory LeaveLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  2047. return LeaveLiveCourseNotification(
  2048. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2049. courseCode: map['CourseCode'],
  2050. leaverInfo: map['LeaverInfo'] != null ? LiveCourseMember.fromJson(map['LeaverInfo']) : null,
  2051. code: map['Code'],
  2052. isResponse: map['IsResponse'],
  2053. );
  2054. }
  2055. Map<String, dynamic> toJson() {
  2056. final map = super.toJson();
  2057. if (courseCode != null)
  2058. map['CourseCode'] = courseCode;
  2059. if (leaverInfo != null)
  2060. map['LeaverInfo'] = leaverInfo;
  2061. return map;
  2062. }
  2063. }
  2064. class MuteLiveCourseNotification extends NotificationDTO{
  2065. String? courseCode;
  2066. bool mute;
  2067. LiveCourseMember? muterInfo;
  2068. MuteLiveCourseNotification({
  2069. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2070. this.courseCode,
  2071. this.mute = false,
  2072. this.muterInfo,
  2073. String? code,
  2074. bool isResponse = false,
  2075. }) : super(
  2076. notificationType: notificationType,
  2077. code: code,
  2078. isResponse: isResponse,
  2079. );
  2080. factory MuteLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  2081. return MuteLiveCourseNotification(
  2082. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2083. courseCode: map['CourseCode'],
  2084. mute: map['Mute'],
  2085. muterInfo: map['MuterInfo'] != null ? LiveCourseMember.fromJson(map['MuterInfo']) : null,
  2086. code: map['Code'],
  2087. isResponse: map['IsResponse'],
  2088. );
  2089. }
  2090. Map<String, dynamic> toJson() {
  2091. final map = super.toJson();
  2092. if (courseCode != null)
  2093. map['CourseCode'] = courseCode;
  2094. map['Mute'] = mute;
  2095. if (muterInfo != null)
  2096. map['MuterInfo'] = muterInfo;
  2097. return map;
  2098. }
  2099. }
  2100. class NetworkErrCourseNotification extends NotificationDTO{
  2101. String? courseCode;
  2102. LiveCourseMember? networkErrMemberInfo;
  2103. NetworkErrCourseNotification({
  2104. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2105. this.courseCode,
  2106. this.networkErrMemberInfo,
  2107. String? code,
  2108. bool isResponse = false,
  2109. }) : super(
  2110. notificationType: notificationType,
  2111. code: code,
  2112. isResponse: isResponse,
  2113. );
  2114. factory NetworkErrCourseNotification.fromJson(Map<String, dynamic> map) {
  2115. return NetworkErrCourseNotification(
  2116. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2117. courseCode: map['CourseCode'],
  2118. networkErrMemberInfo: map['NetworkErrMemberInfo'] != null ? LiveCourseMember.fromJson(map['NetworkErrMemberInfo']) : null,
  2119. code: map['Code'],
  2120. isResponse: map['IsResponse'],
  2121. );
  2122. }
  2123. Map<String, dynamic> toJson() {
  2124. final map = super.toJson();
  2125. if (courseCode != null)
  2126. map['CourseCode'] = courseCode;
  2127. if (networkErrMemberInfo != null)
  2128. map['NetworkErrMemberInfo'] = networkErrMemberInfo;
  2129. return map;
  2130. }
  2131. }
  2132. class SendLiveInteractiveBoardDataNotification extends NotificationDTO{
  2133. String? courseCode;
  2134. bool isClear;
  2135. String? userCode;
  2136. String? boardData;
  2137. SendLiveInteractiveBoardDataNotification({
  2138. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2139. this.courseCode,
  2140. this.isClear = false,
  2141. this.userCode,
  2142. this.boardData,
  2143. String? code,
  2144. bool isResponse = false,
  2145. }) : super(
  2146. notificationType: notificationType,
  2147. code: code,
  2148. isResponse: isResponse,
  2149. );
  2150. factory SendLiveInteractiveBoardDataNotification.fromJson(Map<String, dynamic> map) {
  2151. return SendLiveInteractiveBoardDataNotification(
  2152. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2153. courseCode: map['CourseCode'],
  2154. isClear: map['IsClear'],
  2155. userCode: map['UserCode'],
  2156. boardData: map['BoardData'],
  2157. code: map['Code'],
  2158. isResponse: map['IsResponse'],
  2159. );
  2160. }
  2161. Map<String, dynamic> toJson() {
  2162. final map = super.toJson();
  2163. if (courseCode != null)
  2164. map['CourseCode'] = courseCode;
  2165. map['IsClear'] = isClear;
  2166. if (userCode != null)
  2167. map['UserCode'] = userCode;
  2168. if (boardData != null)
  2169. map['BoardData'] = boardData;
  2170. return map;
  2171. }
  2172. }
  2173. class SwitchLiveCourseVideoNotification extends NotificationDTO{
  2174. String? courseCode;
  2175. bool opened;
  2176. LiveCourseMember? switcherInfo;
  2177. SwitchLiveCourseVideoNotification({
  2178. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2179. this.courseCode,
  2180. this.opened = false,
  2181. this.switcherInfo,
  2182. String? code,
  2183. bool isResponse = false,
  2184. }) : super(
  2185. notificationType: notificationType,
  2186. code: code,
  2187. isResponse: isResponse,
  2188. );
  2189. factory SwitchLiveCourseVideoNotification.fromJson(Map<String, dynamic> map) {
  2190. return SwitchLiveCourseVideoNotification(
  2191. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2192. courseCode: map['CourseCode'],
  2193. opened: map['Opened'],
  2194. switcherInfo: map['SwitcherInfo'] != null ? LiveCourseMember.fromJson(map['SwitcherInfo']) : null,
  2195. code: map['Code'],
  2196. isResponse: map['IsResponse'],
  2197. );
  2198. }
  2199. Map<String, dynamic> toJson() {
  2200. final map = super.toJson();
  2201. if (courseCode != null)
  2202. map['CourseCode'] = courseCode;
  2203. map['Opened'] = opened;
  2204. if (switcherInfo != null)
  2205. map['SwitcherInfo'] = switcherInfo;
  2206. return map;
  2207. }
  2208. }
  2209. class UpgradeNotification extends NotificationDTO{
  2210. UpgradeTypeEnum upgadeType;
  2211. String? upgradeCDNUrl;
  2212. String? upgradeUrl;
  2213. UpgradeUpdateTypeEnum upgradeUpdateType;
  2214. String? newVersion;
  2215. String? description;
  2216. UpgradeNotification({
  2217. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2218. this.upgadeType = UpgradeTypeEnum.NoUpgrade,
  2219. this.upgradeCDNUrl,
  2220. this.upgradeUrl,
  2221. this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part,
  2222. this.newVersion,
  2223. this.description,
  2224. String? code,
  2225. bool isResponse = false,
  2226. }) : super(
  2227. notificationType: notificationType,
  2228. code: code,
  2229. isResponse: isResponse,
  2230. );
  2231. factory UpgradeNotification.fromJson(Map<String, dynamic> map) {
  2232. return UpgradeNotification(
  2233. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2234. upgadeType: UpgradeTypeEnum.values.firstWhere((e) => e.index == map['UpgadeType']),
  2235. upgradeCDNUrl: map['UpgradeCDNUrl'],
  2236. upgradeUrl: map['UpgradeUrl'],
  2237. upgradeUpdateType: UpgradeUpdateTypeEnum.values.firstWhere((e) => e.index == map['UpgradeUpdateType']),
  2238. newVersion: map['NewVersion'],
  2239. description: map['Description'],
  2240. code: map['Code'],
  2241. isResponse: map['IsResponse'],
  2242. );
  2243. }
  2244. Map<String, dynamic> toJson() {
  2245. final map = super.toJson();
  2246. map['UpgadeType'] = upgadeType.index;
  2247. if (upgradeCDNUrl != null)
  2248. map['UpgradeCDNUrl'] = upgradeCDNUrl;
  2249. if (upgradeUrl != null)
  2250. map['UpgradeUrl'] = upgradeUrl;
  2251. map['UpgradeUpdateType'] = upgradeUpdateType.index;
  2252. if (newVersion != null)
  2253. map['NewVersion'] = newVersion;
  2254. if (description != null)
  2255. map['Description'] = description;
  2256. return map;
  2257. }
  2258. }
  2259. class ApplyConsultationNotification extends NotificationDTO{
  2260. String? consultationCode;
  2261. String? operatorName;
  2262. String? patientName;
  2263. DateTime? applicationTime;
  2264. String? applyOrganizationName;
  2265. DateTime? consultationTime;
  2266. ApplyConsultationNotification({
  2267. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2268. this.consultationCode,
  2269. this.operatorName,
  2270. this.patientName,
  2271. this.applicationTime,
  2272. this.applyOrganizationName,
  2273. this.consultationTime,
  2274. String? code,
  2275. bool isResponse = false,
  2276. }) : super(
  2277. notificationType: notificationType,
  2278. code: code,
  2279. isResponse: isResponse,
  2280. );
  2281. factory ApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2282. return ApplyConsultationNotification(
  2283. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2284. consultationCode: map['ConsultationCode'],
  2285. operatorName: map['OperatorName'],
  2286. patientName: map['PatientName'],
  2287. applicationTime: map['ApplicationTime'] != null ? DateTime.parse(map['ApplicationTime']) : null,
  2288. applyOrganizationName: map['ApplyOrganizationName'],
  2289. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2290. code: map['Code'],
  2291. isResponse: map['IsResponse'],
  2292. );
  2293. }
  2294. Map<String, dynamic> toJson() {
  2295. final map = super.toJson();
  2296. if (consultationCode != null)
  2297. map['ConsultationCode'] = consultationCode;
  2298. if (operatorName != null)
  2299. map['OperatorName'] = operatorName;
  2300. if (patientName != null)
  2301. map['PatientName'] = patientName;
  2302. if (applicationTime != null)
  2303. map['ApplicationTime'] = JsonRpcUtils.dateFormat(applicationTime!);
  2304. if (applyOrganizationName != null)
  2305. map['ApplyOrganizationName'] = applyOrganizationName;
  2306. if (consultationTime != null)
  2307. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2308. return map;
  2309. }
  2310. }
  2311. class ApprovalApplyConsultationNotification extends NotificationDTO{
  2312. String? consultationCode;
  2313. String? operatorName;
  2314. String? patientName;
  2315. DateTime? consultationTime;
  2316. DateTime? consultationTimeEnd;
  2317. String? expertName;
  2318. ApprovalApplyConsultationNotification({
  2319. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2320. this.consultationCode,
  2321. this.operatorName,
  2322. this.patientName,
  2323. this.consultationTime,
  2324. this.consultationTimeEnd,
  2325. this.expertName,
  2326. String? code,
  2327. bool isResponse = false,
  2328. }) : super(
  2329. notificationType: notificationType,
  2330. code: code,
  2331. isResponse: isResponse,
  2332. );
  2333. factory ApprovalApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2334. return ApprovalApplyConsultationNotification(
  2335. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2336. consultationCode: map['ConsultationCode'],
  2337. operatorName: map['OperatorName'],
  2338. patientName: map['PatientName'],
  2339. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2340. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2341. expertName: map['ExpertName'],
  2342. code: map['Code'],
  2343. isResponse: map['IsResponse'],
  2344. );
  2345. }
  2346. Map<String, dynamic> toJson() {
  2347. final map = super.toJson();
  2348. if (consultationCode != null)
  2349. map['ConsultationCode'] = consultationCode;
  2350. if (operatorName != null)
  2351. map['OperatorName'] = operatorName;
  2352. if (patientName != null)
  2353. map['PatientName'] = patientName;
  2354. if (consultationTime != null)
  2355. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2356. if (consultationTimeEnd != null)
  2357. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2358. if (expertName != null)
  2359. map['ExpertName'] = expertName;
  2360. return map;
  2361. }
  2362. }
  2363. class CloseConsolutionHeartRateToDeviceNotification extends NotificationDTO{
  2364. String? liveRoomCode;
  2365. CloseConsolutionHeartRateToDeviceNotification({
  2366. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2367. this.liveRoomCode,
  2368. String? code,
  2369. bool isResponse = false,
  2370. }) : super(
  2371. notificationType: notificationType,
  2372. code: code,
  2373. isResponse: isResponse,
  2374. );
  2375. factory CloseConsolutionHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
  2376. return CloseConsolutionHeartRateToDeviceNotification(
  2377. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2378. liveRoomCode: map['LiveRoomCode'],
  2379. code: map['Code'],
  2380. isResponse: map['IsResponse'],
  2381. );
  2382. }
  2383. Map<String, dynamic> toJson() {
  2384. final map = super.toJson();
  2385. if (liveRoomCode != null)
  2386. map['LiveRoomCode'] = liveRoomCode;
  2387. return map;
  2388. }
  2389. }
  2390. class ConsultationAnswerTimeoutNotification extends NotificationDTO{
  2391. String? consultationCode;
  2392. String? userCode;
  2393. String? userName;
  2394. ConsultationAnswerTimeoutNotification({
  2395. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2396. this.consultationCode,
  2397. this.userCode,
  2398. this.userName,
  2399. String? code,
  2400. bool isResponse = false,
  2401. }) : super(
  2402. notificationType: notificationType,
  2403. code: code,
  2404. isResponse: isResponse,
  2405. );
  2406. factory ConsultationAnswerTimeoutNotification.fromJson(Map<String, dynamic> map) {
  2407. return ConsultationAnswerTimeoutNotification(
  2408. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2409. consultationCode: map['ConsultationCode'],
  2410. userCode: map['UserCode'],
  2411. userName: map['UserName'],
  2412. code: map['Code'],
  2413. isResponse: map['IsResponse'],
  2414. );
  2415. }
  2416. Map<String, dynamic> toJson() {
  2417. final map = super.toJson();
  2418. if (consultationCode != null)
  2419. map['ConsultationCode'] = consultationCode;
  2420. if (userCode != null)
  2421. map['UserCode'] = userCode;
  2422. if (userName != null)
  2423. map['UserName'] = userName;
  2424. return map;
  2425. }
  2426. }
  2427. class ConsultationRemindNotification extends NotificationDTO{
  2428. String? consultationCode;
  2429. int countdownTime;
  2430. String? patientName;
  2431. DateTime? consultationTime;
  2432. DateTime? consultationTimeEnd;
  2433. String? expertName;
  2434. ConsultationRemindNotification({
  2435. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2436. this.consultationCode,
  2437. this.countdownTime = 0,
  2438. this.patientName,
  2439. this.consultationTime,
  2440. this.consultationTimeEnd,
  2441. this.expertName,
  2442. String? code,
  2443. bool isResponse = false,
  2444. }) : super(
  2445. notificationType: notificationType,
  2446. code: code,
  2447. isResponse: isResponse,
  2448. );
  2449. factory ConsultationRemindNotification.fromJson(Map<String, dynamic> map) {
  2450. return ConsultationRemindNotification(
  2451. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2452. consultationCode: map['ConsultationCode'],
  2453. countdownTime: map['CountdownTime'],
  2454. patientName: map['PatientName'],
  2455. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2456. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2457. expertName: map['ExpertName'],
  2458. code: map['Code'],
  2459. isResponse: map['IsResponse'],
  2460. );
  2461. }
  2462. Map<String, dynamic> toJson() {
  2463. final map = super.toJson();
  2464. if (consultationCode != null)
  2465. map['ConsultationCode'] = consultationCode;
  2466. map['CountdownTime'] = countdownTime;
  2467. if (patientName != null)
  2468. map['PatientName'] = patientName;
  2469. if (consultationTime != null)
  2470. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2471. if (consultationTimeEnd != null)
  2472. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2473. if (expertName != null)
  2474. map['ExpertName'] = expertName;
  2475. return map;
  2476. }
  2477. }
  2478. class InviteeApproveApplyConsultationNotification extends NotificationDTO{
  2479. String? consultationCode;
  2480. String? operatorName;
  2481. String? patientName;
  2482. DateTime? consultationTime;
  2483. DateTime? consultationTimeEnd;
  2484. InviteeApproveApplyConsultationNotification({
  2485. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2486. this.consultationCode,
  2487. this.operatorName,
  2488. this.patientName,
  2489. this.consultationTime,
  2490. this.consultationTimeEnd,
  2491. String? code,
  2492. bool isResponse = false,
  2493. }) : super(
  2494. notificationType: notificationType,
  2495. code: code,
  2496. isResponse: isResponse,
  2497. );
  2498. factory InviteeApproveApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2499. return InviteeApproveApplyConsultationNotification(
  2500. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2501. consultationCode: map['ConsultationCode'],
  2502. operatorName: map['OperatorName'],
  2503. patientName: map['PatientName'],
  2504. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2505. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2506. code: map['Code'],
  2507. isResponse: map['IsResponse'],
  2508. );
  2509. }
  2510. Map<String, dynamic> toJson() {
  2511. final map = super.toJson();
  2512. if (consultationCode != null)
  2513. map['ConsultationCode'] = consultationCode;
  2514. if (operatorName != null)
  2515. map['OperatorName'] = operatorName;
  2516. if (patientName != null)
  2517. map['PatientName'] = patientName;
  2518. if (consultationTime != null)
  2519. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2520. if (consultationTimeEnd != null)
  2521. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2522. return map;
  2523. }
  2524. }
  2525. class InviteeConsultationNotification extends NotificationDTO{
  2526. String? consultationCode;
  2527. String? operatorName;
  2528. String? patientName;
  2529. DateTime? consultationTime;
  2530. DateTime? consultationTimeEnd;
  2531. InviteeConsultationNotification({
  2532. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2533. this.consultationCode,
  2534. this.operatorName,
  2535. this.patientName,
  2536. this.consultationTime,
  2537. this.consultationTimeEnd,
  2538. String? code,
  2539. bool isResponse = false,
  2540. }) : super(
  2541. notificationType: notificationType,
  2542. code: code,
  2543. isResponse: isResponse,
  2544. );
  2545. factory InviteeConsultationNotification.fromJson(Map<String, dynamic> map) {
  2546. return InviteeConsultationNotification(
  2547. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2548. consultationCode: map['ConsultationCode'],
  2549. operatorName: map['OperatorName'],
  2550. patientName: map['PatientName'],
  2551. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2552. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2553. code: map['Code'],
  2554. isResponse: map['IsResponse'],
  2555. );
  2556. }
  2557. Map<String, dynamic> toJson() {
  2558. final map = super.toJson();
  2559. if (consultationCode != null)
  2560. map['ConsultationCode'] = consultationCode;
  2561. if (operatorName != null)
  2562. map['OperatorName'] = operatorName;
  2563. if (patientName != null)
  2564. map['PatientName'] = patientName;
  2565. if (consultationTime != null)
  2566. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2567. if (consultationTimeEnd != null)
  2568. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2569. return map;
  2570. }
  2571. }
  2572. class InviteeRejectApplyConsultationNotification extends NotificationDTO{
  2573. String? consultationCode;
  2574. String? operatorName;
  2575. String? patientName;
  2576. DateTime? consultationTime;
  2577. DateTime? consultationTimeEnd;
  2578. String? rejectReason;
  2579. InviteeRejectApplyConsultationNotification({
  2580. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2581. this.consultationCode,
  2582. this.operatorName,
  2583. this.patientName,
  2584. this.consultationTime,
  2585. this.consultationTimeEnd,
  2586. this.rejectReason,
  2587. String? code,
  2588. bool isResponse = false,
  2589. }) : super(
  2590. notificationType: notificationType,
  2591. code: code,
  2592. isResponse: isResponse,
  2593. );
  2594. factory InviteeRejectApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2595. return InviteeRejectApplyConsultationNotification(
  2596. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2597. consultationCode: map['ConsultationCode'],
  2598. operatorName: map['OperatorName'],
  2599. patientName: map['PatientName'],
  2600. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2601. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2602. rejectReason: map['RejectReason'],
  2603. code: map['Code'],
  2604. isResponse: map['IsResponse'],
  2605. );
  2606. }
  2607. Map<String, dynamic> toJson() {
  2608. final map = super.toJson();
  2609. if (consultationCode != null)
  2610. map['ConsultationCode'] = consultationCode;
  2611. if (operatorName != null)
  2612. map['OperatorName'] = operatorName;
  2613. if (patientName != null)
  2614. map['PatientName'] = patientName;
  2615. if (consultationTime != null)
  2616. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2617. if (consultationTimeEnd != null)
  2618. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2619. if (rejectReason != null)
  2620. map['RejectReason'] = rejectReason;
  2621. return map;
  2622. }
  2623. }
  2624. class RejectApplyConsultationNotification extends NotificationDTO{
  2625. String? consultationCode;
  2626. String? patientName;
  2627. String? operatorName;
  2628. String? rejectReason;
  2629. RejectApplyConsultationNotification({
  2630. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2631. this.consultationCode,
  2632. this.patientName,
  2633. this.operatorName,
  2634. this.rejectReason,
  2635. String? code,
  2636. bool isResponse = false,
  2637. }) : super(
  2638. notificationType: notificationType,
  2639. code: code,
  2640. isResponse: isResponse,
  2641. );
  2642. factory RejectApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2643. return RejectApplyConsultationNotification(
  2644. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2645. consultationCode: map['ConsultationCode'],
  2646. patientName: map['PatientName'],
  2647. operatorName: map['OperatorName'],
  2648. rejectReason: map['RejectReason'],
  2649. code: map['Code'],
  2650. isResponse: map['IsResponse'],
  2651. );
  2652. }
  2653. Map<String, dynamic> toJson() {
  2654. final map = super.toJson();
  2655. if (consultationCode != null)
  2656. map['ConsultationCode'] = consultationCode;
  2657. if (patientName != null)
  2658. map['PatientName'] = patientName;
  2659. if (operatorName != null)
  2660. map['OperatorName'] = operatorName;
  2661. if (rejectReason != null)
  2662. map['RejectReason'] = rejectReason;
  2663. return map;
  2664. }
  2665. }
  2666. class StartConsolutionHeartRateToDeviceNotification extends NotificationDTO{
  2667. String? liveRoomCode;
  2668. TransactionStatusEnum liveProtocol;
  2669. int intervalSeconds;
  2670. StartConsolutionHeartRateToDeviceNotification({
  2671. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2672. this.liveRoomCode,
  2673. this.liveProtocol = TransactionStatusEnum.Applied,
  2674. this.intervalSeconds = 0,
  2675. String? code,
  2676. bool isResponse = false,
  2677. }) : super(
  2678. notificationType: notificationType,
  2679. code: code,
  2680. isResponse: isResponse,
  2681. );
  2682. factory StartConsolutionHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
  2683. return StartConsolutionHeartRateToDeviceNotification(
  2684. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2685. liveRoomCode: map['LiveRoomCode'],
  2686. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  2687. intervalSeconds: map['IntervalSeconds'],
  2688. code: map['Code'],
  2689. isResponse: map['IsResponse'],
  2690. );
  2691. }
  2692. Map<String, dynamic> toJson() {
  2693. final map = super.toJson();
  2694. if (liveRoomCode != null)
  2695. map['LiveRoomCode'] = liveRoomCode;
  2696. map['LiveProtocol'] = liveProtocol.index;
  2697. map['IntervalSeconds'] = intervalSeconds;
  2698. return map;
  2699. }
  2700. }
  2701. enum LiveStates {
  2702. OK,
  2703. TerminalRequestPush,
  2704. TerminalIsLiving,
  2705. TerminalPushTimeout,
  2706. ServiceIsBusy,
  2707. AccountUnauthenticated,
  2708. FriendsAccountIsNotExsiting,
  2709. TerminalIsLivingInOtherRoom,
  2710. TerminalNotExist,
  2711. TerminalOffLine,
  2712. RtcUrlIsEmpty,
  2713. FriendsAccountIsOffline,
  2714. OtherIsBusy,
  2715. Ignore,
  2716. TalkIsBusy,
  2717. TerminalRequestError,
  2718. TerminalRequestTimeout,
  2719. Cancelled,
  2720. NotFoundTerminal,
  2721. ShareTerminalVideoExpired,
  2722. TerminalIsPushing,
  2723. TerminalPushFailed,
  2724. NotOnline,
  2725. placeHolder_23,
  2726. placeHolder_24,
  2727. placeHolder_25,
  2728. placeHolder_26,
  2729. placeHolder_27,
  2730. placeHolder_28,
  2731. placeHolder_29,
  2732. placeHolder_30,
  2733. placeHolder_31,
  2734. placeHolder_32,
  2735. placeHolder_33,
  2736. placeHolder_34,
  2737. placeHolder_35,
  2738. placeHolder_36,
  2739. placeHolder_37,
  2740. placeHolder_38,
  2741. placeHolder_39,
  2742. placeHolder_40,
  2743. placeHolder_41,
  2744. placeHolder_42,
  2745. placeHolder_43,
  2746. placeHolder_44,
  2747. placeHolder_45,
  2748. placeHolder_46,
  2749. placeHolder_47,
  2750. placeHolder_48,
  2751. placeHolder_49,
  2752. placeHolder_50,
  2753. placeHolder_51,
  2754. placeHolder_52,
  2755. placeHolder_53,
  2756. placeHolder_54,
  2757. placeHolder_55,
  2758. placeHolder_56,
  2759. placeHolder_57,
  2760. placeHolder_58,
  2761. placeHolder_59,
  2762. placeHolder_60,
  2763. placeHolder_61,
  2764. placeHolder_62,
  2765. placeHolder_63,
  2766. placeHolder_64,
  2767. placeHolder_65,
  2768. placeHolder_66,
  2769. placeHolder_67,
  2770. placeHolder_68,
  2771. placeHolder_69,
  2772. placeHolder_70,
  2773. placeHolder_71,
  2774. placeHolder_72,
  2775. placeHolder_73,
  2776. placeHolder_74,
  2777. placeHolder_75,
  2778. placeHolder_76,
  2779. placeHolder_77,
  2780. placeHolder_78,
  2781. placeHolder_79,
  2782. placeHolder_80,
  2783. placeHolder_81,
  2784. placeHolder_82,
  2785. placeHolder_83,
  2786. placeHolder_84,
  2787. placeHolder_85,
  2788. placeHolder_86,
  2789. placeHolder_87,
  2790. placeHolder_88,
  2791. placeHolder_89,
  2792. placeHolder_90,
  2793. placeHolder_91,
  2794. placeHolder_92,
  2795. placeHolder_93,
  2796. placeHolder_94,
  2797. placeHolder_95,
  2798. placeHolder_96,
  2799. placeHolder_97,
  2800. placeHolder_98,
  2801. placeHolder_99,
  2802. RequestChat,
  2803. ChatRequestArrived,
  2804. LiveRequestHandledInOldService,
  2805. ExitTerminalLiveRequestFailed,
  2806. TerminalStartPushing,
  2807. InitiatorRequestingChat,
  2808. RecipientAnswerred,
  2809. RecipientRejected,
  2810. RecipientAcceptted,
  2811. ChatHangup,
  2812. Idle,
  2813. AcceptedInOtherDevice,
  2814. Disconnected,
  2815. LiveTalkingInProgressInOtherDevice,
  2816. DeviceIsNotConnected,
  2817. RecipientAcceptting,
  2818. IsLivingOnTrainning,
  2819. TrainningTerminalRoomIsOff,
  2820. InitiatorChargeGroupNotAvailable,
  2821. HeartBeatWarning,
  2822. HeartBeatDown,
  2823. TerminalOnLocalCapture,
  2824. Failed,
  2825. LowVersion,
  2826. NoImagePushed,
  2827. InitiativeExit,
  2828. SessionReplaced,
  2829. NoSupport,
  2830. RoomNoExist,
  2831. MemberNotExist,
  2832. IsShared,
  2833. }
  2834. class MeetingMemberInfo {
  2835. String? roomId;
  2836. LiveStates state;
  2837. String? id;
  2838. String? displayName;
  2839. String? avatar;
  2840. String? userSign;
  2841. MeetingMemberInfo({
  2842. this.roomId,
  2843. this.state = LiveStates.OK,
  2844. this.id,
  2845. this.displayName,
  2846. this.avatar,
  2847. this.userSign,
  2848. });
  2849. factory MeetingMemberInfo.fromJson(Map<String, dynamic> map) {
  2850. return MeetingMemberInfo(
  2851. roomId: map['RoomId'],
  2852. state: LiveStates.values.firstWhere((e) => e.index == map['State']),
  2853. id: map['Id'],
  2854. displayName: map['DisplayName'],
  2855. avatar: map['Avatar'],
  2856. userSign: map['UserSign'],
  2857. );
  2858. }
  2859. Map<String, dynamic> toJson() {
  2860. final map = Map<String, dynamic>();
  2861. if (roomId != null) {
  2862. map['RoomId'] = roomId;
  2863. }
  2864. map['State'] = state.index;
  2865. if (id != null) {
  2866. map['Id'] = id;
  2867. }
  2868. if (displayName != null) {
  2869. map['DisplayName'] = displayName;
  2870. }
  2871. if (avatar != null) {
  2872. map['Avatar'] = avatar;
  2873. }
  2874. if (userSign != null) {
  2875. map['UserSign'] = userSign;
  2876. }
  2877. return map;
  2878. }
  2879. }
  2880. class PullChannelUrl {
  2881. String? rtmpUrl;
  2882. String? flvUrl;
  2883. String? hlsUrl;
  2884. int width;
  2885. int height;
  2886. String? name;
  2887. bool enable;
  2888. String? userId;
  2889. PullChannelUrl({
  2890. this.rtmpUrl,
  2891. this.flvUrl,
  2892. this.hlsUrl,
  2893. this.width = 0,
  2894. this.height = 0,
  2895. this.name,
  2896. this.enable = false,
  2897. this.userId,
  2898. });
  2899. factory PullChannelUrl.fromJson(Map<String, dynamic> map) {
  2900. return PullChannelUrl(
  2901. rtmpUrl: map['RtmpUrl'],
  2902. flvUrl: map['FlvUrl'],
  2903. hlsUrl: map['HlsUrl'],
  2904. width: map['Width'],
  2905. height: map['Height'],
  2906. name: map['Name'],
  2907. enable: map['Enable'],
  2908. userId: map['UserId'],
  2909. );
  2910. }
  2911. Map<String, dynamic> toJson() {
  2912. final map = Map<String, dynamic>();
  2913. if (rtmpUrl != null) {
  2914. map['RtmpUrl'] = rtmpUrl;
  2915. }
  2916. if (flvUrl != null) {
  2917. map['FlvUrl'] = flvUrl;
  2918. }
  2919. if (hlsUrl != null) {
  2920. map['HlsUrl'] = hlsUrl;
  2921. }
  2922. map['Width'] = width;
  2923. map['Height'] = height;
  2924. if (name != null) {
  2925. map['Name'] = name;
  2926. }
  2927. map['Enable'] = enable;
  2928. if (userId != null) {
  2929. map['UserId'] = userId;
  2930. }
  2931. return map;
  2932. }
  2933. }
  2934. class LiveTerminalInfo {
  2935. String? id;
  2936. String? roomId;
  2937. int integerRoomId;
  2938. LiveStates state;
  2939. String? terminalUrl;
  2940. String? cameraUrl;
  2941. bool terminalLiveEnabled;
  2942. bool cameraLiveEnabled;
  2943. bool isMergeChannel;
  2944. int terminalWidth;
  2945. int terminalHeight;
  2946. int cameraWidth;
  2947. int cameraHeight;
  2948. int terminalIntegerRoomId;
  2949. bool isMultiChannels;
  2950. List<PullChannelUrl>? channels;
  2951. LiveTerminalInfo({
  2952. this.id,
  2953. this.roomId,
  2954. this.integerRoomId = 0,
  2955. this.state = LiveStates.OK,
  2956. this.terminalUrl,
  2957. this.cameraUrl,
  2958. this.terminalLiveEnabled = false,
  2959. this.cameraLiveEnabled = false,
  2960. this.isMergeChannel = false,
  2961. this.terminalWidth = 0,
  2962. this.terminalHeight = 0,
  2963. this.cameraWidth = 0,
  2964. this.cameraHeight = 0,
  2965. this.terminalIntegerRoomId = 0,
  2966. this.isMultiChannels = false,
  2967. this.channels,
  2968. });
  2969. factory LiveTerminalInfo.fromJson(Map<String, dynamic> map) {
  2970. return LiveTerminalInfo(
  2971. id: map['Id'],
  2972. roomId: map['RoomId'],
  2973. integerRoomId: map['IntegerRoomId'],
  2974. state: LiveStates.values.firstWhere((e) => e.index == map['State']),
  2975. terminalUrl: map['TerminalUrl'],
  2976. cameraUrl: map['CameraUrl'],
  2977. terminalLiveEnabled: map['TerminalLiveEnabled'],
  2978. cameraLiveEnabled: map['CameraLiveEnabled'],
  2979. isMergeChannel: map['IsMergeChannel'],
  2980. terminalWidth: map['TerminalWidth'],
  2981. terminalHeight: map['TerminalHeight'],
  2982. cameraWidth: map['CameraWidth'],
  2983. cameraHeight: map['CameraHeight'],
  2984. terminalIntegerRoomId: map['TerminalIntegerRoomId'],
  2985. isMultiChannels: map['IsMultiChannels'],
  2986. channels: map['Channels'] != null ? (map['Channels'] as List).map((e)=>PullChannelUrl.fromJson(e as Map<String,dynamic>)).toList() : null,
  2987. );
  2988. }
  2989. Map<String, dynamic> toJson() {
  2990. final map = Map<String, dynamic>();
  2991. if (id != null) {
  2992. map['Id'] = id;
  2993. }
  2994. if (roomId != null) {
  2995. map['RoomId'] = roomId;
  2996. }
  2997. map['IntegerRoomId'] = integerRoomId;
  2998. map['State'] = state.index;
  2999. if (terminalUrl != null) {
  3000. map['TerminalUrl'] = terminalUrl;
  3001. }
  3002. if (cameraUrl != null) {
  3003. map['CameraUrl'] = cameraUrl;
  3004. }
  3005. map['TerminalLiveEnabled'] = terminalLiveEnabled;
  3006. map['CameraLiveEnabled'] = cameraLiveEnabled;
  3007. map['IsMergeChannel'] = isMergeChannel;
  3008. map['TerminalWidth'] = terminalWidth;
  3009. map['TerminalHeight'] = terminalHeight;
  3010. map['CameraWidth'] = cameraWidth;
  3011. map['CameraHeight'] = cameraHeight;
  3012. map['TerminalIntegerRoomId'] = terminalIntegerRoomId;
  3013. map['IsMultiChannels'] = isMultiChannels;
  3014. if (channels != null) {
  3015. map['Channels'] = channels;
  3016. }
  3017. return map;
  3018. }
  3019. }
  3020. class MeetingMemberNotification extends NotificationDTO{
  3021. String? roomId;
  3022. List<MeetingMemberInfo>? members;
  3023. List<LiveTerminalInfo>? liveTerminals;
  3024. MeetingMemberNotification({
  3025. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3026. this.roomId,
  3027. this.members,
  3028. this.liveTerminals,
  3029. String? code,
  3030. bool isResponse = false,
  3031. }) : super(
  3032. notificationType: notificationType,
  3033. code: code,
  3034. isResponse: isResponse,
  3035. );
  3036. factory MeetingMemberNotification.fromJson(Map<String, dynamic> map) {
  3037. return MeetingMemberNotification(
  3038. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3039. roomId: map['RoomId'],
  3040. members: map['Members'] != null ? (map['Members'] as List).map((e)=>MeetingMemberInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  3041. liveTerminals: map['LiveTerminals'] != null ? (map['LiveTerminals'] as List).map((e)=>LiveTerminalInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  3042. code: map['Code'],
  3043. isResponse: map['IsResponse'],
  3044. );
  3045. }
  3046. Map<String, dynamic> toJson() {
  3047. final map = super.toJson();
  3048. if (roomId != null)
  3049. map['RoomId'] = roomId;
  3050. if (members != null)
  3051. map['Members'] = members;
  3052. if (liveTerminals != null)
  3053. map['LiveTerminals'] = liveTerminals;
  3054. return map;
  3055. }
  3056. }
  3057. class MeetingHangupNotification extends NotificationDTO{
  3058. LiveStates hangupReason;
  3059. String? roomId;
  3060. MeetingHangupNotification({
  3061. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3062. this.hangupReason = LiveStates.OK,
  3063. this.roomId,
  3064. String? code,
  3065. bool isResponse = false,
  3066. }) : super(
  3067. notificationType: notificationType,
  3068. code: code,
  3069. isResponse: isResponse,
  3070. );
  3071. factory MeetingHangupNotification.fromJson(Map<String, dynamic> map) {
  3072. return MeetingHangupNotification(
  3073. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3074. hangupReason: LiveStates.values.firstWhere((e) => e.index == map['HangupReason']),
  3075. roomId: map['RoomId'],
  3076. code: map['Code'],
  3077. isResponse: map['IsResponse'],
  3078. );
  3079. }
  3080. Map<String, dynamic> toJson() {
  3081. final map = super.toJson();
  3082. map['HangupReason'] = hangupReason.index;
  3083. if (roomId != null)
  3084. map['RoomId'] = roomId;
  3085. return map;
  3086. }
  3087. }
  3088. class RejectMeetingNotification extends NotificationDTO{
  3089. String? userId;
  3090. String? roomId;
  3091. RejectMeetingNotification({
  3092. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3093. this.userId,
  3094. this.roomId,
  3095. String? code,
  3096. bool isResponse = false,
  3097. }) : super(
  3098. notificationType: notificationType,
  3099. code: code,
  3100. isResponse: isResponse,
  3101. );
  3102. factory RejectMeetingNotification.fromJson(Map<String, dynamic> map) {
  3103. return RejectMeetingNotification(
  3104. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3105. userId: map['UserId'],
  3106. roomId: map['RoomId'],
  3107. code: map['Code'],
  3108. isResponse: map['IsResponse'],
  3109. );
  3110. }
  3111. Map<String, dynamic> toJson() {
  3112. final map = super.toJson();
  3113. if (userId != null)
  3114. map['UserId'] = userId;
  3115. if (roomId != null)
  3116. map['RoomId'] = roomId;
  3117. return map;
  3118. }
  3119. }
  3120. class AcceptMeetingNotification extends NotificationDTO{
  3121. String? subscriberId;
  3122. String? roomId;
  3123. LiveStates pushLiveState;
  3124. AcceptMeetingNotification({
  3125. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3126. this.subscriberId,
  3127. this.roomId,
  3128. this.pushLiveState = LiveStates.OK,
  3129. String? code,
  3130. bool isResponse = false,
  3131. }) : super(
  3132. notificationType: notificationType,
  3133. code: code,
  3134. isResponse: isResponse,
  3135. );
  3136. factory AcceptMeetingNotification.fromJson(Map<String, dynamic> map) {
  3137. return AcceptMeetingNotification(
  3138. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3139. subscriberId: map['SubscriberId'],
  3140. roomId: map['RoomId'],
  3141. pushLiveState: LiveStates.values.firstWhere((e) => e.index == map['PushLiveState']),
  3142. code: map['Code'],
  3143. isResponse: map['IsResponse'],
  3144. );
  3145. }
  3146. Map<String, dynamic> toJson() {
  3147. final map = super.toJson();
  3148. if (subscriberId != null)
  3149. map['SubscriberId'] = subscriberId;
  3150. if (roomId != null)
  3151. map['RoomId'] = roomId;
  3152. map['PushLiveState'] = pushLiveState.index;
  3153. return map;
  3154. }
  3155. }
  3156. class MeetingPendingMemberTimeoutNotification extends NotificationDTO{
  3157. String? roomId;
  3158. List<String>? userIds;
  3159. MeetingPendingMemberTimeoutNotification({
  3160. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3161. this.roomId,
  3162. this.userIds,
  3163. String? code,
  3164. bool isResponse = false,
  3165. }) : super(
  3166. notificationType: notificationType,
  3167. code: code,
  3168. isResponse: isResponse,
  3169. );
  3170. factory MeetingPendingMemberTimeoutNotification.fromJson(Map<String, dynamic> map) {
  3171. return MeetingPendingMemberTimeoutNotification(
  3172. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3173. roomId: map['RoomId'],
  3174. userIds: map['UserIds']?.cast<String>().toList(),
  3175. code: map['Code'],
  3176. isResponse: map['IsResponse'],
  3177. );
  3178. }
  3179. Map<String, dynamic> toJson() {
  3180. final map = super.toJson();
  3181. if (roomId != null)
  3182. map['RoomId'] = roomId;
  3183. if (userIds != null)
  3184. map['UserIds'] = userIds;
  3185. return map;
  3186. }
  3187. }
  3188. class ProbeApplicationSettingResponseNotification extends NotificationDTO{
  3189. String? deviceCode;
  3190. ControlDeviceParameterEnum controlType;
  3191. RemoteDeviceStateEnum remoteDeviceState;
  3192. ProbeApplicationSettingResponseNotification({
  3193. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3194. this.deviceCode,
  3195. this.controlType = ControlDeviceParameterEnum.Start,
  3196. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  3197. String? code,
  3198. bool isResponse = false,
  3199. }) : super(
  3200. notificationType: notificationType,
  3201. code: code,
  3202. isResponse: isResponse,
  3203. );
  3204. factory ProbeApplicationSettingResponseNotification.fromJson(Map<String, dynamic> map) {
  3205. return ProbeApplicationSettingResponseNotification(
  3206. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3207. deviceCode: map['DeviceCode'],
  3208. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  3209. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  3210. code: map['Code'],
  3211. isResponse: map['IsResponse'],
  3212. );
  3213. }
  3214. Map<String, dynamic> toJson() {
  3215. final map = super.toJson();
  3216. if (deviceCode != null)
  3217. map['DeviceCode'] = deviceCode;
  3218. map['ControlType'] = controlType.index;
  3219. map['RemoteDeviceState'] = remoteDeviceState.index;
  3220. return map;
  3221. }
  3222. }
  3223. class CancelLogDownloadNotification extends NotificationDTO{
  3224. String? controlUserCode;
  3225. LoginSource loginSource;
  3226. String? deviceCode;
  3227. String? controlUserName;
  3228. CancelLogDownloadNotification({
  3229. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3230. this.controlUserCode,
  3231. this.loginSource = LoginSource.PC,
  3232. this.deviceCode,
  3233. this.controlUserName,
  3234. String? code,
  3235. bool isResponse = false,
  3236. }) : super(
  3237. notificationType: notificationType,
  3238. code: code,
  3239. isResponse: isResponse,
  3240. );
  3241. factory CancelLogDownloadNotification.fromJson(Map<String, dynamic> map) {
  3242. return CancelLogDownloadNotification(
  3243. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3244. controlUserCode: map['ControlUserCode'],
  3245. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  3246. deviceCode: map['DeviceCode'],
  3247. controlUserName: map['ControlUserName'],
  3248. code: map['Code'],
  3249. isResponse: map['IsResponse'],
  3250. );
  3251. }
  3252. Map<String, dynamic> toJson() {
  3253. final map = super.toJson();
  3254. if (controlUserCode != null)
  3255. map['ControlUserCode'] = controlUserCode;
  3256. map['LoginSource'] = loginSource.index;
  3257. if (deviceCode != null)
  3258. map['DeviceCode'] = deviceCode;
  3259. if (controlUserName != null)
  3260. map['ControlUserName'] = controlUserName;
  3261. return map;
  3262. }
  3263. }
  3264. class DeviceDownloadPatchProgressToUserNotification extends NotificationDTO{
  3265. int progress;
  3266. String? patchCode;
  3267. String? deviceCode;
  3268. String? patchName;
  3269. RemoteDeviceStateEnum remoteDeviceState;
  3270. DeviceDownloadPatchProgressToUserNotification({
  3271. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3272. this.progress = 0,
  3273. this.patchCode,
  3274. this.deviceCode,
  3275. this.patchName,
  3276. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  3277. String? code,
  3278. bool isResponse = false,
  3279. }) : super(
  3280. notificationType: notificationType,
  3281. code: code,
  3282. isResponse: isResponse,
  3283. );
  3284. factory DeviceDownloadPatchProgressToUserNotification.fromJson(Map<String, dynamic> map) {
  3285. return DeviceDownloadPatchProgressToUserNotification(
  3286. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3287. progress: map['Progress'],
  3288. patchCode: map['PatchCode'],
  3289. deviceCode: map['DeviceCode'],
  3290. patchName: map['PatchName'],
  3291. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  3292. code: map['Code'],
  3293. isResponse: map['IsResponse'],
  3294. );
  3295. }
  3296. Map<String, dynamic> toJson() {
  3297. final map = super.toJson();
  3298. map['Progress'] = progress;
  3299. if (patchCode != null)
  3300. map['PatchCode'] = patchCode;
  3301. if (deviceCode != null)
  3302. map['DeviceCode'] = deviceCode;
  3303. if (patchName != null)
  3304. map['PatchName'] = patchName;
  3305. map['RemoteDeviceState'] = remoteDeviceState.index;
  3306. return map;
  3307. }
  3308. }
  3309. enum DevicePrinterEnum {
  3310. GetInstalledPrinters,
  3311. PrintTestPage,
  3312. UpdatePrinterConfiguration,
  3313. GetUninstalledPrinters,
  3314. InstallPrinterDrive,
  3315. DeletePrinter,
  3316. CancelSearchPrinter,
  3317. SearchPrinter,
  3318. CancelInstallPrinter,
  3319. InstallPrinterProgress,
  3320. }
  3321. enum DevicePrinterParameterEnum {
  3322. PrinterName,
  3323. IPAddress,
  3324. Port,
  3325. PrinterModel,
  3326. DevicePrinterPatchCode,
  3327. PageSize,
  3328. PageOrientation,
  3329. IsNormalSearchType,
  3330. }
  3331. class DevicePrinterParameter {
  3332. DevicePrinterParameterEnum setPrinterEnum;
  3333. String? parameterValue;
  3334. DevicePrinterParameter({
  3335. this.setPrinterEnum = DevicePrinterParameterEnum.PrinterName,
  3336. this.parameterValue,
  3337. });
  3338. factory DevicePrinterParameter.fromJson(Map<String, dynamic> map) {
  3339. return DevicePrinterParameter(
  3340. setPrinterEnum: DevicePrinterParameterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  3341. parameterValue: map['ParameterValue'],
  3342. );
  3343. }
  3344. Map<String, dynamic> toJson() {
  3345. final map = Map<String, dynamic>();
  3346. map['SetPrinterEnum'] = setPrinterEnum.index;
  3347. if (parameterValue != null) {
  3348. map['ParameterValue'] = parameterValue;
  3349. }
  3350. return map;
  3351. }
  3352. }
  3353. class BaseDTO {
  3354. DateTime? createTime;
  3355. DateTime? updateTime;
  3356. BaseDTO({
  3357. this.createTime,
  3358. this.updateTime,
  3359. });
  3360. factory BaseDTO.fromJson(Map<String, dynamic> map) {
  3361. return BaseDTO(
  3362. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  3363. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  3364. );
  3365. }
  3366. Map<String, dynamic> toJson() {
  3367. final map = Map<String, dynamic>();
  3368. if (createTime != null) {
  3369. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  3370. }
  3371. if (updateTime != null) {
  3372. map['UpdateTime'] = JsonRpcUtils.dateFormat(updateTime!);
  3373. }
  3374. return map;
  3375. }
  3376. }
  3377. class UploadDeviceFileInfoDTO {
  3378. int partNum;
  3379. String? fileUrl;
  3380. UploadDeviceFileInfoDTO({
  3381. this.partNum = 0,
  3382. this.fileUrl,
  3383. });
  3384. factory UploadDeviceFileInfoDTO.fromJson(Map<String, dynamic> map) {
  3385. return UploadDeviceFileInfoDTO(
  3386. partNum: map['PartNum'],
  3387. fileUrl: map['FileUrl'],
  3388. );
  3389. }
  3390. Map<String, dynamic> toJson() {
  3391. final map = Map<String, dynamic>();
  3392. map['PartNum'] = partNum;
  3393. if (fileUrl != null) {
  3394. map['FileUrl'] = fileUrl;
  3395. }
  3396. return map;
  3397. }
  3398. }
  3399. class DevicePrinterDTO extends BaseDTO{
  3400. String? code;
  3401. String? name;
  3402. String? driveModelName;
  3403. String? description;
  3404. String? osVersion;
  3405. List<UploadDeviceFileInfoDTO>? fileUploadInfoList;
  3406. int fileSize;
  3407. String? printerBrands;
  3408. List<String>? printerModels;
  3409. String? fileName;
  3410. DevicePrinterDTO({
  3411. this.code,
  3412. this.name,
  3413. this.driveModelName,
  3414. this.description,
  3415. this.osVersion,
  3416. this.fileUploadInfoList,
  3417. this.fileSize = 0,
  3418. this.printerBrands,
  3419. this.printerModels,
  3420. this.fileName,
  3421. DateTime? createTime,
  3422. DateTime? updateTime,
  3423. }) : super(
  3424. createTime: createTime,
  3425. updateTime: updateTime,
  3426. );
  3427. factory DevicePrinterDTO.fromJson(Map<String, dynamic> map) {
  3428. return DevicePrinterDTO(
  3429. code: map['Code'],
  3430. name: map['Name'],
  3431. driveModelName: map['DriveModelName'],
  3432. description: map['Description'],
  3433. osVersion: map['OsVersion'],
  3434. fileUploadInfoList: map['FileUploadInfoList'] != null ? (map['FileUploadInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  3435. fileSize: map['FileSize'],
  3436. printerBrands: map['PrinterBrands'],
  3437. printerModels: map['PrinterModels']?.cast<String>().toList(),
  3438. fileName: map['FileName'],
  3439. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  3440. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  3441. );
  3442. }
  3443. Map<String, dynamic> toJson() {
  3444. final map = super.toJson();
  3445. if (code != null)
  3446. map['Code'] = code;
  3447. if (name != null)
  3448. map['Name'] = name;
  3449. if (driveModelName != null)
  3450. map['DriveModelName'] = driveModelName;
  3451. if (description != null)
  3452. map['Description'] = description;
  3453. if (osVersion != null)
  3454. map['OsVersion'] = osVersion;
  3455. if (fileUploadInfoList != null)
  3456. map['FileUploadInfoList'] = fileUploadInfoList;
  3457. map['FileSize'] = fileSize;
  3458. if (printerBrands != null)
  3459. map['PrinterBrands'] = printerBrands;
  3460. if (printerModels != null)
  3461. map['PrinterModels'] = printerModels;
  3462. if (fileName != null)
  3463. map['FileName'] = fileName;
  3464. return map;
  3465. }
  3466. }
  3467. class DevicePrinterRequestNotification extends NotificationDTO{
  3468. DevicePrinterEnum setPrinterEnum;
  3469. List<DevicePrinterParameter>? parameters;
  3470. DevicePrinterDTO? devicePrinter;
  3471. String? deviceCode;
  3472. String? operatorCode;
  3473. DevicePrinterRequestNotification({
  3474. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3475. this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters,
  3476. this.parameters,
  3477. this.devicePrinter,
  3478. this.deviceCode,
  3479. this.operatorCode,
  3480. String? code,
  3481. bool isResponse = false,
  3482. }) : super(
  3483. notificationType: notificationType,
  3484. code: code,
  3485. isResponse: isResponse,
  3486. );
  3487. factory DevicePrinterRequestNotification.fromJson(Map<String, dynamic> map) {
  3488. return DevicePrinterRequestNotification(
  3489. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3490. setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  3491. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>DevicePrinterParameter.fromJson(e as Map<String,dynamic>)).toList() : null,
  3492. devicePrinter: map['DevicePrinter'] != null ? DevicePrinterDTO.fromJson(map['DevicePrinter']) : null,
  3493. deviceCode: map['DeviceCode'],
  3494. operatorCode: map['OperatorCode'],
  3495. code: map['Code'],
  3496. isResponse: map['IsResponse'],
  3497. );
  3498. }
  3499. Map<String, dynamic> toJson() {
  3500. final map = super.toJson();
  3501. map['SetPrinterEnum'] = setPrinterEnum.index;
  3502. if (parameters != null)
  3503. map['Parameters'] = parameters;
  3504. if (devicePrinter != null)
  3505. map['DevicePrinter'] = devicePrinter;
  3506. if (deviceCode != null)
  3507. map['DeviceCode'] = deviceCode;
  3508. if (operatorCode != null)
  3509. map['OperatorCode'] = operatorCode;
  3510. return map;
  3511. }
  3512. }
  3513. class DevicePrinterParameterDTO {
  3514. String? name;
  3515. String? pageSize;
  3516. String? pageOrientation;
  3517. List<String>? pageOrientationList;
  3518. List<String>? pageSizeList;
  3519. String? brand;
  3520. int installPrinterProgress;
  3521. String? iPAddress;
  3522. DevicePrinterParameterDTO({
  3523. this.name,
  3524. this.pageSize,
  3525. this.pageOrientation,
  3526. this.pageOrientationList,
  3527. this.pageSizeList,
  3528. this.brand,
  3529. this.installPrinterProgress = 0,
  3530. this.iPAddress,
  3531. });
  3532. factory DevicePrinterParameterDTO.fromJson(Map<String, dynamic> map) {
  3533. return DevicePrinterParameterDTO(
  3534. name: map['Name'],
  3535. pageSize: map['PageSize'],
  3536. pageOrientation: map['PageOrientation'],
  3537. pageOrientationList: map['PageOrientationList']?.cast<String>().toList(),
  3538. pageSizeList: map['PageSizeList']?.cast<String>().toList(),
  3539. brand: map['Brand'],
  3540. installPrinterProgress: map['InstallPrinterProgress'],
  3541. iPAddress: map['IPAddress'],
  3542. );
  3543. }
  3544. Map<String, dynamic> toJson() {
  3545. final map = Map<String, dynamic>();
  3546. if (name != null) {
  3547. map['Name'] = name;
  3548. }
  3549. if (pageSize != null) {
  3550. map['PageSize'] = pageSize;
  3551. }
  3552. if (pageOrientation != null) {
  3553. map['PageOrientation'] = pageOrientation;
  3554. }
  3555. if (pageOrientationList != null) {
  3556. map['PageOrientationList'] = pageOrientationList;
  3557. }
  3558. if (pageSizeList != null) {
  3559. map['PageSizeList'] = pageSizeList;
  3560. }
  3561. if (brand != null) {
  3562. map['Brand'] = brand;
  3563. }
  3564. map['InstallPrinterProgress'] = installPrinterProgress;
  3565. if (iPAddress != null) {
  3566. map['IPAddress'] = iPAddress;
  3567. }
  3568. return map;
  3569. }
  3570. }
  3571. class DevicePrinterResultNotification extends NotificationDTO{
  3572. String? deviceCode;
  3573. DevicePrinterEnum setPrinterEnum;
  3574. List<DevicePrinterParameterDTO>? devicePrinterList;
  3575. RemoteDeviceStateEnum remoteDeviceState;
  3576. DevicePrinterResultNotification({
  3577. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3578. this.deviceCode,
  3579. this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters,
  3580. this.devicePrinterList,
  3581. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  3582. String? code,
  3583. bool isResponse = false,
  3584. }) : super(
  3585. notificationType: notificationType,
  3586. code: code,
  3587. isResponse: isResponse,
  3588. );
  3589. factory DevicePrinterResultNotification.fromJson(Map<String, dynamic> map) {
  3590. return DevicePrinterResultNotification(
  3591. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3592. deviceCode: map['DeviceCode'],
  3593. setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  3594. devicePrinterList: map['DevicePrinterList'] != null ? (map['DevicePrinterList'] as List).map((e)=>DevicePrinterParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  3595. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  3596. code: map['Code'],
  3597. isResponse: map['IsResponse'],
  3598. );
  3599. }
  3600. Map<String, dynamic> toJson() {
  3601. final map = super.toJson();
  3602. if (deviceCode != null)
  3603. map['DeviceCode'] = deviceCode;
  3604. map['SetPrinterEnum'] = setPrinterEnum.index;
  3605. if (devicePrinterList != null)
  3606. map['DevicePrinterList'] = devicePrinterList;
  3607. map['RemoteDeviceState'] = remoteDeviceState.index;
  3608. return map;
  3609. }
  3610. }
  3611. class GetRemoteLogToClientNotification extends NotificationDTO{
  3612. String? deviceCode;
  3613. String? logFileToken;
  3614. int rate;
  3615. RemoteDeviceStateEnum remoteDeviceState;
  3616. String? fileName;
  3617. GetRemoteLogToClientNotification({
  3618. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3619. this.deviceCode,
  3620. this.logFileToken,
  3621. this.rate = 0,
  3622. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  3623. this.fileName,
  3624. String? code,
  3625. bool isResponse = false,
  3626. }) : super(
  3627. notificationType: notificationType,
  3628. code: code,
  3629. isResponse: isResponse,
  3630. );
  3631. factory GetRemoteLogToClientNotification.fromJson(Map<String, dynamic> map) {
  3632. return GetRemoteLogToClientNotification(
  3633. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3634. deviceCode: map['DeviceCode'],
  3635. logFileToken: map['LogFileToken'],
  3636. rate: map['Rate'],
  3637. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  3638. fileName: map['FileName'],
  3639. code: map['Code'],
  3640. isResponse: map['IsResponse'],
  3641. );
  3642. }
  3643. Map<String, dynamic> toJson() {
  3644. final map = super.toJson();
  3645. if (deviceCode != null)
  3646. map['DeviceCode'] = deviceCode;
  3647. if (logFileToken != null)
  3648. map['LogFileToken'] = logFileToken;
  3649. map['Rate'] = rate;
  3650. map['RemoteDeviceState'] = remoteDeviceState.index;
  3651. if (fileName != null)
  3652. map['FileName'] = fileName;
  3653. return map;
  3654. }
  3655. }
  3656. class GetRemoteLogToDeviceNotification extends NotificationDTO{
  3657. String? controlUserCode;
  3658. DateTime? startTime;
  3659. DateTime? endTime;
  3660. LoginSource loginSource;
  3661. String? deviceCode;
  3662. String? controlUserName;
  3663. String? scriptVersion;
  3664. GetRemoteLogToDeviceNotification({
  3665. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3666. this.controlUserCode,
  3667. this.startTime,
  3668. this.endTime,
  3669. this.loginSource = LoginSource.PC,
  3670. this.deviceCode,
  3671. this.controlUserName,
  3672. this.scriptVersion,
  3673. String? code,
  3674. bool isResponse = false,
  3675. }) : super(
  3676. notificationType: notificationType,
  3677. code: code,
  3678. isResponse: isResponse,
  3679. );
  3680. factory GetRemoteLogToDeviceNotification.fromJson(Map<String, dynamic> map) {
  3681. return GetRemoteLogToDeviceNotification(
  3682. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3683. controlUserCode: map['ControlUserCode'],
  3684. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  3685. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  3686. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  3687. deviceCode: map['DeviceCode'],
  3688. controlUserName: map['ControlUserName'],
  3689. scriptVersion: map['ScriptVersion'],
  3690. code: map['Code'],
  3691. isResponse: map['IsResponse'],
  3692. );
  3693. }
  3694. Map<String, dynamic> toJson() {
  3695. final map = super.toJson();
  3696. if (controlUserCode != null)
  3697. map['ControlUserCode'] = controlUserCode;
  3698. if (startTime != null)
  3699. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  3700. if (endTime != null)
  3701. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  3702. map['LoginSource'] = loginSource.index;
  3703. if (deviceCode != null)
  3704. map['DeviceCode'] = deviceCode;
  3705. if (controlUserName != null)
  3706. map['ControlUserName'] = controlUserName;
  3707. if (scriptVersion != null)
  3708. map['ScriptVersion'] = scriptVersion;
  3709. return map;
  3710. }
  3711. }
  3712. enum PushDevicePatchEnum {
  3713. Start,
  3714. Cancel,
  3715. }
  3716. class PushDevicePatchToDeviceNotification extends NotificationDTO{
  3717. String? patchName;
  3718. String? patchCode;
  3719. List<UploadDeviceFileInfoDTO>? deviceFileInfoList;
  3720. int fileSize;
  3721. PushDevicePatchEnum pushEnum;
  3722. String? fileName;
  3723. String? deviceType;
  3724. String? deviceCode;
  3725. String? userCode;
  3726. PushDevicePatchToDeviceNotification({
  3727. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3728. this.patchName,
  3729. this.patchCode,
  3730. this.deviceFileInfoList,
  3731. this.fileSize = 0,
  3732. this.pushEnum = PushDevicePatchEnum.Start,
  3733. this.fileName,
  3734. this.deviceType,
  3735. this.deviceCode,
  3736. this.userCode,
  3737. String? code,
  3738. bool isResponse = false,
  3739. }) : super(
  3740. notificationType: notificationType,
  3741. code: code,
  3742. isResponse: isResponse,
  3743. );
  3744. factory PushDevicePatchToDeviceNotification.fromJson(Map<String, dynamic> map) {
  3745. return PushDevicePatchToDeviceNotification(
  3746. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3747. patchName: map['PatchName'],
  3748. patchCode: map['PatchCode'],
  3749. deviceFileInfoList: map['DeviceFileInfoList'] != null ? (map['DeviceFileInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  3750. fileSize: map['FileSize'],
  3751. pushEnum: PushDevicePatchEnum.values.firstWhere((e) => e.index == map['PushEnum']),
  3752. fileName: map['FileName'],
  3753. deviceType: map['DeviceType'],
  3754. deviceCode: map['DeviceCode'],
  3755. userCode: map['UserCode'],
  3756. code: map['Code'],
  3757. isResponse: map['IsResponse'],
  3758. );
  3759. }
  3760. Map<String, dynamic> toJson() {
  3761. final map = super.toJson();
  3762. if (patchName != null)
  3763. map['PatchName'] = patchName;
  3764. if (patchCode != null)
  3765. map['PatchCode'] = patchCode;
  3766. if (deviceFileInfoList != null)
  3767. map['DeviceFileInfoList'] = deviceFileInfoList;
  3768. map['FileSize'] = fileSize;
  3769. map['PushEnum'] = pushEnum.index;
  3770. if (fileName != null)
  3771. map['FileName'] = fileName;
  3772. if (deviceType != null)
  3773. map['DeviceType'] = deviceType;
  3774. if (deviceCode != null)
  3775. map['DeviceCode'] = deviceCode;
  3776. if (userCode != null)
  3777. map['UserCode'] = userCode;
  3778. return map;
  3779. }
  3780. }
  3781. class RestartDeviceNotification extends NotificationDTO{
  3782. String? deviceCode;
  3783. String? controlUserCode;
  3784. RestartDeviceNotification({
  3785. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3786. this.deviceCode,
  3787. this.controlUserCode,
  3788. String? code,
  3789. bool isResponse = false,
  3790. }) : super(
  3791. notificationType: notificationType,
  3792. code: code,
  3793. isResponse: isResponse,
  3794. );
  3795. factory RestartDeviceNotification.fromJson(Map<String, dynamic> map) {
  3796. return RestartDeviceNotification(
  3797. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3798. deviceCode: map['DeviceCode'],
  3799. controlUserCode: map['ControlUserCode'],
  3800. code: map['Code'],
  3801. isResponse: map['IsResponse'],
  3802. );
  3803. }
  3804. Map<String, dynamic> toJson() {
  3805. final map = super.toJson();
  3806. if (deviceCode != null)
  3807. map['DeviceCode'] = deviceCode;
  3808. if (controlUserCode != null)
  3809. map['ControlUserCode'] = controlUserCode;
  3810. return map;
  3811. }
  3812. }
  3813. class LiveConsultationMemberInfo {
  3814. String? id;
  3815. String? name;
  3816. String? headImageUrl;
  3817. LiveConsultationMemberInfo({
  3818. this.id,
  3819. this.name,
  3820. this.headImageUrl,
  3821. });
  3822. factory LiveConsultationMemberInfo.fromJson(Map<String, dynamic> map) {
  3823. return LiveConsultationMemberInfo(
  3824. id: map['Id'],
  3825. name: map['Name'],
  3826. headImageUrl: map['HeadImageUrl'],
  3827. );
  3828. }
  3829. Map<String, dynamic> toJson() {
  3830. final map = Map<String, dynamic>();
  3831. if (id != null) {
  3832. map['Id'] = id;
  3833. }
  3834. if (name != null) {
  3835. map['Name'] = name;
  3836. }
  3837. if (headImageUrl != null) {
  3838. map['HeadImageUrl'] = headImageUrl;
  3839. }
  3840. return map;
  3841. }
  3842. }
  3843. class LiveConsultatioAccepterInfo extends LiveConsultationMemberInfo{
  3844. bool isOnline;
  3845. bool mute;
  3846. bool videoOpend;
  3847. LoginSource loginSource;
  3848. LiveData? liveData;
  3849. LiveConsultatioAccepterInfo({
  3850. this.isOnline = false,
  3851. this.mute = false,
  3852. this.videoOpend = false,
  3853. this.loginSource = LoginSource.PC,
  3854. this.liveData,
  3855. String? id,
  3856. String? name,
  3857. String? headImageUrl,
  3858. }) : super(
  3859. id: id,
  3860. name: name,
  3861. headImageUrl: headImageUrl,
  3862. );
  3863. factory LiveConsultatioAccepterInfo.fromJson(Map<String, dynamic> map) {
  3864. return LiveConsultatioAccepterInfo(
  3865. isOnline: map['IsOnline'],
  3866. mute: map['Mute'],
  3867. videoOpend: map['VideoOpend'],
  3868. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  3869. liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
  3870. id: map['Id'],
  3871. name: map['Name'],
  3872. headImageUrl: map['HeadImageUrl'],
  3873. );
  3874. }
  3875. Map<String, dynamic> toJson() {
  3876. final map = super.toJson();
  3877. map['IsOnline'] = isOnline;
  3878. map['Mute'] = mute;
  3879. map['VideoOpend'] = videoOpend;
  3880. map['LoginSource'] = loginSource.index;
  3881. if (liveData != null)
  3882. map['LiveData'] = liveData;
  3883. return map;
  3884. }
  3885. }
  3886. class AcceptLiveConsultationNotification extends NotificationDTO{
  3887. String? consultationCode;
  3888. LiveConsultatioAccepterInfo? accepter;
  3889. AcceptLiveConsultationNotification({
  3890. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3891. this.consultationCode,
  3892. this.accepter,
  3893. String? code,
  3894. bool isResponse = false,
  3895. }) : super(
  3896. notificationType: notificationType,
  3897. code: code,
  3898. isResponse: isResponse,
  3899. );
  3900. factory AcceptLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3901. return AcceptLiveConsultationNotification(
  3902. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3903. consultationCode: map['ConsultationCode'],
  3904. accepter: map['Accepter'] != null ? LiveConsultatioAccepterInfo.fromJson(map['Accepter']) : null,
  3905. code: map['Code'],
  3906. isResponse: map['IsResponse'],
  3907. );
  3908. }
  3909. Map<String, dynamic> toJson() {
  3910. final map = super.toJson();
  3911. if (consultationCode != null)
  3912. map['ConsultationCode'] = consultationCode;
  3913. if (accepter != null)
  3914. map['Accepter'] = accepter;
  3915. return map;
  3916. }
  3917. }
  3918. class CancelInvitingInLiveConsultationNotification extends NotificationDTO{
  3919. String? consultationCode;
  3920. List<String>? userCodes;
  3921. CancelInvitingInLiveConsultationNotification({
  3922. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3923. this.consultationCode,
  3924. this.userCodes,
  3925. String? code,
  3926. bool isResponse = false,
  3927. }) : super(
  3928. notificationType: notificationType,
  3929. code: code,
  3930. isResponse: isResponse,
  3931. );
  3932. factory CancelInvitingInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3933. return CancelInvitingInLiveConsultationNotification(
  3934. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3935. consultationCode: map['ConsultationCode'],
  3936. userCodes: map['UserCodes']?.cast<String>().toList(),
  3937. code: map['Code'],
  3938. isResponse: map['IsResponse'],
  3939. );
  3940. }
  3941. Map<String, dynamic> toJson() {
  3942. final map = super.toJson();
  3943. if (consultationCode != null)
  3944. map['ConsultationCode'] = consultationCode;
  3945. if (userCodes != null)
  3946. map['UserCodes'] = userCodes;
  3947. return map;
  3948. }
  3949. }
  3950. class CancelLiveConsultationNotification extends NotificationDTO{
  3951. String? consultationCode;
  3952. String? initiatorCode;
  3953. CancelLiveConsultationNotification({
  3954. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3955. this.consultationCode,
  3956. this.initiatorCode,
  3957. String? code,
  3958. bool isResponse = false,
  3959. }) : super(
  3960. notificationType: notificationType,
  3961. code: code,
  3962. isResponse: isResponse,
  3963. );
  3964. factory CancelLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3965. return CancelLiveConsultationNotification(
  3966. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3967. consultationCode: map['ConsultationCode'],
  3968. initiatorCode: map['InitiatorCode'],
  3969. code: map['Code'],
  3970. isResponse: map['IsResponse'],
  3971. );
  3972. }
  3973. Map<String, dynamic> toJson() {
  3974. final map = super.toJson();
  3975. if (consultationCode != null)
  3976. map['ConsultationCode'] = consultationCode;
  3977. if (initiatorCode != null)
  3978. map['InitiatorCode'] = initiatorCode;
  3979. return map;
  3980. }
  3981. }
  3982. class CloseLiveConsultationNotification extends NotificationDTO{
  3983. String? consultationCode;
  3984. String? initiatorCode;
  3985. CloseLiveConsultationNotification({
  3986. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3987. this.consultationCode,
  3988. this.initiatorCode,
  3989. String? code,
  3990. bool isResponse = false,
  3991. }) : super(
  3992. notificationType: notificationType,
  3993. code: code,
  3994. isResponse: isResponse,
  3995. );
  3996. factory CloseLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3997. return CloseLiveConsultationNotification(
  3998. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3999. consultationCode: map['ConsultationCode'],
  4000. initiatorCode: map['InitiatorCode'],
  4001. code: map['Code'],
  4002. isResponse: map['IsResponse'],
  4003. );
  4004. }
  4005. Map<String, dynamic> toJson() {
  4006. final map = super.toJson();
  4007. if (consultationCode != null)
  4008. map['ConsultationCode'] = consultationCode;
  4009. if (initiatorCode != null)
  4010. map['InitiatorCode'] = initiatorCode;
  4011. return map;
  4012. }
  4013. }
  4014. enum LiveConsultationMemberStatus {
  4015. Default,
  4016. Accepted,
  4017. Rejected,
  4018. Joined,
  4019. Left,
  4020. }
  4021. class LiveConsultationMember {
  4022. String? id;
  4023. String? name;
  4024. LiveMemberEnum memberType;
  4025. String? headImageToken;
  4026. bool isOnline;
  4027. bool mute;
  4028. bool videoOpend;
  4029. bool isInitiator;
  4030. bool isBusy;
  4031. LiveConsultationMemberStatus status;
  4032. String? loginServerUrl;
  4033. LoginSource loginSource;
  4034. bool mergedChannel;
  4035. int mergedVideoOutputWidth;
  4036. int mergedVideoOutputHeight;
  4037. LiveData? liveData;
  4038. List<VideoDeviceOutputInfo>? videoDeviceInfos;
  4039. bool isControllingParameter;
  4040. int sortNumber;
  4041. int sortLevel;
  4042. bool isOldPlatform;
  4043. bool supportRtc;
  4044. LiveConsultationMember({
  4045. this.id,
  4046. this.name,
  4047. this.memberType = LiveMemberEnum.User,
  4048. this.headImageToken,
  4049. this.isOnline = false,
  4050. this.mute = false,
  4051. this.videoOpend = false,
  4052. this.isInitiator = false,
  4053. this.isBusy = false,
  4054. this.status = LiveConsultationMemberStatus.Default,
  4055. this.loginServerUrl,
  4056. this.loginSource = LoginSource.PC,
  4057. this.mergedChannel = false,
  4058. this.mergedVideoOutputWidth = 0,
  4059. this.mergedVideoOutputHeight = 0,
  4060. this.liveData,
  4061. this.videoDeviceInfos,
  4062. this.isControllingParameter = false,
  4063. this.sortNumber = 0,
  4064. this.sortLevel = 0,
  4065. this.isOldPlatform = false,
  4066. this.supportRtc = false,
  4067. });
  4068. factory LiveConsultationMember.fromJson(Map<String, dynamic> map) {
  4069. return LiveConsultationMember(
  4070. id: map['Id'],
  4071. name: map['Name'],
  4072. memberType: LiveMemberEnum.values.firstWhere((e) => e.index == map['MemberType']),
  4073. headImageToken: map['HeadImageToken'],
  4074. isOnline: map['IsOnline'],
  4075. mute: map['Mute'],
  4076. videoOpend: map['VideoOpend'],
  4077. isInitiator: map['IsInitiator'],
  4078. isBusy: map['IsBusy'],
  4079. status: LiveConsultationMemberStatus.values.firstWhere((e) => e.index == map['Status']),
  4080. loginServerUrl: map['LoginServerUrl'],
  4081. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  4082. mergedChannel: map['MergedChannel'],
  4083. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  4084. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  4085. liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
  4086. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  4087. isControllingParameter: map['IsControllingParameter'],
  4088. sortNumber: map['SortNumber'],
  4089. sortLevel: map['SortLevel'],
  4090. isOldPlatform: map['IsOldPlatform'],
  4091. supportRtc: map['SupportRtc'],
  4092. );
  4093. }
  4094. Map<String, dynamic> toJson() {
  4095. final map = Map<String, dynamic>();
  4096. if (id != null) {
  4097. map['Id'] = id;
  4098. }
  4099. if (name != null) {
  4100. map['Name'] = name;
  4101. }
  4102. map['MemberType'] = memberType.index;
  4103. if (headImageToken != null) {
  4104. map['HeadImageToken'] = headImageToken;
  4105. }
  4106. map['IsOnline'] = isOnline;
  4107. map['Mute'] = mute;
  4108. map['VideoOpend'] = videoOpend;
  4109. map['IsInitiator'] = isInitiator;
  4110. map['IsBusy'] = isBusy;
  4111. map['Status'] = status.index;
  4112. if (loginServerUrl != null) {
  4113. map['LoginServerUrl'] = loginServerUrl;
  4114. }
  4115. map['LoginSource'] = loginSource.index;
  4116. map['MergedChannel'] = mergedChannel;
  4117. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  4118. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  4119. if (liveData != null) {
  4120. map['LiveData'] = liveData;
  4121. }
  4122. if (videoDeviceInfos != null) {
  4123. map['VideoDeviceInfos'] = videoDeviceInfos;
  4124. }
  4125. map['IsControllingParameter'] = isControllingParameter;
  4126. map['SortNumber'] = sortNumber;
  4127. map['SortLevel'] = sortLevel;
  4128. map['IsOldPlatform'] = isOldPlatform;
  4129. map['SupportRtc'] = supportRtc;
  4130. return map;
  4131. }
  4132. }
  4133. class ChangeConsultationNotification extends NotificationDTO{
  4134. String? consultationCode;
  4135. int roomNo;
  4136. List<LiveConsultationMember>? memberLiveDatas;
  4137. ChangeConsultationNotification({
  4138. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4139. this.consultationCode,
  4140. this.roomNo = 0,
  4141. this.memberLiveDatas,
  4142. String? code,
  4143. bool isResponse = false,
  4144. }) : super(
  4145. notificationType: notificationType,
  4146. code: code,
  4147. isResponse: isResponse,
  4148. );
  4149. factory ChangeConsultationNotification.fromJson(Map<String, dynamic> map) {
  4150. return ChangeConsultationNotification(
  4151. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4152. consultationCode: map['ConsultationCode'],
  4153. roomNo: map['RoomNo'],
  4154. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  4155. code: map['Code'],
  4156. isResponse: map['IsResponse'],
  4157. );
  4158. }
  4159. Map<String, dynamic> toJson() {
  4160. final map = super.toJson();
  4161. if (consultationCode != null)
  4162. map['ConsultationCode'] = consultationCode;
  4163. map['RoomNo'] = roomNo;
  4164. if (memberLiveDatas != null)
  4165. map['MemberLiveDatas'] = memberLiveDatas;
  4166. return map;
  4167. }
  4168. }
  4169. class ChangeConsultationToDeviceNotification extends NotificationDTO{
  4170. String? consultationCode;
  4171. int roomNo;
  4172. List<LiveConsultationMember>? memberLiveDatas;
  4173. ChangeConsultationToDeviceNotification({
  4174. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4175. this.consultationCode,
  4176. this.roomNo = 0,
  4177. this.memberLiveDatas,
  4178. String? code,
  4179. bool isResponse = false,
  4180. }) : super(
  4181. notificationType: notificationType,
  4182. code: code,
  4183. isResponse: isResponse,
  4184. );
  4185. factory ChangeConsultationToDeviceNotification.fromJson(Map<String, dynamic> map) {
  4186. return ChangeConsultationToDeviceNotification(
  4187. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4188. consultationCode: map['ConsultationCode'],
  4189. roomNo: map['RoomNo'],
  4190. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  4191. code: map['Code'],
  4192. isResponse: map['IsResponse'],
  4193. );
  4194. }
  4195. Map<String, dynamic> toJson() {
  4196. final map = super.toJson();
  4197. if (consultationCode != null)
  4198. map['ConsultationCode'] = consultationCode;
  4199. map['RoomNo'] = roomNo;
  4200. if (memberLiveDatas != null)
  4201. map['MemberLiveDatas'] = memberLiveDatas;
  4202. return map;
  4203. }
  4204. }
  4205. class CloseConsultationDueToChangeNotification extends NotificationDTO{
  4206. String? consultationCode;
  4207. CloseConsultationDueToChangeNotification({
  4208. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4209. this.consultationCode,
  4210. String? code,
  4211. bool isResponse = false,
  4212. }) : super(
  4213. notificationType: notificationType,
  4214. code: code,
  4215. isResponse: isResponse,
  4216. );
  4217. factory CloseConsultationDueToChangeNotification.fromJson(Map<String, dynamic> map) {
  4218. return CloseConsultationDueToChangeNotification(
  4219. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4220. consultationCode: map['ConsultationCode'],
  4221. code: map['Code'],
  4222. isResponse: map['IsResponse'],
  4223. );
  4224. }
  4225. Map<String, dynamic> toJson() {
  4226. final map = super.toJson();
  4227. if (consultationCode != null)
  4228. map['ConsultationCode'] = consultationCode;
  4229. return map;
  4230. }
  4231. }
  4232. class EmergencyCallFailedNotification extends NotificationDTO{
  4233. String? consultationCode;
  4234. EmergencyCallFailedNotification({
  4235. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4236. this.consultationCode,
  4237. String? code,
  4238. bool isResponse = false,
  4239. }) : super(
  4240. notificationType: notificationType,
  4241. code: code,
  4242. isResponse: isResponse,
  4243. );
  4244. factory EmergencyCallFailedNotification.fromJson(Map<String, dynamic> map) {
  4245. return EmergencyCallFailedNotification(
  4246. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4247. consultationCode: map['ConsultationCode'],
  4248. code: map['Code'],
  4249. isResponse: map['IsResponse'],
  4250. );
  4251. }
  4252. Map<String, dynamic> toJson() {
  4253. final map = super.toJson();
  4254. if (consultationCode != null)
  4255. map['ConsultationCode'] = consultationCode;
  4256. return map;
  4257. }
  4258. }
  4259. class EmergencyCallNotification extends NotificationDTO{
  4260. String? consultationCode;
  4261. int roomNo;
  4262. int timeout;
  4263. LiveConsultationMember? initiator;
  4264. EmergencyCallNotification({
  4265. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4266. this.consultationCode,
  4267. this.roomNo = 0,
  4268. this.timeout = 0,
  4269. this.initiator,
  4270. String? code,
  4271. bool isResponse = false,
  4272. }) : super(
  4273. notificationType: notificationType,
  4274. code: code,
  4275. isResponse: isResponse,
  4276. );
  4277. factory EmergencyCallNotification.fromJson(Map<String, dynamic> map) {
  4278. return EmergencyCallNotification(
  4279. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4280. consultationCode: map['ConsultationCode'],
  4281. roomNo: map['RoomNo'],
  4282. timeout: map['Timeout'],
  4283. initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null,
  4284. code: map['Code'],
  4285. isResponse: map['IsResponse'],
  4286. );
  4287. }
  4288. Map<String, dynamic> toJson() {
  4289. final map = super.toJson();
  4290. if (consultationCode != null)
  4291. map['ConsultationCode'] = consultationCode;
  4292. map['RoomNo'] = roomNo;
  4293. map['Timeout'] = timeout;
  4294. if (initiator != null)
  4295. map['Initiator'] = initiator;
  4296. return map;
  4297. }
  4298. }
  4299. class LiveConsultationJoinDeviceInfo {
  4300. TransactionStatusEnum liveProtocol;
  4301. int appId;
  4302. bool mergedChannel;
  4303. int mergedVideoOutputWidth;
  4304. int mergedVideoOutputHeight;
  4305. List<VideoDeviceOutputInfo>? videoDeviceOutputList;
  4306. String? deviceCode;
  4307. String? deviceSign;
  4308. bool isOldPlatform;
  4309. bool supportRtc;
  4310. LiveConsultationJoinDeviceInfo({
  4311. this.liveProtocol = TransactionStatusEnum.Applied,
  4312. this.appId = 0,
  4313. this.mergedChannel = false,
  4314. this.mergedVideoOutputWidth = 0,
  4315. this.mergedVideoOutputHeight = 0,
  4316. this.videoDeviceOutputList,
  4317. this.deviceCode,
  4318. this.deviceSign,
  4319. this.isOldPlatform = false,
  4320. this.supportRtc = false,
  4321. });
  4322. factory LiveConsultationJoinDeviceInfo.fromJson(Map<String, dynamic> map) {
  4323. return LiveConsultationJoinDeviceInfo(
  4324. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  4325. appId: map['AppId'],
  4326. mergedChannel: map['MergedChannel'],
  4327. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  4328. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  4329. videoDeviceOutputList: map['VideoDeviceOutputList'] != null ? (map['VideoDeviceOutputList'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  4330. deviceCode: map['DeviceCode'],
  4331. deviceSign: map['DeviceSign'],
  4332. isOldPlatform: map['IsOldPlatform'],
  4333. supportRtc: map['SupportRtc'],
  4334. );
  4335. }
  4336. Map<String, dynamic> toJson() {
  4337. final map = Map<String, dynamic>();
  4338. map['LiveProtocol'] = liveProtocol.index;
  4339. map['AppId'] = appId;
  4340. map['MergedChannel'] = mergedChannel;
  4341. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  4342. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  4343. if (videoDeviceOutputList != null) {
  4344. map['VideoDeviceOutputList'] = videoDeviceOutputList;
  4345. }
  4346. if (deviceCode != null) {
  4347. map['DeviceCode'] = deviceCode;
  4348. }
  4349. if (deviceSign != null) {
  4350. map['DeviceSign'] = deviceSign;
  4351. }
  4352. map['IsOldPlatform'] = isOldPlatform;
  4353. map['SupportRtc'] = supportRtc;
  4354. return map;
  4355. }
  4356. }
  4357. class LiveConsultationJoinerInfo extends LiveConsultationMemberInfo{
  4358. bool isOnline;
  4359. bool mute;
  4360. bool videoOpend;
  4361. bool isInitiator;
  4362. LoginSource loginSource;
  4363. LiveData? liveData;
  4364. int sortNumber;
  4365. int sortLevel;
  4366. LiveConsultationJoinDeviceInfo? consultationDeviceInfo;
  4367. bool isOldPlatform;
  4368. bool supportRtc;
  4369. LiveConsultationJoinerInfo({
  4370. this.isOnline = false,
  4371. this.mute = false,
  4372. this.videoOpend = false,
  4373. this.isInitiator = false,
  4374. this.loginSource = LoginSource.PC,
  4375. this.liveData,
  4376. this.sortNumber = 0,
  4377. this.sortLevel = 0,
  4378. this.consultationDeviceInfo,
  4379. this.isOldPlatform = false,
  4380. this.supportRtc = false,
  4381. String? id,
  4382. String? name,
  4383. String? headImageUrl,
  4384. }) : super(
  4385. id: id,
  4386. name: name,
  4387. headImageUrl: headImageUrl,
  4388. );
  4389. factory LiveConsultationJoinerInfo.fromJson(Map<String, dynamic> map) {
  4390. return LiveConsultationJoinerInfo(
  4391. isOnline: map['IsOnline'],
  4392. mute: map['Mute'],
  4393. videoOpend: map['VideoOpend'],
  4394. isInitiator: map['IsInitiator'],
  4395. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  4396. liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
  4397. sortNumber: map['SortNumber'],
  4398. sortLevel: map['SortLevel'],
  4399. consultationDeviceInfo: map['ConsultationDeviceInfo'] != null ? LiveConsultationJoinDeviceInfo.fromJson(map['ConsultationDeviceInfo']) : null,
  4400. isOldPlatform: map['IsOldPlatform'],
  4401. supportRtc: map['SupportRtc'],
  4402. id: map['Id'],
  4403. name: map['Name'],
  4404. headImageUrl: map['HeadImageUrl'],
  4405. );
  4406. }
  4407. Map<String, dynamic> toJson() {
  4408. final map = super.toJson();
  4409. map['IsOnline'] = isOnline;
  4410. map['Mute'] = mute;
  4411. map['VideoOpend'] = videoOpend;
  4412. map['IsInitiator'] = isInitiator;
  4413. map['LoginSource'] = loginSource.index;
  4414. if (liveData != null)
  4415. map['LiveData'] = liveData;
  4416. map['SortNumber'] = sortNumber;
  4417. map['SortLevel'] = sortLevel;
  4418. if (consultationDeviceInfo != null)
  4419. map['ConsultationDeviceInfo'] = consultationDeviceInfo;
  4420. map['IsOldPlatform'] = isOldPlatform;
  4421. map['SupportRtc'] = supportRtc;
  4422. return map;
  4423. }
  4424. }
  4425. class HeartRateJoinConsultationNotification extends NotificationDTO{
  4426. String? consultationCode;
  4427. LiveConsultationJoinerInfo? joiner;
  4428. HeartRateJoinConsultationNotification({
  4429. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4430. this.consultationCode,
  4431. this.joiner,
  4432. String? code,
  4433. bool isResponse = false,
  4434. }) : super(
  4435. notificationType: notificationType,
  4436. code: code,
  4437. isResponse: isResponse,
  4438. );
  4439. factory HeartRateJoinConsultationNotification.fromJson(Map<String, dynamic> map) {
  4440. return HeartRateJoinConsultationNotification(
  4441. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4442. consultationCode: map['ConsultationCode'],
  4443. joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null,
  4444. code: map['Code'],
  4445. isResponse: map['IsResponse'],
  4446. );
  4447. }
  4448. Map<String, dynamic> toJson() {
  4449. final map = super.toJson();
  4450. if (consultationCode != null)
  4451. map['ConsultationCode'] = consultationCode;
  4452. if (joiner != null)
  4453. map['Joiner'] = joiner;
  4454. return map;
  4455. }
  4456. }
  4457. class LiveConsultationLeaverInfo extends LiveConsultationMemberInfo{
  4458. LiveConsultationLeaverInfo({
  4459. String? id,
  4460. String? name,
  4461. String? headImageUrl,
  4462. }) : super(
  4463. id: id,
  4464. name: name,
  4465. headImageUrl: headImageUrl,
  4466. );
  4467. factory LiveConsultationLeaverInfo.fromJson(Map<String, dynamic> map) {
  4468. return LiveConsultationLeaverInfo(
  4469. id: map['Id'],
  4470. name: map['Name'],
  4471. headImageUrl: map['HeadImageUrl'],
  4472. );
  4473. }
  4474. Map<String, dynamic> toJson() {
  4475. final map = super.toJson();
  4476. return map;
  4477. }
  4478. }
  4479. class HeartRateLeaveConsultationNotification extends NotificationDTO{
  4480. String? consultationCode;
  4481. LiveConsultationLeaverInfo? leaverInfo;
  4482. HeartRateLeaveConsultationNotification({
  4483. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4484. this.consultationCode,
  4485. this.leaverInfo,
  4486. String? code,
  4487. bool isResponse = false,
  4488. }) : super(
  4489. notificationType: notificationType,
  4490. code: code,
  4491. isResponse: isResponse,
  4492. );
  4493. factory HeartRateLeaveConsultationNotification.fromJson(Map<String, dynamic> map) {
  4494. return HeartRateLeaveConsultationNotification(
  4495. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4496. consultationCode: map['ConsultationCode'],
  4497. leaverInfo: map['LeaverInfo'] != null ? LiveConsultationLeaverInfo.fromJson(map['LeaverInfo']) : null,
  4498. code: map['Code'],
  4499. isResponse: map['IsResponse'],
  4500. );
  4501. }
  4502. Map<String, dynamic> toJson() {
  4503. final map = super.toJson();
  4504. if (consultationCode != null)
  4505. map['ConsultationCode'] = consultationCode;
  4506. if (leaverInfo != null)
  4507. map['LeaverInfo'] = leaverInfo;
  4508. return map;
  4509. }
  4510. }
  4511. class InviteLiveConsultationNotification extends NotificationDTO{
  4512. String? consultationCode;
  4513. int roomNo;
  4514. TransactionStatusEnum liveProtocol;
  4515. LiveConsultationMember? initiator;
  4516. InviteLiveConsultationNotification({
  4517. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4518. this.consultationCode,
  4519. this.roomNo = 0,
  4520. this.liveProtocol = TransactionStatusEnum.Applied,
  4521. this.initiator,
  4522. String? code,
  4523. bool isResponse = false,
  4524. }) : super(
  4525. notificationType: notificationType,
  4526. code: code,
  4527. isResponse: isResponse,
  4528. );
  4529. factory InviteLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  4530. return InviteLiveConsultationNotification(
  4531. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4532. consultationCode: map['ConsultationCode'],
  4533. roomNo: map['RoomNo'],
  4534. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  4535. initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null,
  4536. code: map['Code'],
  4537. isResponse: map['IsResponse'],
  4538. );
  4539. }
  4540. Map<String, dynamic> toJson() {
  4541. final map = super.toJson();
  4542. if (consultationCode != null)
  4543. map['ConsultationCode'] = consultationCode;
  4544. map['RoomNo'] = roomNo;
  4545. map['LiveProtocol'] = liveProtocol.index;
  4546. if (initiator != null)
  4547. map['Initiator'] = initiator;
  4548. return map;
  4549. }
  4550. }
  4551. class InviteInLiveConsultationNotification extends NotificationDTO{
  4552. String? consultationCode;
  4553. int roomNo;
  4554. LiveConsultationMember? operator;
  4555. List<LiveConsultationMember>? memberLiveDatas;
  4556. InviteInLiveConsultationNotification({
  4557. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4558. this.consultationCode,
  4559. this.roomNo = 0,
  4560. this.operator,
  4561. this.memberLiveDatas,
  4562. String? code,
  4563. bool isResponse = false,
  4564. }) : super(
  4565. notificationType: notificationType,
  4566. code: code,
  4567. isResponse: isResponse,
  4568. );
  4569. factory InviteInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  4570. return InviteInLiveConsultationNotification(
  4571. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4572. consultationCode: map['ConsultationCode'],
  4573. roomNo: map['RoomNo'],
  4574. operator: map['Operator'] != null ? LiveConsultationMember.fromJson(map['Operator']) : null,
  4575. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  4576. code: map['Code'],
  4577. isResponse: map['IsResponse'],
  4578. );
  4579. }
  4580. Map<String, dynamic> toJson() {
  4581. final map = super.toJson();
  4582. if (consultationCode != null)
  4583. map['ConsultationCode'] = consultationCode;
  4584. map['RoomNo'] = roomNo;
  4585. if (operator != null)
  4586. map['Operator'] = operator;
  4587. if (memberLiveDatas != null)
  4588. map['MemberLiveDatas'] = memberLiveDatas;
  4589. return map;
  4590. }
  4591. }
  4592. class JoinInLiveConsultationNotification extends NotificationDTO{
  4593. String? consultationCode;
  4594. LiveConsultationJoinerInfo? joiner;
  4595. JoinInLiveConsultationNotification({
  4596. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4597. this.consultationCode,
  4598. this.joiner,
  4599. String? code,
  4600. bool isResponse = false,
  4601. }) : super(
  4602. notificationType: notificationType,
  4603. code: code,
  4604. isResponse: isResponse,
  4605. );
  4606. factory JoinInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  4607. return JoinInLiveConsultationNotification(
  4608. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4609. consultationCode: map['ConsultationCode'],
  4610. joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null,
  4611. code: map['Code'],
  4612. isResponse: map['IsResponse'],
  4613. );
  4614. }
  4615. Map<String, dynamic> toJson() {
  4616. final map = super.toJson();
  4617. if (consultationCode != null)
  4618. map['ConsultationCode'] = consultationCode;
  4619. if (joiner != null)
  4620. map['Joiner'] = joiner;
  4621. return map;
  4622. }
  4623. }
  4624. class LiveConsultationRejecterInfo extends LiveConsultationMemberInfo{
  4625. LiveConsultationRejecterInfo({
  4626. String? id,
  4627. String? name,
  4628. String? headImageUrl,
  4629. }) : super(
  4630. id: id,
  4631. name: name,
  4632. headImageUrl: headImageUrl,
  4633. );
  4634. factory LiveConsultationRejecterInfo.fromJson(Map<String, dynamic> map) {
  4635. return LiveConsultationRejecterInfo(
  4636. id: map['Id'],
  4637. name: map['Name'],
  4638. headImageUrl: map['HeadImageUrl'],
  4639. );
  4640. }
  4641. Map<String, dynamic> toJson() {
  4642. final map = super.toJson();
  4643. return map;
  4644. }
  4645. }
  4646. class RejectInviteLiveConsultationNotification extends NotificationDTO{
  4647. String? consultationCode;
  4648. LiveConsultationRejecterInfo? rejecter;
  4649. RejectInviteLiveConsultationNotification({
  4650. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4651. this.consultationCode,
  4652. this.rejecter,
  4653. String? code,
  4654. bool isResponse = false,
  4655. }) : super(
  4656. notificationType: notificationType,
  4657. code: code,
  4658. isResponse: isResponse,
  4659. );
  4660. factory RejectInviteLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  4661. return RejectInviteLiveConsultationNotification(
  4662. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4663. consultationCode: map['ConsultationCode'],
  4664. rejecter: map['Rejecter'] != null ? LiveConsultationRejecterInfo.fromJson(map['Rejecter']) : null,
  4665. code: map['Code'],
  4666. isResponse: map['IsResponse'],
  4667. );
  4668. }
  4669. Map<String, dynamic> toJson() {
  4670. final map = super.toJson();
  4671. if (consultationCode != null)
  4672. map['ConsultationCode'] = consultationCode;
  4673. if (rejecter != null)
  4674. map['Rejecter'] = rejecter;
  4675. return map;
  4676. }
  4677. }
  4678. class JoinLiveConsultationNotification extends NotificationDTO{
  4679. String? consultationCode;
  4680. LiveConsultationJoinerInfo? joiner;
  4681. JoinLiveConsultationNotification({
  4682. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4683. this.consultationCode,
  4684. this.joiner,
  4685. String? code,
  4686. bool isResponse = false,
  4687. }) : super(
  4688. notificationType: notificationType,
  4689. code: code,
  4690. isResponse: isResponse,
  4691. );
  4692. factory JoinLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  4693. return JoinLiveConsultationNotification(
  4694. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4695. consultationCode: map['ConsultationCode'],
  4696. joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null,
  4697. code: map['Code'],
  4698. isResponse: map['IsResponse'],
  4699. );
  4700. }
  4701. Map<String, dynamic> toJson() {
  4702. final map = super.toJson();
  4703. if (consultationCode != null)
  4704. map['ConsultationCode'] = consultationCode;
  4705. if (joiner != null)
  4706. map['Joiner'] = joiner;
  4707. return map;
  4708. }
  4709. }
  4710. class LeaveLiveConsultationNotification extends NotificationDTO{
  4711. String? consultationCode;
  4712. LiveConsultationLeaverInfo? leaverInfo;
  4713. LeaveLiveConsultationNotification({
  4714. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4715. this.consultationCode,
  4716. this.leaverInfo,
  4717. String? code,
  4718. bool isResponse = false,
  4719. }) : super(
  4720. notificationType: notificationType,
  4721. code: code,
  4722. isResponse: isResponse,
  4723. );
  4724. factory LeaveLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  4725. return LeaveLiveConsultationNotification(
  4726. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4727. consultationCode: map['ConsultationCode'],
  4728. leaverInfo: map['LeaverInfo'] != null ? LiveConsultationLeaverInfo.fromJson(map['LeaverInfo']) : null,
  4729. code: map['Code'],
  4730. isResponse: map['IsResponse'],
  4731. );
  4732. }
  4733. Map<String, dynamic> toJson() {
  4734. final map = super.toJson();
  4735. if (consultationCode != null)
  4736. map['ConsultationCode'] = consultationCode;
  4737. if (leaverInfo != null)
  4738. map['LeaverInfo'] = leaverInfo;
  4739. return map;
  4740. }
  4741. }
  4742. class LiveConsultationMuterInfo extends LiveConsultationMemberInfo{
  4743. LiveConsultationMuterInfo({
  4744. String? id,
  4745. String? name,
  4746. String? headImageUrl,
  4747. }) : super(
  4748. id: id,
  4749. name: name,
  4750. headImageUrl: headImageUrl,
  4751. );
  4752. factory LiveConsultationMuterInfo.fromJson(Map<String, dynamic> map) {
  4753. return LiveConsultationMuterInfo(
  4754. id: map['Id'],
  4755. name: map['Name'],
  4756. headImageUrl: map['HeadImageUrl'],
  4757. );
  4758. }
  4759. Map<String, dynamic> toJson() {
  4760. final map = super.toJson();
  4761. return map;
  4762. }
  4763. }
  4764. class MuteLiveConsultationNotification extends NotificationDTO{
  4765. String? consultationCode;
  4766. bool mute;
  4767. LiveConsultationMuterInfo? muterInfo;
  4768. MuteLiveConsultationNotification({
  4769. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4770. this.consultationCode,
  4771. this.mute = false,
  4772. this.muterInfo,
  4773. String? code,
  4774. bool isResponse = false,
  4775. }) : super(
  4776. notificationType: notificationType,
  4777. code: code,
  4778. isResponse: isResponse,
  4779. );
  4780. factory MuteLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  4781. return MuteLiveConsultationNotification(
  4782. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4783. consultationCode: map['ConsultationCode'],
  4784. mute: map['Mute'],
  4785. muterInfo: map['MuterInfo'] != null ? LiveConsultationMuterInfo.fromJson(map['MuterInfo']) : null,
  4786. code: map['Code'],
  4787. isResponse: map['IsResponse'],
  4788. );
  4789. }
  4790. Map<String, dynamic> toJson() {
  4791. final map = super.toJson();
  4792. if (consultationCode != null)
  4793. map['ConsultationCode'] = consultationCode;
  4794. map['Mute'] = mute;
  4795. if (muterInfo != null)
  4796. map['MuterInfo'] = muterInfo;
  4797. return map;
  4798. }
  4799. }
  4800. class LiveConsultationNetworkErrMemberInfo extends LiveConsultationMemberInfo{
  4801. LiveConsultationNetworkErrMemberInfo({
  4802. String? id,
  4803. String? name,
  4804. String? headImageUrl,
  4805. }) : super(
  4806. id: id,
  4807. name: name,
  4808. headImageUrl: headImageUrl,
  4809. );
  4810. factory LiveConsultationNetworkErrMemberInfo.fromJson(Map<String, dynamic> map) {
  4811. return LiveConsultationNetworkErrMemberInfo(
  4812. id: map['Id'],
  4813. name: map['Name'],
  4814. headImageUrl: map['HeadImageUrl'],
  4815. );
  4816. }
  4817. Map<String, dynamic> toJson() {
  4818. final map = super.toJson();
  4819. return map;
  4820. }
  4821. }
  4822. class NetworkErrConsultationNotification extends NotificationDTO{
  4823. String? consultationCode;
  4824. LiveConsultationNetworkErrMemberInfo? networkErrMemberInfo;
  4825. NetworkErrConsultationNotification({
  4826. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4827. this.consultationCode,
  4828. this.networkErrMemberInfo,
  4829. String? code,
  4830. bool isResponse = false,
  4831. }) : super(
  4832. notificationType: notificationType,
  4833. code: code,
  4834. isResponse: isResponse,
  4835. );
  4836. factory NetworkErrConsultationNotification.fromJson(Map<String, dynamic> map) {
  4837. return NetworkErrConsultationNotification(
  4838. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4839. consultationCode: map['ConsultationCode'],
  4840. networkErrMemberInfo: map['NetworkErrMemberInfo'] != null ? LiveConsultationNetworkErrMemberInfo.fromJson(map['NetworkErrMemberInfo']) : null,
  4841. code: map['Code'],
  4842. isResponse: map['IsResponse'],
  4843. );
  4844. }
  4845. Map<String, dynamic> toJson() {
  4846. final map = super.toJson();
  4847. if (consultationCode != null)
  4848. map['ConsultationCode'] = consultationCode;
  4849. if (networkErrMemberInfo != null)
  4850. map['NetworkErrMemberInfo'] = networkErrMemberInfo;
  4851. return map;
  4852. }
  4853. }
  4854. class RealtimeConsultationMembersNotification extends NotificationDTO{
  4855. String? consultationCode;
  4856. List<LiveConsultationMember>? consultationMembers;
  4857. RealtimeConsultationMembersNotification({
  4858. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4859. this.consultationCode,
  4860. this.consultationMembers,
  4861. String? code,
  4862. bool isResponse = false,
  4863. }) : super(
  4864. notificationType: notificationType,
  4865. code: code,
  4866. isResponse: isResponse,
  4867. );
  4868. factory RealtimeConsultationMembersNotification.fromJson(Map<String, dynamic> map) {
  4869. return RealtimeConsultationMembersNotification(
  4870. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4871. consultationCode: map['ConsultationCode'],
  4872. consultationMembers: map['ConsultationMembers'] != null ? (map['ConsultationMembers'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  4873. code: map['Code'],
  4874. isResponse: map['IsResponse'],
  4875. );
  4876. }
  4877. Map<String, dynamic> toJson() {
  4878. final map = super.toJson();
  4879. if (consultationCode != null)
  4880. map['ConsultationCode'] = consultationCode;
  4881. if (consultationMembers != null)
  4882. map['ConsultationMembers'] = consultationMembers;
  4883. return map;
  4884. }
  4885. }
  4886. class RejectLiveConsultationNotification extends NotificationDTO{
  4887. String? consultationCode;
  4888. LiveConsultationRejecterInfo? rejecter;
  4889. RejectLiveConsultationNotification({
  4890. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4891. this.consultationCode,
  4892. this.rejecter,
  4893. String? code,
  4894. bool isResponse = false,
  4895. }) : super(
  4896. notificationType: notificationType,
  4897. code: code,
  4898. isResponse: isResponse,
  4899. );
  4900. factory RejectLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  4901. return RejectLiveConsultationNotification(
  4902. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4903. consultationCode: map['ConsultationCode'],
  4904. rejecter: map['Rejecter'] != null ? LiveConsultationRejecterInfo.fromJson(map['Rejecter']) : null,
  4905. code: map['Code'],
  4906. isResponse: map['IsResponse'],
  4907. );
  4908. }
  4909. Map<String, dynamic> toJson() {
  4910. final map = super.toJson();
  4911. if (consultationCode != null)
  4912. map['ConsultationCode'] = consultationCode;
  4913. if (rejecter != null)
  4914. map['Rejecter'] = rejecter;
  4915. return map;
  4916. }
  4917. }
  4918. class LiveConsultationSwitcherInfo extends LiveConsultationMemberInfo{
  4919. LiveConsultationSwitcherInfo({
  4920. String? id,
  4921. String? name,
  4922. String? headImageUrl,
  4923. }) : super(
  4924. id: id,
  4925. name: name,
  4926. headImageUrl: headImageUrl,
  4927. );
  4928. factory LiveConsultationSwitcherInfo.fromJson(Map<String, dynamic> map) {
  4929. return LiveConsultationSwitcherInfo(
  4930. id: map['Id'],
  4931. name: map['Name'],
  4932. headImageUrl: map['HeadImageUrl'],
  4933. );
  4934. }
  4935. Map<String, dynamic> toJson() {
  4936. final map = super.toJson();
  4937. return map;
  4938. }
  4939. }
  4940. class SwitchLiveConsultationVideoNotification extends NotificationDTO{
  4941. String? consultationCode;
  4942. bool opened;
  4943. LiveConsultationSwitcherInfo? switcherInfo;
  4944. SwitchLiveConsultationVideoNotification({
  4945. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4946. this.consultationCode,
  4947. this.opened = false,
  4948. this.switcherInfo,
  4949. String? code,
  4950. bool isResponse = false,
  4951. }) : super(
  4952. notificationType: notificationType,
  4953. code: code,
  4954. isResponse: isResponse,
  4955. );
  4956. factory SwitchLiveConsultationVideoNotification.fromJson(Map<String, dynamic> map) {
  4957. return SwitchLiveConsultationVideoNotification(
  4958. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4959. consultationCode: map['ConsultationCode'],
  4960. opened: map['Opened'],
  4961. switcherInfo: map['SwitcherInfo'] != null ? LiveConsultationSwitcherInfo.fromJson(map['SwitcherInfo']) : null,
  4962. code: map['Code'],
  4963. isResponse: map['IsResponse'],
  4964. );
  4965. }
  4966. Map<String, dynamic> toJson() {
  4967. final map = super.toJson();
  4968. if (consultationCode != null)
  4969. map['ConsultationCode'] = consultationCode;
  4970. map['Opened'] = opened;
  4971. if (switcherInfo != null)
  4972. map['SwitcherInfo'] = switcherInfo;
  4973. return map;
  4974. }
  4975. }
  4976. class UploadConsultationDataNotification extends NotificationDTO{
  4977. String? consultationCode;
  4978. String? userCode;
  4979. UploadConsultationDataNotification({
  4980. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  4981. this.consultationCode,
  4982. this.userCode,
  4983. String? code,
  4984. bool isResponse = false,
  4985. }) : super(
  4986. notificationType: notificationType,
  4987. code: code,
  4988. isResponse: isResponse,
  4989. );
  4990. factory UploadConsultationDataNotification.fromJson(Map<String, dynamic> map) {
  4991. return UploadConsultationDataNotification(
  4992. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  4993. consultationCode: map['ConsultationCode'],
  4994. userCode: map['UserCode'],
  4995. code: map['Code'],
  4996. isResponse: map['IsResponse'],
  4997. );
  4998. }
  4999. Map<String, dynamic> toJson() {
  5000. final map = super.toJson();
  5001. if (consultationCode != null)
  5002. map['ConsultationCode'] = consultationCode;
  5003. if (userCode != null)
  5004. map['UserCode'] = userCode;
  5005. return map;
  5006. }
  5007. }
  5008. class SendInteractiveBoardDataNotification extends NotificationDTO{
  5009. String? consultationCode;
  5010. bool isClear;
  5011. String? userCode;
  5012. String? boardData;
  5013. SendInteractiveBoardDataNotification({
  5014. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  5015. this.consultationCode,
  5016. this.isClear = false,
  5017. this.userCode,
  5018. this.boardData,
  5019. String? code,
  5020. bool isResponse = false,
  5021. }) : super(
  5022. notificationType: notificationType,
  5023. code: code,
  5024. isResponse: isResponse,
  5025. );
  5026. factory SendInteractiveBoardDataNotification.fromJson(Map<String, dynamic> map) {
  5027. return SendInteractiveBoardDataNotification(
  5028. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  5029. consultationCode: map['ConsultationCode'],
  5030. isClear: map['IsClear'],
  5031. userCode: map['UserCode'],
  5032. boardData: map['BoardData'],
  5033. code: map['Code'],
  5034. isResponse: map['IsResponse'],
  5035. );
  5036. }
  5037. Map<String, dynamic> toJson() {
  5038. final map = super.toJson();
  5039. if (consultationCode != null)
  5040. map['ConsultationCode'] = consultationCode;
  5041. map['IsClear'] = isClear;
  5042. if (userCode != null)
  5043. map['UserCode'] = userCode;
  5044. if (boardData != null)
  5045. map['BoardData'] = boardData;
  5046. return map;
  5047. }
  5048. }