notification.m.dart 94 KB

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