notification.m.dart 143 KB

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