notification.m.dart 143 KB

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