notification.m.dart 113 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056
  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. }
  91. class NotificationDTO {
  92. NotificationTypeEnum notificationType;
  93. String? code;
  94. bool isResponse;
  95. NotificationDTO({
  96. this.notificationType = NotificationTypeEnum.Unknown,
  97. this.code,
  98. this.isResponse = false,
  99. });
  100. factory NotificationDTO.fromJson(Map<String, dynamic> map) {
  101. return NotificationDTO(
  102. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  103. code: map['Code'],
  104. isResponse: map['IsResponse'],
  105. );
  106. }
  107. Map<String, dynamic> toJson() {
  108. final map = Map<String, dynamic>();
  109. map['NotificationType'] = notificationType.index;
  110. if(code != null)
  111. map['Code'] = code;
  112. map['IsResponse'] = isResponse;
  113. return map;
  114. }
  115. }
  116. class SendCommandToDeviceNotification extends NotificationDTO{
  117. String? actionType;
  118. String? resultCode;
  119. String? sender;
  120. SendCommandToDeviceNotification({
  121. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  122. this.actionType,
  123. this.resultCode,
  124. this.sender,
  125. String? code,
  126. bool isResponse = false,
  127. }) : super(
  128. notificationType: notificationType,
  129. code: code,
  130. isResponse: isResponse,
  131. );
  132. factory SendCommandToDeviceNotification.fromJson(Map<String, dynamic> map) {
  133. return SendCommandToDeviceNotification(
  134. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  135. actionType: map['ActionType'],
  136. resultCode: map['ResultCode'],
  137. sender: map['Sender'],
  138. code: map['Code'],
  139. isResponse: map['IsResponse'],
  140. );
  141. }
  142. Map<String, dynamic> toJson() {
  143. final map = super.toJson();
  144. if(actionType != null)
  145. map['ActionType'] = actionType;
  146. if(resultCode != null)
  147. map['ResultCode'] = resultCode;
  148. if(sender != null)
  149. map['Sender'] = sender;
  150. return map;
  151. }
  152. }
  153. class SendResultToClientNotification extends NotificationDTO{
  154. String? resultCode;
  155. String? sender;
  156. SendResultToClientNotification({
  157. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  158. this.resultCode,
  159. this.sender,
  160. String? code,
  161. bool isResponse = false,
  162. }) : super(
  163. notificationType: notificationType,
  164. code: code,
  165. isResponse: isResponse,
  166. );
  167. factory SendResultToClientNotification.fromJson(Map<String, dynamic> map) {
  168. return SendResultToClientNotification(
  169. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  170. resultCode: map['ResultCode'],
  171. sender: map['Sender'],
  172. code: map['Code'],
  173. isResponse: map['IsResponse'],
  174. );
  175. }
  176. Map<String, dynamic> toJson() {
  177. final map = super.toJson();
  178. if(resultCode != null)
  179. map['ResultCode'] = resultCode;
  180. if(sender != null)
  181. map['Sender'] = sender;
  182. return map;
  183. }
  184. }
  185. enum AnnouncementTypeEnum {
  186. placeHolder_0,
  187. Broadcast,
  188. Maintenance,
  189. }
  190. class AnnouncementLanguageConfigDTO {
  191. String? language;
  192. String? title;
  193. String? content;
  194. AnnouncementLanguageConfigDTO({
  195. this.language,
  196. this.title,
  197. this.content,
  198. });
  199. factory AnnouncementLanguageConfigDTO.fromJson(Map<String, dynamic> map) {
  200. return AnnouncementLanguageConfigDTO(
  201. language: map['Language'],
  202. title: map['Title'],
  203. content: map['Content'],
  204. );
  205. }
  206. Map<String, dynamic> toJson() {
  207. final map = Map<String, dynamic>();
  208. if(language != null)
  209. map['Language'] = language;
  210. if(title != null)
  211. map['Title'] = title;
  212. if(content != null)
  213. map['Content'] = content;
  214. return map;
  215. }
  216. }
  217. class AnnouncementNotification extends NotificationDTO{
  218. AnnouncementTypeEnum announcementType;
  219. List<AnnouncementLanguageConfigDTO >? announcementLanguageConfigs;
  220. AnnouncementNotification({
  221. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  222. this.announcementType = AnnouncementTypeEnum.Broadcast,
  223. this.announcementLanguageConfigs,
  224. String? code,
  225. bool isResponse = false,
  226. }) : super(
  227. notificationType: notificationType,
  228. code: code,
  229. isResponse: isResponse,
  230. );
  231. factory AnnouncementNotification.fromJson(Map<String, dynamic> map) {
  232. return AnnouncementNotification(
  233. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  234. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  235. announcementLanguageConfigs: map['AnnouncementLanguageConfigs'] != null ? (map['AnnouncementLanguageConfigs'] as List).map((e)=>AnnouncementLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  236. code: map['Code'],
  237. isResponse: map['IsResponse'],
  238. );
  239. }
  240. Map<String, dynamic> toJson() {
  241. final map = super.toJson();
  242. map['AnnouncementType'] = announcementType.index;
  243. if(announcementLanguageConfigs != null)
  244. map['AnnouncementLanguageConfigs'] = announcementLanguageConfigs;
  245. return map;
  246. }
  247. }
  248. enum ChatCmdEnum {
  249. Txt,
  250. Image,
  251. MP4,
  252. Voice,
  253. Cases,
  254. ShareLive,
  255. VideoCall,
  256. VoiceCall,
  257. }
  258. class ChatMsgNotification extends NotificationDTO{
  259. String? userCode;
  260. ChatCmdEnum chatCmd;
  261. DateTime? sendTime;
  262. String? message;
  263. ChatMsgNotification({
  264. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  265. this.userCode,
  266. this.chatCmd = ChatCmdEnum.Txt,
  267. this.sendTime,
  268. this.message,
  269. String? code,
  270. bool isResponse = false,
  271. }) : super(
  272. notificationType: notificationType,
  273. code: code,
  274. isResponse: isResponse,
  275. );
  276. factory ChatMsgNotification.fromJson(Map<String, dynamic> map) {
  277. return ChatMsgNotification(
  278. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  279. userCode: map['UserCode'],
  280. chatCmd: ChatCmdEnum.values.firstWhere((e) => e.index == map['ChatCmd']),
  281. sendTime: map['SendTime'] != null ? DateTime.parse(map['SendTime']) : null,
  282. message: map['Message'],
  283. code: map['Code'],
  284. isResponse: map['IsResponse'],
  285. );
  286. }
  287. Map<String, dynamic> toJson() {
  288. final map = super.toJson();
  289. if(userCode != null)
  290. map['UserCode'] = userCode;
  291. map['ChatCmd'] = chatCmd.index;
  292. if(sendTime != null)
  293. map['SendTime'] = JsonRpcUtils.dateFormat(sendTime!);
  294. if(message != null)
  295. map['Message'] = message;
  296. return map;
  297. }
  298. }
  299. class ConnectionNotification extends NotificationDTO{
  300. ConnectionNotification({
  301. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  302. String? code,
  303. bool isResponse = false,
  304. }) : super(
  305. notificationType: notificationType,
  306. code: code,
  307. isResponse: isResponse,
  308. );
  309. factory ConnectionNotification.fromJson(Map<String, dynamic> map) {
  310. return ConnectionNotification(
  311. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  312. code: map['Code'],
  313. isResponse: map['IsResponse'],
  314. );
  315. }
  316. Map<String, dynamic> toJson() {
  317. final map = super.toJson();
  318. return map;
  319. }
  320. }
  321. enum ControlDeviceParameterEnum {
  322. Start,
  323. End,
  324. RunExecuteApi,
  325. ExecuteProbeApplicationSetting,
  326. RejectConnect,
  327. EndRunExecuteApi,
  328. Get,
  329. UserTimeout,
  330. }
  331. class AdditionParameterDTO {
  332. String? parameterName;
  333. String? parameterType;
  334. String? parameterValue;
  335. AdditionParameterDTO({
  336. this.parameterName,
  337. this.parameterType,
  338. this.parameterValue,
  339. });
  340. factory AdditionParameterDTO.fromJson(Map<String, dynamic> map) {
  341. return AdditionParameterDTO(
  342. parameterName: map['ParameterName'],
  343. parameterType: map['ParameterType'],
  344. parameterValue: map['ParameterValue'],
  345. );
  346. }
  347. Map<String, dynamic> toJson() {
  348. final map = Map<String, dynamic>();
  349. if(parameterName != null)
  350. map['ParameterName'] = parameterName;
  351. if(parameterType != null)
  352. map['ParameterType'] = parameterType;
  353. if(parameterValue != null)
  354. map['ParameterValue'] = parameterValue;
  355. return map;
  356. }
  357. }
  358. class DeviceControlledParametersNotification extends NotificationDTO{
  359. String? controlUserCode;
  360. String? controlUserName;
  361. ControlDeviceParameterEnum controlType;
  362. List<AdditionParameterDTO >? parameters;
  363. DeviceControlledParametersNotification({
  364. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  365. this.controlUserCode,
  366. this.controlUserName,
  367. this.controlType = ControlDeviceParameterEnum.Start,
  368. this.parameters,
  369. String? code,
  370. bool isResponse = false,
  371. }) : super(
  372. notificationType: notificationType,
  373. code: code,
  374. isResponse: isResponse,
  375. );
  376. factory DeviceControlledParametersNotification.fromJson(Map<String, dynamic> map) {
  377. return DeviceControlledParametersNotification(
  378. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  379. controlUserCode: map['ControlUserCode'],
  380. controlUserName: map['ControlUserName'],
  381. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  382. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  383. code: map['Code'],
  384. isResponse: map['IsResponse'],
  385. );
  386. }
  387. Map<String, dynamic> toJson() {
  388. final map = super.toJson();
  389. if(controlUserCode != null)
  390. map['ControlUserCode'] = controlUserCode;
  391. if(controlUserName != null)
  392. map['ControlUserName'] = controlUserName;
  393. map['ControlType'] = controlType.index;
  394. if(parameters != null)
  395. map['Parameters'] = parameters;
  396. return map;
  397. }
  398. }
  399. enum RemoteDeviceStateEnum {
  400. Unknown,
  401. Success,
  402. Fail,
  403. DownloadPatchFail,
  404. CancelDownloadPatch,
  405. LogDownloaddFail,
  406. DeviceCancelLogDownload,
  407. DeviceDisconnect,
  408. DeviceTimeOutDisconnect,
  409. DownloadPatching,
  410. }
  411. class DeviceDisconnectRemoteControlNotification extends NotificationDTO{
  412. String? deviceCode;
  413. RemoteDeviceStateEnum remoteDeviceState;
  414. DeviceDisconnectRemoteControlNotification({
  415. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  416. this.deviceCode,
  417. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  418. String? code,
  419. bool isResponse = false,
  420. }) : super(
  421. notificationType: notificationType,
  422. code: code,
  423. isResponse: isResponse,
  424. );
  425. factory DeviceDisconnectRemoteControlNotification.fromJson(Map<String, dynamic> map) {
  426. return DeviceDisconnectRemoteControlNotification(
  427. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  428. deviceCode: map['DeviceCode'],
  429. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  430. code: map['Code'],
  431. isResponse: map['IsResponse'],
  432. );
  433. }
  434. Map<String, dynamic> toJson() {
  435. final map = super.toJson();
  436. if(deviceCode != null)
  437. map['DeviceCode'] = deviceCode;
  438. map['RemoteDeviceState'] = remoteDeviceState.index;
  439. return map;
  440. }
  441. }
  442. class DeviceParametersNotification extends NotificationDTO{
  443. String? deviceCode;
  444. DeviceParametersNotification({
  445. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  446. this.deviceCode,
  447. String? code,
  448. bool isResponse = false,
  449. }) : super(
  450. notificationType: notificationType,
  451. code: code,
  452. isResponse: isResponse,
  453. );
  454. factory DeviceParametersNotification.fromJson(Map<String, dynamic> map) {
  455. return DeviceParametersNotification(
  456. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  457. deviceCode: map['DeviceCode'],
  458. code: map['Code'],
  459. isResponse: map['IsResponse'],
  460. );
  461. }
  462. Map<String, dynamic> toJson() {
  463. final map = super.toJson();
  464. if(deviceCode != null)
  465. map['DeviceCode'] = deviceCode;
  466. return map;
  467. }
  468. }
  469. class DeviceRejectRemoteControlNotification extends NotificationDTO{
  470. String? deviceCode;
  471. DeviceRejectRemoteControlNotification({
  472. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  473. this.deviceCode,
  474. String? code,
  475. bool isResponse = false,
  476. }) : super(
  477. notificationType: notificationType,
  478. code: code,
  479. isResponse: isResponse,
  480. );
  481. factory DeviceRejectRemoteControlNotification.fromJson(Map<String, dynamic> map) {
  482. return DeviceRejectRemoteControlNotification(
  483. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  484. deviceCode: map['DeviceCode'],
  485. code: map['Code'],
  486. isResponse: map['IsResponse'],
  487. );
  488. }
  489. Map<String, dynamic> toJson() {
  490. final map = super.toJson();
  491. if(deviceCode != null)
  492. map['DeviceCode'] = deviceCode;
  493. return map;
  494. }
  495. }
  496. class DisconnectNotification extends NotificationDTO{
  497. DisconnectNotification({
  498. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  499. String? code,
  500. bool isResponse = false,
  501. }) : super(
  502. notificationType: notificationType,
  503. code: code,
  504. isResponse: isResponse,
  505. );
  506. factory DisconnectNotification.fromJson(Map<String, dynamic> map) {
  507. return DisconnectNotification(
  508. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  509. code: map['Code'],
  510. isResponse: map['IsResponse'],
  511. );
  512. }
  513. Map<String, dynamic> toJson() {
  514. final map = super.toJson();
  515. return map;
  516. }
  517. }
  518. class ExamRecordsFinishedNotification extends NotificationDTO{
  519. List<String >? codes;
  520. ExamRecordsFinishedNotification({
  521. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  522. this.codes,
  523. String? code,
  524. bool isResponse = false,
  525. }) : super(
  526. notificationType: notificationType,
  527. code: code,
  528. isResponse: isResponse,
  529. );
  530. factory ExamRecordsFinishedNotification.fromJson(Map<String, dynamic> map) {
  531. return ExamRecordsFinishedNotification(
  532. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  533. codes: map['Codes'] != null ? map['Codes'].cast<String>().toList() : null,
  534. code: map['Code'],
  535. isResponse: map['IsResponse'],
  536. );
  537. }
  538. Map<String, dynamic> toJson() {
  539. final map = super.toJson();
  540. if(codes != null)
  541. map['Codes'] = codes;
  542. return map;
  543. }
  544. }
  545. class ExecuteResultNotification extends NotificationDTO{
  546. bool isSuccess;
  547. String? exportFileToken;
  548. ExecuteResultNotification({
  549. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  550. this.isSuccess = false,
  551. this.exportFileToken,
  552. String? code,
  553. bool isResponse = false,
  554. }) : super(
  555. notificationType: notificationType,
  556. code: code,
  557. isResponse: isResponse,
  558. );
  559. factory ExecuteResultNotification.fromJson(Map<String, dynamic> map) {
  560. return ExecuteResultNotification(
  561. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  562. isSuccess: map['IsSuccess'],
  563. exportFileToken: map['ExportFileToken'],
  564. code: map['Code'],
  565. isResponse: map['IsResponse'],
  566. );
  567. }
  568. Map<String, dynamic> toJson() {
  569. final map = super.toJson();
  570. map['IsSuccess'] = isSuccess;
  571. if(exportFileToken != null)
  572. map['ExportFileToken'] = exportFileToken;
  573. return map;
  574. }
  575. }
  576. enum VideoDeviceSourceTypeEnum {
  577. Desktop,
  578. Camera,
  579. }
  580. class VideoDeviceDTO {
  581. String? videoDeviceId;
  582. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  583. int width;
  584. int height;
  585. int outputWidth;
  586. int outputHeight;
  587. int videoFps;
  588. int videoBitrate;
  589. int minVideoBitrate;
  590. VideoDeviceDTO({
  591. this.videoDeviceId,
  592. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  593. this.width = 0,
  594. this.height = 0,
  595. this.outputWidth = 0,
  596. this.outputHeight = 0,
  597. this.videoFps = 0,
  598. this.videoBitrate = 0,
  599. this.minVideoBitrate = 0,
  600. });
  601. factory VideoDeviceDTO.fromJson(Map<String, dynamic> map) {
  602. return VideoDeviceDTO(
  603. videoDeviceId: map['VideoDeviceId'],
  604. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  605. width: map['Width'],
  606. height: map['Height'],
  607. outputWidth: map['OutputWidth'],
  608. outputHeight: map['OutputHeight'],
  609. videoFps: map['VideoFps'],
  610. videoBitrate: map['VideoBitrate'],
  611. minVideoBitrate: map['MinVideoBitrate'],
  612. );
  613. }
  614. Map<String, dynamic> toJson() {
  615. final map = Map<String, dynamic>();
  616. if(videoDeviceId != null)
  617. map['VideoDeviceId'] = videoDeviceId;
  618. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  619. map['Width'] = width;
  620. map['Height'] = height;
  621. map['OutputWidth'] = outputWidth;
  622. map['OutputHeight'] = outputHeight;
  623. map['VideoFps'] = videoFps;
  624. map['VideoBitrate'] = videoBitrate;
  625. map['MinVideoBitrate'] = minVideoBitrate;
  626. return map;
  627. }
  628. }
  629. class ModifyDeviceMergedVideoSizeNotification extends NotificationDTO{
  630. bool mergedChannel;
  631. String? deviceCode;
  632. int mergedVideoOutputWidth;
  633. int mergedVideoOutputHeight;
  634. List<VideoDeviceDTO >? videoDeviceInfos;
  635. ModifyDeviceMergedVideoSizeNotification({
  636. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  637. this.mergedChannel = false,
  638. this.deviceCode,
  639. this.mergedVideoOutputWidth = 0,
  640. this.mergedVideoOutputHeight = 0,
  641. this.videoDeviceInfos,
  642. String? code,
  643. bool isResponse = false,
  644. }) : super(
  645. notificationType: notificationType,
  646. code: code,
  647. isResponse: isResponse,
  648. );
  649. factory ModifyDeviceMergedVideoSizeNotification.fromJson(Map<String, dynamic> map) {
  650. return ModifyDeviceMergedVideoSizeNotification(
  651. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  652. mergedChannel: map['MergedChannel'],
  653. deviceCode: map['DeviceCode'],
  654. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  655. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  656. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  657. code: map['Code'],
  658. isResponse: map['IsResponse'],
  659. );
  660. }
  661. Map<String, dynamic> toJson() {
  662. final map = super.toJson();
  663. map['MergedChannel'] = mergedChannel;
  664. if(deviceCode != null)
  665. map['DeviceCode'] = deviceCode;
  666. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  667. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  668. if(videoDeviceInfos != null)
  669. map['VideoDeviceInfos'] = videoDeviceInfos;
  670. return map;
  671. }
  672. }
  673. class PasswordExpiredWarningNotification extends NotificationDTO{
  674. double surplusTime;
  675. PasswordExpiredWarningNotification({
  676. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  677. this.surplusTime = 0,
  678. String? code,
  679. bool isResponse = false,
  680. }) : super(
  681. notificationType: notificationType,
  682. code: code,
  683. isResponse: isResponse,
  684. );
  685. factory PasswordExpiredWarningNotification.fromJson(Map<String, dynamic> map) {
  686. return PasswordExpiredWarningNotification(
  687. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  688. surplusTime: double.parse(map['SurplusTime'].toString()),
  689. code: map['Code'],
  690. isResponse: map['IsResponse'],
  691. );
  692. }
  693. Map<String, dynamic> toJson() {
  694. final map = super.toJson();
  695. map['SurplusTime'] = surplusTime;
  696. return map;
  697. }
  698. }
  699. class ProgressBarNotification extends NotificationDTO{
  700. int rate;
  701. ProgressBarNotification({
  702. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  703. this.rate = 0,
  704. String? code,
  705. bool isResponse = false,
  706. }) : super(
  707. notificationType: notificationType,
  708. code: code,
  709. isResponse: isResponse,
  710. );
  711. factory ProgressBarNotification.fromJson(Map<String, dynamic> map) {
  712. return ProgressBarNotification(
  713. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  714. rate: map['Rate'],
  715. code: map['Code'],
  716. isResponse: map['IsResponse'],
  717. );
  718. }
  719. Map<String, dynamic> toJson() {
  720. final map = super.toJson();
  721. map['Rate'] = rate;
  722. return map;
  723. }
  724. }
  725. class TokenReplacedNotification extends NotificationDTO{
  726. String? userCode;
  727. TokenReplacedNotification({
  728. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  729. this.userCode,
  730. String? code,
  731. bool isResponse = false,
  732. }) : super(
  733. notificationType: notificationType,
  734. code: code,
  735. isResponse: isResponse,
  736. );
  737. factory TokenReplacedNotification.fromJson(Map<String, dynamic> map) {
  738. return TokenReplacedNotification(
  739. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  740. userCode: map['UserCode'],
  741. code: map['Code'],
  742. isResponse: map['IsResponse'],
  743. );
  744. }
  745. Map<String, dynamic> toJson() {
  746. final map = super.toJson();
  747. if(userCode != null)
  748. map['UserCode'] = userCode;
  749. return map;
  750. }
  751. }
  752. enum UpgradeTypeEnum {
  753. NoUpgrade,
  754. Normal,
  755. Force,
  756. AutoAfterRestart,
  757. }
  758. enum UpgradeUpdateTypeEnum {
  759. Part,
  760. All,
  761. }
  762. class DescriptionInfoDTO {
  763. String? description;
  764. String? languageCode;
  765. DescriptionInfoDTO({
  766. this.description,
  767. this.languageCode,
  768. });
  769. factory DescriptionInfoDTO.fromJson(Map<String, dynamic> map) {
  770. return DescriptionInfoDTO(
  771. description: map['Description'],
  772. languageCode: map['LanguageCode'],
  773. );
  774. }
  775. Map<String, dynamic> toJson() {
  776. final map = Map<String, dynamic>();
  777. if(description != null)
  778. map['Description'] = description;
  779. if(languageCode != null)
  780. map['LanguageCode'] = languageCode;
  781. return map;
  782. }
  783. }
  784. class UpgradeVersionNotification extends NotificationDTO{
  785. UpgradeTypeEnum upgradeType;
  786. String? upgradeCDNUrl;
  787. String? upgradeSourceUrl;
  788. String? backUpCDNUrl;
  789. String? backUpSourceUrl;
  790. UpgradeUpdateTypeEnum upgradeUpdateType;
  791. String? newVersion;
  792. List<DescriptionInfoDTO >? descriptions;
  793. UpgradeVersionNotification({
  794. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  795. this.upgradeType = UpgradeTypeEnum.NoUpgrade,
  796. this.upgradeCDNUrl,
  797. this.upgradeSourceUrl,
  798. this.backUpCDNUrl,
  799. this.backUpSourceUrl,
  800. this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part,
  801. this.newVersion,
  802. this.descriptions,
  803. String? code,
  804. bool isResponse = false,
  805. }) : super(
  806. notificationType: notificationType,
  807. code: code,
  808. isResponse: isResponse,
  809. );
  810. factory UpgradeVersionNotification.fromJson(Map<String, dynamic> map) {
  811. return UpgradeVersionNotification(
  812. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  813. upgradeType: UpgradeTypeEnum.values.firstWhere((e) => e.index == map['UpgradeType']),
  814. upgradeCDNUrl: map['UpgradeCDNUrl'],
  815. upgradeSourceUrl: map['UpgradeSourceUrl'],
  816. backUpCDNUrl: map['BackUpCDNUrl'],
  817. backUpSourceUrl: map['BackUpSourceUrl'],
  818. upgradeUpdateType: UpgradeUpdateTypeEnum.values.firstWhere((e) => e.index == map['UpgradeUpdateType']),
  819. newVersion: map['NewVersion'],
  820. descriptions: map['Descriptions'] != null ? (map['Descriptions'] as List).map((e)=>DescriptionInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  821. code: map['Code'],
  822. isResponse: map['IsResponse'],
  823. );
  824. }
  825. Map<String, dynamic> toJson() {
  826. final map = super.toJson();
  827. map['UpgradeType'] = upgradeType.index;
  828. if(upgradeCDNUrl != null)
  829. map['UpgradeCDNUrl'] = upgradeCDNUrl;
  830. if(upgradeSourceUrl != null)
  831. map['UpgradeSourceUrl'] = upgradeSourceUrl;
  832. if(backUpCDNUrl != null)
  833. map['BackUpCDNUrl'] = backUpCDNUrl;
  834. if(backUpSourceUrl != null)
  835. map['BackUpSourceUrl'] = backUpSourceUrl;
  836. map['UpgradeUpdateType'] = upgradeUpdateType.index;
  837. if(newVersion != null)
  838. map['NewVersion'] = newVersion;
  839. if(descriptions != null)
  840. map['Descriptions'] = descriptions;
  841. return map;
  842. }
  843. }
  844. class CancelLogDownloadNotification extends NotificationDTO{
  845. String? controlUserCode;
  846. CancelLogDownloadNotification({
  847. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  848. this.controlUserCode,
  849. String? code,
  850. bool isResponse = false,
  851. }) : super(
  852. notificationType: notificationType,
  853. code: code,
  854. isResponse: isResponse,
  855. );
  856. factory CancelLogDownloadNotification.fromJson(Map<String, dynamic> map) {
  857. return CancelLogDownloadNotification(
  858. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  859. controlUserCode: map['ControlUserCode'],
  860. code: map['Code'],
  861. isResponse: map['IsResponse'],
  862. );
  863. }
  864. Map<String, dynamic> toJson() {
  865. final map = super.toJson();
  866. if(controlUserCode != null)
  867. map['ControlUserCode'] = controlUserCode;
  868. return map;
  869. }
  870. }
  871. class DeviceDownloadPatchProgressToUserNotification extends NotificationDTO{
  872. int progress;
  873. String? patchCode;
  874. String? deviceCode;
  875. String? patchName;
  876. RemoteDeviceStateEnum remoteDeviceState;
  877. DeviceDownloadPatchProgressToUserNotification({
  878. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  879. this.progress = 0,
  880. this.patchCode,
  881. this.deviceCode,
  882. this.patchName,
  883. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  884. String? code,
  885. bool isResponse = false,
  886. }) : super(
  887. notificationType: notificationType,
  888. code: code,
  889. isResponse: isResponse,
  890. );
  891. factory DeviceDownloadPatchProgressToUserNotification.fromJson(Map<String, dynamic> map) {
  892. return DeviceDownloadPatchProgressToUserNotification(
  893. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  894. progress: map['Progress'],
  895. patchCode: map['PatchCode'],
  896. deviceCode: map['DeviceCode'],
  897. patchName: map['PatchName'],
  898. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  899. code: map['Code'],
  900. isResponse: map['IsResponse'],
  901. );
  902. }
  903. Map<String, dynamic> toJson() {
  904. final map = super.toJson();
  905. map['Progress'] = progress;
  906. if(patchCode != null)
  907. map['PatchCode'] = patchCode;
  908. if(deviceCode != null)
  909. map['DeviceCode'] = deviceCode;
  910. if(patchName != null)
  911. map['PatchName'] = patchName;
  912. map['RemoteDeviceState'] = remoteDeviceState.index;
  913. return map;
  914. }
  915. }
  916. enum DevicePrinterEnum {
  917. GetInstalledPrinters,
  918. PrintTestPage,
  919. UpdatePrinterConfiguration,
  920. GetUninstalledPrinters,
  921. InstallPrinterDrive,
  922. DeletePrinter,
  923. CancelSearchPrinter,
  924. SearchPrinter,
  925. CancelInstallPrinter,
  926. InstallPrinterProgress,
  927. }
  928. enum DevicePrinterParameterEnum {
  929. PrinterName,
  930. IPAddress,
  931. Port,
  932. PrinterModel,
  933. DevicePrinterPatchCode,
  934. PageSize,
  935. PageOrientation,
  936. IsNormalSearchType,
  937. }
  938. class DevicePrinterParameter {
  939. DevicePrinterParameterEnum setPrinterEnum;
  940. String? parameterValue;
  941. DevicePrinterParameter({
  942. this.setPrinterEnum = DevicePrinterParameterEnum.PrinterName,
  943. this.parameterValue,
  944. });
  945. factory DevicePrinterParameter.fromJson(Map<String, dynamic> map) {
  946. return DevicePrinterParameter(
  947. setPrinterEnum: DevicePrinterParameterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  948. parameterValue: map['ParameterValue'],
  949. );
  950. }
  951. Map<String, dynamic> toJson() {
  952. final map = Map<String, dynamic>();
  953. map['SetPrinterEnum'] = setPrinterEnum.index;
  954. if(parameterValue != null)
  955. map['ParameterValue'] = parameterValue;
  956. return map;
  957. }
  958. }
  959. class BaseDTO {
  960. DateTime? createTime;
  961. DateTime? updateTime;
  962. BaseDTO({
  963. this.createTime,
  964. this.updateTime,
  965. });
  966. factory BaseDTO.fromJson(Map<String, dynamic> map) {
  967. return BaseDTO(
  968. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  969. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  970. );
  971. }
  972. Map<String, dynamic> toJson() {
  973. final map = Map<String, dynamic>();
  974. if(createTime != null)
  975. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  976. if(updateTime != null)
  977. map['UpdateTime'] = JsonRpcUtils.dateFormat(updateTime!);
  978. return map;
  979. }
  980. }
  981. class UploadDeviceFileInfoDTO {
  982. String? uploadId;
  983. int partNum;
  984. String? fileUrl;
  985. String? fileName;
  986. UploadDeviceFileInfoDTO({
  987. this.uploadId,
  988. this.partNum = 0,
  989. this.fileUrl,
  990. this.fileName,
  991. });
  992. factory UploadDeviceFileInfoDTO.fromJson(Map<String, dynamic> map) {
  993. return UploadDeviceFileInfoDTO(
  994. uploadId: map['UploadId'],
  995. partNum: map['PartNum'],
  996. fileUrl: map['FileUrl'],
  997. fileName: map['FileName'],
  998. );
  999. }
  1000. Map<String, dynamic> toJson() {
  1001. final map = Map<String, dynamic>();
  1002. if(uploadId != null)
  1003. map['UploadId'] = uploadId;
  1004. map['PartNum'] = partNum;
  1005. if(fileUrl != null)
  1006. map['FileUrl'] = fileUrl;
  1007. if(fileName != null)
  1008. map['FileName'] = fileName;
  1009. return map;
  1010. }
  1011. }
  1012. class DevicePrinterDTO extends BaseDTO{
  1013. String? code;
  1014. String? name;
  1015. String? driveModelName;
  1016. String? description;
  1017. String? osVersion;
  1018. List<UploadDeviceFileInfoDTO >? fileUploadInfoList;
  1019. int fileSize;
  1020. String? printerBrands;
  1021. List<String >? printerModels;
  1022. DevicePrinterDTO({
  1023. this.code,
  1024. this.name,
  1025. this.driveModelName,
  1026. this.description,
  1027. this.osVersion,
  1028. this.fileUploadInfoList,
  1029. this.fileSize = 0,
  1030. this.printerBrands,
  1031. this.printerModels,
  1032. DateTime? createTime,
  1033. DateTime? updateTime,
  1034. }) : super(
  1035. createTime: createTime,
  1036. updateTime: updateTime,
  1037. );
  1038. factory DevicePrinterDTO.fromJson(Map<String, dynamic> map) {
  1039. return DevicePrinterDTO(
  1040. code: map['Code'],
  1041. name: map['Name'],
  1042. driveModelName: map['DriveModelName'],
  1043. description: map['Description'],
  1044. osVersion: map['OsVersion'],
  1045. fileUploadInfoList: map['FileUploadInfoList'] != null ? (map['FileUploadInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1046. fileSize: map['FileSize'],
  1047. printerBrands: map['PrinterBrands'],
  1048. printerModels: map['PrinterModels'] != null ? map['PrinterModels'].cast<String>().toList() : null,
  1049. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1050. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  1051. );
  1052. }
  1053. Map<String, dynamic> toJson() {
  1054. final map = super.toJson();
  1055. if(code != null)
  1056. map['Code'] = code;
  1057. if(name != null)
  1058. map['Name'] = name;
  1059. if(driveModelName != null)
  1060. map['DriveModelName'] = driveModelName;
  1061. if(description != null)
  1062. map['Description'] = description;
  1063. if(osVersion != null)
  1064. map['OsVersion'] = osVersion;
  1065. if(fileUploadInfoList != null)
  1066. map['FileUploadInfoList'] = fileUploadInfoList;
  1067. map['FileSize'] = fileSize;
  1068. if(printerBrands != null)
  1069. map['PrinterBrands'] = printerBrands;
  1070. if(printerModels != null)
  1071. map['PrinterModels'] = printerModels;
  1072. return map;
  1073. }
  1074. }
  1075. class DevicePrinterRequestNotification extends NotificationDTO{
  1076. DevicePrinterEnum setPrinterEnum;
  1077. List<DevicePrinterParameter >? parameters;
  1078. DevicePrinterDTO? devicePrinter;
  1079. DevicePrinterRequestNotification({
  1080. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1081. this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters,
  1082. this.parameters,
  1083. this.devicePrinter,
  1084. String? code,
  1085. bool isResponse = false,
  1086. }) : super(
  1087. notificationType: notificationType,
  1088. code: code,
  1089. isResponse: isResponse,
  1090. );
  1091. factory DevicePrinterRequestNotification.fromJson(Map<String, dynamic> map) {
  1092. return DevicePrinterRequestNotification(
  1093. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1094. setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  1095. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>DevicePrinterParameter.fromJson(e as Map<String,dynamic>)).toList() : null,
  1096. devicePrinter: map['DevicePrinter'] != null ? DevicePrinterDTO.fromJson(map['DevicePrinter']) : null,
  1097. code: map['Code'],
  1098. isResponse: map['IsResponse'],
  1099. );
  1100. }
  1101. Map<String, dynamic> toJson() {
  1102. final map = super.toJson();
  1103. map['SetPrinterEnum'] = setPrinterEnum.index;
  1104. if(parameters != null)
  1105. map['Parameters'] = parameters;
  1106. if(devicePrinter != null)
  1107. map['DevicePrinter'] = devicePrinter;
  1108. return map;
  1109. }
  1110. }
  1111. class DevicePrinterParameterDTO {
  1112. String? name;
  1113. String? pageSize;
  1114. String? pageOrientation;
  1115. List<String >? pageOrientationList;
  1116. List<String >? pageSizeList;
  1117. String? brand;
  1118. int installPrinterProgress;
  1119. DevicePrinterParameterDTO({
  1120. this.name,
  1121. this.pageSize,
  1122. this.pageOrientation,
  1123. this.pageOrientationList,
  1124. this.pageSizeList,
  1125. this.brand,
  1126. this.installPrinterProgress = 0,
  1127. });
  1128. factory DevicePrinterParameterDTO.fromJson(Map<String, dynamic> map) {
  1129. return DevicePrinterParameterDTO(
  1130. name: map['Name'],
  1131. pageSize: map['PageSize'],
  1132. pageOrientation: map['PageOrientation'],
  1133. pageOrientationList: map['PageOrientationList'] != null ? map['PageOrientationList'].cast<String>().toList() : null,
  1134. pageSizeList: map['PageSizeList'] != null ? map['PageSizeList'].cast<String>().toList() : null,
  1135. brand: map['Brand'],
  1136. installPrinterProgress: map['InstallPrinterProgress'],
  1137. );
  1138. }
  1139. Map<String, dynamic> toJson() {
  1140. final map = Map<String, dynamic>();
  1141. if(name != null)
  1142. map['Name'] = name;
  1143. if(pageSize != null)
  1144. map['PageSize'] = pageSize;
  1145. if(pageOrientation != null)
  1146. map['PageOrientation'] = pageOrientation;
  1147. if(pageOrientationList != null)
  1148. map['PageOrientationList'] = pageOrientationList;
  1149. if(pageSizeList != null)
  1150. map['PageSizeList'] = pageSizeList;
  1151. if(brand != null)
  1152. map['Brand'] = brand;
  1153. map['InstallPrinterProgress'] = installPrinterProgress;
  1154. return map;
  1155. }
  1156. }
  1157. class DevicePrinterResultNotification extends NotificationDTO{
  1158. String? deviceCode;
  1159. DevicePrinterEnum setPrinterEnum;
  1160. List<DevicePrinterParameterDTO >? devicePrinterList;
  1161. RemoteDeviceStateEnum remoteDeviceState;
  1162. DevicePrinterResultNotification({
  1163. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1164. this.deviceCode,
  1165. this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters,
  1166. this.devicePrinterList,
  1167. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  1168. String? code,
  1169. bool isResponse = false,
  1170. }) : super(
  1171. notificationType: notificationType,
  1172. code: code,
  1173. isResponse: isResponse,
  1174. );
  1175. factory DevicePrinterResultNotification.fromJson(Map<String, dynamic> map) {
  1176. return DevicePrinterResultNotification(
  1177. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1178. deviceCode: map['DeviceCode'],
  1179. setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  1180. devicePrinterList: map['DevicePrinterList'] != null ? (map['DevicePrinterList'] as List).map((e)=>DevicePrinterParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1181. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  1182. code: map['Code'],
  1183. isResponse: map['IsResponse'],
  1184. );
  1185. }
  1186. Map<String, dynamic> toJson() {
  1187. final map = super.toJson();
  1188. if(deviceCode != null)
  1189. map['DeviceCode'] = deviceCode;
  1190. map['SetPrinterEnum'] = setPrinterEnum.index;
  1191. if(devicePrinterList != null)
  1192. map['DevicePrinterList'] = devicePrinterList;
  1193. map['RemoteDeviceState'] = remoteDeviceState.index;
  1194. return map;
  1195. }
  1196. }
  1197. class GetRemoteLogToClientNotification extends NotificationDTO{
  1198. String? deviceCode;
  1199. String? logFileToken;
  1200. int rate;
  1201. RemoteDeviceStateEnum remoteDeviceState;
  1202. GetRemoteLogToClientNotification({
  1203. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1204. this.deviceCode,
  1205. this.logFileToken,
  1206. this.rate = 0,
  1207. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  1208. String? code,
  1209. bool isResponse = false,
  1210. }) : super(
  1211. notificationType: notificationType,
  1212. code: code,
  1213. isResponse: isResponse,
  1214. );
  1215. factory GetRemoteLogToClientNotification.fromJson(Map<String, dynamic> map) {
  1216. return GetRemoteLogToClientNotification(
  1217. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1218. deviceCode: map['DeviceCode'],
  1219. logFileToken: map['LogFileToken'],
  1220. rate: map['Rate'],
  1221. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  1222. code: map['Code'],
  1223. isResponse: map['IsResponse'],
  1224. );
  1225. }
  1226. Map<String, dynamic> toJson() {
  1227. final map = super.toJson();
  1228. if(deviceCode != null)
  1229. map['DeviceCode'] = deviceCode;
  1230. if(logFileToken != null)
  1231. map['LogFileToken'] = logFileToken;
  1232. map['Rate'] = rate;
  1233. map['RemoteDeviceState'] = remoteDeviceState.index;
  1234. return map;
  1235. }
  1236. }
  1237. class GetRemoteLogToDeviceNotification extends NotificationDTO{
  1238. String? controlUserCode;
  1239. DateTime? startTime;
  1240. DateTime? endTime;
  1241. GetRemoteLogToDeviceNotification({
  1242. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1243. this.controlUserCode,
  1244. this.startTime,
  1245. this.endTime,
  1246. String? code,
  1247. bool isResponse = false,
  1248. }) : super(
  1249. notificationType: notificationType,
  1250. code: code,
  1251. isResponse: isResponse,
  1252. );
  1253. factory GetRemoteLogToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1254. return GetRemoteLogToDeviceNotification(
  1255. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1256. controlUserCode: map['ControlUserCode'],
  1257. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1258. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  1259. code: map['Code'],
  1260. isResponse: map['IsResponse'],
  1261. );
  1262. }
  1263. Map<String, dynamic> toJson() {
  1264. final map = super.toJson();
  1265. if(controlUserCode != null)
  1266. map['ControlUserCode'] = controlUserCode;
  1267. if(startTime != null)
  1268. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1269. if(endTime != null)
  1270. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  1271. return map;
  1272. }
  1273. }
  1274. enum PushDevicePatchEnum {
  1275. Start,
  1276. Cancel,
  1277. }
  1278. class PushDevicePatchToDeviceNotification extends NotificationDTO{
  1279. String? patchName;
  1280. String? patchCode;
  1281. List<UploadDeviceFileInfoDTO >? deviceFileInfoList;
  1282. int fileSize;
  1283. PushDevicePatchEnum pushEnum;
  1284. PushDevicePatchToDeviceNotification({
  1285. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1286. this.patchName,
  1287. this.patchCode,
  1288. this.deviceFileInfoList,
  1289. this.fileSize = 0,
  1290. this.pushEnum = PushDevicePatchEnum.Start,
  1291. String? code,
  1292. bool isResponse = false,
  1293. }) : super(
  1294. notificationType: notificationType,
  1295. code: code,
  1296. isResponse: isResponse,
  1297. );
  1298. factory PushDevicePatchToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1299. return PushDevicePatchToDeviceNotification(
  1300. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1301. patchName: map['PatchName'],
  1302. patchCode: map['PatchCode'],
  1303. deviceFileInfoList: map['DeviceFileInfoList'] != null ? (map['DeviceFileInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1304. fileSize: map['FileSize'],
  1305. pushEnum: PushDevicePatchEnum.values.firstWhere((e) => e.index == map['PushEnum']),
  1306. code: map['Code'],
  1307. isResponse: map['IsResponse'],
  1308. );
  1309. }
  1310. Map<String, dynamic> toJson() {
  1311. final map = super.toJson();
  1312. if(patchName != null)
  1313. map['PatchName'] = patchName;
  1314. if(patchCode != null)
  1315. map['PatchCode'] = patchCode;
  1316. if(deviceFileInfoList != null)
  1317. map['DeviceFileInfoList'] = deviceFileInfoList;
  1318. map['FileSize'] = fileSize;
  1319. map['PushEnum'] = pushEnum.index;
  1320. return map;
  1321. }
  1322. }
  1323. class RestartDeviceNotification extends NotificationDTO{
  1324. String? controlUserCode;
  1325. RestartDeviceNotification({
  1326. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1327. this.controlUserCode,
  1328. String? code,
  1329. bool isResponse = false,
  1330. }) : super(
  1331. notificationType: notificationType,
  1332. code: code,
  1333. isResponse: isResponse,
  1334. );
  1335. factory RestartDeviceNotification.fromJson(Map<String, dynamic> map) {
  1336. return RestartDeviceNotification(
  1337. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1338. controlUserCode: map['ControlUserCode'],
  1339. code: map['Code'],
  1340. isResponse: map['IsResponse'],
  1341. );
  1342. }
  1343. Map<String, dynamic> toJson() {
  1344. final map = super.toJson();
  1345. if(controlUserCode != null)
  1346. map['ControlUserCode'] = controlUserCode;
  1347. return map;
  1348. }
  1349. }
  1350. class CloseLiveToDeviceNotification extends NotificationDTO{
  1351. String? liveRoomCode;
  1352. CloseLiveToDeviceNotification({
  1353. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1354. this.liveRoomCode,
  1355. String? code,
  1356. bool isResponse = false,
  1357. }) : super(
  1358. notificationType: notificationType,
  1359. code: code,
  1360. isResponse: isResponse,
  1361. );
  1362. factory CloseLiveToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1363. return CloseLiveToDeviceNotification(
  1364. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1365. liveRoomCode: map['LiveRoomCode'],
  1366. code: map['Code'],
  1367. isResponse: map['IsResponse'],
  1368. );
  1369. }
  1370. Map<String, dynamic> toJson() {
  1371. final map = super.toJson();
  1372. if(liveRoomCode != null)
  1373. map['LiveRoomCode'] = liveRoomCode;
  1374. return map;
  1375. }
  1376. }
  1377. class ConnectStatusToClientNotification extends NotificationDTO{
  1378. String? deviceCode;
  1379. String? deviceName;
  1380. ControlDeviceParameterEnum controlType;
  1381. RemoteDeviceStateEnum remoteDeviceState;
  1382. ConnectStatusToClientNotification({
  1383. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1384. this.deviceCode,
  1385. this.deviceName,
  1386. this.controlType = ControlDeviceParameterEnum.Start,
  1387. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  1388. String? code,
  1389. bool isResponse = false,
  1390. }) : super(
  1391. notificationType: notificationType,
  1392. code: code,
  1393. isResponse: isResponse,
  1394. );
  1395. factory ConnectStatusToClientNotification.fromJson(Map<String, dynamic> map) {
  1396. return ConnectStatusToClientNotification(
  1397. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1398. deviceCode: map['DeviceCode'],
  1399. deviceName: map['DeviceName'],
  1400. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1401. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  1402. code: map['Code'],
  1403. isResponse: map['IsResponse'],
  1404. );
  1405. }
  1406. Map<String, dynamic> toJson() {
  1407. final map = super.toJson();
  1408. if(deviceCode != null)
  1409. map['DeviceCode'] = deviceCode;
  1410. if(deviceName != null)
  1411. map['DeviceName'] = deviceName;
  1412. map['ControlType'] = controlType.index;
  1413. map['RemoteDeviceState'] = remoteDeviceState.index;
  1414. return map;
  1415. }
  1416. }
  1417. enum TransactionTypeEnum {
  1418. placeHolder_0,
  1419. Consultion,
  1420. Chat,
  1421. Announcement,
  1422. Session,
  1423. RemoteDia,
  1424. ControlParameter,
  1425. Education,
  1426. Upgrade,
  1427. Live,
  1428. AfterSales,
  1429. }
  1430. class ConnectStatusToDeviceNotification extends NotificationDTO{
  1431. String? controlUserCode;
  1432. String? controlUserName;
  1433. ControlDeviceParameterEnum controlType;
  1434. TransactionTypeEnum transactionType;
  1435. ConnectStatusToDeviceNotification({
  1436. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1437. this.controlUserCode,
  1438. this.controlUserName,
  1439. this.controlType = ControlDeviceParameterEnum.Start,
  1440. this.transactionType = TransactionTypeEnum.Consultion,
  1441. String? code,
  1442. bool isResponse = false,
  1443. }) : super(
  1444. notificationType: notificationType,
  1445. code: code,
  1446. isResponse: isResponse,
  1447. );
  1448. factory ConnectStatusToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1449. return ConnectStatusToDeviceNotification(
  1450. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1451. controlUserCode: map['ControlUserCode'],
  1452. controlUserName: map['ControlUserName'],
  1453. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1454. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  1455. code: map['Code'],
  1456. isResponse: map['IsResponse'],
  1457. );
  1458. }
  1459. Map<String, dynamic> toJson() {
  1460. final map = super.toJson();
  1461. if(controlUserCode != null)
  1462. map['ControlUserCode'] = controlUserCode;
  1463. if(controlUserName != null)
  1464. map['ControlUserName'] = controlUserName;
  1465. map['ControlType'] = controlType.index;
  1466. map['TransactionType'] = transactionType.index;
  1467. return map;
  1468. }
  1469. }
  1470. class DeviceLiveFinishedNotification extends NotificationDTO{
  1471. String? liveRoomCode;
  1472. DeviceLiveFinishedNotification({
  1473. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1474. this.liveRoomCode,
  1475. String? code,
  1476. bool isResponse = false,
  1477. }) : super(
  1478. notificationType: notificationType,
  1479. code: code,
  1480. isResponse: isResponse,
  1481. );
  1482. factory DeviceLiveFinishedNotification.fromJson(Map<String, dynamic> map) {
  1483. return DeviceLiveFinishedNotification(
  1484. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1485. liveRoomCode: map['LiveRoomCode'],
  1486. code: map['Code'],
  1487. isResponse: map['IsResponse'],
  1488. );
  1489. }
  1490. Map<String, dynamic> toJson() {
  1491. final map = super.toJson();
  1492. if(liveRoomCode != null)
  1493. map['LiveRoomCode'] = liveRoomCode;
  1494. return map;
  1495. }
  1496. }
  1497. class VideoDeviceOutputInfo {
  1498. String? videoDeviceId;
  1499. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  1500. int outputWidth;
  1501. int outputHeight;
  1502. int videoFps;
  1503. int videoBitrate;
  1504. int minVideoBitrate;
  1505. String? videoDeviceSign;
  1506. VideoDeviceOutputInfo({
  1507. this.videoDeviceId,
  1508. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  1509. this.outputWidth = 0,
  1510. this.outputHeight = 0,
  1511. this.videoFps = 0,
  1512. this.videoBitrate = 0,
  1513. this.minVideoBitrate = 0,
  1514. this.videoDeviceSign,
  1515. });
  1516. factory VideoDeviceOutputInfo.fromJson(Map<String, dynamic> map) {
  1517. return VideoDeviceOutputInfo(
  1518. videoDeviceId: map['VideoDeviceId'],
  1519. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  1520. outputWidth: map['OutputWidth'],
  1521. outputHeight: map['OutputHeight'],
  1522. videoFps: map['VideoFps'],
  1523. videoBitrate: map['VideoBitrate'],
  1524. minVideoBitrate: map['MinVideoBitrate'],
  1525. videoDeviceSign: map['VideoDeviceSign'],
  1526. );
  1527. }
  1528. Map<String, dynamic> toJson() {
  1529. final map = Map<String, dynamic>();
  1530. if(videoDeviceId != null)
  1531. map['VideoDeviceId'] = videoDeviceId;
  1532. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  1533. map['OutputWidth'] = outputWidth;
  1534. map['OutputHeight'] = outputHeight;
  1535. map['VideoFps'] = videoFps;
  1536. map['VideoBitrate'] = videoBitrate;
  1537. map['MinVideoBitrate'] = minVideoBitrate;
  1538. if(videoDeviceSign != null)
  1539. map['VideoDeviceSign'] = videoDeviceSign;
  1540. return map;
  1541. }
  1542. }
  1543. class StartLiveToDeviceNotification extends NotificationDTO{
  1544. String? liveRoomCode;
  1545. int roomNo;
  1546. int appId;
  1547. bool mergedChannel;
  1548. int mergedVideoOutputWidth;
  1549. int mergedVideoOutputHeight;
  1550. List<VideoDeviceOutputInfo >? videoDeviceOutputList;
  1551. StartLiveToDeviceNotification({
  1552. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1553. this.liveRoomCode,
  1554. this.roomNo = 0,
  1555. this.appId = 0,
  1556. this.mergedChannel = false,
  1557. this.mergedVideoOutputWidth = 0,
  1558. this.mergedVideoOutputHeight = 0,
  1559. this.videoDeviceOutputList,
  1560. String? code,
  1561. bool isResponse = false,
  1562. }) : super(
  1563. notificationType: notificationType,
  1564. code: code,
  1565. isResponse: isResponse,
  1566. );
  1567. factory StartLiveToDeviceNotification.fromJson(Map<String, dynamic> map) {
  1568. return StartLiveToDeviceNotification(
  1569. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1570. liveRoomCode: map['LiveRoomCode'],
  1571. roomNo: map['RoomNo'],
  1572. appId: map['AppId'],
  1573. mergedChannel: map['MergedChannel'],
  1574. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  1575. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  1576. videoDeviceOutputList: map['VideoDeviceOutputList'] != null ? (map['VideoDeviceOutputList'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  1577. code: map['Code'],
  1578. isResponse: map['IsResponse'],
  1579. );
  1580. }
  1581. Map<String, dynamic> toJson() {
  1582. final map = super.toJson();
  1583. if(liveRoomCode != null)
  1584. map['LiveRoomCode'] = liveRoomCode;
  1585. map['RoomNo'] = roomNo;
  1586. map['AppId'] = appId;
  1587. map['MergedChannel'] = mergedChannel;
  1588. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  1589. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  1590. if(videoDeviceOutputList != null)
  1591. map['VideoDeviceOutputList'] = videoDeviceOutputList;
  1592. return map;
  1593. }
  1594. }
  1595. class CancelInvitingInLiveCourseNotification extends NotificationDTO{
  1596. String? courseCode;
  1597. CancelInvitingInLiveCourseNotification({
  1598. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1599. this.courseCode,
  1600. String? code,
  1601. bool isResponse = false,
  1602. }) : super(
  1603. notificationType: notificationType,
  1604. code: code,
  1605. isResponse: isResponse,
  1606. );
  1607. factory CancelInvitingInLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  1608. return CancelInvitingInLiveCourseNotification(
  1609. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1610. courseCode: map['CourseCode'],
  1611. code: map['Code'],
  1612. isResponse: map['IsResponse'],
  1613. );
  1614. }
  1615. Map<String, dynamic> toJson() {
  1616. final map = super.toJson();
  1617. if(courseCode != null)
  1618. map['CourseCode'] = courseCode;
  1619. return map;
  1620. }
  1621. }
  1622. class CancelLiveCourseNotification extends NotificationDTO{
  1623. String? courseCode;
  1624. String? teacherCode;
  1625. CancelLiveCourseNotification({
  1626. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1627. this.courseCode,
  1628. this.teacherCode,
  1629. String? code,
  1630. bool isResponse = false,
  1631. }) : super(
  1632. notificationType: notificationType,
  1633. code: code,
  1634. isResponse: isResponse,
  1635. );
  1636. factory CancelLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  1637. return CancelLiveCourseNotification(
  1638. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1639. courseCode: map['CourseCode'],
  1640. teacherCode: map['TeacherCode'],
  1641. code: map['Code'],
  1642. isResponse: map['IsResponse'],
  1643. );
  1644. }
  1645. Map<String, dynamic> toJson() {
  1646. final map = super.toJson();
  1647. if(courseCode != null)
  1648. map['CourseCode'] = courseCode;
  1649. if(teacherCode != null)
  1650. map['TeacherCode'] = teacherCode;
  1651. return map;
  1652. }
  1653. }
  1654. class CloseLiveCourseNotification extends NotificationDTO{
  1655. String? courseCode;
  1656. String? teacherCode;
  1657. CloseLiveCourseNotification({
  1658. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1659. this.courseCode,
  1660. this.teacherCode,
  1661. String? code,
  1662. bool isResponse = false,
  1663. }) : super(
  1664. notificationType: notificationType,
  1665. code: code,
  1666. isResponse: isResponse,
  1667. );
  1668. factory CloseLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  1669. return CloseLiveCourseNotification(
  1670. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1671. courseCode: map['CourseCode'],
  1672. teacherCode: map['TeacherCode'],
  1673. code: map['Code'],
  1674. isResponse: map['IsResponse'],
  1675. );
  1676. }
  1677. Map<String, dynamic> toJson() {
  1678. final map = super.toJson();
  1679. if(courseCode != null)
  1680. map['CourseCode'] = courseCode;
  1681. if(teacherCode != null)
  1682. map['TeacherCode'] = teacherCode;
  1683. return map;
  1684. }
  1685. }
  1686. class CourcePaySuccessNotification extends NotificationDTO{
  1687. String? paymentOrderCode;
  1688. String? orderTitle;
  1689. double orderAmount;
  1690. DateTime? payTime;
  1691. CourcePaySuccessNotification({
  1692. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1693. this.paymentOrderCode,
  1694. this.orderTitle,
  1695. this.orderAmount = 0,
  1696. this.payTime,
  1697. String? code,
  1698. bool isResponse = false,
  1699. }) : super(
  1700. notificationType: notificationType,
  1701. code: code,
  1702. isResponse: isResponse,
  1703. );
  1704. factory CourcePaySuccessNotification.fromJson(Map<String, dynamic> map) {
  1705. return CourcePaySuccessNotification(
  1706. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1707. paymentOrderCode: map['PaymentOrderCode'],
  1708. orderTitle: map['OrderTitle'],
  1709. orderAmount: double.parse(map['OrderAmount'].toString()),
  1710. payTime: map['PayTime'] != null ? DateTime.parse(map['PayTime']) : null,
  1711. code: map['Code'],
  1712. isResponse: map['IsResponse'],
  1713. );
  1714. }
  1715. Map<String, dynamic> toJson() {
  1716. final map = super.toJson();
  1717. if(paymentOrderCode != null)
  1718. map['PaymentOrderCode'] = paymentOrderCode;
  1719. if(orderTitle != null)
  1720. map['OrderTitle'] = orderTitle;
  1721. map['OrderAmount'] = orderAmount;
  1722. if(payTime != null)
  1723. map['PayTime'] = JsonRpcUtils.dateFormat(payTime!);
  1724. return map;
  1725. }
  1726. }
  1727. enum CourseStatusEnum {
  1728. Unknown,
  1729. NoApproval,
  1730. Approved,
  1731. RejectApproval,
  1732. Started,
  1733. HasEnded,
  1734. HasCancelled,
  1735. Overdue,
  1736. Offline,
  1737. }
  1738. class CourseStatusNotification extends NotificationDTO{
  1739. CourseStatusEnum status;
  1740. String? courseCode;
  1741. String? courseName;
  1742. CourseStatusNotification({
  1743. this.status = CourseStatusEnum.Unknown,
  1744. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1745. this.courseCode,
  1746. this.courseName,
  1747. String? code,
  1748. bool isResponse = false,
  1749. }) : super(
  1750. notificationType: notificationType,
  1751. code: code,
  1752. isResponse: isResponse,
  1753. );
  1754. factory CourseStatusNotification.fromJson(Map<String, dynamic> map) {
  1755. return CourseStatusNotification(
  1756. status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  1757. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1758. courseCode: map['CourseCode'],
  1759. courseName: map['CourseName'],
  1760. code: map['Code'],
  1761. isResponse: map['IsResponse'],
  1762. );
  1763. }
  1764. Map<String, dynamic> toJson() {
  1765. final map = super.toJson();
  1766. map['Status'] = status.index;
  1767. if(courseCode != null)
  1768. map['CourseCode'] = courseCode;
  1769. if(courseName != null)
  1770. map['CourseName'] = courseName;
  1771. return map;
  1772. }
  1773. }
  1774. enum LiveMemberEnum {
  1775. placeHolder_0,
  1776. User,
  1777. Device,
  1778. }
  1779. enum LiveConsultationMemberStatus {
  1780. Default,
  1781. Accepted,
  1782. Rejected,
  1783. Joined,
  1784. Left,
  1785. }
  1786. enum LoginSource {
  1787. PC,
  1788. Mobile,
  1789. Pad,
  1790. Web,
  1791. US,
  1792. }
  1793. class LiveData {
  1794. int height;
  1795. int width;
  1796. String? rtmpPushUrl;
  1797. String? rtmpPullUrl;
  1798. String? httpPullUrl;
  1799. String? hlsPullUrl;
  1800. LiveData({
  1801. this.height = 0,
  1802. this.width = 0,
  1803. this.rtmpPushUrl,
  1804. this.rtmpPullUrl,
  1805. this.httpPullUrl,
  1806. this.hlsPullUrl,
  1807. });
  1808. factory LiveData.fromJson(Map<String, dynamic> map) {
  1809. return LiveData(
  1810. height: map['Height'],
  1811. width: map['Width'],
  1812. rtmpPushUrl: map['RtmpPushUrl'],
  1813. rtmpPullUrl: map['RtmpPullUrl'],
  1814. httpPullUrl: map['HttpPullUrl'],
  1815. hlsPullUrl: map['HlsPullUrl'],
  1816. );
  1817. }
  1818. Map<String, dynamic> toJson() {
  1819. final map = Map<String, dynamic>();
  1820. map['Height'] = height;
  1821. map['Width'] = width;
  1822. if(rtmpPushUrl != null)
  1823. map['RtmpPushUrl'] = rtmpPushUrl;
  1824. if(rtmpPullUrl != null)
  1825. map['RtmpPullUrl'] = rtmpPullUrl;
  1826. if(httpPullUrl != null)
  1827. map['HttpPullUrl'] = httpPullUrl;
  1828. if(hlsPullUrl != null)
  1829. map['HlsPullUrl'] = hlsPullUrl;
  1830. return map;
  1831. }
  1832. }
  1833. class LiveConsultationMember {
  1834. String? id;
  1835. String? name;
  1836. LiveMemberEnum memberType;
  1837. String? headImageToken;
  1838. bool isOnline;
  1839. bool mute;
  1840. bool videoOpend;
  1841. bool isInitiator;
  1842. bool isBusy;
  1843. LiveConsultationMemberStatus status;
  1844. String? loginServerUrl;
  1845. LoginSource loginSource;
  1846. bool mergedChannel;
  1847. int mergedVideoOutputWidth;
  1848. int mergedVideoOutputHeight;
  1849. LiveData? liveData;
  1850. List<VideoDeviceOutputInfo >? videoDeviceInfos;
  1851. bool isControllingParameter;
  1852. int sortNumber;
  1853. int sortLevel;
  1854. LiveConsultationMember({
  1855. this.id,
  1856. this.name,
  1857. this.memberType = LiveMemberEnum.User,
  1858. this.headImageToken,
  1859. this.isOnline = false,
  1860. this.mute = false,
  1861. this.videoOpend = false,
  1862. this.isInitiator = false,
  1863. this.isBusy = false,
  1864. this.status = LiveConsultationMemberStatus.Default,
  1865. this.loginServerUrl,
  1866. this.loginSource = LoginSource.PC,
  1867. this.mergedChannel = false,
  1868. this.mergedVideoOutputWidth = 0,
  1869. this.mergedVideoOutputHeight = 0,
  1870. this.liveData,
  1871. this.videoDeviceInfos,
  1872. this.isControllingParameter = false,
  1873. this.sortNumber = 0,
  1874. this.sortLevel = 0,
  1875. });
  1876. factory LiveConsultationMember.fromJson(Map<String, dynamic> map) {
  1877. return LiveConsultationMember(
  1878. id: map['Id'],
  1879. name: map['Name'],
  1880. memberType: LiveMemberEnum.values.firstWhere((e) => e.index == map['MemberType']),
  1881. headImageToken: map['HeadImageToken'],
  1882. isOnline: map['IsOnline'],
  1883. mute: map['Mute'],
  1884. videoOpend: map['VideoOpend'],
  1885. isInitiator: map['IsInitiator'],
  1886. isBusy: map['IsBusy'],
  1887. status: LiveConsultationMemberStatus.values.firstWhere((e) => e.index == map['Status']),
  1888. loginServerUrl: map['LoginServerUrl'],
  1889. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  1890. mergedChannel: map['MergedChannel'],
  1891. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  1892. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  1893. liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
  1894. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  1895. isControllingParameter: map['IsControllingParameter'],
  1896. sortNumber: map['SortNumber'],
  1897. sortLevel: map['SortLevel'],
  1898. );
  1899. }
  1900. Map<String, dynamic> toJson() {
  1901. final map = Map<String, dynamic>();
  1902. if(id != null)
  1903. map['Id'] = id;
  1904. if(name != null)
  1905. map['Name'] = name;
  1906. map['MemberType'] = memberType.index;
  1907. if(headImageToken != null)
  1908. map['HeadImageToken'] = headImageToken;
  1909. map['IsOnline'] = isOnline;
  1910. map['Mute'] = mute;
  1911. map['VideoOpend'] = videoOpend;
  1912. map['IsInitiator'] = isInitiator;
  1913. map['IsBusy'] = isBusy;
  1914. map['Status'] = status.index;
  1915. if(loginServerUrl != null)
  1916. map['LoginServerUrl'] = loginServerUrl;
  1917. map['LoginSource'] = loginSource.index;
  1918. map['MergedChannel'] = mergedChannel;
  1919. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  1920. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  1921. if(liveData != null)
  1922. map['LiveData'] = liveData;
  1923. if(videoDeviceInfos != null)
  1924. map['VideoDeviceInfos'] = videoDeviceInfos;
  1925. map['IsControllingParameter'] = isControllingParameter;
  1926. map['SortNumber'] = sortNumber;
  1927. map['SortLevel'] = sortLevel;
  1928. return map;
  1929. }
  1930. }
  1931. class HeartRateJoinCourseNotification extends NotificationDTO{
  1932. String? courseCode;
  1933. LiveConsultationMember? joiner;
  1934. HeartRateJoinCourseNotification({
  1935. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1936. this.courseCode,
  1937. this.joiner,
  1938. String? code,
  1939. bool isResponse = false,
  1940. }) : super(
  1941. notificationType: notificationType,
  1942. code: code,
  1943. isResponse: isResponse,
  1944. );
  1945. factory HeartRateJoinCourseNotification.fromJson(Map<String, dynamic> map) {
  1946. return HeartRateJoinCourseNotification(
  1947. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1948. courseCode: map['CourseCode'],
  1949. joiner: map['Joiner'] != null ? LiveConsultationMember.fromJson(map['Joiner']) : null,
  1950. code: map['Code'],
  1951. isResponse: map['IsResponse'],
  1952. );
  1953. }
  1954. Map<String, dynamic> toJson() {
  1955. final map = super.toJson();
  1956. if(courseCode != null)
  1957. map['CourseCode'] = courseCode;
  1958. if(joiner != null)
  1959. map['Joiner'] = joiner;
  1960. return map;
  1961. }
  1962. }
  1963. class HeartRateLeaveCourseNotification extends NotificationDTO{
  1964. String? courseCode;
  1965. LiveConsultationMember? leaverInfo;
  1966. HeartRateLeaveCourseNotification({
  1967. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  1968. this.courseCode,
  1969. this.leaverInfo,
  1970. String? code,
  1971. bool isResponse = false,
  1972. }) : super(
  1973. notificationType: notificationType,
  1974. code: code,
  1975. isResponse: isResponse,
  1976. );
  1977. factory HeartRateLeaveCourseNotification.fromJson(Map<String, dynamic> map) {
  1978. return HeartRateLeaveCourseNotification(
  1979. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  1980. courseCode: map['CourseCode'],
  1981. leaverInfo: map['LeaverInfo'] != null ? LiveConsultationMember.fromJson(map['LeaverInfo']) : null,
  1982. code: map['Code'],
  1983. isResponse: map['IsResponse'],
  1984. );
  1985. }
  1986. Map<String, dynamic> toJson() {
  1987. final map = super.toJson();
  1988. if(courseCode != null)
  1989. map['CourseCode'] = courseCode;
  1990. if(leaverInfo != null)
  1991. map['LeaverInfo'] = leaverInfo;
  1992. return map;
  1993. }
  1994. }
  1995. class InviteLiveCourseNotification extends NotificationDTO{
  1996. String? courseCode;
  1997. int roomNo;
  1998. LiveConsultationMember? initiator;
  1999. InviteLiveCourseNotification({
  2000. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2001. this.courseCode,
  2002. this.roomNo = 0,
  2003. this.initiator,
  2004. String? code,
  2005. bool isResponse = false,
  2006. }) : super(
  2007. notificationType: notificationType,
  2008. code: code,
  2009. isResponse: isResponse,
  2010. );
  2011. factory InviteLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  2012. return InviteLiveCourseNotification(
  2013. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2014. courseCode: map['CourseCode'],
  2015. roomNo: map['RoomNo'],
  2016. initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null,
  2017. code: map['Code'],
  2018. isResponse: map['IsResponse'],
  2019. );
  2020. }
  2021. Map<String, dynamic> toJson() {
  2022. final map = super.toJson();
  2023. if(courseCode != null)
  2024. map['CourseCode'] = courseCode;
  2025. map['RoomNo'] = roomNo;
  2026. if(initiator != null)
  2027. map['Initiator'] = initiator;
  2028. return map;
  2029. }
  2030. }
  2031. class JoinLiveCourseNotification extends NotificationDTO{
  2032. String? courseCode;
  2033. LiveConsultationMember? joiner;
  2034. JoinLiveCourseNotification({
  2035. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2036. this.courseCode,
  2037. this.joiner,
  2038. String? code,
  2039. bool isResponse = false,
  2040. }) : super(
  2041. notificationType: notificationType,
  2042. code: code,
  2043. isResponse: isResponse,
  2044. );
  2045. factory JoinLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  2046. return JoinLiveCourseNotification(
  2047. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2048. courseCode: map['CourseCode'],
  2049. joiner: map['Joiner'] != null ? LiveConsultationMember.fromJson(map['Joiner']) : null,
  2050. code: map['Code'],
  2051. isResponse: map['IsResponse'],
  2052. );
  2053. }
  2054. Map<String, dynamic> toJson() {
  2055. final map = super.toJson();
  2056. if(courseCode != null)
  2057. map['CourseCode'] = courseCode;
  2058. if(joiner != null)
  2059. map['Joiner'] = joiner;
  2060. return map;
  2061. }
  2062. }
  2063. class LeaveLiveCourseNotification extends NotificationDTO{
  2064. String? courseCode;
  2065. LiveConsultationMember? leaverInfo;
  2066. LeaveLiveCourseNotification({
  2067. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2068. this.courseCode,
  2069. this.leaverInfo,
  2070. String? code,
  2071. bool isResponse = false,
  2072. }) : super(
  2073. notificationType: notificationType,
  2074. code: code,
  2075. isResponse: isResponse,
  2076. );
  2077. factory LeaveLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  2078. return LeaveLiveCourseNotification(
  2079. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2080. courseCode: map['CourseCode'],
  2081. leaverInfo: map['LeaverInfo'] != null ? LiveConsultationMember.fromJson(map['LeaverInfo']) : null,
  2082. code: map['Code'],
  2083. isResponse: map['IsResponse'],
  2084. );
  2085. }
  2086. Map<String, dynamic> toJson() {
  2087. final map = super.toJson();
  2088. if(courseCode != null)
  2089. map['CourseCode'] = courseCode;
  2090. if(leaverInfo != null)
  2091. map['LeaverInfo'] = leaverInfo;
  2092. return map;
  2093. }
  2094. }
  2095. class MuteLiveCourseNotification extends NotificationDTO{
  2096. String? courseCode;
  2097. bool mute;
  2098. LiveConsultationMember? muterInfo;
  2099. MuteLiveCourseNotification({
  2100. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2101. this.courseCode,
  2102. this.mute = false,
  2103. this.muterInfo,
  2104. String? code,
  2105. bool isResponse = false,
  2106. }) : super(
  2107. notificationType: notificationType,
  2108. code: code,
  2109. isResponse: isResponse,
  2110. );
  2111. factory MuteLiveCourseNotification.fromJson(Map<String, dynamic> map) {
  2112. return MuteLiveCourseNotification(
  2113. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2114. courseCode: map['CourseCode'],
  2115. mute: map['Mute'],
  2116. muterInfo: map['MuterInfo'] != null ? LiveConsultationMember.fromJson(map['MuterInfo']) : null,
  2117. code: map['Code'],
  2118. isResponse: map['IsResponse'],
  2119. );
  2120. }
  2121. Map<String, dynamic> toJson() {
  2122. final map = super.toJson();
  2123. if(courseCode != null)
  2124. map['CourseCode'] = courseCode;
  2125. map['Mute'] = mute;
  2126. if(muterInfo != null)
  2127. map['MuterInfo'] = muterInfo;
  2128. return map;
  2129. }
  2130. }
  2131. class NetworkErrCourseNotification extends NotificationDTO{
  2132. String? courseCode;
  2133. LiveConsultationMember? networkErrMemberInfo;
  2134. NetworkErrCourseNotification({
  2135. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2136. this.courseCode,
  2137. this.networkErrMemberInfo,
  2138. String? code,
  2139. bool isResponse = false,
  2140. }) : super(
  2141. notificationType: notificationType,
  2142. code: code,
  2143. isResponse: isResponse,
  2144. );
  2145. factory NetworkErrCourseNotification.fromJson(Map<String, dynamic> map) {
  2146. return NetworkErrCourseNotification(
  2147. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2148. courseCode: map['CourseCode'],
  2149. networkErrMemberInfo: map['NetworkErrMemberInfo'] != null ? LiveConsultationMember.fromJson(map['NetworkErrMemberInfo']) : null,
  2150. code: map['Code'],
  2151. isResponse: map['IsResponse'],
  2152. );
  2153. }
  2154. Map<String, dynamic> toJson() {
  2155. final map = super.toJson();
  2156. if(courseCode != null)
  2157. map['CourseCode'] = courseCode;
  2158. if(networkErrMemberInfo != null)
  2159. map['NetworkErrMemberInfo'] = networkErrMemberInfo;
  2160. return map;
  2161. }
  2162. }
  2163. class SwitchLiveCourseVideoNotification extends NotificationDTO{
  2164. String? courseCode;
  2165. bool opened;
  2166. LiveConsultationMember? switcherInfo;
  2167. SwitchLiveCourseVideoNotification({
  2168. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2169. this.courseCode,
  2170. this.opened = false,
  2171. this.switcherInfo,
  2172. String? code,
  2173. bool isResponse = false,
  2174. }) : super(
  2175. notificationType: notificationType,
  2176. code: code,
  2177. isResponse: isResponse,
  2178. );
  2179. factory SwitchLiveCourseVideoNotification.fromJson(Map<String, dynamic> map) {
  2180. return SwitchLiveCourseVideoNotification(
  2181. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2182. courseCode: map['CourseCode'],
  2183. opened: map['Opened'],
  2184. switcherInfo: map['SwitcherInfo'] != null ? LiveConsultationMember.fromJson(map['SwitcherInfo']) : null,
  2185. code: map['Code'],
  2186. isResponse: map['IsResponse'],
  2187. );
  2188. }
  2189. Map<String, dynamic> toJson() {
  2190. final map = super.toJson();
  2191. if(courseCode != null)
  2192. map['CourseCode'] = courseCode;
  2193. map['Opened'] = opened;
  2194. if(switcherInfo != null)
  2195. map['SwitcherInfo'] = switcherInfo;
  2196. return map;
  2197. }
  2198. }
  2199. class UpgradeNotification extends NotificationDTO{
  2200. UpgradeTypeEnum upgadeType;
  2201. String? upgradeCDNUrl;
  2202. String? upgradeUrl;
  2203. UpgradeUpdateTypeEnum upgradeUpdateType;
  2204. String? newVersion;
  2205. String? description;
  2206. UpgradeNotification({
  2207. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2208. this.upgadeType = UpgradeTypeEnum.NoUpgrade,
  2209. this.upgradeCDNUrl,
  2210. this.upgradeUrl,
  2211. this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part,
  2212. this.newVersion,
  2213. this.description,
  2214. String? code,
  2215. bool isResponse = false,
  2216. }) : super(
  2217. notificationType: notificationType,
  2218. code: code,
  2219. isResponse: isResponse,
  2220. );
  2221. factory UpgradeNotification.fromJson(Map<String, dynamic> map) {
  2222. return UpgradeNotification(
  2223. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2224. upgadeType: UpgradeTypeEnum.values.firstWhere((e) => e.index == map['UpgadeType']),
  2225. upgradeCDNUrl: map['UpgradeCDNUrl'],
  2226. upgradeUrl: map['UpgradeUrl'],
  2227. upgradeUpdateType: UpgradeUpdateTypeEnum.values.firstWhere((e) => e.index == map['UpgradeUpdateType']),
  2228. newVersion: map['NewVersion'],
  2229. description: map['Description'],
  2230. code: map['Code'],
  2231. isResponse: map['IsResponse'],
  2232. );
  2233. }
  2234. Map<String, dynamic> toJson() {
  2235. final map = super.toJson();
  2236. map['UpgadeType'] = upgadeType.index;
  2237. if(upgradeCDNUrl != null)
  2238. map['UpgradeCDNUrl'] = upgradeCDNUrl;
  2239. if(upgradeUrl != null)
  2240. map['UpgradeUrl'] = upgradeUrl;
  2241. map['UpgradeUpdateType'] = upgradeUpdateType.index;
  2242. if(newVersion != null)
  2243. map['NewVersion'] = newVersion;
  2244. if(description != null)
  2245. map['Description'] = description;
  2246. return map;
  2247. }
  2248. }
  2249. class ApplyConsultationNotification extends NotificationDTO{
  2250. String? consultationCode;
  2251. String? operatorName;
  2252. String? patientName;
  2253. DateTime? applicationTime;
  2254. String? applyOrganizationName;
  2255. DateTime? consultationTime;
  2256. ApplyConsultationNotification({
  2257. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2258. this.consultationCode,
  2259. this.operatorName,
  2260. this.patientName,
  2261. this.applicationTime,
  2262. this.applyOrganizationName,
  2263. this.consultationTime,
  2264. String? code,
  2265. bool isResponse = false,
  2266. }) : super(
  2267. notificationType: notificationType,
  2268. code: code,
  2269. isResponse: isResponse,
  2270. );
  2271. factory ApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2272. return ApplyConsultationNotification(
  2273. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2274. consultationCode: map['ConsultationCode'],
  2275. operatorName: map['OperatorName'],
  2276. patientName: map['PatientName'],
  2277. applicationTime: map['ApplicationTime'] != null ? DateTime.parse(map['ApplicationTime']) : null,
  2278. applyOrganizationName: map['ApplyOrganizationName'],
  2279. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2280. code: map['Code'],
  2281. isResponse: map['IsResponse'],
  2282. );
  2283. }
  2284. Map<String, dynamic> toJson() {
  2285. final map = super.toJson();
  2286. if(consultationCode != null)
  2287. map['ConsultationCode'] = consultationCode;
  2288. if(operatorName != null)
  2289. map['OperatorName'] = operatorName;
  2290. if(patientName != null)
  2291. map['PatientName'] = patientName;
  2292. if(applicationTime != null)
  2293. map['ApplicationTime'] = JsonRpcUtils.dateFormat(applicationTime!);
  2294. if(applyOrganizationName != null)
  2295. map['ApplyOrganizationName'] = applyOrganizationName;
  2296. if(consultationTime != null)
  2297. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2298. return map;
  2299. }
  2300. }
  2301. class ApprovalApplyConsultationNotification extends NotificationDTO{
  2302. String? consultationCode;
  2303. String? operatorName;
  2304. String? patientName;
  2305. DateTime? consultationTime;
  2306. DateTime? consultationTimeEnd;
  2307. String? expertName;
  2308. ApprovalApplyConsultationNotification({
  2309. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2310. this.consultationCode,
  2311. this.operatorName,
  2312. this.patientName,
  2313. this.consultationTime,
  2314. this.consultationTimeEnd,
  2315. this.expertName,
  2316. String? code,
  2317. bool isResponse = false,
  2318. }) : super(
  2319. notificationType: notificationType,
  2320. code: code,
  2321. isResponse: isResponse,
  2322. );
  2323. factory ApprovalApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2324. return ApprovalApplyConsultationNotification(
  2325. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2326. consultationCode: map['ConsultationCode'],
  2327. operatorName: map['OperatorName'],
  2328. patientName: map['PatientName'],
  2329. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2330. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2331. expertName: map['ExpertName'],
  2332. code: map['Code'],
  2333. isResponse: map['IsResponse'],
  2334. );
  2335. }
  2336. Map<String, dynamic> toJson() {
  2337. final map = super.toJson();
  2338. if(consultationCode != null)
  2339. map['ConsultationCode'] = consultationCode;
  2340. if(operatorName != null)
  2341. map['OperatorName'] = operatorName;
  2342. if(patientName != null)
  2343. map['PatientName'] = patientName;
  2344. if(consultationTime != null)
  2345. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2346. if(consultationTimeEnd != null)
  2347. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2348. if(expertName != null)
  2349. map['ExpertName'] = expertName;
  2350. return map;
  2351. }
  2352. }
  2353. class CloseConsolutionHeartRateToDeviceNotification extends NotificationDTO{
  2354. String? liveRoomCode;
  2355. CloseConsolutionHeartRateToDeviceNotification({
  2356. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2357. this.liveRoomCode,
  2358. String? code,
  2359. bool isResponse = false,
  2360. }) : super(
  2361. notificationType: notificationType,
  2362. code: code,
  2363. isResponse: isResponse,
  2364. );
  2365. factory CloseConsolutionHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
  2366. return CloseConsolutionHeartRateToDeviceNotification(
  2367. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2368. liveRoomCode: map['LiveRoomCode'],
  2369. code: map['Code'],
  2370. isResponse: map['IsResponse'],
  2371. );
  2372. }
  2373. Map<String, dynamic> toJson() {
  2374. final map = super.toJson();
  2375. if(liveRoomCode != null)
  2376. map['LiveRoomCode'] = liveRoomCode;
  2377. return map;
  2378. }
  2379. }
  2380. class ConsultationRemindNotification extends NotificationDTO{
  2381. String? consultationCode;
  2382. int countdownTime;
  2383. String? patientName;
  2384. DateTime? consultationTime;
  2385. DateTime? consultationTimeEnd;
  2386. String? expertName;
  2387. ConsultationRemindNotification({
  2388. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2389. this.consultationCode,
  2390. this.countdownTime = 0,
  2391. this.patientName,
  2392. this.consultationTime,
  2393. this.consultationTimeEnd,
  2394. this.expertName,
  2395. String? code,
  2396. bool isResponse = false,
  2397. }) : super(
  2398. notificationType: notificationType,
  2399. code: code,
  2400. isResponse: isResponse,
  2401. );
  2402. factory ConsultationRemindNotification.fromJson(Map<String, dynamic> map) {
  2403. return ConsultationRemindNotification(
  2404. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2405. consultationCode: map['ConsultationCode'],
  2406. countdownTime: map['CountdownTime'],
  2407. patientName: map['PatientName'],
  2408. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2409. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2410. expertName: map['ExpertName'],
  2411. code: map['Code'],
  2412. isResponse: map['IsResponse'],
  2413. );
  2414. }
  2415. Map<String, dynamic> toJson() {
  2416. final map = super.toJson();
  2417. if(consultationCode != null)
  2418. map['ConsultationCode'] = consultationCode;
  2419. map['CountdownTime'] = countdownTime;
  2420. if(patientName != null)
  2421. map['PatientName'] = patientName;
  2422. if(consultationTime != null)
  2423. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2424. if(consultationTimeEnd != null)
  2425. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2426. if(expertName != null)
  2427. map['ExpertName'] = expertName;
  2428. return map;
  2429. }
  2430. }
  2431. class InviteeApproveApplyConsultationNotification extends NotificationDTO{
  2432. String? consultationCode;
  2433. String? operatorName;
  2434. String? patientName;
  2435. DateTime? consultationTime;
  2436. DateTime? consultationTimeEnd;
  2437. InviteeApproveApplyConsultationNotification({
  2438. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2439. this.consultationCode,
  2440. this.operatorName,
  2441. this.patientName,
  2442. this.consultationTime,
  2443. this.consultationTimeEnd,
  2444. String? code,
  2445. bool isResponse = false,
  2446. }) : super(
  2447. notificationType: notificationType,
  2448. code: code,
  2449. isResponse: isResponse,
  2450. );
  2451. factory InviteeApproveApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2452. return InviteeApproveApplyConsultationNotification(
  2453. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2454. consultationCode: map['ConsultationCode'],
  2455. operatorName: map['OperatorName'],
  2456. patientName: map['PatientName'],
  2457. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2458. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2459. code: map['Code'],
  2460. isResponse: map['IsResponse'],
  2461. );
  2462. }
  2463. Map<String, dynamic> toJson() {
  2464. final map = super.toJson();
  2465. if(consultationCode != null)
  2466. map['ConsultationCode'] = consultationCode;
  2467. if(operatorName != null)
  2468. map['OperatorName'] = operatorName;
  2469. if(patientName != null)
  2470. map['PatientName'] = patientName;
  2471. if(consultationTime != null)
  2472. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2473. if(consultationTimeEnd != null)
  2474. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2475. return map;
  2476. }
  2477. }
  2478. class InviteeConsultationNotification extends NotificationDTO{
  2479. String? consultationCode;
  2480. String? operatorName;
  2481. String? patientName;
  2482. DateTime? consultationTime;
  2483. DateTime? consultationTimeEnd;
  2484. InviteeConsultationNotification({
  2485. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2486. this.consultationCode,
  2487. this.operatorName,
  2488. this.patientName,
  2489. this.consultationTime,
  2490. this.consultationTimeEnd,
  2491. String? code,
  2492. bool isResponse = false,
  2493. }) : super(
  2494. notificationType: notificationType,
  2495. code: code,
  2496. isResponse: isResponse,
  2497. );
  2498. factory InviteeConsultationNotification.fromJson(Map<String, dynamic> map) {
  2499. return InviteeConsultationNotification(
  2500. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2501. consultationCode: map['ConsultationCode'],
  2502. operatorName: map['OperatorName'],
  2503. patientName: map['PatientName'],
  2504. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2505. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2506. code: map['Code'],
  2507. isResponse: map['IsResponse'],
  2508. );
  2509. }
  2510. Map<String, dynamic> toJson() {
  2511. final map = super.toJson();
  2512. if(consultationCode != null)
  2513. map['ConsultationCode'] = consultationCode;
  2514. if(operatorName != null)
  2515. map['OperatorName'] = operatorName;
  2516. if(patientName != null)
  2517. map['PatientName'] = patientName;
  2518. if(consultationTime != null)
  2519. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2520. if(consultationTimeEnd != null)
  2521. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2522. return map;
  2523. }
  2524. }
  2525. class InviteeRejectApplyConsultationNotification extends NotificationDTO{
  2526. String? consultationCode;
  2527. String? operatorName;
  2528. String? patientName;
  2529. DateTime? consultationTime;
  2530. DateTime? consultationTimeEnd;
  2531. String? rejectReason;
  2532. InviteeRejectApplyConsultationNotification({
  2533. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2534. this.consultationCode,
  2535. this.operatorName,
  2536. this.patientName,
  2537. this.consultationTime,
  2538. this.consultationTimeEnd,
  2539. this.rejectReason,
  2540. String? code,
  2541. bool isResponse = false,
  2542. }) : super(
  2543. notificationType: notificationType,
  2544. code: code,
  2545. isResponse: isResponse,
  2546. );
  2547. factory InviteeRejectApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2548. return InviteeRejectApplyConsultationNotification(
  2549. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2550. consultationCode: map['ConsultationCode'],
  2551. operatorName: map['OperatorName'],
  2552. patientName: map['PatientName'],
  2553. consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
  2554. consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
  2555. rejectReason: map['RejectReason'],
  2556. code: map['Code'],
  2557. isResponse: map['IsResponse'],
  2558. );
  2559. }
  2560. Map<String, dynamic> toJson() {
  2561. final map = super.toJson();
  2562. if(consultationCode != null)
  2563. map['ConsultationCode'] = consultationCode;
  2564. if(operatorName != null)
  2565. map['OperatorName'] = operatorName;
  2566. if(patientName != null)
  2567. map['PatientName'] = patientName;
  2568. if(consultationTime != null)
  2569. map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
  2570. if(consultationTimeEnd != null)
  2571. map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
  2572. if(rejectReason != null)
  2573. map['RejectReason'] = rejectReason;
  2574. return map;
  2575. }
  2576. }
  2577. class RejectApplyConsultationNotification extends NotificationDTO{
  2578. String? consultationCode;
  2579. String? patientName;
  2580. String? operatorName;
  2581. String? rejectReason;
  2582. RejectApplyConsultationNotification({
  2583. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2584. this.consultationCode,
  2585. this.patientName,
  2586. this.operatorName,
  2587. this.rejectReason,
  2588. String? code,
  2589. bool isResponse = false,
  2590. }) : super(
  2591. notificationType: notificationType,
  2592. code: code,
  2593. isResponse: isResponse,
  2594. );
  2595. factory RejectApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
  2596. return RejectApplyConsultationNotification(
  2597. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2598. consultationCode: map['ConsultationCode'],
  2599. patientName: map['PatientName'],
  2600. operatorName: map['OperatorName'],
  2601. rejectReason: map['RejectReason'],
  2602. code: map['Code'],
  2603. isResponse: map['IsResponse'],
  2604. );
  2605. }
  2606. Map<String, dynamic> toJson() {
  2607. final map = super.toJson();
  2608. if(consultationCode != null)
  2609. map['ConsultationCode'] = consultationCode;
  2610. if(patientName != null)
  2611. map['PatientName'] = patientName;
  2612. if(operatorName != null)
  2613. map['OperatorName'] = operatorName;
  2614. if(rejectReason != null)
  2615. map['RejectReason'] = rejectReason;
  2616. return map;
  2617. }
  2618. }
  2619. class StartConsolutionHeartRateToDeviceNotification extends NotificationDTO{
  2620. String? liveRoomCode;
  2621. int intervalSeconds;
  2622. StartConsolutionHeartRateToDeviceNotification({
  2623. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2624. this.liveRoomCode,
  2625. this.intervalSeconds = 0,
  2626. String? code,
  2627. bool isResponse = false,
  2628. }) : super(
  2629. notificationType: notificationType,
  2630. code: code,
  2631. isResponse: isResponse,
  2632. );
  2633. factory StartConsolutionHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
  2634. return StartConsolutionHeartRateToDeviceNotification(
  2635. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2636. liveRoomCode: map['LiveRoomCode'],
  2637. intervalSeconds: map['IntervalSeconds'],
  2638. code: map['Code'],
  2639. isResponse: map['IsResponse'],
  2640. );
  2641. }
  2642. Map<String, dynamic> toJson() {
  2643. final map = super.toJson();
  2644. if(liveRoomCode != null)
  2645. map['LiveRoomCode'] = liveRoomCode;
  2646. map['IntervalSeconds'] = intervalSeconds;
  2647. return map;
  2648. }
  2649. }
  2650. class StartCourseHeartRateToDeviceNotification extends NotificationDTO{
  2651. String? liveRoomCode;
  2652. int intervalSeconds;
  2653. StartCourseHeartRateToDeviceNotification({
  2654. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2655. this.liveRoomCode,
  2656. this.intervalSeconds = 0,
  2657. String? code,
  2658. bool isResponse = false,
  2659. }) : super(
  2660. notificationType: notificationType,
  2661. code: code,
  2662. isResponse: isResponse,
  2663. );
  2664. factory StartCourseHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
  2665. return StartCourseHeartRateToDeviceNotification(
  2666. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2667. liveRoomCode: map['LiveRoomCode'],
  2668. intervalSeconds: map['IntervalSeconds'],
  2669. code: map['Code'],
  2670. isResponse: map['IsResponse'],
  2671. );
  2672. }
  2673. Map<String, dynamic> toJson() {
  2674. final map = super.toJson();
  2675. if(liveRoomCode != null)
  2676. map['LiveRoomCode'] = liveRoomCode;
  2677. map['IntervalSeconds'] = intervalSeconds;
  2678. return map;
  2679. }
  2680. }
  2681. class LiveConsultationMemberInfo {
  2682. String? id;
  2683. String? name;
  2684. String? headImageUrl;
  2685. LiveConsultationMemberInfo({
  2686. this.id,
  2687. this.name,
  2688. this.headImageUrl,
  2689. });
  2690. factory LiveConsultationMemberInfo.fromJson(Map<String, dynamic> map) {
  2691. return LiveConsultationMemberInfo(
  2692. id: map['Id'],
  2693. name: map['Name'],
  2694. headImageUrl: map['HeadImageUrl'],
  2695. );
  2696. }
  2697. Map<String, dynamic> toJson() {
  2698. final map = Map<String, dynamic>();
  2699. if(id != null)
  2700. map['Id'] = id;
  2701. if(name != null)
  2702. map['Name'] = name;
  2703. if(headImageUrl != null)
  2704. map['HeadImageUrl'] = headImageUrl;
  2705. return map;
  2706. }
  2707. }
  2708. class LiveConsultatioAccepterInfo extends LiveConsultationMemberInfo{
  2709. bool isOnline;
  2710. bool mute;
  2711. bool videoOpend;
  2712. LoginSource loginSource;
  2713. LiveData? liveData;
  2714. LiveConsultatioAccepterInfo({
  2715. this.isOnline = false,
  2716. this.mute = false,
  2717. this.videoOpend = false,
  2718. this.loginSource = LoginSource.PC,
  2719. this.liveData,
  2720. String? id,
  2721. String? name,
  2722. String? headImageUrl,
  2723. }) : super(
  2724. id: id,
  2725. name: name,
  2726. headImageUrl: headImageUrl,
  2727. );
  2728. factory LiveConsultatioAccepterInfo.fromJson(Map<String, dynamic> map) {
  2729. return LiveConsultatioAccepterInfo(
  2730. isOnline: map['IsOnline'],
  2731. mute: map['Mute'],
  2732. videoOpend: map['VideoOpend'],
  2733. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  2734. liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
  2735. id: map['Id'],
  2736. name: map['Name'],
  2737. headImageUrl: map['HeadImageUrl'],
  2738. );
  2739. }
  2740. Map<String, dynamic> toJson() {
  2741. final map = super.toJson();
  2742. map['IsOnline'] = isOnline;
  2743. map['Mute'] = mute;
  2744. map['VideoOpend'] = videoOpend;
  2745. map['LoginSource'] = loginSource.index;
  2746. if(liveData != null)
  2747. map['LiveData'] = liveData;
  2748. return map;
  2749. }
  2750. }
  2751. class AcceptLiveConsultationNotification extends NotificationDTO{
  2752. String? consultationCode;
  2753. LiveConsultatioAccepterInfo? accepter;
  2754. AcceptLiveConsultationNotification({
  2755. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2756. this.consultationCode,
  2757. this.accepter,
  2758. String? code,
  2759. bool isResponse = false,
  2760. }) : super(
  2761. notificationType: notificationType,
  2762. code: code,
  2763. isResponse: isResponse,
  2764. );
  2765. factory AcceptLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  2766. return AcceptLiveConsultationNotification(
  2767. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2768. consultationCode: map['ConsultationCode'],
  2769. accepter: map['Accepter'] != null ? LiveConsultatioAccepterInfo.fromJson(map['Accepter']) : null,
  2770. code: map['Code'],
  2771. isResponse: map['IsResponse'],
  2772. );
  2773. }
  2774. Map<String, dynamic> toJson() {
  2775. final map = super.toJson();
  2776. if(consultationCode != null)
  2777. map['ConsultationCode'] = consultationCode;
  2778. if(accepter != null)
  2779. map['Accepter'] = accepter;
  2780. return map;
  2781. }
  2782. }
  2783. class CancelInvitingInLiveConsultationNotification extends NotificationDTO{
  2784. String? consultationCode;
  2785. CancelInvitingInLiveConsultationNotification({
  2786. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2787. this.consultationCode,
  2788. String? code,
  2789. bool isResponse = false,
  2790. }) : super(
  2791. notificationType: notificationType,
  2792. code: code,
  2793. isResponse: isResponse,
  2794. );
  2795. factory CancelInvitingInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  2796. return CancelInvitingInLiveConsultationNotification(
  2797. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2798. consultationCode: map['ConsultationCode'],
  2799. code: map['Code'],
  2800. isResponse: map['IsResponse'],
  2801. );
  2802. }
  2803. Map<String, dynamic> toJson() {
  2804. final map = super.toJson();
  2805. if(consultationCode != null)
  2806. map['ConsultationCode'] = consultationCode;
  2807. return map;
  2808. }
  2809. }
  2810. class CancelLiveConsultationNotification extends NotificationDTO{
  2811. String? consultationCode;
  2812. String? initiatorCode;
  2813. CancelLiveConsultationNotification({
  2814. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2815. this.consultationCode,
  2816. this.initiatorCode,
  2817. String? code,
  2818. bool isResponse = false,
  2819. }) : super(
  2820. notificationType: notificationType,
  2821. code: code,
  2822. isResponse: isResponse,
  2823. );
  2824. factory CancelLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  2825. return CancelLiveConsultationNotification(
  2826. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2827. consultationCode: map['ConsultationCode'],
  2828. initiatorCode: map['InitiatorCode'],
  2829. code: map['Code'],
  2830. isResponse: map['IsResponse'],
  2831. );
  2832. }
  2833. Map<String, dynamic> toJson() {
  2834. final map = super.toJson();
  2835. if(consultationCode != null)
  2836. map['ConsultationCode'] = consultationCode;
  2837. if(initiatorCode != null)
  2838. map['InitiatorCode'] = initiatorCode;
  2839. return map;
  2840. }
  2841. }
  2842. class CloseLiveConsultationNotification extends NotificationDTO{
  2843. String? consultationCode;
  2844. String? initiatorCode;
  2845. CloseLiveConsultationNotification({
  2846. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2847. this.consultationCode,
  2848. this.initiatorCode,
  2849. String? code,
  2850. bool isResponse = false,
  2851. }) : super(
  2852. notificationType: notificationType,
  2853. code: code,
  2854. isResponse: isResponse,
  2855. );
  2856. factory CloseLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  2857. return CloseLiveConsultationNotification(
  2858. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2859. consultationCode: map['ConsultationCode'],
  2860. initiatorCode: map['InitiatorCode'],
  2861. code: map['Code'],
  2862. isResponse: map['IsResponse'],
  2863. );
  2864. }
  2865. Map<String, dynamic> toJson() {
  2866. final map = super.toJson();
  2867. if(consultationCode != null)
  2868. map['ConsultationCode'] = consultationCode;
  2869. if(initiatorCode != null)
  2870. map['InitiatorCode'] = initiatorCode;
  2871. return map;
  2872. }
  2873. }
  2874. class ChangeConsultationNotification extends NotificationDTO{
  2875. String? consultationCode;
  2876. int roomNo;
  2877. List<LiveConsultationMember >? memberLiveDatas;
  2878. ChangeConsultationNotification({
  2879. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2880. this.consultationCode,
  2881. this.roomNo = 0,
  2882. this.memberLiveDatas,
  2883. String? code,
  2884. bool isResponse = false,
  2885. }) : super(
  2886. notificationType: notificationType,
  2887. code: code,
  2888. isResponse: isResponse,
  2889. );
  2890. factory ChangeConsultationNotification.fromJson(Map<String, dynamic> map) {
  2891. return ChangeConsultationNotification(
  2892. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2893. consultationCode: map['ConsultationCode'],
  2894. roomNo: map['RoomNo'],
  2895. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  2896. code: map['Code'],
  2897. isResponse: map['IsResponse'],
  2898. );
  2899. }
  2900. Map<String, dynamic> toJson() {
  2901. final map = super.toJson();
  2902. if(consultationCode != null)
  2903. map['ConsultationCode'] = consultationCode;
  2904. map['RoomNo'] = roomNo;
  2905. if(memberLiveDatas != null)
  2906. map['MemberLiveDatas'] = memberLiveDatas;
  2907. return map;
  2908. }
  2909. }
  2910. class ChangeConsultationToDeviceNotification extends NotificationDTO{
  2911. String? consultationCode;
  2912. int roomNo;
  2913. List<LiveConsultationMember >? memberLiveDatas;
  2914. ChangeConsultationToDeviceNotification({
  2915. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2916. this.consultationCode,
  2917. this.roomNo = 0,
  2918. this.memberLiveDatas,
  2919. String? code,
  2920. bool isResponse = false,
  2921. }) : super(
  2922. notificationType: notificationType,
  2923. code: code,
  2924. isResponse: isResponse,
  2925. );
  2926. factory ChangeConsultationToDeviceNotification.fromJson(Map<String, dynamic> map) {
  2927. return ChangeConsultationToDeviceNotification(
  2928. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2929. consultationCode: map['ConsultationCode'],
  2930. roomNo: map['RoomNo'],
  2931. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  2932. code: map['Code'],
  2933. isResponse: map['IsResponse'],
  2934. );
  2935. }
  2936. Map<String, dynamic> toJson() {
  2937. final map = super.toJson();
  2938. if(consultationCode != null)
  2939. map['ConsultationCode'] = consultationCode;
  2940. map['RoomNo'] = roomNo;
  2941. if(memberLiveDatas != null)
  2942. map['MemberLiveDatas'] = memberLiveDatas;
  2943. return map;
  2944. }
  2945. }
  2946. class CloseConsultationDueToChangeNotification extends NotificationDTO{
  2947. String? consultationCode;
  2948. CloseConsultationDueToChangeNotification({
  2949. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2950. this.consultationCode,
  2951. String? code,
  2952. bool isResponse = false,
  2953. }) : super(
  2954. notificationType: notificationType,
  2955. code: code,
  2956. isResponse: isResponse,
  2957. );
  2958. factory CloseConsultationDueToChangeNotification.fromJson(Map<String, dynamic> map) {
  2959. return CloseConsultationDueToChangeNotification(
  2960. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2961. consultationCode: map['ConsultationCode'],
  2962. code: map['Code'],
  2963. isResponse: map['IsResponse'],
  2964. );
  2965. }
  2966. Map<String, dynamic> toJson() {
  2967. final map = super.toJson();
  2968. if(consultationCode != null)
  2969. map['ConsultationCode'] = consultationCode;
  2970. return map;
  2971. }
  2972. }
  2973. class EmergencyCallFailedNotification extends NotificationDTO{
  2974. String? consultationCode;
  2975. EmergencyCallFailedNotification({
  2976. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  2977. this.consultationCode,
  2978. String? code,
  2979. bool isResponse = false,
  2980. }) : super(
  2981. notificationType: notificationType,
  2982. code: code,
  2983. isResponse: isResponse,
  2984. );
  2985. factory EmergencyCallFailedNotification.fromJson(Map<String, dynamic> map) {
  2986. return EmergencyCallFailedNotification(
  2987. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  2988. consultationCode: map['ConsultationCode'],
  2989. code: map['Code'],
  2990. isResponse: map['IsResponse'],
  2991. );
  2992. }
  2993. Map<String, dynamic> toJson() {
  2994. final map = super.toJson();
  2995. if(consultationCode != null)
  2996. map['ConsultationCode'] = consultationCode;
  2997. return map;
  2998. }
  2999. }
  3000. class EmergencyCallNotification extends NotificationDTO{
  3001. String? consultationCode;
  3002. int roomNo;
  3003. int timeout;
  3004. LiveConsultationMember? initiator;
  3005. EmergencyCallNotification({
  3006. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3007. this.consultationCode,
  3008. this.roomNo = 0,
  3009. this.timeout = 0,
  3010. this.initiator,
  3011. String? code,
  3012. bool isResponse = false,
  3013. }) : super(
  3014. notificationType: notificationType,
  3015. code: code,
  3016. isResponse: isResponse,
  3017. );
  3018. factory EmergencyCallNotification.fromJson(Map<String, dynamic> map) {
  3019. return EmergencyCallNotification(
  3020. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3021. consultationCode: map['ConsultationCode'],
  3022. roomNo: map['RoomNo'],
  3023. timeout: map['Timeout'],
  3024. initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null,
  3025. code: map['Code'],
  3026. isResponse: map['IsResponse'],
  3027. );
  3028. }
  3029. Map<String, dynamic> toJson() {
  3030. final map = super.toJson();
  3031. if(consultationCode != null)
  3032. map['ConsultationCode'] = consultationCode;
  3033. map['RoomNo'] = roomNo;
  3034. map['Timeout'] = timeout;
  3035. if(initiator != null)
  3036. map['Initiator'] = initiator;
  3037. return map;
  3038. }
  3039. }
  3040. class LiveConsultationJoinerInfo extends LiveConsultationMemberInfo{
  3041. bool isOnline;
  3042. bool mute;
  3043. bool videoOpend;
  3044. bool isInitiator;
  3045. LoginSource loginSource;
  3046. LiveData? liveData;
  3047. int sortNumber;
  3048. int sortLevel;
  3049. LiveConsultationJoinerInfo({
  3050. this.isOnline = false,
  3051. this.mute = false,
  3052. this.videoOpend = false,
  3053. this.isInitiator = false,
  3054. this.loginSource = LoginSource.PC,
  3055. this.liveData,
  3056. this.sortNumber = 0,
  3057. this.sortLevel = 0,
  3058. String? id,
  3059. String? name,
  3060. String? headImageUrl,
  3061. }) : super(
  3062. id: id,
  3063. name: name,
  3064. headImageUrl: headImageUrl,
  3065. );
  3066. factory LiveConsultationJoinerInfo.fromJson(Map<String, dynamic> map) {
  3067. return LiveConsultationJoinerInfo(
  3068. isOnline: map['IsOnline'],
  3069. mute: map['Mute'],
  3070. videoOpend: map['VideoOpend'],
  3071. isInitiator: map['IsInitiator'],
  3072. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  3073. liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
  3074. sortNumber: map['SortNumber'],
  3075. sortLevel: map['SortLevel'],
  3076. id: map['Id'],
  3077. name: map['Name'],
  3078. headImageUrl: map['HeadImageUrl'],
  3079. );
  3080. }
  3081. Map<String, dynamic> toJson() {
  3082. final map = super.toJson();
  3083. map['IsOnline'] = isOnline;
  3084. map['Mute'] = mute;
  3085. map['VideoOpend'] = videoOpend;
  3086. map['IsInitiator'] = isInitiator;
  3087. map['LoginSource'] = loginSource.index;
  3088. if(liveData != null)
  3089. map['LiveData'] = liveData;
  3090. map['SortNumber'] = sortNumber;
  3091. map['SortLevel'] = sortLevel;
  3092. return map;
  3093. }
  3094. }
  3095. class HeartRateJoinConsultationNotification extends NotificationDTO{
  3096. String? consultationCode;
  3097. LiveConsultationJoinerInfo? joiner;
  3098. HeartRateJoinConsultationNotification({
  3099. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3100. this.consultationCode,
  3101. this.joiner,
  3102. String? code,
  3103. bool isResponse = false,
  3104. }) : super(
  3105. notificationType: notificationType,
  3106. code: code,
  3107. isResponse: isResponse,
  3108. );
  3109. factory HeartRateJoinConsultationNotification.fromJson(Map<String, dynamic> map) {
  3110. return HeartRateJoinConsultationNotification(
  3111. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3112. consultationCode: map['ConsultationCode'],
  3113. joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null,
  3114. code: map['Code'],
  3115. isResponse: map['IsResponse'],
  3116. );
  3117. }
  3118. Map<String, dynamic> toJson() {
  3119. final map = super.toJson();
  3120. if(consultationCode != null)
  3121. map['ConsultationCode'] = consultationCode;
  3122. if(joiner != null)
  3123. map['Joiner'] = joiner;
  3124. return map;
  3125. }
  3126. }
  3127. class LiveConsultationLeaverInfo extends LiveConsultationMemberInfo{
  3128. LiveConsultationLeaverInfo({
  3129. String? id,
  3130. String? name,
  3131. String? headImageUrl,
  3132. }) : super(
  3133. id: id,
  3134. name: name,
  3135. headImageUrl: headImageUrl,
  3136. );
  3137. factory LiveConsultationLeaverInfo.fromJson(Map<String, dynamic> map) {
  3138. return LiveConsultationLeaverInfo(
  3139. id: map['Id'],
  3140. name: map['Name'],
  3141. headImageUrl: map['HeadImageUrl'],
  3142. );
  3143. }
  3144. Map<String, dynamic> toJson() {
  3145. final map = super.toJson();
  3146. return map;
  3147. }
  3148. }
  3149. class HeartRateLeaveConsultationNotification extends NotificationDTO{
  3150. String? consultationCode;
  3151. LiveConsultationLeaverInfo? leaverInfo;
  3152. HeartRateLeaveConsultationNotification({
  3153. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3154. this.consultationCode,
  3155. this.leaverInfo,
  3156. String? code,
  3157. bool isResponse = false,
  3158. }) : super(
  3159. notificationType: notificationType,
  3160. code: code,
  3161. isResponse: isResponse,
  3162. );
  3163. factory HeartRateLeaveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3164. return HeartRateLeaveConsultationNotification(
  3165. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3166. consultationCode: map['ConsultationCode'],
  3167. leaverInfo: map['LeaverInfo'] != null ? LiveConsultationLeaverInfo.fromJson(map['LeaverInfo']) : null,
  3168. code: map['Code'],
  3169. isResponse: map['IsResponse'],
  3170. );
  3171. }
  3172. Map<String, dynamic> toJson() {
  3173. final map = super.toJson();
  3174. if(consultationCode != null)
  3175. map['ConsultationCode'] = consultationCode;
  3176. if(leaverInfo != null)
  3177. map['LeaverInfo'] = leaverInfo;
  3178. return map;
  3179. }
  3180. }
  3181. class InviteLiveConsultationNotification extends NotificationDTO{
  3182. String? consultationCode;
  3183. int roomNo;
  3184. LiveConsultationMember? initiator;
  3185. InviteLiveConsultationNotification({
  3186. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3187. this.consultationCode,
  3188. this.roomNo = 0,
  3189. this.initiator,
  3190. String? code,
  3191. bool isResponse = false,
  3192. }) : super(
  3193. notificationType: notificationType,
  3194. code: code,
  3195. isResponse: isResponse,
  3196. );
  3197. factory InviteLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3198. return InviteLiveConsultationNotification(
  3199. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3200. consultationCode: map['ConsultationCode'],
  3201. roomNo: map['RoomNo'],
  3202. initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null,
  3203. code: map['Code'],
  3204. isResponse: map['IsResponse'],
  3205. );
  3206. }
  3207. Map<String, dynamic> toJson() {
  3208. final map = super.toJson();
  3209. if(consultationCode != null)
  3210. map['ConsultationCode'] = consultationCode;
  3211. map['RoomNo'] = roomNo;
  3212. if(initiator != null)
  3213. map['Initiator'] = initiator;
  3214. return map;
  3215. }
  3216. }
  3217. class InviteInLiveConsultationNotification extends NotificationDTO{
  3218. String? consultationCode;
  3219. int roomNo;
  3220. LiveConsultationMember? operator;
  3221. List<LiveConsultationMember >? memberLiveDatas;
  3222. InviteInLiveConsultationNotification({
  3223. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3224. this.consultationCode,
  3225. this.roomNo = 0,
  3226. this.operator,
  3227. this.memberLiveDatas,
  3228. String? code,
  3229. bool isResponse = false,
  3230. }) : super(
  3231. notificationType: notificationType,
  3232. code: code,
  3233. isResponse: isResponse,
  3234. );
  3235. factory InviteInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3236. return InviteInLiveConsultationNotification(
  3237. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3238. consultationCode: map['ConsultationCode'],
  3239. roomNo: map['RoomNo'],
  3240. operator: map['Operator'] != null ? LiveConsultationMember.fromJson(map['Operator']) : null,
  3241. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  3242. code: map['Code'],
  3243. isResponse: map['IsResponse'],
  3244. );
  3245. }
  3246. Map<String, dynamic> toJson() {
  3247. final map = super.toJson();
  3248. if(consultationCode != null)
  3249. map['ConsultationCode'] = consultationCode;
  3250. map['RoomNo'] = roomNo;
  3251. if(operator != null)
  3252. map['Operator'] = operator;
  3253. if(memberLiveDatas != null)
  3254. map['MemberLiveDatas'] = memberLiveDatas;
  3255. return map;
  3256. }
  3257. }
  3258. class JoinInLiveConsultationNotification extends NotificationDTO{
  3259. String? consultationCode;
  3260. LiveConsultationJoinerInfo? joiner;
  3261. JoinInLiveConsultationNotification({
  3262. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3263. this.consultationCode,
  3264. this.joiner,
  3265. String? code,
  3266. bool isResponse = false,
  3267. }) : super(
  3268. notificationType: notificationType,
  3269. code: code,
  3270. isResponse: isResponse,
  3271. );
  3272. factory JoinInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3273. return JoinInLiveConsultationNotification(
  3274. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3275. consultationCode: map['ConsultationCode'],
  3276. joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null,
  3277. code: map['Code'],
  3278. isResponse: map['IsResponse'],
  3279. );
  3280. }
  3281. Map<String, dynamic> toJson() {
  3282. final map = super.toJson();
  3283. if(consultationCode != null)
  3284. map['ConsultationCode'] = consultationCode;
  3285. if(joiner != null)
  3286. map['Joiner'] = joiner;
  3287. return map;
  3288. }
  3289. }
  3290. class LiveConsultationRejecterInfo extends LiveConsultationMemberInfo{
  3291. LiveConsultationRejecterInfo({
  3292. String? id,
  3293. String? name,
  3294. String? headImageUrl,
  3295. }) : super(
  3296. id: id,
  3297. name: name,
  3298. headImageUrl: headImageUrl,
  3299. );
  3300. factory LiveConsultationRejecterInfo.fromJson(Map<String, dynamic> map) {
  3301. return LiveConsultationRejecterInfo(
  3302. id: map['Id'],
  3303. name: map['Name'],
  3304. headImageUrl: map['HeadImageUrl'],
  3305. );
  3306. }
  3307. Map<String, dynamic> toJson() {
  3308. final map = super.toJson();
  3309. return map;
  3310. }
  3311. }
  3312. class RejectInviteLiveConsultationNotification extends NotificationDTO{
  3313. String? consultationCode;
  3314. LiveConsultationRejecterInfo? rejecter;
  3315. RejectInviteLiveConsultationNotification({
  3316. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3317. this.consultationCode,
  3318. this.rejecter,
  3319. String? code,
  3320. bool isResponse = false,
  3321. }) : super(
  3322. notificationType: notificationType,
  3323. code: code,
  3324. isResponse: isResponse,
  3325. );
  3326. factory RejectInviteLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3327. return RejectInviteLiveConsultationNotification(
  3328. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3329. consultationCode: map['ConsultationCode'],
  3330. rejecter: map['Rejecter'] != null ? LiveConsultationRejecterInfo.fromJson(map['Rejecter']) : null,
  3331. code: map['Code'],
  3332. isResponse: map['IsResponse'],
  3333. );
  3334. }
  3335. Map<String, dynamic> toJson() {
  3336. final map = super.toJson();
  3337. if(consultationCode != null)
  3338. map['ConsultationCode'] = consultationCode;
  3339. if(rejecter != null)
  3340. map['Rejecter'] = rejecter;
  3341. return map;
  3342. }
  3343. }
  3344. class JoinLiveConsultationNotification extends NotificationDTO{
  3345. String? consultationCode;
  3346. LiveConsultationJoinerInfo? joiner;
  3347. JoinLiveConsultationNotification({
  3348. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3349. this.consultationCode,
  3350. this.joiner,
  3351. String? code,
  3352. bool isResponse = false,
  3353. }) : super(
  3354. notificationType: notificationType,
  3355. code: code,
  3356. isResponse: isResponse,
  3357. );
  3358. factory JoinLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3359. return JoinLiveConsultationNotification(
  3360. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3361. consultationCode: map['ConsultationCode'],
  3362. joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null,
  3363. code: map['Code'],
  3364. isResponse: map['IsResponse'],
  3365. );
  3366. }
  3367. Map<String, dynamic> toJson() {
  3368. final map = super.toJson();
  3369. if(consultationCode != null)
  3370. map['ConsultationCode'] = consultationCode;
  3371. if(joiner != null)
  3372. map['Joiner'] = joiner;
  3373. return map;
  3374. }
  3375. }
  3376. class LeaveLiveConsultationNotification extends NotificationDTO{
  3377. String? consultationCode;
  3378. LiveConsultationLeaverInfo? leaverInfo;
  3379. LeaveLiveConsultationNotification({
  3380. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3381. this.consultationCode,
  3382. this.leaverInfo,
  3383. String? code,
  3384. bool isResponse = false,
  3385. }) : super(
  3386. notificationType: notificationType,
  3387. code: code,
  3388. isResponse: isResponse,
  3389. );
  3390. factory LeaveLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3391. return LeaveLiveConsultationNotification(
  3392. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3393. consultationCode: map['ConsultationCode'],
  3394. leaverInfo: map['LeaverInfo'] != null ? LiveConsultationLeaverInfo.fromJson(map['LeaverInfo']) : null,
  3395. code: map['Code'],
  3396. isResponse: map['IsResponse'],
  3397. );
  3398. }
  3399. Map<String, dynamic> toJson() {
  3400. final map = super.toJson();
  3401. if(consultationCode != null)
  3402. map['ConsultationCode'] = consultationCode;
  3403. if(leaverInfo != null)
  3404. map['LeaverInfo'] = leaverInfo;
  3405. return map;
  3406. }
  3407. }
  3408. class LiveConsultationMuterInfo extends LiveConsultationMemberInfo{
  3409. LiveConsultationMuterInfo({
  3410. String? id,
  3411. String? name,
  3412. String? headImageUrl,
  3413. }) : super(
  3414. id: id,
  3415. name: name,
  3416. headImageUrl: headImageUrl,
  3417. );
  3418. factory LiveConsultationMuterInfo.fromJson(Map<String, dynamic> map) {
  3419. return LiveConsultationMuterInfo(
  3420. id: map['Id'],
  3421. name: map['Name'],
  3422. headImageUrl: map['HeadImageUrl'],
  3423. );
  3424. }
  3425. Map<String, dynamic> toJson() {
  3426. final map = super.toJson();
  3427. return map;
  3428. }
  3429. }
  3430. class MuteLiveConsultationNotification extends NotificationDTO{
  3431. String? consultationCode;
  3432. bool mute;
  3433. LiveConsultationMuterInfo? muterInfo;
  3434. MuteLiveConsultationNotification({
  3435. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3436. this.consultationCode,
  3437. this.mute = false,
  3438. this.muterInfo,
  3439. String? code,
  3440. bool isResponse = false,
  3441. }) : super(
  3442. notificationType: notificationType,
  3443. code: code,
  3444. isResponse: isResponse,
  3445. );
  3446. factory MuteLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3447. return MuteLiveConsultationNotification(
  3448. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3449. consultationCode: map['ConsultationCode'],
  3450. mute: map['Mute'],
  3451. muterInfo: map['MuterInfo'] != null ? LiveConsultationMuterInfo.fromJson(map['MuterInfo']) : null,
  3452. code: map['Code'],
  3453. isResponse: map['IsResponse'],
  3454. );
  3455. }
  3456. Map<String, dynamic> toJson() {
  3457. final map = super.toJson();
  3458. if(consultationCode != null)
  3459. map['ConsultationCode'] = consultationCode;
  3460. map['Mute'] = mute;
  3461. if(muterInfo != null)
  3462. map['MuterInfo'] = muterInfo;
  3463. return map;
  3464. }
  3465. }
  3466. class LiveConsultationNetworkErrMemberInfo extends LiveConsultationMemberInfo{
  3467. LiveConsultationNetworkErrMemberInfo({
  3468. String? id,
  3469. String? name,
  3470. String? headImageUrl,
  3471. }) : super(
  3472. id: id,
  3473. name: name,
  3474. headImageUrl: headImageUrl,
  3475. );
  3476. factory LiveConsultationNetworkErrMemberInfo.fromJson(Map<String, dynamic> map) {
  3477. return LiveConsultationNetworkErrMemberInfo(
  3478. id: map['Id'],
  3479. name: map['Name'],
  3480. headImageUrl: map['HeadImageUrl'],
  3481. );
  3482. }
  3483. Map<String, dynamic> toJson() {
  3484. final map = super.toJson();
  3485. return map;
  3486. }
  3487. }
  3488. class NetworkErrConsultationNotification extends NotificationDTO{
  3489. String? consultationCode;
  3490. LiveConsultationNetworkErrMemberInfo? networkErrMemberInfo;
  3491. NetworkErrConsultationNotification({
  3492. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3493. this.consultationCode,
  3494. this.networkErrMemberInfo,
  3495. String? code,
  3496. bool isResponse = false,
  3497. }) : super(
  3498. notificationType: notificationType,
  3499. code: code,
  3500. isResponse: isResponse,
  3501. );
  3502. factory NetworkErrConsultationNotification.fromJson(Map<String, dynamic> map) {
  3503. return NetworkErrConsultationNotification(
  3504. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3505. consultationCode: map['ConsultationCode'],
  3506. networkErrMemberInfo: map['NetworkErrMemberInfo'] != null ? LiveConsultationNetworkErrMemberInfo.fromJson(map['NetworkErrMemberInfo']) : null,
  3507. code: map['Code'],
  3508. isResponse: map['IsResponse'],
  3509. );
  3510. }
  3511. Map<String, dynamic> toJson() {
  3512. final map = super.toJson();
  3513. if(consultationCode != null)
  3514. map['ConsultationCode'] = consultationCode;
  3515. if(networkErrMemberInfo != null)
  3516. map['NetworkErrMemberInfo'] = networkErrMemberInfo;
  3517. return map;
  3518. }
  3519. }
  3520. class RejectLiveConsultationNotification extends NotificationDTO{
  3521. String? consultationCode;
  3522. LiveConsultationRejecterInfo? rejecter;
  3523. RejectLiveConsultationNotification({
  3524. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3525. this.consultationCode,
  3526. this.rejecter,
  3527. String? code,
  3528. bool isResponse = false,
  3529. }) : super(
  3530. notificationType: notificationType,
  3531. code: code,
  3532. isResponse: isResponse,
  3533. );
  3534. factory RejectLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
  3535. return RejectLiveConsultationNotification(
  3536. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3537. consultationCode: map['ConsultationCode'],
  3538. rejecter: map['Rejecter'] != null ? LiveConsultationRejecterInfo.fromJson(map['Rejecter']) : null,
  3539. code: map['Code'],
  3540. isResponse: map['IsResponse'],
  3541. );
  3542. }
  3543. Map<String, dynamic> toJson() {
  3544. final map = super.toJson();
  3545. if(consultationCode != null)
  3546. map['ConsultationCode'] = consultationCode;
  3547. if(rejecter != null)
  3548. map['Rejecter'] = rejecter;
  3549. return map;
  3550. }
  3551. }
  3552. class LiveConsultationSwitcherInfo extends LiveConsultationMemberInfo{
  3553. LiveConsultationSwitcherInfo({
  3554. String? id,
  3555. String? name,
  3556. String? headImageUrl,
  3557. }) : super(
  3558. id: id,
  3559. name: name,
  3560. headImageUrl: headImageUrl,
  3561. );
  3562. factory LiveConsultationSwitcherInfo.fromJson(Map<String, dynamic> map) {
  3563. return LiveConsultationSwitcherInfo(
  3564. id: map['Id'],
  3565. name: map['Name'],
  3566. headImageUrl: map['HeadImageUrl'],
  3567. );
  3568. }
  3569. Map<String, dynamic> toJson() {
  3570. final map = super.toJson();
  3571. return map;
  3572. }
  3573. }
  3574. class SwitchLiveConsultationVideoNotification extends NotificationDTO{
  3575. String? consultationCode;
  3576. bool opened;
  3577. LiveConsultationSwitcherInfo? switcherInfo;
  3578. SwitchLiveConsultationVideoNotification({
  3579. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3580. this.consultationCode,
  3581. this.opened = false,
  3582. this.switcherInfo,
  3583. String? code,
  3584. bool isResponse = false,
  3585. }) : super(
  3586. notificationType: notificationType,
  3587. code: code,
  3588. isResponse: isResponse,
  3589. );
  3590. factory SwitchLiveConsultationVideoNotification.fromJson(Map<String, dynamic> map) {
  3591. return SwitchLiveConsultationVideoNotification(
  3592. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3593. consultationCode: map['ConsultationCode'],
  3594. opened: map['Opened'],
  3595. switcherInfo: map['SwitcherInfo'] != null ? LiveConsultationSwitcherInfo.fromJson(map['SwitcherInfo']) : null,
  3596. code: map['Code'],
  3597. isResponse: map['IsResponse'],
  3598. );
  3599. }
  3600. Map<String, dynamic> toJson() {
  3601. final map = super.toJson();
  3602. if(consultationCode != null)
  3603. map['ConsultationCode'] = consultationCode;
  3604. map['Opened'] = opened;
  3605. if(switcherInfo != null)
  3606. map['SwitcherInfo'] = switcherInfo;
  3607. return map;
  3608. }
  3609. }
  3610. class SendInteractiveBoardDataNotification extends NotificationDTO{
  3611. String? consultationCode;
  3612. bool isClear;
  3613. String? userCode;
  3614. String? boardData;
  3615. SendInteractiveBoardDataNotification({
  3616. NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
  3617. this.consultationCode,
  3618. this.isClear = false,
  3619. this.userCode,
  3620. this.boardData,
  3621. String? code,
  3622. bool isResponse = false,
  3623. }) : super(
  3624. notificationType: notificationType,
  3625. code: code,
  3626. isResponse: isResponse,
  3627. );
  3628. factory SendInteractiveBoardDataNotification.fromJson(Map<String, dynamic> map) {
  3629. return SendInteractiveBoardDataNotification(
  3630. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  3631. consultationCode: map['ConsultationCode'],
  3632. isClear: map['IsClear'],
  3633. userCode: map['UserCode'],
  3634. boardData: map['BoardData'],
  3635. code: map['Code'],
  3636. isResponse: map['IsResponse'],
  3637. );
  3638. }
  3639. Map<String, dynamic> toJson() {
  3640. final map = super.toJson();
  3641. if(consultationCode != null)
  3642. map['ConsultationCode'] = consultationCode;
  3643. map['IsClear'] = isClear;
  3644. if(userCode != null)
  3645. map['UserCode'] = userCode;
  3646. if(boardData != null)
  3647. map['BoardData'] = boardData;
  3648. return map;
  3649. }
  3650. }