notification.m.dart 151 KB

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