notification.m.dart 93 KB

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