notification.m.dart 113 KB

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