notification.m.dart 144 KB

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