notification.m.dart 153 KB

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