notification.m.dart 153 KB

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