device.m.dart 97 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860
  1. import 'notification.m.dart';
  2. import 'liveConsultation.m.dart';
  3. import 'package:fis_common/json_convert.dart';
  4. class GetDevicePrintersForUploadRequest extends TokenRequest{
  5. String? deviceCode;
  6. GetDevicePrintersForUploadRequest({
  7. this.deviceCode,
  8. String? token,
  9. }) : super(
  10. token: token,
  11. );
  12. factory GetDevicePrintersForUploadRequest.fromJson(Map<String, dynamic> map) {
  13. return GetDevicePrintersForUploadRequest(
  14. deviceCode: map['DeviceCode'],
  15. token: map['Token'],
  16. );
  17. }
  18. Map<String, dynamic> toJson() {
  19. final map = super.toJson();
  20. if(deviceCode != null)
  21. map['DeviceCode'] = deviceCode;
  22. return map;
  23. }
  24. }
  25. class ExistsDevicePrinterRequest extends TokenRequest{
  26. String? name;
  27. ExistsDevicePrinterRequest({
  28. this.name,
  29. String? token,
  30. }) : super(
  31. token: token,
  32. );
  33. factory ExistsDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  34. return ExistsDevicePrinterRequest(
  35. name: map['Name'],
  36. token: map['Token'],
  37. );
  38. }
  39. Map<String, dynamic> toJson() {
  40. final map = super.toJson();
  41. if(name != null)
  42. map['Name'] = name;
  43. return map;
  44. }
  45. }
  46. class MigrateDevicePrinterInfo extends DevicePrinterDTO{
  47. bool isDelete;
  48. MigrateDevicePrinterInfo({
  49. this.isDelete = false,
  50. DateTime? createTime,
  51. DateTime? updateTime,
  52. String? code,
  53. String? name,
  54. String? driveModelName,
  55. String? description,
  56. String? osVersion,
  57. List<UploadDeviceFileInfoDTO >? fileUploadInfoList,
  58. int fileSize = 0,
  59. String? printerBrands,
  60. List<String >? printerModels,
  61. String? fileName,
  62. }) : super(
  63. code: code,
  64. name: name,
  65. driveModelName: driveModelName,
  66. description: description,
  67. osVersion: osVersion,
  68. fileUploadInfoList: fileUploadInfoList,
  69. fileSize: fileSize,
  70. printerBrands: printerBrands,
  71. printerModels: printerModels,
  72. fileName: fileName,
  73. createTime: createTime,
  74. updateTime: updateTime,
  75. );
  76. factory MigrateDevicePrinterInfo.fromJson(Map<String, dynamic> map) {
  77. return MigrateDevicePrinterInfo(
  78. isDelete: map['IsDelete'],
  79. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  80. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  81. code: map['Code'],
  82. name: map['Name'],
  83. driveModelName: map['DriveModelName'],
  84. description: map['Description'],
  85. osVersion: map['OsVersion'],
  86. fileUploadInfoList: map['FileUploadInfoList'] != null ? (map['FileUploadInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  87. fileSize: map['FileSize'],
  88. printerBrands: map['PrinterBrands'],
  89. printerModels: map['PrinterModels'] != null ? map['PrinterModels'].cast<String>().toList() : null,
  90. fileName: map['FileName'],
  91. );
  92. }
  93. Map<String, dynamic> toJson() {
  94. final map = super.toJson();
  95. map['IsDelete'] = isDelete;
  96. return map;
  97. }
  98. }
  99. class MigrateDevicePrinterRequest extends TokenRequest{
  100. List<MigrateDevicePrinterInfo >? migrateDevicePrinterInfos;
  101. MigrateDevicePrinterRequest({
  102. this.migrateDevicePrinterInfos,
  103. String? token,
  104. }) : super(
  105. token: token,
  106. );
  107. factory MigrateDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  108. return MigrateDevicePrinterRequest(
  109. migrateDevicePrinterInfos: map['MigrateDevicePrinterInfos'] != null ? (map['MigrateDevicePrinterInfos'] as List).map((e)=>MigrateDevicePrinterInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  110. token: map['Token'],
  111. );
  112. }
  113. Map<String, dynamic> toJson() {
  114. final map = super.toJson();
  115. if(migrateDevicePrinterInfos != null)
  116. map['MigrateDevicePrinterInfos'] = migrateDevicePrinterInfos;
  117. return map;
  118. }
  119. }
  120. class DictionaryLanguageConfigDTO {
  121. String? language;
  122. String? value;
  123. DictionaryLanguageConfigDTO({
  124. this.language,
  125. this.value,
  126. });
  127. factory DictionaryLanguageConfigDTO.fromJson(Map<String, dynamic> map) {
  128. return DictionaryLanguageConfigDTO(
  129. language: map['Language'],
  130. value: map['Value'],
  131. );
  132. }
  133. Map<String, dynamic> toJson() {
  134. final map = Map<String, dynamic>();
  135. if(language != null)
  136. map['Language'] = language;
  137. if(value != null)
  138. map['Value'] = value;
  139. return map;
  140. }
  141. }
  142. class DeviceExtendInfoDTO extends DeviceInfoDTO{
  143. String? organizationName;
  144. String? departmentName;
  145. bool isOnline;
  146. bool isLiving;
  147. String? organizationDirectorCode;
  148. String? organizationDirectorUserName;
  149. String? organizationDirectorFullName;
  150. List<DictionaryLanguageConfigDTO >? languageConfigs;
  151. bool isEmergencyDevice;
  152. bool isCanRemoteMaintenance;
  153. bool isCanRestart;
  154. DeviceExtendInfoDTO({
  155. this.organizationName,
  156. this.departmentName,
  157. this.isOnline = false,
  158. this.isLiving = false,
  159. this.organizationDirectorCode,
  160. this.organizationDirectorUserName,
  161. this.organizationDirectorFullName,
  162. this.languageConfigs,
  163. this.isEmergencyDevice = false,
  164. this.isCanRemoteMaintenance = false,
  165. this.isCanRestart = false,
  166. String? deviceCode,
  167. String? serialNumber,
  168. String? password,
  169. String? name,
  170. String? description,
  171. String? deviceModel,
  172. String? deviceType,
  173. String? headPicUrl,
  174. String? deviceSoftwareVersion,
  175. String? sDKSoftwareVersion,
  176. String? organizationCode,
  177. String? departmentCode,
  178. String? shortCode,
  179. bool isAutoShared = false,
  180. bool isEncryptedShow = false,
  181. DateTime? lastLoginTime,
  182. String? systemVersion,
  183. String? cPUModel,
  184. String? systemLanguage,
  185. List<String >? diagnosisModules,
  186. List<String >? reportPosterCodes,
  187. bool mergedChannel = false,
  188. int mergedVideoOutputWidth = 0,
  189. int mergedVideoOutputHeight = 0,
  190. List<VideoDeviceDTO >? videoDeviceInfos,
  191. DownloadModeSettingEnum downloadModeSetting = DownloadModeSettingEnum.Auto,
  192. bool liveOpened = false,
  193. bool supportRtc = false,
  194. String? displayName,
  195. DateTime? createTime,
  196. DateTime? updateTime,
  197. }) : super(
  198. deviceCode: deviceCode,
  199. serialNumber: serialNumber,
  200. password: password,
  201. name: name,
  202. description: description,
  203. deviceModel: deviceModel,
  204. deviceType: deviceType,
  205. headPicUrl: headPicUrl,
  206. deviceSoftwareVersion: deviceSoftwareVersion,
  207. sDKSoftwareVersion: sDKSoftwareVersion,
  208. organizationCode: organizationCode,
  209. departmentCode: departmentCode,
  210. shortCode: shortCode,
  211. isAutoShared: isAutoShared,
  212. isEncryptedShow: isEncryptedShow,
  213. lastLoginTime: lastLoginTime,
  214. systemVersion: systemVersion,
  215. cPUModel: cPUModel,
  216. systemLanguage: systemLanguage,
  217. diagnosisModules: diagnosisModules,
  218. reportPosterCodes: reportPosterCodes,
  219. mergedChannel: mergedChannel,
  220. mergedVideoOutputWidth: mergedVideoOutputWidth,
  221. mergedVideoOutputHeight: mergedVideoOutputHeight,
  222. videoDeviceInfos: videoDeviceInfos,
  223. downloadModeSetting: downloadModeSetting,
  224. liveOpened: liveOpened,
  225. supportRtc: supportRtc,
  226. displayName: displayName,
  227. createTime: createTime,
  228. updateTime: updateTime,
  229. );
  230. factory DeviceExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  231. return DeviceExtendInfoDTO(
  232. organizationName: map['OrganizationName'],
  233. departmentName: map['DepartmentName'],
  234. isOnline: map['IsOnline'],
  235. isLiving: map['IsLiving'],
  236. organizationDirectorCode: map['OrganizationDirectorCode'],
  237. organizationDirectorUserName: map['OrganizationDirectorUserName'],
  238. organizationDirectorFullName: map['OrganizationDirectorFullName'],
  239. languageConfigs: map['LanguageConfigs'] != null ? (map['LanguageConfigs'] as List).map((e)=>DictionaryLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  240. isEmergencyDevice: map['IsEmergencyDevice'],
  241. isCanRemoteMaintenance: map['IsCanRemoteMaintenance'],
  242. isCanRestart: map['IsCanRestart'],
  243. deviceCode: map['DeviceCode'],
  244. serialNumber: map['SerialNumber'],
  245. password: map['Password'],
  246. name: map['Name'],
  247. description: map['Description'],
  248. deviceModel: map['DeviceModel'],
  249. deviceType: map['DeviceType'],
  250. headPicUrl: map['HeadPicUrl'],
  251. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  252. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  253. organizationCode: map['OrganizationCode'],
  254. departmentCode: map['DepartmentCode'],
  255. shortCode: map['ShortCode'],
  256. isAutoShared: map['IsAutoShared'],
  257. isEncryptedShow: map['IsEncryptedShow'],
  258. lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
  259. systemVersion: map['SystemVersion'],
  260. cPUModel: map['CPUModel'],
  261. systemLanguage: map['SystemLanguage'],
  262. diagnosisModules: map['DiagnosisModules'] != null ? map['DiagnosisModules'].cast<String>().toList() : null,
  263. reportPosterCodes: map['ReportPosterCodes'] != null ? map['ReportPosterCodes'].cast<String>().toList() : null,
  264. mergedChannel: map['MergedChannel'],
  265. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  266. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  267. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  268. downloadModeSetting: DownloadModeSettingEnum.values.firstWhere((e) => e.index == map['DownloadModeSetting']),
  269. liveOpened: map['LiveOpened'],
  270. supportRtc: map['SupportRtc'],
  271. displayName: map['DisplayName'],
  272. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  273. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  274. );
  275. }
  276. Map<String, dynamic> toJson() {
  277. final map = super.toJson();
  278. if(organizationName != null)
  279. map['OrganizationName'] = organizationName;
  280. if(departmentName != null)
  281. map['DepartmentName'] = departmentName;
  282. map['IsOnline'] = isOnline;
  283. map['IsLiving'] = isLiving;
  284. if(organizationDirectorCode != null)
  285. map['OrganizationDirectorCode'] = organizationDirectorCode;
  286. if(organizationDirectorUserName != null)
  287. map['OrganizationDirectorUserName'] = organizationDirectorUserName;
  288. if(organizationDirectorFullName != null)
  289. map['OrganizationDirectorFullName'] = organizationDirectorFullName;
  290. if(languageConfigs != null)
  291. map['LanguageConfigs'] = languageConfigs;
  292. map['IsEmergencyDevice'] = isEmergencyDevice;
  293. map['IsCanRemoteMaintenance'] = isCanRemoteMaintenance;
  294. map['IsCanRestart'] = isCanRestart;
  295. return map;
  296. }
  297. }
  298. class PageCollection<T> {
  299. int currentPage;
  300. int pageSize;
  301. int dataCount;
  302. List<T>? pageData;
  303. PageCollection({
  304. this.currentPage = 0,
  305. this.pageSize = 0,
  306. this.dataCount = 0,
  307. this.pageData,
  308. });
  309. factory PageCollection.fromJson(Map<String, dynamic> map) {
  310. List<T> pageDataList = [];
  311. if (map['PageData'] != null) {
  312. pageDataList.addAll(
  313. (map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
  314. }
  315. return PageCollection(
  316. currentPage: map['CurrentPage'],
  317. pageSize: map['PageSize'],
  318. dataCount: map['DataCount'],
  319. pageData: pageDataList,
  320. );
  321. }
  322. Map<String, dynamic> toJson() {
  323. final map = Map<String, dynamic>();
  324. map['CurrentPage'] = currentPage;
  325. map['PageSize'] = pageSize;
  326. map['DataCount'] = dataCount;
  327. if(pageData != null)
  328. map['PageData'] = pageData;
  329. return map;
  330. }
  331. }
  332. class GetPersonDeviceRequest extends PageRequest{
  333. String? keyWord;
  334. String? deviceType;
  335. String? deviceModel;
  336. List<String >? organizationCodes;
  337. bool? isOnline;
  338. GetPersonDeviceRequest({
  339. this.keyWord,
  340. this.deviceType,
  341. this.deviceModel,
  342. this.organizationCodes,
  343. this.isOnline,
  344. int pageIndex = 0,
  345. int pageSize = 0,
  346. String? token,
  347. }) : super(
  348. pageIndex: pageIndex,
  349. pageSize: pageSize,
  350. token: token,
  351. );
  352. factory GetPersonDeviceRequest.fromJson(Map<String, dynamic> map) {
  353. return GetPersonDeviceRequest(
  354. keyWord: map['KeyWord'],
  355. deviceType: map['DeviceType'],
  356. deviceModel: map['DeviceModel'],
  357. organizationCodes: map['OrganizationCodes'] != null ? map['OrganizationCodes'].cast<String>().toList() : null,
  358. isOnline: map['IsOnline'],
  359. pageIndex: map['PageIndex'],
  360. pageSize: map['PageSize'],
  361. token: map['Token'],
  362. );
  363. }
  364. Map<String, dynamic> toJson() {
  365. final map = super.toJson();
  366. if(keyWord != null)
  367. map['KeyWord'] = keyWord;
  368. if(deviceType != null)
  369. map['DeviceType'] = deviceType;
  370. if(deviceModel != null)
  371. map['DeviceModel'] = deviceModel;
  372. if(organizationCodes != null)
  373. map['OrganizationCodes'] = organizationCodes;
  374. if(isOnline != null)
  375. map['IsOnline'] = isOnline;
  376. return map;
  377. }
  378. }
  379. class SelectItemDTO {
  380. String? key;
  381. String? value;
  382. SelectItemDTO({
  383. this.key,
  384. this.value,
  385. });
  386. factory SelectItemDTO.fromJson(Map<String, dynamic> map) {
  387. return SelectItemDTO(
  388. key: map['Key'],
  389. value: map['Value'],
  390. );
  391. }
  392. Map<String, dynamic> toJson() {
  393. final map = Map<String, dynamic>();
  394. if(key != null)
  395. map['Key'] = key;
  396. if(value != null)
  397. map['Value'] = value;
  398. return map;
  399. }
  400. }
  401. class GetPersonDeviceDropdownPageRequest extends PageRequest{
  402. String? keyWord;
  403. List<String >? restrictOrgCodes;
  404. GetPersonDeviceDropdownPageRequest({
  405. this.keyWord,
  406. this.restrictOrgCodes,
  407. int pageIndex = 0,
  408. int pageSize = 0,
  409. String? token,
  410. }) : super(
  411. pageIndex: pageIndex,
  412. pageSize: pageSize,
  413. token: token,
  414. );
  415. factory GetPersonDeviceDropdownPageRequest.fromJson(Map<String, dynamic> map) {
  416. return GetPersonDeviceDropdownPageRequest(
  417. keyWord: map['KeyWord'],
  418. restrictOrgCodes: map['RestrictOrgCodes'] != null ? map['RestrictOrgCodes'].cast<String>().toList() : null,
  419. pageIndex: map['PageIndex'],
  420. pageSize: map['PageSize'],
  421. token: map['Token'],
  422. );
  423. }
  424. Map<String, dynamic> toJson() {
  425. final map = super.toJson();
  426. if(keyWord != null)
  427. map['KeyWord'] = keyWord;
  428. if(restrictOrgCodes != null)
  429. map['RestrictOrgCodes'] = restrictOrgCodes;
  430. return map;
  431. }
  432. }
  433. class UploadDeviceDTO extends BaseDTO{
  434. String? serialNumber;
  435. String? deviceModel;
  436. String? deviceType;
  437. String? deviceSoftwareVersion;
  438. String? sDKSoftwareVersion;
  439. UploadDeviceDTO({
  440. this.serialNumber,
  441. this.deviceModel,
  442. this.deviceType,
  443. this.deviceSoftwareVersion,
  444. this.sDKSoftwareVersion,
  445. DateTime? createTime,
  446. DateTime? updateTime,
  447. }) : super(
  448. createTime: createTime,
  449. updateTime: updateTime,
  450. );
  451. factory UploadDeviceDTO.fromJson(Map<String, dynamic> map) {
  452. return UploadDeviceDTO(
  453. serialNumber: map['SerialNumber'],
  454. deviceModel: map['DeviceModel'],
  455. deviceType: map['DeviceType'],
  456. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  457. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  458. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  459. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  460. );
  461. }
  462. Map<String, dynamic> toJson() {
  463. final map = super.toJson();
  464. if(serialNumber != null)
  465. map['SerialNumber'] = serialNumber;
  466. if(deviceModel != null)
  467. map['DeviceModel'] = deviceModel;
  468. if(deviceType != null)
  469. map['DeviceType'] = deviceType;
  470. if(deviceSoftwareVersion != null)
  471. map['DeviceSoftwareVersion'] = deviceSoftwareVersion;
  472. if(sDKSoftwareVersion != null)
  473. map['SDKSoftwareVersion'] = sDKSoftwareVersion;
  474. return map;
  475. }
  476. }
  477. class CreateDeviceRequest extends UploadDeviceDTO{
  478. CreateDeviceRequest({
  479. String? serialNumber,
  480. String? deviceModel,
  481. String? deviceType,
  482. String? deviceSoftwareVersion,
  483. String? sDKSoftwareVersion,
  484. DateTime? createTime,
  485. DateTime? updateTime,
  486. }) : super(
  487. serialNumber: serialNumber,
  488. deviceModel: deviceModel,
  489. deviceType: deviceType,
  490. deviceSoftwareVersion: deviceSoftwareVersion,
  491. sDKSoftwareVersion: sDKSoftwareVersion,
  492. createTime: createTime,
  493. updateTime: updateTime,
  494. );
  495. factory CreateDeviceRequest.fromJson(Map<String, dynamic> map) {
  496. return CreateDeviceRequest(
  497. serialNumber: map['SerialNumber'],
  498. deviceModel: map['DeviceModel'],
  499. deviceType: map['DeviceType'],
  500. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  501. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  502. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  503. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  504. );
  505. }
  506. Map<String, dynamic> toJson() {
  507. final map = super.toJson();
  508. return map;
  509. }
  510. }
  511. class GetDeviceRequest extends TokenRequest{
  512. String? deviceCode;
  513. bool isNeedSyn;
  514. GetDeviceRequest({
  515. this.deviceCode,
  516. this.isNeedSyn = false,
  517. String? token,
  518. }) : super(
  519. token: token,
  520. );
  521. factory GetDeviceRequest.fromJson(Map<String, dynamic> map) {
  522. return GetDeviceRequest(
  523. deviceCode: map['DeviceCode'],
  524. isNeedSyn: map['IsNeedSyn'],
  525. token: map['Token'],
  526. );
  527. }
  528. Map<String, dynamic> toJson() {
  529. final map = super.toJson();
  530. if(deviceCode != null)
  531. map['DeviceCode'] = deviceCode;
  532. map['IsNeedSyn'] = isNeedSyn;
  533. return map;
  534. }
  535. }
  536. class GetDeviceByShortCodeRequest extends TokenRequest{
  537. String? shortCode;
  538. GetDeviceByShortCodeRequest({
  539. this.shortCode,
  540. String? token,
  541. }) : super(
  542. token: token,
  543. );
  544. factory GetDeviceByShortCodeRequest.fromJson(Map<String, dynamic> map) {
  545. return GetDeviceByShortCodeRequest(
  546. shortCode: map['ShortCode'],
  547. token: map['Token'],
  548. );
  549. }
  550. Map<String, dynamic> toJson() {
  551. final map = super.toJson();
  552. if(shortCode != null)
  553. map['ShortCode'] = shortCode;
  554. return map;
  555. }
  556. }
  557. class PageFilterRequest extends BaseRequest{
  558. int currentPage;
  559. int pageSize;
  560. Map<String,String>? filter;
  561. bool isFuzzy;
  562. PageFilterRequest({
  563. this.currentPage = 0,
  564. this.pageSize = 0,
  565. this.filter,
  566. this.isFuzzy = false,
  567. }) : super(
  568. );
  569. factory PageFilterRequest.fromJson(Map<String, dynamic> map) {
  570. return PageFilterRequest(
  571. currentPage: map['CurrentPage'],
  572. pageSize: map['PageSize'],
  573. filter: map['Filter'] != null ? map['Filter'].cast<String,String>() : null,
  574. isFuzzy: map['IsFuzzy'],
  575. );
  576. }
  577. Map<String, dynamic> toJson() {
  578. final map = super.toJson();
  579. map['CurrentPage'] = currentPage;
  580. map['PageSize'] = pageSize;
  581. if(filter != null)
  582. map['Filter'] = filter;
  583. map['IsFuzzy'] = isFuzzy;
  584. return map;
  585. }
  586. }
  587. class BindDeviceRequest extends TokenRequest{
  588. String? serialNumber;
  589. String? name;
  590. String? description;
  591. String? headPicUrl;
  592. String? organizationCode;
  593. String? departmentCode;
  594. String? shortCode;
  595. bool isAutoShared;
  596. BindDeviceRequest({
  597. this.serialNumber,
  598. this.name,
  599. this.description,
  600. this.headPicUrl,
  601. this.organizationCode,
  602. this.departmentCode,
  603. this.shortCode,
  604. this.isAutoShared = false,
  605. String? token,
  606. }) : super(
  607. token: token,
  608. );
  609. factory BindDeviceRequest.fromJson(Map<String, dynamic> map) {
  610. return BindDeviceRequest(
  611. serialNumber: map['SerialNumber'],
  612. name: map['Name'],
  613. description: map['Description'],
  614. headPicUrl: map['HeadPicUrl'],
  615. organizationCode: map['OrganizationCode'],
  616. departmentCode: map['DepartmentCode'],
  617. shortCode: map['ShortCode'],
  618. isAutoShared: map['IsAutoShared'],
  619. token: map['Token'],
  620. );
  621. }
  622. Map<String, dynamic> toJson() {
  623. final map = super.toJson();
  624. if(serialNumber != null)
  625. map['SerialNumber'] = serialNumber;
  626. if(name != null)
  627. map['Name'] = name;
  628. if(description != null)
  629. map['Description'] = description;
  630. if(headPicUrl != null)
  631. map['HeadPicUrl'] = headPicUrl;
  632. if(organizationCode != null)
  633. map['OrganizationCode'] = organizationCode;
  634. if(departmentCode != null)
  635. map['DepartmentCode'] = departmentCode;
  636. if(shortCode != null)
  637. map['ShortCode'] = shortCode;
  638. map['IsAutoShared'] = isAutoShared;
  639. return map;
  640. }
  641. }
  642. class ModifyDeviceRequest extends TokenRequest{
  643. String? deviceCode;
  644. String? name;
  645. String? headPicUrl;
  646. String? departmentCode;
  647. bool isAutoShared;
  648. String? description;
  649. ModifyDeviceRequest({
  650. this.deviceCode,
  651. this.name,
  652. this.headPicUrl,
  653. this.departmentCode,
  654. this.isAutoShared = false,
  655. this.description,
  656. String? token,
  657. }) : super(
  658. token: token,
  659. );
  660. factory ModifyDeviceRequest.fromJson(Map<String, dynamic> map) {
  661. return ModifyDeviceRequest(
  662. deviceCode: map['DeviceCode'],
  663. name: map['Name'],
  664. headPicUrl: map['HeadPicUrl'],
  665. departmentCode: map['DepartmentCode'],
  666. isAutoShared: map['IsAutoShared'],
  667. description: map['Description'],
  668. token: map['Token'],
  669. );
  670. }
  671. Map<String, dynamic> toJson() {
  672. final map = super.toJson();
  673. if(deviceCode != null)
  674. map['DeviceCode'] = deviceCode;
  675. if(name != null)
  676. map['Name'] = name;
  677. if(headPicUrl != null)
  678. map['HeadPicUrl'] = headPicUrl;
  679. if(departmentCode != null)
  680. map['DepartmentCode'] = departmentCode;
  681. map['IsAutoShared'] = isAutoShared;
  682. if(description != null)
  683. map['Description'] = description;
  684. return map;
  685. }
  686. }
  687. enum DictionaryTypeEnum {
  688. DeviceModel,
  689. DeviceType,
  690. }
  691. class CreateDictionaryItemRequest extends TokenRequest{
  692. DictionaryTypeEnum dictionaryType;
  693. String? dictionaryItemValue;
  694. String? parentCode;
  695. CreateDictionaryItemRequest({
  696. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  697. this.dictionaryItemValue,
  698. this.parentCode,
  699. String? token,
  700. }) : super(
  701. token: token,
  702. );
  703. factory CreateDictionaryItemRequest.fromJson(Map<String, dynamic> map) {
  704. return CreateDictionaryItemRequest(
  705. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  706. dictionaryItemValue: map['DictionaryItemValue'],
  707. parentCode: map['ParentCode'],
  708. token: map['Token'],
  709. );
  710. }
  711. Map<String, dynamic> toJson() {
  712. final map = super.toJson();
  713. map['DictionaryType'] = dictionaryType.index;
  714. if(dictionaryItemValue != null)
  715. map['DictionaryItemValue'] = dictionaryItemValue;
  716. if(parentCode != null)
  717. map['ParentCode'] = parentCode;
  718. return map;
  719. }
  720. }
  721. class DictionaryDTO extends BaseDTO{
  722. String? dictionaryCode;
  723. DictionaryTypeEnum dictionaryType;
  724. String? value;
  725. String? parentCode;
  726. List<DictionaryLanguageConfigDTO >? languageConfigs;
  727. DictionaryDTO({
  728. this.dictionaryCode,
  729. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  730. this.value,
  731. this.parentCode,
  732. this.languageConfigs,
  733. DateTime? createTime,
  734. DateTime? updateTime,
  735. }) : super(
  736. createTime: createTime,
  737. updateTime: updateTime,
  738. );
  739. factory DictionaryDTO.fromJson(Map<String, dynamic> map) {
  740. return DictionaryDTO(
  741. dictionaryCode: map['DictionaryCode'],
  742. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  743. value: map['Value'],
  744. parentCode: map['ParentCode'],
  745. languageConfigs: map['LanguageConfigs'] != null ? (map['LanguageConfigs'] as List).map((e)=>DictionaryLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  746. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  747. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  748. );
  749. }
  750. Map<String, dynamic> toJson() {
  751. final map = super.toJson();
  752. if(dictionaryCode != null)
  753. map['DictionaryCode'] = dictionaryCode;
  754. map['DictionaryType'] = dictionaryType.index;
  755. if(value != null)
  756. map['Value'] = value;
  757. if(parentCode != null)
  758. map['ParentCode'] = parentCode;
  759. if(languageConfigs != null)
  760. map['LanguageConfigs'] = languageConfigs;
  761. return map;
  762. }
  763. }
  764. class FindDeviceModelItemsRequest extends TokenRequest{
  765. DictionaryTypeEnum dictionaryType;
  766. String? deviceTypeCode;
  767. FindDeviceModelItemsRequest({
  768. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  769. this.deviceTypeCode,
  770. String? token,
  771. }) : super(
  772. token: token,
  773. );
  774. factory FindDeviceModelItemsRequest.fromJson(Map<String, dynamic> map) {
  775. return FindDeviceModelItemsRequest(
  776. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  777. deviceTypeCode: map['DeviceTypeCode'],
  778. token: map['Token'],
  779. );
  780. }
  781. Map<String, dynamic> toJson() {
  782. final map = super.toJson();
  783. map['DictionaryType'] = dictionaryType.index;
  784. if(deviceTypeCode != null)
  785. map['DeviceTypeCode'] = deviceTypeCode;
  786. return map;
  787. }
  788. }
  789. class FindDeviceTypeItemsRequest extends TokenRequest{
  790. DictionaryTypeEnum dictionaryType;
  791. FindDeviceTypeItemsRequest({
  792. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  793. String? token,
  794. }) : super(
  795. token: token,
  796. );
  797. factory FindDeviceTypeItemsRequest.fromJson(Map<String, dynamic> map) {
  798. return FindDeviceTypeItemsRequest(
  799. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  800. token: map['Token'],
  801. );
  802. }
  803. Map<String, dynamic> toJson() {
  804. final map = super.toJson();
  805. map['DictionaryType'] = dictionaryType.index;
  806. return map;
  807. }
  808. }
  809. class CreateShareDeviceToUserRequest extends TokenRequest{
  810. List<String >? userCodes;
  811. String? deviceCode;
  812. CreateShareDeviceToUserRequest({
  813. this.userCodes,
  814. this.deviceCode,
  815. String? token,
  816. }) : super(
  817. token: token,
  818. );
  819. factory CreateShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  820. return CreateShareDeviceToUserRequest(
  821. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  822. deviceCode: map['DeviceCode'],
  823. token: map['Token'],
  824. );
  825. }
  826. Map<String, dynamic> toJson() {
  827. final map = super.toJson();
  828. if(userCodes != null)
  829. map['UserCodes'] = userCodes;
  830. if(deviceCode != null)
  831. map['DeviceCode'] = deviceCode;
  832. return map;
  833. }
  834. }
  835. class DeleteShareDeviceToUserRequest extends TokenRequest{
  836. List<String >? userCodes;
  837. String? deviceCode;
  838. DeleteShareDeviceToUserRequest({
  839. this.userCodes,
  840. this.deviceCode,
  841. String? token,
  842. }) : super(
  843. token: token,
  844. );
  845. factory DeleteShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  846. return DeleteShareDeviceToUserRequest(
  847. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  848. deviceCode: map['DeviceCode'],
  849. token: map['Token'],
  850. );
  851. }
  852. Map<String, dynamic> toJson() {
  853. final map = super.toJson();
  854. if(userCodes != null)
  855. map['UserCodes'] = userCodes;
  856. if(deviceCode != null)
  857. map['DeviceCode'] = deviceCode;
  858. return map;
  859. }
  860. }
  861. class RemoveDeviceRelevancyRequest extends TokenRequest{
  862. String? organizationCode;
  863. String? departmentCode;
  864. String? deviceCode;
  865. RemoveDeviceRelevancyRequest({
  866. this.organizationCode,
  867. this.departmentCode,
  868. this.deviceCode,
  869. String? token,
  870. }) : super(
  871. token: token,
  872. );
  873. factory RemoveDeviceRelevancyRequest.fromJson(Map<String, dynamic> map) {
  874. return RemoveDeviceRelevancyRequest(
  875. organizationCode: map['OrganizationCode'],
  876. departmentCode: map['DepartmentCode'],
  877. deviceCode: map['DeviceCode'],
  878. token: map['Token'],
  879. );
  880. }
  881. Map<String, dynamic> toJson() {
  882. final map = super.toJson();
  883. if(organizationCode != null)
  884. map['OrganizationCode'] = organizationCode;
  885. if(departmentCode != null)
  886. map['DepartmentCode'] = departmentCode;
  887. if(deviceCode != null)
  888. map['DeviceCode'] = deviceCode;
  889. return map;
  890. }
  891. }
  892. class GetPersonRoleDeviceRequest extends PageRequest{
  893. String? keyWord;
  894. String? deviceType;
  895. String? deviceModel;
  896. GetPersonRoleDeviceRequest({
  897. this.keyWord,
  898. this.deviceType,
  899. this.deviceModel,
  900. int pageIndex = 0,
  901. int pageSize = 0,
  902. String? token,
  903. }) : super(
  904. pageIndex: pageIndex,
  905. pageSize: pageSize,
  906. token: token,
  907. );
  908. factory GetPersonRoleDeviceRequest.fromJson(Map<String, dynamic> map) {
  909. return GetPersonRoleDeviceRequest(
  910. keyWord: map['KeyWord'],
  911. deviceType: map['DeviceType'],
  912. deviceModel: map['DeviceModel'],
  913. pageIndex: map['PageIndex'],
  914. pageSize: map['PageSize'],
  915. token: map['Token'],
  916. );
  917. }
  918. Map<String, dynamic> toJson() {
  919. final map = super.toJson();
  920. if(keyWord != null)
  921. map['KeyWord'] = keyWord;
  922. if(deviceType != null)
  923. map['DeviceType'] = deviceType;
  924. if(deviceModel != null)
  925. map['DeviceModel'] = deviceModel;
  926. return map;
  927. }
  928. }
  929. class FindDevicesByOrganizationCodeRequest extends TokenRequest{
  930. String? organizationCode;
  931. FindDevicesByOrganizationCodeRequest({
  932. this.organizationCode,
  933. String? token,
  934. }) : super(
  935. token: token,
  936. );
  937. factory FindDevicesByOrganizationCodeRequest.fromJson(Map<String, dynamic> map) {
  938. return FindDevicesByOrganizationCodeRequest(
  939. organizationCode: map['OrganizationCode'],
  940. token: map['Token'],
  941. );
  942. }
  943. Map<String, dynamic> toJson() {
  944. final map = super.toJson();
  945. if(organizationCode != null)
  946. map['OrganizationCode'] = organizationCode;
  947. return map;
  948. }
  949. }
  950. class DeviceServerSettingResult {
  951. Map<String,String>? serverConfigList;
  952. bool isUploadThumbnail;
  953. OrganizationPatientTypeEnum patientType;
  954. int heartRateSeconds;
  955. String? notificationUrl;
  956. bool mergedChannel;
  957. int liveConsultationRateSeconds;
  958. int mergedVideoOutputWidth;
  959. int mergedVideoOutputHeight;
  960. bool isSelfRtcService;
  961. int remoteControlAskTimeoutSec;
  962. String? liveProtocol;
  963. TransactionStatusEnum liveProtocolType;
  964. DeviceServerSettingResult({
  965. this.serverConfigList,
  966. this.isUploadThumbnail = false,
  967. this.patientType = OrganizationPatientTypeEnum.Person,
  968. this.heartRateSeconds = 0,
  969. this.notificationUrl,
  970. this.mergedChannel = false,
  971. this.liveConsultationRateSeconds = 0,
  972. this.mergedVideoOutputWidth = 0,
  973. this.mergedVideoOutputHeight = 0,
  974. this.isSelfRtcService = false,
  975. this.remoteControlAskTimeoutSec = 0,
  976. this.liveProtocol,
  977. this.liveProtocolType = TransactionStatusEnum.Applied,
  978. });
  979. factory DeviceServerSettingResult.fromJson(Map<String, dynamic> map) {
  980. return DeviceServerSettingResult(
  981. serverConfigList: map['ServerConfigList'] != null ? map['ServerConfigList'].cast<String,String>() : null,
  982. isUploadThumbnail: map['IsUploadThumbnail'],
  983. patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  984. heartRateSeconds: map['HeartRateSeconds'],
  985. notificationUrl: map['NotificationUrl'],
  986. mergedChannel: map['MergedChannel'],
  987. liveConsultationRateSeconds: map['LiveConsultationRateSeconds'],
  988. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  989. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  990. isSelfRtcService: map['IsSelfRtcService'],
  991. remoteControlAskTimeoutSec: map['RemoteControlAskTimeoutSec'],
  992. liveProtocol: map['LiveProtocol'],
  993. liveProtocolType: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocolType']),
  994. );
  995. }
  996. Map<String, dynamic> toJson() {
  997. final map = Map<String, dynamic>();
  998. if(serverConfigList != null)
  999. map['ServerConfigList'] = serverConfigList;
  1000. map['IsUploadThumbnail'] = isUploadThumbnail;
  1001. map['PatientType'] = patientType.index;
  1002. map['HeartRateSeconds'] = heartRateSeconds;
  1003. if(notificationUrl != null)
  1004. map['NotificationUrl'] = notificationUrl;
  1005. map['MergedChannel'] = mergedChannel;
  1006. map['LiveConsultationRateSeconds'] = liveConsultationRateSeconds;
  1007. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  1008. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  1009. map['IsSelfRtcService'] = isSelfRtcService;
  1010. map['RemoteControlAskTimeoutSec'] = remoteControlAskTimeoutSec;
  1011. if(liveProtocol != null)
  1012. map['LiveProtocol'] = liveProtocol;
  1013. map['LiveProtocolType'] = liveProtocolType.index;
  1014. return map;
  1015. }
  1016. }
  1017. class AddDeviceToOrgRequest extends TokenRequest{
  1018. String? uniqueCode;
  1019. AddDeviceToOrgRequest({
  1020. this.uniqueCode,
  1021. String? token,
  1022. }) : super(
  1023. token: token,
  1024. );
  1025. factory AddDeviceToOrgRequest.fromJson(Map<String, dynamic> map) {
  1026. return AddDeviceToOrgRequest(
  1027. uniqueCode: map['UniqueCode'],
  1028. token: map['Token'],
  1029. );
  1030. }
  1031. Map<String, dynamic> toJson() {
  1032. final map = super.toJson();
  1033. if(uniqueCode != null)
  1034. map['UniqueCode'] = uniqueCode;
  1035. return map;
  1036. }
  1037. }
  1038. class DiagnosisModuleDTO extends BaseDTO{
  1039. String? diagnosisModuleCode;
  1040. String? diagnosisModule;
  1041. bool enabled;
  1042. DiagnosisModuleDTO({
  1043. this.diagnosisModuleCode,
  1044. this.diagnosisModule,
  1045. this.enabled = false,
  1046. DateTime? createTime,
  1047. DateTime? updateTime,
  1048. }) : super(
  1049. createTime: createTime,
  1050. updateTime: updateTime,
  1051. );
  1052. factory DiagnosisModuleDTO.fromJson(Map<String, dynamic> map) {
  1053. return DiagnosisModuleDTO(
  1054. diagnosisModuleCode: map['DiagnosisModuleCode'],
  1055. diagnosisModule: map['DiagnosisModule'],
  1056. enabled: map['Enabled'],
  1057. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1058. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  1059. );
  1060. }
  1061. Map<String, dynamic> toJson() {
  1062. final map = super.toJson();
  1063. if(diagnosisModuleCode != null)
  1064. map['DiagnosisModuleCode'] = diagnosisModuleCode;
  1065. if(diagnosisModule != null)
  1066. map['DiagnosisModule'] = diagnosisModule;
  1067. map['Enabled'] = enabled;
  1068. return map;
  1069. }
  1070. }
  1071. class FindDeviceDiagnosisModulesRequest extends TokenRequest{
  1072. String? deviceCode;
  1073. FindDeviceDiagnosisModulesRequest({
  1074. this.deviceCode,
  1075. String? token,
  1076. }) : super(
  1077. token: token,
  1078. );
  1079. factory FindDeviceDiagnosisModulesRequest.fromJson(Map<String, dynamic> map) {
  1080. return FindDeviceDiagnosisModulesRequest(
  1081. deviceCode: map['DeviceCode'],
  1082. token: map['Token'],
  1083. );
  1084. }
  1085. Map<String, dynamic> toJson() {
  1086. final map = super.toJson();
  1087. if(deviceCode != null)
  1088. map['DeviceCode'] = deviceCode;
  1089. return map;
  1090. }
  1091. }
  1092. class ModifyDeviceDiagnosisModuleStateRequest extends TokenRequest{
  1093. String? deviceCode;
  1094. String? diagnosisModule;
  1095. bool enabled;
  1096. ModifyDeviceDiagnosisModuleStateRequest({
  1097. this.deviceCode,
  1098. this.diagnosisModule,
  1099. this.enabled = false,
  1100. String? token,
  1101. }) : super(
  1102. token: token,
  1103. );
  1104. factory ModifyDeviceDiagnosisModuleStateRequest.fromJson(Map<String, dynamic> map) {
  1105. return ModifyDeviceDiagnosisModuleStateRequest(
  1106. deviceCode: map['DeviceCode'],
  1107. diagnosisModule: map['DiagnosisModule'],
  1108. enabled: map['Enabled'],
  1109. token: map['Token'],
  1110. );
  1111. }
  1112. Map<String, dynamic> toJson() {
  1113. final map = super.toJson();
  1114. if(deviceCode != null)
  1115. map['DeviceCode'] = deviceCode;
  1116. if(diagnosisModule != null)
  1117. map['DiagnosisModule'] = diagnosisModule;
  1118. map['Enabled'] = enabled;
  1119. return map;
  1120. }
  1121. }
  1122. class ReportVideoDeviceInfoResult {
  1123. bool success;
  1124. List<VideoDeviceDTO >? videoDeviceOutputInfos;
  1125. ReportVideoDeviceInfoResult({
  1126. this.success = false,
  1127. this.videoDeviceOutputInfos,
  1128. });
  1129. factory ReportVideoDeviceInfoResult.fromJson(Map<String, dynamic> map) {
  1130. return ReportVideoDeviceInfoResult(
  1131. success: map['Success'],
  1132. videoDeviceOutputInfos: map['VideoDeviceOutputInfos'] != null ? (map['VideoDeviceOutputInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1133. );
  1134. }
  1135. Map<String, dynamic> toJson() {
  1136. final map = Map<String, dynamic>();
  1137. map['Success'] = success;
  1138. if(videoDeviceOutputInfos != null)
  1139. map['VideoDeviceOutputInfos'] = videoDeviceOutputInfos;
  1140. return map;
  1141. }
  1142. }
  1143. class VideoDeviceInfo {
  1144. String? videoDeviceId;
  1145. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  1146. int width;
  1147. int height;
  1148. int videoFps;
  1149. int videoBitrate;
  1150. int minVideoBitrate;
  1151. VideoDeviceInfo({
  1152. this.videoDeviceId,
  1153. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  1154. this.width = 0,
  1155. this.height = 0,
  1156. this.videoFps = 0,
  1157. this.videoBitrate = 0,
  1158. this.minVideoBitrate = 0,
  1159. });
  1160. factory VideoDeviceInfo.fromJson(Map<String, dynamic> map) {
  1161. return VideoDeviceInfo(
  1162. videoDeviceId: map['VideoDeviceId'],
  1163. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  1164. width: map['Width'],
  1165. height: map['Height'],
  1166. videoFps: map['VideoFps'],
  1167. videoBitrate: map['VideoBitrate'],
  1168. minVideoBitrate: map['MinVideoBitrate'],
  1169. );
  1170. }
  1171. Map<String, dynamic> toJson() {
  1172. final map = Map<String, dynamic>();
  1173. if(videoDeviceId != null)
  1174. map['VideoDeviceId'] = videoDeviceId;
  1175. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  1176. map['Width'] = width;
  1177. map['Height'] = height;
  1178. map['VideoFps'] = videoFps;
  1179. map['VideoBitrate'] = videoBitrate;
  1180. map['MinVideoBitrate'] = minVideoBitrate;
  1181. return map;
  1182. }
  1183. }
  1184. class ReportVideoDeviceInfoRequest extends TokenRequest{
  1185. bool liveOpened;
  1186. bool supportRtc;
  1187. bool mergedChannel;
  1188. List<VideoDeviceInfo >? videoDeviceInfos;
  1189. ReportVideoDeviceInfoRequest({
  1190. this.liveOpened = false,
  1191. this.supportRtc = false,
  1192. this.mergedChannel = false,
  1193. this.videoDeviceInfos,
  1194. String? token,
  1195. }) : super(
  1196. token: token,
  1197. );
  1198. factory ReportVideoDeviceInfoRequest.fromJson(Map<String, dynamic> map) {
  1199. return ReportVideoDeviceInfoRequest(
  1200. liveOpened: map['LiveOpened'],
  1201. supportRtc: map['SupportRtc'],
  1202. mergedChannel: map['MergedChannel'],
  1203. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  1204. token: map['Token'],
  1205. );
  1206. }
  1207. Map<String, dynamic> toJson() {
  1208. final map = super.toJson();
  1209. map['LiveOpened'] = liveOpened;
  1210. map['SupportRtc'] = supportRtc;
  1211. map['MergedChannel'] = mergedChannel;
  1212. if(videoDeviceInfos != null)
  1213. map['VideoDeviceInfos'] = videoDeviceInfos;
  1214. return map;
  1215. }
  1216. }
  1217. class ApplicationSettingInfoDTO {
  1218. String? id;
  1219. String? name;
  1220. bool isPreferred;
  1221. bool isUserDefined;
  1222. bool isHidden;
  1223. ApplicationSettingInfoDTO({
  1224. this.id,
  1225. this.name,
  1226. this.isPreferred = false,
  1227. this.isUserDefined = false,
  1228. this.isHidden = false,
  1229. });
  1230. factory ApplicationSettingInfoDTO.fromJson(Map<String, dynamic> map) {
  1231. return ApplicationSettingInfoDTO(
  1232. id: map['Id'],
  1233. name: map['Name'],
  1234. isPreferred: map['IsPreferred'],
  1235. isUserDefined: map['IsUserDefined'],
  1236. isHidden: map['IsHidden'],
  1237. );
  1238. }
  1239. Map<String, dynamic> toJson() {
  1240. final map = Map<String, dynamic>();
  1241. if(id != null)
  1242. map['Id'] = id;
  1243. if(name != null)
  1244. map['Name'] = name;
  1245. map['IsPreferred'] = isPreferred;
  1246. map['IsUserDefined'] = isUserDefined;
  1247. map['IsHidden'] = isHidden;
  1248. return map;
  1249. }
  1250. }
  1251. class ProbeInfoDTO {
  1252. String? name;
  1253. List<String >? applications;
  1254. List<ApplicationSettingInfoDTO >? applicationInfos;
  1255. ProbeInfoDTO({
  1256. this.name,
  1257. this.applications,
  1258. this.applicationInfos,
  1259. });
  1260. factory ProbeInfoDTO.fromJson(Map<String, dynamic> map) {
  1261. return ProbeInfoDTO(
  1262. name: map['Name'],
  1263. applications: map['Applications'] != null ? map['Applications'].cast<String>().toList() : null,
  1264. applicationInfos: map['ApplicationInfos'] != null ? (map['ApplicationInfos'] as List).map((e)=>ApplicationSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1265. );
  1266. }
  1267. Map<String, dynamic> toJson() {
  1268. final map = Map<String, dynamic>();
  1269. if(name != null)
  1270. map['Name'] = name;
  1271. if(applications != null)
  1272. map['Applications'] = applications;
  1273. if(applicationInfos != null)
  1274. map['ApplicationInfos'] = applicationInfos;
  1275. return map;
  1276. }
  1277. }
  1278. class ProbeApplicationInfoDTO {
  1279. List<ProbeInfoDTO >? probes;
  1280. String? activeProbe;
  1281. String? activeApplication;
  1282. ProbeApplicationInfoDTO({
  1283. this.probes,
  1284. this.activeProbe,
  1285. this.activeApplication,
  1286. });
  1287. factory ProbeApplicationInfoDTO.fromJson(Map<String, dynamic> map) {
  1288. return ProbeApplicationInfoDTO(
  1289. probes: map['Probes'] != null ? (map['Probes'] as List).map((e)=>ProbeInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1290. activeProbe: map['ActiveProbe'],
  1291. activeApplication: map['ActiveApplication'],
  1292. );
  1293. }
  1294. Map<String, dynamic> toJson() {
  1295. final map = Map<String, dynamic>();
  1296. if(probes != null)
  1297. map['Probes'] = probes;
  1298. if(activeProbe != null)
  1299. map['ActiveProbe'] = activeProbe;
  1300. if(activeApplication != null)
  1301. map['ActiveApplication'] = activeApplication;
  1302. return map;
  1303. }
  1304. }
  1305. class ControlParameterDTO {
  1306. bool canExecute;
  1307. List<ControlParameterDTO >? children;
  1308. String? description;
  1309. String? displayValue;
  1310. String? parentDescription;
  1311. String? valuesMapString;
  1312. ControlParameterDTO({
  1313. this.canExecute = false,
  1314. this.children,
  1315. this.description,
  1316. this.displayValue,
  1317. this.parentDescription,
  1318. this.valuesMapString,
  1319. });
  1320. factory ControlParameterDTO.fromJson(Map<String, dynamic> map) {
  1321. return ControlParameterDTO(
  1322. canExecute: map['CanExecute'],
  1323. children: map['Children'] != null ? (map['Children'] as List).map((e)=>ControlParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1324. description: map['Description'],
  1325. displayValue: map['DisplayValue'],
  1326. parentDescription: map['ParentDescription'],
  1327. valuesMapString: map['ValuesMapString'],
  1328. );
  1329. }
  1330. Map<String, dynamic> toJson() {
  1331. final map = Map<String, dynamic>();
  1332. map['CanExecute'] = canExecute;
  1333. if(children != null)
  1334. map['Children'] = children;
  1335. if(description != null)
  1336. map['Description'] = description;
  1337. if(displayValue != null)
  1338. map['DisplayValue'] = displayValue;
  1339. if(parentDescription != null)
  1340. map['ParentDescription'] = parentDescription;
  1341. if(valuesMapString != null)
  1342. map['ValuesMapString'] = valuesMapString;
  1343. return map;
  1344. }
  1345. }
  1346. class SendControlParameterByDeviceRequest extends TokenRequest{
  1347. String? controlUserCode;
  1348. ProbeApplicationInfoDTO? probeApplication;
  1349. ControlParameterDTO? parameter;
  1350. SendControlParameterByDeviceRequest({
  1351. this.controlUserCode,
  1352. this.probeApplication,
  1353. this.parameter,
  1354. String? token,
  1355. }) : super(
  1356. token: token,
  1357. );
  1358. factory SendControlParameterByDeviceRequest.fromJson(Map<String, dynamic> map) {
  1359. return SendControlParameterByDeviceRequest(
  1360. controlUserCode: map['ControlUserCode'],
  1361. probeApplication: map['ProbeApplication'] != null ? ProbeApplicationInfoDTO.fromJson(map['ProbeApplication']) : null,
  1362. parameter: map['Parameter'] != null ? ControlParameterDTO.fromJson(map['Parameter']) : null,
  1363. token: map['Token'],
  1364. );
  1365. }
  1366. Map<String, dynamic> toJson() {
  1367. final map = super.toJson();
  1368. if(controlUserCode != null)
  1369. map['ControlUserCode'] = controlUserCode;
  1370. if(probeApplication != null)
  1371. map['ProbeApplication'] = probeApplication;
  1372. if(parameter != null)
  1373. map['Parameter'] = parameter;
  1374. return map;
  1375. }
  1376. }
  1377. class VideoDeviceInfoDTO {
  1378. String? videoDeviceId;
  1379. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  1380. LiveDataDTO? liveData;
  1381. VideoDeviceInfoDTO({
  1382. this.videoDeviceId,
  1383. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  1384. this.liveData,
  1385. });
  1386. factory VideoDeviceInfoDTO.fromJson(Map<String, dynamic> map) {
  1387. return VideoDeviceInfoDTO(
  1388. videoDeviceId: map['VideoDeviceId'],
  1389. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  1390. liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null,
  1391. );
  1392. }
  1393. Map<String, dynamic> toJson() {
  1394. final map = Map<String, dynamic>();
  1395. if(videoDeviceId != null)
  1396. map['VideoDeviceId'] = videoDeviceId;
  1397. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  1398. if(liveData != null)
  1399. map['LiveData'] = liveData;
  1400. return map;
  1401. }
  1402. }
  1403. class JoinDeviceLiveRoomResult extends TokenRequest{
  1404. int roomNo;
  1405. TransactionStatusEnum liveProtocol;
  1406. String? deviceCode;
  1407. bool mergedChannel;
  1408. int mergedVideoOutputWidth;
  1409. int mergedVideoOutputHeight;
  1410. List<VideoDeviceInfoDTO >? videoDeviceInfos;
  1411. int reportStateIntervalSeconds;
  1412. bool isOldPlatform;
  1413. JoinDeviceLiveRoomResult({
  1414. this.roomNo = 0,
  1415. this.liveProtocol = TransactionStatusEnum.Applied,
  1416. this.deviceCode,
  1417. this.mergedChannel = false,
  1418. this.mergedVideoOutputWidth = 0,
  1419. this.mergedVideoOutputHeight = 0,
  1420. this.videoDeviceInfos,
  1421. this.reportStateIntervalSeconds = 0,
  1422. this.isOldPlatform = false,
  1423. String? token,
  1424. }) : super(
  1425. token: token,
  1426. );
  1427. factory JoinDeviceLiveRoomResult.fromJson(Map<String, dynamic> map) {
  1428. return JoinDeviceLiveRoomResult(
  1429. roomNo: map['RoomNo'],
  1430. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  1431. deviceCode: map['DeviceCode'],
  1432. mergedChannel: map['MergedChannel'],
  1433. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  1434. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  1435. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1436. reportStateIntervalSeconds: map['ReportStateIntervalSeconds'],
  1437. isOldPlatform: map['IsOldPlatform'],
  1438. token: map['Token'],
  1439. );
  1440. }
  1441. Map<String, dynamic> toJson() {
  1442. final map = super.toJson();
  1443. map['RoomNo'] = roomNo;
  1444. map['LiveProtocol'] = liveProtocol.index;
  1445. if(deviceCode != null)
  1446. map['DeviceCode'] = deviceCode;
  1447. map['MergedChannel'] = mergedChannel;
  1448. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  1449. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  1450. if(videoDeviceInfos != null)
  1451. map['VideoDeviceInfos'] = videoDeviceInfos;
  1452. map['ReportStateIntervalSeconds'] = reportStateIntervalSeconds;
  1453. map['IsOldPlatform'] = isOldPlatform;
  1454. return map;
  1455. }
  1456. }
  1457. class JoinDeviceLiveRoomRequest extends TokenRequest{
  1458. String? deviceCode;
  1459. JoinDeviceLiveRoomRequest({
  1460. this.deviceCode,
  1461. String? token,
  1462. }) : super(
  1463. token: token,
  1464. );
  1465. factory JoinDeviceLiveRoomRequest.fromJson(Map<String, dynamic> map) {
  1466. return JoinDeviceLiveRoomRequest(
  1467. deviceCode: map['DeviceCode'],
  1468. token: map['Token'],
  1469. );
  1470. }
  1471. Map<String, dynamic> toJson() {
  1472. final map = super.toJson();
  1473. if(deviceCode != null)
  1474. map['DeviceCode'] = deviceCode;
  1475. return map;
  1476. }
  1477. }
  1478. class LeaveDeviceLiveRoomRequest extends TokenRequest{
  1479. String? deviceCode;
  1480. LeaveDeviceLiveRoomRequest({
  1481. this.deviceCode,
  1482. String? token,
  1483. }) : super(
  1484. token: token,
  1485. );
  1486. factory LeaveDeviceLiveRoomRequest.fromJson(Map<String, dynamic> map) {
  1487. return LeaveDeviceLiveRoomRequest(
  1488. deviceCode: map['DeviceCode'],
  1489. token: map['Token'],
  1490. );
  1491. }
  1492. Map<String, dynamic> toJson() {
  1493. final map = super.toJson();
  1494. if(deviceCode != null)
  1495. map['DeviceCode'] = deviceCode;
  1496. return map;
  1497. }
  1498. }
  1499. class ReportLiveViewStateRequest extends TokenRequest{
  1500. String? deviceCode;
  1501. ReportLiveViewStateRequest({
  1502. this.deviceCode,
  1503. String? token,
  1504. }) : super(
  1505. token: token,
  1506. );
  1507. factory ReportLiveViewStateRequest.fromJson(Map<String, dynamic> map) {
  1508. return ReportLiveViewStateRequest(
  1509. deviceCode: map['DeviceCode'],
  1510. token: map['Token'],
  1511. );
  1512. }
  1513. Map<String, dynamic> toJson() {
  1514. final map = super.toJson();
  1515. if(deviceCode != null)
  1516. map['DeviceCode'] = deviceCode;
  1517. return map;
  1518. }
  1519. }
  1520. class CreateLiveShareInfoResult extends TokenRequest{
  1521. String? shareUrl;
  1522. CreateLiveShareInfoResult({
  1523. this.shareUrl,
  1524. String? token,
  1525. }) : super(
  1526. token: token,
  1527. );
  1528. factory CreateLiveShareInfoResult.fromJson(Map<String, dynamic> map) {
  1529. return CreateLiveShareInfoResult(
  1530. shareUrl: map['ShareUrl'],
  1531. token: map['Token'],
  1532. );
  1533. }
  1534. Map<String, dynamic> toJson() {
  1535. final map = super.toJson();
  1536. if(shareUrl != null)
  1537. map['ShareUrl'] = shareUrl;
  1538. return map;
  1539. }
  1540. }
  1541. class CreateLiveShareInfoRequest extends TokenRequest{
  1542. String? deviceCode;
  1543. CreateLiveShareInfoRequest({
  1544. this.deviceCode,
  1545. String? token,
  1546. }) : super(
  1547. token: token,
  1548. );
  1549. factory CreateLiveShareInfoRequest.fromJson(Map<String, dynamic> map) {
  1550. return CreateLiveShareInfoRequest(
  1551. deviceCode: map['DeviceCode'],
  1552. token: map['Token'],
  1553. );
  1554. }
  1555. Map<String, dynamic> toJson() {
  1556. final map = super.toJson();
  1557. if(deviceCode != null)
  1558. map['DeviceCode'] = deviceCode;
  1559. return map;
  1560. }
  1561. }
  1562. class JoinDeviceLiveRoomByShareResult {
  1563. int roomNo;
  1564. TransactionStatusEnum liveProtocol;
  1565. String? deviceCode;
  1566. bool mergedChannel;
  1567. int mergedVideoOutputWidth;
  1568. int mergedVideoOutputHeight;
  1569. List<VideoDeviceInfoDTO >? videoDeviceInfos;
  1570. int reportStateIntervalSeconds;
  1571. JoinDeviceLiveRoomByShareResult({
  1572. this.roomNo = 0,
  1573. this.liveProtocol = TransactionStatusEnum.Applied,
  1574. this.deviceCode,
  1575. this.mergedChannel = false,
  1576. this.mergedVideoOutputWidth = 0,
  1577. this.mergedVideoOutputHeight = 0,
  1578. this.videoDeviceInfos,
  1579. this.reportStateIntervalSeconds = 0,
  1580. });
  1581. factory JoinDeviceLiveRoomByShareResult.fromJson(Map<String, dynamic> map) {
  1582. return JoinDeviceLiveRoomByShareResult(
  1583. roomNo: map['RoomNo'],
  1584. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  1585. deviceCode: map['DeviceCode'],
  1586. mergedChannel: map['MergedChannel'],
  1587. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  1588. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  1589. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1590. reportStateIntervalSeconds: map['ReportStateIntervalSeconds'],
  1591. );
  1592. }
  1593. Map<String, dynamic> toJson() {
  1594. final map = Map<String, dynamic>();
  1595. map['RoomNo'] = roomNo;
  1596. map['LiveProtocol'] = liveProtocol.index;
  1597. if(deviceCode != null)
  1598. map['DeviceCode'] = deviceCode;
  1599. map['MergedChannel'] = mergedChannel;
  1600. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  1601. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  1602. if(videoDeviceInfos != null)
  1603. map['VideoDeviceInfos'] = videoDeviceInfos;
  1604. map['ReportStateIntervalSeconds'] = reportStateIntervalSeconds;
  1605. return map;
  1606. }
  1607. }
  1608. class JoinDeviceLiveRoomByShareRequest {
  1609. String? shareCode;
  1610. JoinDeviceLiveRoomByShareRequest({
  1611. this.shareCode,
  1612. });
  1613. factory JoinDeviceLiveRoomByShareRequest.fromJson(Map<String, dynamic> map) {
  1614. return JoinDeviceLiveRoomByShareRequest(
  1615. shareCode: map['ShareCode'],
  1616. );
  1617. }
  1618. Map<String, dynamic> toJson() {
  1619. final map = Map<String, dynamic>();
  1620. if(shareCode != null)
  1621. map['ShareCode'] = shareCode;
  1622. return map;
  1623. }
  1624. }
  1625. class LeaveDeviceLiveRoomByShareRequest {
  1626. String? deviceCode;
  1627. String? viewerUniqueId;
  1628. LeaveDeviceLiveRoomByShareRequest({
  1629. this.deviceCode,
  1630. this.viewerUniqueId,
  1631. });
  1632. factory LeaveDeviceLiveRoomByShareRequest.fromJson(Map<String, dynamic> map) {
  1633. return LeaveDeviceLiveRoomByShareRequest(
  1634. deviceCode: map['DeviceCode'],
  1635. viewerUniqueId: map['ViewerUniqueId'],
  1636. );
  1637. }
  1638. Map<String, dynamic> toJson() {
  1639. final map = Map<String, dynamic>();
  1640. if(deviceCode != null)
  1641. map['DeviceCode'] = deviceCode;
  1642. if(viewerUniqueId != null)
  1643. map['ViewerUniqueId'] = viewerUniqueId;
  1644. return map;
  1645. }
  1646. }
  1647. class ReportLiveViewStateByShareRequest {
  1648. String? deviceCode;
  1649. String? viewerUniqueId;
  1650. ReportLiveViewStateByShareRequest({
  1651. this.deviceCode,
  1652. this.viewerUniqueId,
  1653. });
  1654. factory ReportLiveViewStateByShareRequest.fromJson(Map<String, dynamic> map) {
  1655. return ReportLiveViewStateByShareRequest(
  1656. deviceCode: map['DeviceCode'],
  1657. viewerUniqueId: map['ViewerUniqueId'],
  1658. );
  1659. }
  1660. Map<String, dynamic> toJson() {
  1661. final map = Map<String, dynamic>();
  1662. if(deviceCode != null)
  1663. map['DeviceCode'] = deviceCode;
  1664. if(viewerUniqueId != null)
  1665. map['ViewerUniqueId'] = viewerUniqueId;
  1666. return map;
  1667. }
  1668. }
  1669. enum DeviceLiveStateEnum {
  1670. Default,
  1671. Pushing,
  1672. Closed,
  1673. Error,
  1674. Warning,
  1675. }
  1676. class ReportLiveStateRequest extends TokenRequest{
  1677. int roomNo;
  1678. DeviceLiveStateEnum liveState;
  1679. String? message;
  1680. ReportLiveStateRequest({
  1681. this.roomNo = 0,
  1682. this.liveState = DeviceLiveStateEnum.Default,
  1683. this.message,
  1684. String? token,
  1685. }) : super(
  1686. token: token,
  1687. );
  1688. factory ReportLiveStateRequest.fromJson(Map<String, dynamic> map) {
  1689. return ReportLiveStateRequest(
  1690. roomNo: map['RoomNo'],
  1691. liveState: DeviceLiveStateEnum.values.firstWhere((e) => e.index == map['LiveState']),
  1692. message: map['Message'],
  1693. token: map['Token'],
  1694. );
  1695. }
  1696. Map<String, dynamic> toJson() {
  1697. final map = super.toJson();
  1698. map['RoomNo'] = roomNo;
  1699. map['LiveState'] = liveState.index;
  1700. if(message != null)
  1701. map['Message'] = message;
  1702. return map;
  1703. }
  1704. }
  1705. class CreateLiveRoomInfoResult {
  1706. String? userCode;
  1707. String? userSign;
  1708. int roomNo;
  1709. int appId;
  1710. bool isTrtc;
  1711. TransactionStatusEnum liveProtocol;
  1712. LiveDataDTO? liveData;
  1713. CreateLiveRoomInfoResult({
  1714. this.userCode,
  1715. this.userSign,
  1716. this.roomNo = 0,
  1717. this.appId = 0,
  1718. this.isTrtc = false,
  1719. this.liveProtocol = TransactionStatusEnum.Applied,
  1720. this.liveData,
  1721. });
  1722. factory CreateLiveRoomInfoResult.fromJson(Map<String, dynamic> map) {
  1723. return CreateLiveRoomInfoResult(
  1724. userCode: map['UserCode'],
  1725. userSign: map['UserSign'],
  1726. roomNo: map['RoomNo'],
  1727. appId: map['AppId'],
  1728. isTrtc: map['IsTrtc'],
  1729. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  1730. liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null,
  1731. );
  1732. }
  1733. Map<String, dynamic> toJson() {
  1734. final map = Map<String, dynamic>();
  1735. if(userCode != null)
  1736. map['UserCode'] = userCode;
  1737. if(userSign != null)
  1738. map['UserSign'] = userSign;
  1739. map['RoomNo'] = roomNo;
  1740. map['AppId'] = appId;
  1741. map['IsTrtc'] = isTrtc;
  1742. map['LiveProtocol'] = liveProtocol.index;
  1743. if(liveData != null)
  1744. map['LiveData'] = liveData;
  1745. return map;
  1746. }
  1747. }
  1748. class CreateLiveRoomInfoRequest {
  1749. String? deviceUniqueCode;
  1750. String? deviceModel;
  1751. String? deviceType;
  1752. String? softwareVersion;
  1753. CreateLiveRoomInfoRequest({
  1754. this.deviceUniqueCode,
  1755. this.deviceModel,
  1756. this.deviceType,
  1757. this.softwareVersion,
  1758. });
  1759. factory CreateLiveRoomInfoRequest.fromJson(Map<String, dynamic> map) {
  1760. return CreateLiveRoomInfoRequest(
  1761. deviceUniqueCode: map['DeviceUniqueCode'],
  1762. deviceModel: map['DeviceModel'],
  1763. deviceType: map['DeviceType'],
  1764. softwareVersion: map['SoftwareVersion'],
  1765. );
  1766. }
  1767. Map<String, dynamic> toJson() {
  1768. final map = Map<String, dynamic>();
  1769. if(deviceUniqueCode != null)
  1770. map['DeviceUniqueCode'] = deviceUniqueCode;
  1771. if(deviceModel != null)
  1772. map['DeviceModel'] = deviceModel;
  1773. if(deviceType != null)
  1774. map['DeviceType'] = deviceType;
  1775. if(softwareVersion != null)
  1776. map['SoftwareVersion'] = softwareVersion;
  1777. return map;
  1778. }
  1779. }
  1780. class UploadConsultationDataRequest extends TokenRequest{
  1781. String? consultationCode;
  1782. String? previewFileToken;
  1783. String? fileToken;
  1784. int fileSize;
  1785. String? coverImageToken;
  1786. String? applicationCategory;
  1787. String? application;
  1788. RemedicalFileDataTypeEnum fileDataType;
  1789. MeasuredResultsDTO? measuredResult;
  1790. ScanImageDTO? commentResult;
  1791. UploadConsultationDataRequest({
  1792. this.consultationCode,
  1793. this.previewFileToken,
  1794. this.fileToken,
  1795. this.fileSize = 0,
  1796. this.coverImageToken,
  1797. this.applicationCategory,
  1798. this.application,
  1799. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  1800. this.measuredResult,
  1801. this.commentResult,
  1802. String? token,
  1803. }) : super(
  1804. token: token,
  1805. );
  1806. factory UploadConsultationDataRequest.fromJson(Map<String, dynamic> map) {
  1807. return UploadConsultationDataRequest(
  1808. consultationCode: map['ConsultationCode'],
  1809. previewFileToken: map['PreviewFileToken'],
  1810. fileToken: map['FileToken'],
  1811. fileSize: map['FileSize'],
  1812. coverImageToken: map['CoverImageToken'],
  1813. applicationCategory: map['ApplicationCategory'],
  1814. application: map['Application'],
  1815. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  1816. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  1817. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  1818. token: map['Token'],
  1819. );
  1820. }
  1821. Map<String, dynamic> toJson() {
  1822. final map = super.toJson();
  1823. if(consultationCode != null)
  1824. map['ConsultationCode'] = consultationCode;
  1825. if(previewFileToken != null)
  1826. map['PreviewFileToken'] = previewFileToken;
  1827. if(fileToken != null)
  1828. map['FileToken'] = fileToken;
  1829. map['FileSize'] = fileSize;
  1830. if(coverImageToken != null)
  1831. map['CoverImageToken'] = coverImageToken;
  1832. if(applicationCategory != null)
  1833. map['ApplicationCategory'] = applicationCategory;
  1834. if(application != null)
  1835. map['Application'] = application;
  1836. map['FileDataType'] = fileDataType.index;
  1837. if(measuredResult != null)
  1838. map['MeasuredResult'] = measuredResult;
  1839. if(commentResult != null)
  1840. map['CommentResult'] = commentResult;
  1841. return map;
  1842. }
  1843. }
  1844. class DeviceControlParameterDataDTO {
  1845. String? deviceCode;
  1846. String? probeApplication;
  1847. String? parameter;
  1848. DeviceControlParameterDataDTO({
  1849. this.deviceCode,
  1850. this.probeApplication,
  1851. this.parameter,
  1852. });
  1853. factory DeviceControlParameterDataDTO.fromJson(Map<String, dynamic> map) {
  1854. return DeviceControlParameterDataDTO(
  1855. deviceCode: map['DeviceCode'],
  1856. probeApplication: map['ProbeApplication'],
  1857. parameter: map['Parameter'],
  1858. );
  1859. }
  1860. Map<String, dynamic> toJson() {
  1861. final map = Map<String, dynamic>();
  1862. if(deviceCode != null)
  1863. map['DeviceCode'] = deviceCode;
  1864. if(probeApplication != null)
  1865. map['ProbeApplication'] = probeApplication;
  1866. if(parameter != null)
  1867. map['Parameter'] = parameter;
  1868. return map;
  1869. }
  1870. }
  1871. class GetControlParametersRequest extends TokenRequest{
  1872. String? deviceCode;
  1873. GetControlParametersRequest({
  1874. this.deviceCode,
  1875. String? token,
  1876. }) : super(
  1877. token: token,
  1878. );
  1879. factory GetControlParametersRequest.fromJson(Map<String, dynamic> map) {
  1880. return GetControlParametersRequest(
  1881. deviceCode: map['DeviceCode'],
  1882. token: map['Token'],
  1883. );
  1884. }
  1885. Map<String, dynamic> toJson() {
  1886. final map = super.toJson();
  1887. if(deviceCode != null)
  1888. map['DeviceCode'] = deviceCode;
  1889. return map;
  1890. }
  1891. }
  1892. class ControlDeviceConnectRequest extends BaseControlDeviceRequest{
  1893. String? deviceCode;
  1894. String? roomCode;
  1895. ControlDeviceConnectRequest({
  1896. this.deviceCode,
  1897. this.roomCode,
  1898. ControlDeviceParameterEnum controlType = ControlDeviceParameterEnum.Start,
  1899. bool isNeedSyn = false,
  1900. String? token,
  1901. }) : super(
  1902. controlType: controlType,
  1903. isNeedSyn: isNeedSyn,
  1904. token: token,
  1905. );
  1906. factory ControlDeviceConnectRequest.fromJson(Map<String, dynamic> map) {
  1907. return ControlDeviceConnectRequest(
  1908. deviceCode: map['DeviceCode'],
  1909. roomCode: map['RoomCode'],
  1910. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1911. isNeedSyn: map['IsNeedSyn'],
  1912. token: map['Token'],
  1913. );
  1914. }
  1915. Map<String, dynamic> toJson() {
  1916. final map = super.toJson();
  1917. if(deviceCode != null)
  1918. map['DeviceCode'] = deviceCode;
  1919. if(roomCode != null)
  1920. map['RoomCode'] = roomCode;
  1921. return map;
  1922. }
  1923. }
  1924. class ControlDeviceParameterRequest extends BaseControlDeviceParameterRequest{
  1925. String? deviceCode;
  1926. String? consultationCode;
  1927. ControlDeviceParameterRequest({
  1928. this.deviceCode,
  1929. this.consultationCode,
  1930. List<AdditionParameterDTO >? parameters,
  1931. ControlDeviceParameterEnum controlType = ControlDeviceParameterEnum.Start,
  1932. bool isNeedSyn = false,
  1933. String? token,
  1934. }) : super(
  1935. parameters: parameters,
  1936. controlType: controlType,
  1937. isNeedSyn: isNeedSyn,
  1938. token: token,
  1939. );
  1940. factory ControlDeviceParameterRequest.fromJson(Map<String, dynamic> map) {
  1941. return ControlDeviceParameterRequest(
  1942. deviceCode: map['DeviceCode'],
  1943. consultationCode: map['ConsultationCode'],
  1944. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1945. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1946. isNeedSyn: map['IsNeedSyn'],
  1947. token: map['Token'],
  1948. );
  1949. }
  1950. Map<String, dynamic> toJson() {
  1951. final map = super.toJson();
  1952. if(deviceCode != null)
  1953. map['DeviceCode'] = deviceCode;
  1954. if(consultationCode != null)
  1955. map['ConsultationCode'] = consultationCode;
  1956. return map;
  1957. }
  1958. }
  1959. enum LogTimeEnum {
  1960. All,
  1961. Today,
  1962. OneWeek,
  1963. OneMonth,
  1964. OneYear,
  1965. }
  1966. class GetRemoteLogRequest extends TokenRequest{
  1967. String? deviceCode;
  1968. LogTimeEnum logTime;
  1969. GetRemoteLogRequest({
  1970. this.deviceCode,
  1971. this.logTime = LogTimeEnum.All,
  1972. String? token,
  1973. }) : super(
  1974. token: token,
  1975. );
  1976. factory GetRemoteLogRequest.fromJson(Map<String, dynamic> map) {
  1977. return GetRemoteLogRequest(
  1978. deviceCode: map['DeviceCode'],
  1979. logTime: LogTimeEnum.values.firstWhere((e) => e.index == map['LogTime']),
  1980. token: map['Token'],
  1981. );
  1982. }
  1983. Map<String, dynamic> toJson() {
  1984. final map = super.toJson();
  1985. if(deviceCode != null)
  1986. map['DeviceCode'] = deviceCode;
  1987. map['LogTime'] = logTime.index;
  1988. return map;
  1989. }
  1990. }
  1991. class RemoteLogResponseRequest extends TokenRequest{
  1992. String? userCode;
  1993. String? logFileToken;
  1994. int rate;
  1995. RemoteDeviceStateEnum remoteDeviceState;
  1996. RemoteLogResponseRequest({
  1997. this.userCode,
  1998. this.logFileToken,
  1999. this.rate = 0,
  2000. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  2001. String? token,
  2002. }) : super(
  2003. token: token,
  2004. );
  2005. factory RemoteLogResponseRequest.fromJson(Map<String, dynamic> map) {
  2006. return RemoteLogResponseRequest(
  2007. userCode: map['UserCode'],
  2008. logFileToken: map['LogFileToken'],
  2009. rate: map['Rate'],
  2010. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  2011. token: map['Token'],
  2012. );
  2013. }
  2014. Map<String, dynamic> toJson() {
  2015. final map = super.toJson();
  2016. if(userCode != null)
  2017. map['UserCode'] = userCode;
  2018. if(logFileToken != null)
  2019. map['LogFileToken'] = logFileToken;
  2020. map['Rate'] = rate;
  2021. map['RemoteDeviceState'] = remoteDeviceState.index;
  2022. return map;
  2023. }
  2024. }
  2025. class ScanBindDeviceRequest extends TokenRequest{
  2026. String? shortCode;
  2027. ScanBindDeviceRequest({
  2028. this.shortCode,
  2029. String? token,
  2030. }) : super(
  2031. token: token,
  2032. );
  2033. factory ScanBindDeviceRequest.fromJson(Map<String, dynamic> map) {
  2034. return ScanBindDeviceRequest(
  2035. shortCode: map['ShortCode'],
  2036. token: map['Token'],
  2037. );
  2038. }
  2039. Map<String, dynamic> toJson() {
  2040. final map = super.toJson();
  2041. if(shortCode != null)
  2042. map['ShortCode'] = shortCode;
  2043. return map;
  2044. }
  2045. }
  2046. class ReportBrandModelOutputConfigRequest extends TokenRequest{
  2047. String? brand;
  2048. String? model;
  2049. String? shortCode;
  2050. int videoWidth;
  2051. int videoHeight;
  2052. ReportBrandModelOutputConfigRequest({
  2053. this.brand,
  2054. this.model,
  2055. this.shortCode,
  2056. this.videoWidth = 0,
  2057. this.videoHeight = 0,
  2058. String? token,
  2059. }) : super(
  2060. token: token,
  2061. );
  2062. factory ReportBrandModelOutputConfigRequest.fromJson(Map<String, dynamic> map) {
  2063. return ReportBrandModelOutputConfigRequest(
  2064. brand: map['Brand'],
  2065. model: map['Model'],
  2066. shortCode: map['ShortCode'],
  2067. videoWidth: map['VideoWidth'],
  2068. videoHeight: map['VideoHeight'],
  2069. token: map['Token'],
  2070. );
  2071. }
  2072. Map<String, dynamic> toJson() {
  2073. final map = super.toJson();
  2074. if(brand != null)
  2075. map['Brand'] = brand;
  2076. if(model != null)
  2077. map['Model'] = model;
  2078. if(shortCode != null)
  2079. map['ShortCode'] = shortCode;
  2080. map['VideoWidth'] = videoWidth;
  2081. map['VideoHeight'] = videoHeight;
  2082. return map;
  2083. }
  2084. }
  2085. class BrandModelOutputConfigDTO {
  2086. bool isSelect;
  2087. int videoWidth;
  2088. int videoHeight;
  2089. BrandModelOutputConfigDTO({
  2090. this.isSelect = false,
  2091. this.videoWidth = 0,
  2092. this.videoHeight = 0,
  2093. });
  2094. factory BrandModelOutputConfigDTO.fromJson(Map<String, dynamic> map) {
  2095. return BrandModelOutputConfigDTO(
  2096. isSelect: map['IsSelect'],
  2097. videoWidth: map['VideoWidth'],
  2098. videoHeight: map['VideoHeight'],
  2099. );
  2100. }
  2101. Map<String, dynamic> toJson() {
  2102. final map = Map<String, dynamic>();
  2103. map['IsSelect'] = isSelect;
  2104. map['VideoWidth'] = videoWidth;
  2105. map['VideoHeight'] = videoHeight;
  2106. return map;
  2107. }
  2108. }
  2109. class SyncBrandModelOutputConfigRequest extends TokenRequest{
  2110. String? brand;
  2111. String? model;
  2112. String? shortCode;
  2113. SyncBrandModelOutputConfigRequest({
  2114. this.brand,
  2115. this.model,
  2116. this.shortCode,
  2117. String? token,
  2118. }) : super(
  2119. token: token,
  2120. );
  2121. factory SyncBrandModelOutputConfigRequest.fromJson(Map<String, dynamic> map) {
  2122. return SyncBrandModelOutputConfigRequest(
  2123. brand: map['Brand'],
  2124. model: map['Model'],
  2125. shortCode: map['ShortCode'],
  2126. token: map['Token'],
  2127. );
  2128. }
  2129. Map<String, dynamic> toJson() {
  2130. final map = super.toJson();
  2131. if(brand != null)
  2132. map['Brand'] = brand;
  2133. if(model != null)
  2134. map['Model'] = model;
  2135. if(shortCode != null)
  2136. map['ShortCode'] = shortCode;
  2137. return map;
  2138. }
  2139. }
  2140. class GetBrandsRequest extends TokenRequest{
  2141. GetBrandsRequest({
  2142. String? token,
  2143. }) : super(
  2144. token: token,
  2145. );
  2146. factory GetBrandsRequest.fromJson(Map<String, dynamic> map) {
  2147. return GetBrandsRequest(
  2148. token: map['Token'],
  2149. );
  2150. }
  2151. Map<String, dynamic> toJson() {
  2152. final map = super.toJson();
  2153. return map;
  2154. }
  2155. }
  2156. class GetModelsRequest extends TokenRequest{
  2157. String? brand;
  2158. GetModelsRequest({
  2159. this.brand,
  2160. String? token,
  2161. }) : super(
  2162. token: token,
  2163. );
  2164. factory GetModelsRequest.fromJson(Map<String, dynamic> map) {
  2165. return GetModelsRequest(
  2166. brand: map['Brand'],
  2167. token: map['Token'],
  2168. );
  2169. }
  2170. Map<String, dynamic> toJson() {
  2171. final map = super.toJson();
  2172. if(brand != null)
  2173. map['Brand'] = brand;
  2174. return map;
  2175. }
  2176. }
  2177. class AddDevicePatchRequest extends TokenRequest{
  2178. String? name;
  2179. String? description;
  2180. String? deviceType;
  2181. String? softwareVersion;
  2182. String? osVersion;
  2183. List<UploadDeviceFileInfoDTO >? fileUploadInfoList;
  2184. int fileSize;
  2185. String? fileName;
  2186. AddDevicePatchRequest({
  2187. this.name,
  2188. this.description,
  2189. this.deviceType,
  2190. this.softwareVersion,
  2191. this.osVersion,
  2192. this.fileUploadInfoList,
  2193. this.fileSize = 0,
  2194. this.fileName,
  2195. String? token,
  2196. }) : super(
  2197. token: token,
  2198. );
  2199. factory AddDevicePatchRequest.fromJson(Map<String, dynamic> map) {
  2200. return AddDevicePatchRequest(
  2201. name: map['Name'],
  2202. description: map['Description'],
  2203. deviceType: map['DeviceType'],
  2204. softwareVersion: map['SoftwareVersion'],
  2205. osVersion: map['OsVersion'],
  2206. fileUploadInfoList: map['FileUploadInfoList'] != null ? (map['FileUploadInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2207. fileSize: map['FileSize'],
  2208. fileName: map['FileName'],
  2209. token: map['Token'],
  2210. );
  2211. }
  2212. Map<String, dynamic> toJson() {
  2213. final map = super.toJson();
  2214. if(name != null)
  2215. map['Name'] = name;
  2216. if(description != null)
  2217. map['Description'] = description;
  2218. if(deviceType != null)
  2219. map['DeviceType'] = deviceType;
  2220. if(softwareVersion != null)
  2221. map['SoftwareVersion'] = softwareVersion;
  2222. if(osVersion != null)
  2223. map['OsVersion'] = osVersion;
  2224. if(fileUploadInfoList != null)
  2225. map['FileUploadInfoList'] = fileUploadInfoList;
  2226. map['FileSize'] = fileSize;
  2227. if(fileName != null)
  2228. map['FileName'] = fileName;
  2229. return map;
  2230. }
  2231. }
  2232. class DevicePatchDTO extends BaseDTO{
  2233. String? code;
  2234. String? name;
  2235. String? description;
  2236. String? deviceType;
  2237. String? softwareVersion;
  2238. String? osVersion;
  2239. List<UploadDeviceFileInfoDTO >? deviceFileInfoList;
  2240. int fileSize;
  2241. String? fileName;
  2242. DevicePatchDTO({
  2243. this.code,
  2244. this.name,
  2245. this.description,
  2246. this.deviceType,
  2247. this.softwareVersion,
  2248. this.osVersion,
  2249. this.deviceFileInfoList,
  2250. this.fileSize = 0,
  2251. this.fileName,
  2252. DateTime? createTime,
  2253. DateTime? updateTime,
  2254. }) : super(
  2255. createTime: createTime,
  2256. updateTime: updateTime,
  2257. );
  2258. factory DevicePatchDTO.fromJson(Map<String, dynamic> map) {
  2259. return DevicePatchDTO(
  2260. code: map['Code'],
  2261. name: map['Name'],
  2262. description: map['Description'],
  2263. deviceType: map['DeviceType'],
  2264. softwareVersion: map['SoftwareVersion'],
  2265. osVersion: map['OsVersion'],
  2266. deviceFileInfoList: map['DeviceFileInfoList'] != null ? (map['DeviceFileInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2267. fileSize: map['FileSize'],
  2268. fileName: map['FileName'],
  2269. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2270. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2271. );
  2272. }
  2273. Map<String, dynamic> toJson() {
  2274. final map = super.toJson();
  2275. if(code != null)
  2276. map['Code'] = code;
  2277. if(name != null)
  2278. map['Name'] = name;
  2279. if(description != null)
  2280. map['Description'] = description;
  2281. if(deviceType != null)
  2282. map['DeviceType'] = deviceType;
  2283. if(softwareVersion != null)
  2284. map['SoftwareVersion'] = softwareVersion;
  2285. if(osVersion != null)
  2286. map['OsVersion'] = osVersion;
  2287. if(deviceFileInfoList != null)
  2288. map['DeviceFileInfoList'] = deviceFileInfoList;
  2289. map['FileSize'] = fileSize;
  2290. if(fileName != null)
  2291. map['FileName'] = fileName;
  2292. return map;
  2293. }
  2294. }
  2295. class FindDevicePatchPageRequest extends PageRequest{
  2296. String? keyword;
  2297. FindDevicePatchPageRequest({
  2298. this.keyword,
  2299. int pageIndex = 0,
  2300. int pageSize = 0,
  2301. String? token,
  2302. }) : super(
  2303. pageIndex: pageIndex,
  2304. pageSize: pageSize,
  2305. token: token,
  2306. );
  2307. factory FindDevicePatchPageRequest.fromJson(Map<String, dynamic> map) {
  2308. return FindDevicePatchPageRequest(
  2309. keyword: map['Keyword'],
  2310. pageIndex: map['PageIndex'],
  2311. pageSize: map['PageSize'],
  2312. token: map['Token'],
  2313. );
  2314. }
  2315. Map<String, dynamic> toJson() {
  2316. final map = super.toJson();
  2317. if(keyword != null)
  2318. map['Keyword'] = keyword;
  2319. return map;
  2320. }
  2321. }
  2322. class DeleteDevicePatchByCodeRequest extends TokenRequest{
  2323. String? code;
  2324. DeleteDevicePatchByCodeRequest({
  2325. this.code,
  2326. String? token,
  2327. }) : super(
  2328. token: token,
  2329. );
  2330. factory DeleteDevicePatchByCodeRequest.fromJson(Map<String, dynamic> map) {
  2331. return DeleteDevicePatchByCodeRequest(
  2332. code: map['Code'],
  2333. token: map['Token'],
  2334. );
  2335. }
  2336. Map<String, dynamic> toJson() {
  2337. final map = super.toJson();
  2338. if(code != null)
  2339. map['Code'] = code;
  2340. return map;
  2341. }
  2342. }
  2343. class UpdateDevicePatchRequest extends TokenRequest{
  2344. String? code;
  2345. String? name;
  2346. String? description;
  2347. String? softwareVersion;
  2348. String? osVersion;
  2349. UpdateDevicePatchRequest({
  2350. this.code,
  2351. this.name,
  2352. this.description,
  2353. this.softwareVersion,
  2354. this.osVersion,
  2355. String? token,
  2356. }) : super(
  2357. token: token,
  2358. );
  2359. factory UpdateDevicePatchRequest.fromJson(Map<String, dynamic> map) {
  2360. return UpdateDevicePatchRequest(
  2361. code: map['Code'],
  2362. name: map['Name'],
  2363. description: map['Description'],
  2364. softwareVersion: map['SoftwareVersion'],
  2365. osVersion: map['OsVersion'],
  2366. token: map['Token'],
  2367. );
  2368. }
  2369. Map<String, dynamic> toJson() {
  2370. final map = super.toJson();
  2371. if(code != null)
  2372. map['Code'] = code;
  2373. if(name != null)
  2374. map['Name'] = name;
  2375. if(description != null)
  2376. map['Description'] = description;
  2377. if(softwareVersion != null)
  2378. map['SoftwareVersion'] = softwareVersion;
  2379. if(osVersion != null)
  2380. map['OsVersion'] = osVersion;
  2381. return map;
  2382. }
  2383. }
  2384. class PushDevicePatchRequest extends TokenRequest{
  2385. String? deviceCode;
  2386. String? patchCode;
  2387. PushDevicePatchEnum pushEnum;
  2388. PushDevicePatchRequest({
  2389. this.deviceCode,
  2390. this.patchCode,
  2391. this.pushEnum = PushDevicePatchEnum.Start,
  2392. String? token,
  2393. }) : super(
  2394. token: token,
  2395. );
  2396. factory PushDevicePatchRequest.fromJson(Map<String, dynamic> map) {
  2397. return PushDevicePatchRequest(
  2398. deviceCode: map['DeviceCode'],
  2399. patchCode: map['PatchCode'],
  2400. pushEnum: PushDevicePatchEnum.values.firstWhere((e) => e.index == map['PushEnum']),
  2401. token: map['Token'],
  2402. );
  2403. }
  2404. Map<String, dynamic> toJson() {
  2405. final map = super.toJson();
  2406. if(deviceCode != null)
  2407. map['DeviceCode'] = deviceCode;
  2408. if(patchCode != null)
  2409. map['PatchCode'] = patchCode;
  2410. map['PushEnum'] = pushEnum.index;
  2411. return map;
  2412. }
  2413. }
  2414. class FindPushDevicePatchPageRequest extends PageRequest{
  2415. String? keyword;
  2416. String? deviceCode;
  2417. List<String >? findOnlyDeviceTypes;
  2418. FindPushDevicePatchPageRequest({
  2419. this.keyword,
  2420. this.deviceCode,
  2421. this.findOnlyDeviceTypes,
  2422. int pageIndex = 0,
  2423. int pageSize = 0,
  2424. String? token,
  2425. }) : super(
  2426. pageIndex: pageIndex,
  2427. pageSize: pageSize,
  2428. token: token,
  2429. );
  2430. factory FindPushDevicePatchPageRequest.fromJson(Map<String, dynamic> map) {
  2431. return FindPushDevicePatchPageRequest(
  2432. keyword: map['Keyword'],
  2433. deviceCode: map['DeviceCode'],
  2434. findOnlyDeviceTypes: map['FindOnlyDeviceTypes'] != null ? map['FindOnlyDeviceTypes'].cast<String>().toList() : null,
  2435. pageIndex: map['PageIndex'],
  2436. pageSize: map['PageSize'],
  2437. token: map['Token'],
  2438. );
  2439. }
  2440. Map<String, dynamic> toJson() {
  2441. final map = super.toJson();
  2442. if(keyword != null)
  2443. map['Keyword'] = keyword;
  2444. if(deviceCode != null)
  2445. map['DeviceCode'] = deviceCode;
  2446. if(findOnlyDeviceTypes != null)
  2447. map['FindOnlyDeviceTypes'] = findOnlyDeviceTypes;
  2448. return map;
  2449. }
  2450. }
  2451. class UploadDeviceDownloadPatchProgressToUserRequest extends TokenRequest{
  2452. int progress;
  2453. String? userCode;
  2454. String? patchCode;
  2455. RemoteDeviceStateEnum remoteDeviceState;
  2456. UploadDeviceDownloadPatchProgressToUserRequest({
  2457. this.progress = 0,
  2458. this.userCode,
  2459. this.patchCode,
  2460. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  2461. String? token,
  2462. }) : super(
  2463. token: token,
  2464. );
  2465. factory UploadDeviceDownloadPatchProgressToUserRequest.fromJson(Map<String, dynamic> map) {
  2466. return UploadDeviceDownloadPatchProgressToUserRequest(
  2467. progress: map['Progress'],
  2468. userCode: map['UserCode'],
  2469. patchCode: map['PatchCode'],
  2470. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  2471. token: map['Token'],
  2472. );
  2473. }
  2474. Map<String, dynamic> toJson() {
  2475. final map = super.toJson();
  2476. map['Progress'] = progress;
  2477. if(userCode != null)
  2478. map['UserCode'] = userCode;
  2479. if(patchCode != null)
  2480. map['PatchCode'] = patchCode;
  2481. map['RemoteDeviceState'] = remoteDeviceState.index;
  2482. return map;
  2483. }
  2484. }
  2485. enum DeviceVersionEnum {
  2486. All,
  2487. SoftwareVersion,
  2488. OsVersion,
  2489. }
  2490. class AddDevicePatchVersionRequest extends TokenRequest{
  2491. String? version;
  2492. DeviceVersionEnum versionTypeEnum;
  2493. String? deviceType;
  2494. AddDevicePatchVersionRequest({
  2495. this.version,
  2496. this.versionTypeEnum = DeviceVersionEnum.All,
  2497. this.deviceType,
  2498. String? token,
  2499. }) : super(
  2500. token: token,
  2501. );
  2502. factory AddDevicePatchVersionRequest.fromJson(Map<String, dynamic> map) {
  2503. return AddDevicePatchVersionRequest(
  2504. version: map['Version'],
  2505. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2506. deviceType: map['DeviceType'],
  2507. token: map['Token'],
  2508. );
  2509. }
  2510. Map<String, dynamic> toJson() {
  2511. final map = super.toJson();
  2512. if(version != null)
  2513. map['Version'] = version;
  2514. map['VersionTypeEnum'] = versionTypeEnum.index;
  2515. if(deviceType != null)
  2516. map['DeviceType'] = deviceType;
  2517. return map;
  2518. }
  2519. }
  2520. class DevicePatchVersionDTO extends BaseDTO{
  2521. String? version;
  2522. DeviceVersionEnum versionTypeEnum;
  2523. String? deviceType;
  2524. String? code;
  2525. DevicePatchVersionDTO({
  2526. this.version,
  2527. this.versionTypeEnum = DeviceVersionEnum.All,
  2528. this.deviceType,
  2529. this.code,
  2530. DateTime? createTime,
  2531. DateTime? updateTime,
  2532. }) : super(
  2533. createTime: createTime,
  2534. updateTime: updateTime,
  2535. );
  2536. factory DevicePatchVersionDTO.fromJson(Map<String, dynamic> map) {
  2537. return DevicePatchVersionDTO(
  2538. version: map['Version'],
  2539. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2540. deviceType: map['DeviceType'],
  2541. code: map['Code'],
  2542. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2543. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2544. );
  2545. }
  2546. Map<String, dynamic> toJson() {
  2547. final map = super.toJson();
  2548. if(version != null)
  2549. map['Version'] = version;
  2550. map['VersionTypeEnum'] = versionTypeEnum.index;
  2551. if(deviceType != null)
  2552. map['DeviceType'] = deviceType;
  2553. if(code != null)
  2554. map['Code'] = code;
  2555. return map;
  2556. }
  2557. }
  2558. class FindDevicePatchListRequest extends TokenRequest{
  2559. String? deviceType;
  2560. DeviceVersionEnum versionTypeEnum;
  2561. FindDevicePatchListRequest({
  2562. this.deviceType,
  2563. this.versionTypeEnum = DeviceVersionEnum.All,
  2564. String? token,
  2565. }) : super(
  2566. token: token,
  2567. );
  2568. factory FindDevicePatchListRequest.fromJson(Map<String, dynamic> map) {
  2569. return FindDevicePatchListRequest(
  2570. deviceType: map['DeviceType'],
  2571. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2572. token: map['Token'],
  2573. );
  2574. }
  2575. Map<String, dynamic> toJson() {
  2576. final map = super.toJson();
  2577. if(deviceType != null)
  2578. map['DeviceType'] = deviceType;
  2579. map['VersionTypeEnum'] = versionTypeEnum.index;
  2580. return map;
  2581. }
  2582. }
  2583. class DeleteDevicePatchVersionRequest extends TokenRequest{
  2584. String? code;
  2585. DeleteDevicePatchVersionRequest({
  2586. this.code,
  2587. String? token,
  2588. }) : super(
  2589. token: token,
  2590. );
  2591. factory DeleteDevicePatchVersionRequest.fromJson(Map<String, dynamic> map) {
  2592. return DeleteDevicePatchVersionRequest(
  2593. code: map['Code'],
  2594. token: map['Token'],
  2595. );
  2596. }
  2597. Map<String, dynamic> toJson() {
  2598. final map = super.toJson();
  2599. if(code != null)
  2600. map['Code'] = code;
  2601. return map;
  2602. }
  2603. }
  2604. class AddDevicePrinterVersionRequest extends TokenRequest{
  2605. String? version;
  2606. DeviceVersionEnum versionTypeEnum;
  2607. AddDevicePrinterVersionRequest({
  2608. this.version,
  2609. this.versionTypeEnum = DeviceVersionEnum.All,
  2610. String? token,
  2611. }) : super(
  2612. token: token,
  2613. );
  2614. factory AddDevicePrinterVersionRequest.fromJson(Map<String, dynamic> map) {
  2615. return AddDevicePrinterVersionRequest(
  2616. version: map['Version'],
  2617. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2618. token: map['Token'],
  2619. );
  2620. }
  2621. Map<String, dynamic> toJson() {
  2622. final map = super.toJson();
  2623. if(version != null)
  2624. map['Version'] = version;
  2625. map['VersionTypeEnum'] = versionTypeEnum.index;
  2626. return map;
  2627. }
  2628. }
  2629. class DevicePrinterVersionDTO extends BaseDTO{
  2630. String? version;
  2631. DeviceVersionEnum versionTypeEnum;
  2632. String? code;
  2633. DevicePrinterVersionDTO({
  2634. this.version,
  2635. this.versionTypeEnum = DeviceVersionEnum.All,
  2636. this.code,
  2637. DateTime? createTime,
  2638. DateTime? updateTime,
  2639. }) : super(
  2640. createTime: createTime,
  2641. updateTime: updateTime,
  2642. );
  2643. factory DevicePrinterVersionDTO.fromJson(Map<String, dynamic> map) {
  2644. return DevicePrinterVersionDTO(
  2645. version: map['Version'],
  2646. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2647. code: map['Code'],
  2648. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2649. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2650. );
  2651. }
  2652. Map<String, dynamic> toJson() {
  2653. final map = super.toJson();
  2654. if(version != null)
  2655. map['Version'] = version;
  2656. map['VersionTypeEnum'] = versionTypeEnum.index;
  2657. if(code != null)
  2658. map['Code'] = code;
  2659. return map;
  2660. }
  2661. }
  2662. class FindDevicePrinterVersionListRequest extends TokenRequest{
  2663. DeviceVersionEnum versionTypeEnum;
  2664. FindDevicePrinterVersionListRequest({
  2665. this.versionTypeEnum = DeviceVersionEnum.All,
  2666. String? token,
  2667. }) : super(
  2668. token: token,
  2669. );
  2670. factory FindDevicePrinterVersionListRequest.fromJson(Map<String, dynamic> map) {
  2671. return FindDevicePrinterVersionListRequest(
  2672. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2673. token: map['Token'],
  2674. );
  2675. }
  2676. Map<String, dynamic> toJson() {
  2677. final map = super.toJson();
  2678. map['VersionTypeEnum'] = versionTypeEnum.index;
  2679. return map;
  2680. }
  2681. }
  2682. class DeleteDevicePrinterVersionRequest extends TokenRequest{
  2683. String? code;
  2684. DeleteDevicePrinterVersionRequest({
  2685. this.code,
  2686. String? token,
  2687. }) : super(
  2688. token: token,
  2689. );
  2690. factory DeleteDevicePrinterVersionRequest.fromJson(Map<String, dynamic> map) {
  2691. return DeleteDevicePrinterVersionRequest(
  2692. code: map['Code'],
  2693. token: map['Token'],
  2694. );
  2695. }
  2696. Map<String, dynamic> toJson() {
  2697. final map = super.toJson();
  2698. if(code != null)
  2699. map['Code'] = code;
  2700. return map;
  2701. }
  2702. }
  2703. class AddDevicePrinterRequest extends TokenRequest{
  2704. String? name;
  2705. String? description;
  2706. String? osVersion;
  2707. List<UploadDeviceFileInfoDTO >? fileUploadInfoList;
  2708. int fileSize;
  2709. String? printerBrands;
  2710. List<String >? printerModels;
  2711. String? fileName;
  2712. AddDevicePrinterRequest({
  2713. this.name,
  2714. this.description,
  2715. this.osVersion,
  2716. this.fileUploadInfoList,
  2717. this.fileSize = 0,
  2718. this.printerBrands,
  2719. this.printerModels,
  2720. this.fileName,
  2721. String? token,
  2722. }) : super(
  2723. token: token,
  2724. );
  2725. factory AddDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  2726. return AddDevicePrinterRequest(
  2727. name: map['Name'],
  2728. description: map['Description'],
  2729. osVersion: map['OsVersion'],
  2730. fileUploadInfoList: map['FileUploadInfoList'] != null ? (map['FileUploadInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2731. fileSize: map['FileSize'],
  2732. printerBrands: map['PrinterBrands'],
  2733. printerModels: map['PrinterModels'] != null ? map['PrinterModels'].cast<String>().toList() : null,
  2734. fileName: map['FileName'],
  2735. token: map['Token'],
  2736. );
  2737. }
  2738. Map<String, dynamic> toJson() {
  2739. final map = super.toJson();
  2740. if(name != null)
  2741. map['Name'] = name;
  2742. if(description != null)
  2743. map['Description'] = description;
  2744. if(osVersion != null)
  2745. map['OsVersion'] = osVersion;
  2746. if(fileUploadInfoList != null)
  2747. map['FileUploadInfoList'] = fileUploadInfoList;
  2748. map['FileSize'] = fileSize;
  2749. if(printerBrands != null)
  2750. map['PrinterBrands'] = printerBrands;
  2751. if(printerModels != null)
  2752. map['PrinterModels'] = printerModels;
  2753. if(fileName != null)
  2754. map['FileName'] = fileName;
  2755. return map;
  2756. }
  2757. }
  2758. class FindDevicePrinterPageRequest extends PageRequest{
  2759. String? keyword;
  2760. FindDevicePrinterPageRequest({
  2761. this.keyword,
  2762. int pageIndex = 0,
  2763. int pageSize = 0,
  2764. String? token,
  2765. }) : super(
  2766. pageIndex: pageIndex,
  2767. pageSize: pageSize,
  2768. token: token,
  2769. );
  2770. factory FindDevicePrinterPageRequest.fromJson(Map<String, dynamic> map) {
  2771. return FindDevicePrinterPageRequest(
  2772. keyword: map['Keyword'],
  2773. pageIndex: map['PageIndex'],
  2774. pageSize: map['PageSize'],
  2775. token: map['Token'],
  2776. );
  2777. }
  2778. Map<String, dynamic> toJson() {
  2779. final map = super.toJson();
  2780. if(keyword != null)
  2781. map['Keyword'] = keyword;
  2782. return map;
  2783. }
  2784. }
  2785. class DeleteDevicePrinterByCodeRequest extends TokenRequest{
  2786. String? code;
  2787. DeleteDevicePrinterByCodeRequest({
  2788. this.code,
  2789. String? token,
  2790. }) : super(
  2791. token: token,
  2792. );
  2793. factory DeleteDevicePrinterByCodeRequest.fromJson(Map<String, dynamic> map) {
  2794. return DeleteDevicePrinterByCodeRequest(
  2795. code: map['Code'],
  2796. token: map['Token'],
  2797. );
  2798. }
  2799. Map<String, dynamic> toJson() {
  2800. final map = super.toJson();
  2801. if(code != null)
  2802. map['Code'] = code;
  2803. return map;
  2804. }
  2805. }
  2806. class UpdateDevicePrinterRequest extends TokenRequest{
  2807. String? name;
  2808. String? description;
  2809. String? osVersion;
  2810. String? code;
  2811. UpdateDevicePrinterRequest({
  2812. this.name,
  2813. this.description,
  2814. this.osVersion,
  2815. this.code,
  2816. String? token,
  2817. }) : super(
  2818. token: token,
  2819. );
  2820. factory UpdateDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  2821. return UpdateDevicePrinterRequest(
  2822. name: map['Name'],
  2823. description: map['Description'],
  2824. osVersion: map['OsVersion'],
  2825. code: map['Code'],
  2826. token: map['Token'],
  2827. );
  2828. }
  2829. Map<String, dynamic> toJson() {
  2830. final map = super.toJson();
  2831. if(name != null)
  2832. map['Name'] = name;
  2833. if(description != null)
  2834. map['Description'] = description;
  2835. if(osVersion != null)
  2836. map['OsVersion'] = osVersion;
  2837. if(code != null)
  2838. map['Code'] = code;
  2839. return map;
  2840. }
  2841. }
  2842. class SetDevicePrinterRequest extends TokenRequest{
  2843. String? deviceCode;
  2844. DevicePrinterEnum setPrinterEnum;
  2845. List<DevicePrinterParameter >? parameters;
  2846. SetDevicePrinterRequest({
  2847. this.deviceCode,
  2848. this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters,
  2849. this.parameters,
  2850. String? token,
  2851. }) : super(
  2852. token: token,
  2853. );
  2854. factory SetDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  2855. return SetDevicePrinterRequest(
  2856. deviceCode: map['DeviceCode'],
  2857. setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  2858. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>DevicePrinterParameter.fromJson(e as Map<String,dynamic>)).toList() : null,
  2859. token: map['Token'],
  2860. );
  2861. }
  2862. Map<String, dynamic> toJson() {
  2863. final map = super.toJson();
  2864. if(deviceCode != null)
  2865. map['DeviceCode'] = deviceCode;
  2866. map['SetPrinterEnum'] = setPrinterEnum.index;
  2867. if(parameters != null)
  2868. map['Parameters'] = parameters;
  2869. return map;
  2870. }
  2871. }
  2872. class UploadDevicePrinterRequest extends TokenRequest{
  2873. String? userCode;
  2874. DevicePrinterEnum setPrinterEnum;
  2875. List<DevicePrinterParameterDTO >? devicePrinterList;
  2876. RemoteDeviceStateEnum remoteDeviceState;
  2877. UploadDevicePrinterRequest({
  2878. this.userCode,
  2879. this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters,
  2880. this.devicePrinterList,
  2881. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  2882. String? token,
  2883. }) : super(
  2884. token: token,
  2885. );
  2886. factory UploadDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  2887. return UploadDevicePrinterRequest(
  2888. userCode: map['UserCode'],
  2889. setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  2890. devicePrinterList: map['DevicePrinterList'] != null ? (map['DevicePrinterList'] as List).map((e)=>DevicePrinterParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2891. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  2892. token: map['Token'],
  2893. );
  2894. }
  2895. Map<String, dynamic> toJson() {
  2896. final map = super.toJson();
  2897. if(userCode != null)
  2898. map['UserCode'] = userCode;
  2899. map['SetPrinterEnum'] = setPrinterEnum.index;
  2900. if(devicePrinterList != null)
  2901. map['DevicePrinterList'] = devicePrinterList;
  2902. map['RemoteDeviceState'] = remoteDeviceState.index;
  2903. return map;
  2904. }
  2905. }
  2906. class RestartDeviceRequest extends TokenRequest{
  2907. String? deviceCode;
  2908. bool isNeedSyn;
  2909. RestartDeviceRequest({
  2910. this.deviceCode,
  2911. this.isNeedSyn = false,
  2912. String? token,
  2913. }) : super(
  2914. token: token,
  2915. );
  2916. factory RestartDeviceRequest.fromJson(Map<String, dynamic> map) {
  2917. return RestartDeviceRequest(
  2918. deviceCode: map['DeviceCode'],
  2919. isNeedSyn: map['IsNeedSyn'],
  2920. token: map['Token'],
  2921. );
  2922. }
  2923. Map<String, dynamic> toJson() {
  2924. final map = super.toJson();
  2925. if(deviceCode != null)
  2926. map['DeviceCode'] = deviceCode;
  2927. map['IsNeedSyn'] = isNeedSyn;
  2928. return map;
  2929. }
  2930. }
  2931. class ModifyEmergencyDeviceCodeRequest extends TokenRequest{
  2932. String? emergencyDeviceCode;
  2933. ModifyEmergencyDeviceCodeRequest({
  2934. this.emergencyDeviceCode,
  2935. String? token,
  2936. }) : super(
  2937. token: token,
  2938. );
  2939. factory ModifyEmergencyDeviceCodeRequest.fromJson(Map<String, dynamic> map) {
  2940. return ModifyEmergencyDeviceCodeRequest(
  2941. emergencyDeviceCode: map['EmergencyDeviceCode'],
  2942. token: map['Token'],
  2943. );
  2944. }
  2945. Map<String, dynamic> toJson() {
  2946. final map = super.toJson();
  2947. if(emergencyDeviceCode != null)
  2948. map['EmergencyDeviceCode'] = emergencyDeviceCode;
  2949. return map;
  2950. }
  2951. }
  2952. class SendCommandToDeviceRequest extends TokenRequest{
  2953. String? deviceCode;
  2954. String? actionType;
  2955. String? settings;
  2956. SendCommandToDeviceRequest({
  2957. this.deviceCode,
  2958. this.actionType,
  2959. this.settings,
  2960. String? token,
  2961. }) : super(
  2962. token: token,
  2963. );
  2964. factory SendCommandToDeviceRequest.fromJson(Map<String, dynamic> map) {
  2965. return SendCommandToDeviceRequest(
  2966. deviceCode: map['DeviceCode'],
  2967. actionType: map['ActionType'],
  2968. settings: map['Settings'],
  2969. token: map['Token'],
  2970. );
  2971. }
  2972. Map<String, dynamic> toJson() {
  2973. final map = super.toJson();
  2974. if(deviceCode != null)
  2975. map['DeviceCode'] = deviceCode;
  2976. if(actionType != null)
  2977. map['ActionType'] = actionType;
  2978. if(settings != null)
  2979. map['Settings'] = settings;
  2980. return map;
  2981. }
  2982. }
  2983. class SendResultToClientRequest extends TokenRequest{
  2984. String? userCode;
  2985. String? settings;
  2986. SendResultToClientRequest({
  2987. this.userCode,
  2988. this.settings,
  2989. String? token,
  2990. }) : super(
  2991. token: token,
  2992. );
  2993. factory SendResultToClientRequest.fromJson(Map<String, dynamic> map) {
  2994. return SendResultToClientRequest(
  2995. userCode: map['UserCode'],
  2996. settings: map['Settings'],
  2997. token: map['Token'],
  2998. );
  2999. }
  3000. Map<String, dynamic> toJson() {
  3001. final map = super.toJson();
  3002. if(userCode != null)
  3003. map['UserCode'] = userCode;
  3004. if(settings != null)
  3005. map['Settings'] = settings;
  3006. return map;
  3007. }
  3008. }
  3009. class GetResultFromServerRequest extends TokenRequest{
  3010. String? resultCode;
  3011. GetResultFromServerRequest({
  3012. this.resultCode,
  3013. String? token,
  3014. }) : super(
  3015. token: token,
  3016. );
  3017. factory GetResultFromServerRequest.fromJson(Map<String, dynamic> map) {
  3018. return GetResultFromServerRequest(
  3019. resultCode: map['ResultCode'],
  3020. token: map['Token'],
  3021. );
  3022. }
  3023. Map<String, dynamic> toJson() {
  3024. final map = super.toJson();
  3025. if(resultCode != null)
  3026. map['ResultCode'] = resultCode;
  3027. return map;
  3028. }
  3029. }
  3030. class RemoteConnectStautsRequest extends TokenRequest{
  3031. String? userCode;
  3032. LoginSource loginSource;
  3033. bool isNeedSyn;
  3034. RemoteConnectStautsRequest({
  3035. this.userCode,
  3036. this.loginSource = LoginSource.PC,
  3037. this.isNeedSyn = false,
  3038. String? token,
  3039. }) : super(
  3040. token: token,
  3041. );
  3042. factory RemoteConnectStautsRequest.fromJson(Map<String, dynamic> map) {
  3043. return RemoteConnectStautsRequest(
  3044. userCode: map['UserCode'],
  3045. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  3046. isNeedSyn: map['IsNeedSyn'],
  3047. token: map['Token'],
  3048. );
  3049. }
  3050. Map<String, dynamic> toJson() {
  3051. final map = super.toJson();
  3052. if(userCode != null)
  3053. map['UserCode'] = userCode;
  3054. map['LoginSource'] = loginSource.index;
  3055. map['IsNeedSyn'] = isNeedSyn;
  3056. return map;
  3057. }
  3058. }
  3059. class RemoteConnectHeartRateRequest extends TokenRequest{
  3060. TransactionTypeEnum transactionType;
  3061. bool isNeedSyn;
  3062. RemoteConnectHeartRateRequest({
  3063. this.transactionType = TransactionTypeEnum.Consultion,
  3064. this.isNeedSyn = false,
  3065. String? token,
  3066. }) : super(
  3067. token: token,
  3068. );
  3069. factory RemoteConnectHeartRateRequest.fromJson(Map<String, dynamic> map) {
  3070. return RemoteConnectHeartRateRequest(
  3071. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  3072. isNeedSyn: map['IsNeedSyn'],
  3073. token: map['Token'],
  3074. );
  3075. }
  3076. Map<String, dynamic> toJson() {
  3077. final map = super.toJson();
  3078. map['TransactionType'] = transactionType.index;
  3079. map['IsNeedSyn'] = isNeedSyn;
  3080. return map;
  3081. }
  3082. }
  3083. enum ConnectStatusEnum {
  3084. UnConnect,
  3085. WaitConnect,
  3086. CompleteConnect,
  3087. WaitDisconnect,
  3088. CompleteDisconnect,
  3089. }
  3090. class AddUserRemoteConnectRequest extends GetDeviceRequest{
  3091. String? roomId;
  3092. ConnectStatusEnum statusEnum;
  3093. AddUserRemoteConnectRequest({
  3094. this.roomId,
  3095. this.statusEnum = ConnectStatusEnum.UnConnect,
  3096. String? deviceCode,
  3097. bool isNeedSyn = false,
  3098. String? token,
  3099. }) : super(
  3100. deviceCode: deviceCode,
  3101. isNeedSyn: isNeedSyn,
  3102. token: token,
  3103. );
  3104. factory AddUserRemoteConnectRequest.fromJson(Map<String, dynamic> map) {
  3105. return AddUserRemoteConnectRequest(
  3106. roomId: map['RoomId'],
  3107. statusEnum: ConnectStatusEnum.values.firstWhere((e) => e.index == map['StatusEnum']),
  3108. deviceCode: map['DeviceCode'],
  3109. isNeedSyn: map['IsNeedSyn'],
  3110. token: map['Token'],
  3111. );
  3112. }
  3113. Map<String, dynamic> toJson() {
  3114. final map = super.toJson();
  3115. if(roomId != null)
  3116. map['RoomId'] = roomId;
  3117. map['StatusEnum'] = statusEnum.index;
  3118. return map;
  3119. }
  3120. }
  3121. class DeviceConnectStateResult {
  3122. String? deviceCode;
  3123. ConnectStatusEnum connectStatus;
  3124. DeviceConnectStateResult({
  3125. this.deviceCode,
  3126. this.connectStatus = ConnectStatusEnum.UnConnect,
  3127. });
  3128. factory DeviceConnectStateResult.fromJson(Map<String, dynamic> map) {
  3129. return DeviceConnectStateResult(
  3130. deviceCode: map['DeviceCode'],
  3131. connectStatus: ConnectStatusEnum.values.firstWhere((e) => e.index == map['ConnectStatus']),
  3132. );
  3133. }
  3134. Map<String, dynamic> toJson() {
  3135. final map = Map<String, dynamic>();
  3136. if(deviceCode != null)
  3137. map['DeviceCode'] = deviceCode;
  3138. map['ConnectStatus'] = connectStatus.index;
  3139. return map;
  3140. }
  3141. }
  3142. class GetDeviceStateListRequest extends TokenRequest{
  3143. List<String >? deviceCodes;
  3144. GetDeviceStateListRequest({
  3145. this.deviceCodes,
  3146. String? token,
  3147. }) : super(
  3148. token: token,
  3149. );
  3150. factory GetDeviceStateListRequest.fromJson(Map<String, dynamic> map) {
  3151. return GetDeviceStateListRequest(
  3152. deviceCodes: map['DeviceCodes'] != null ? map['DeviceCodes'].cast<String>().toList() : null,
  3153. token: map['Token'],
  3154. );
  3155. }
  3156. Map<String, dynamic> toJson() {
  3157. final map = super.toJson();
  3158. if(deviceCodes != null)
  3159. map['DeviceCodes'] = deviceCodes;
  3160. return map;
  3161. }
  3162. }
  3163. class DeivceCancelLogDownloadRequest extends TokenRequest{
  3164. String? userCode;
  3165. DeivceCancelLogDownloadRequest({
  3166. this.userCode,
  3167. String? token,
  3168. }) : super(
  3169. token: token,
  3170. );
  3171. factory DeivceCancelLogDownloadRequest.fromJson(Map<String, dynamic> map) {
  3172. return DeivceCancelLogDownloadRequest(
  3173. userCode: map['UserCode'],
  3174. token: map['Token'],
  3175. );
  3176. }
  3177. Map<String, dynamic> toJson() {
  3178. final map = super.toJson();
  3179. if(userCode != null)
  3180. map['UserCode'] = userCode;
  3181. return map;
  3182. }
  3183. }
  3184. class ProbeSettingInfoDTO {
  3185. String? name;
  3186. List<ApplicationSettingInfoDTO >? applications;
  3187. ProbeSettingInfoDTO({
  3188. this.name,
  3189. this.applications,
  3190. });
  3191. factory ProbeSettingInfoDTO.fromJson(Map<String, dynamic> map) {
  3192. return ProbeSettingInfoDTO(
  3193. name: map['Name'],
  3194. applications: map['Applications'] != null ? (map['Applications'] as List).map((e)=>ApplicationSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  3195. );
  3196. }
  3197. Map<String, dynamic> toJson() {
  3198. final map = Map<String, dynamic>();
  3199. if(name != null)
  3200. map['Name'] = name;
  3201. if(applications != null)
  3202. map['Applications'] = applications;
  3203. return map;
  3204. }
  3205. }
  3206. class ProbeApplicationSettingInfoDTO {
  3207. List<ProbeSettingInfoDTO >? probes;
  3208. String? activeProbe;
  3209. String? activeApplication;
  3210. int maxNumberForApplication;
  3211. int maxNumberForApplicationOfUserDefine;
  3212. ProbeApplicationSettingInfoDTO({
  3213. this.probes,
  3214. this.activeProbe,
  3215. this.activeApplication,
  3216. this.maxNumberForApplication = 0,
  3217. this.maxNumberForApplicationOfUserDefine = 0,
  3218. });
  3219. factory ProbeApplicationSettingInfoDTO.fromJson(Map<String, dynamic> map) {
  3220. return ProbeApplicationSettingInfoDTO(
  3221. probes: map['Probes'] != null ? (map['Probes'] as List).map((e)=>ProbeSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  3222. activeProbe: map['ActiveProbe'],
  3223. activeApplication: map['ActiveApplication'],
  3224. maxNumberForApplication: map['MaxNumberForApplication'],
  3225. maxNumberForApplicationOfUserDefine: map['MaxNumberForApplicationOfUserDefine'],
  3226. );
  3227. }
  3228. Map<String, dynamic> toJson() {
  3229. final map = Map<String, dynamic>();
  3230. if(probes != null)
  3231. map['Probes'] = probes;
  3232. if(activeProbe != null)
  3233. map['ActiveProbe'] = activeProbe;
  3234. if(activeApplication != null)
  3235. map['ActiveApplication'] = activeApplication;
  3236. map['MaxNumberForApplication'] = maxNumberForApplication;
  3237. map['MaxNumberForApplicationOfUserDefine'] = maxNumberForApplicationOfUserDefine;
  3238. return map;
  3239. }
  3240. }
  3241. class ProbeApplicationSettingRequest extends TokenRequest{
  3242. String? deviceCode;
  3243. ProbeApplicationSettingInfoDTO? probeApplicationSetting;
  3244. ControlDeviceParameterEnum controlType;
  3245. ProbeApplicationSettingRequest({
  3246. this.deviceCode,
  3247. this.probeApplicationSetting,
  3248. this.controlType = ControlDeviceParameterEnum.Start,
  3249. String? token,
  3250. }) : super(
  3251. token: token,
  3252. );
  3253. factory ProbeApplicationSettingRequest.fromJson(Map<String, dynamic> map) {
  3254. return ProbeApplicationSettingRequest(
  3255. deviceCode: map['DeviceCode'],
  3256. probeApplicationSetting: map['ProbeApplicationSetting'] != null ? ProbeApplicationSettingInfoDTO.fromJson(map['ProbeApplicationSetting']) : null,
  3257. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  3258. token: map['Token'],
  3259. );
  3260. }
  3261. Map<String, dynamic> toJson() {
  3262. final map = super.toJson();
  3263. if(deviceCode != null)
  3264. map['DeviceCode'] = deviceCode;
  3265. if(probeApplicationSetting != null)
  3266. map['ProbeApplicationSetting'] = probeApplicationSetting;
  3267. map['ControlType'] = controlType.index;
  3268. return map;
  3269. }
  3270. }
  3271. class ProbeApplicationSettingResultRequest extends TokenRequest{
  3272. String? userCode;
  3273. ProbeApplicationSettingInfoDTO? probeApplicationSetting;
  3274. ControlDeviceParameterEnum controlType;
  3275. ProbeApplicationSettingResultRequest({
  3276. this.userCode,
  3277. this.probeApplicationSetting,
  3278. this.controlType = ControlDeviceParameterEnum.Start,
  3279. String? token,
  3280. }) : super(
  3281. token: token,
  3282. );
  3283. factory ProbeApplicationSettingResultRequest.fromJson(Map<String, dynamic> map) {
  3284. return ProbeApplicationSettingResultRequest(
  3285. userCode: map['UserCode'],
  3286. probeApplicationSetting: map['ProbeApplicationSetting'] != null ? ProbeApplicationSettingInfoDTO.fromJson(map['ProbeApplicationSetting']) : null,
  3287. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  3288. token: map['Token'],
  3289. );
  3290. }
  3291. Map<String, dynamic> toJson() {
  3292. final map = super.toJson();
  3293. if(userCode != null)
  3294. map['UserCode'] = userCode;
  3295. if(probeApplicationSetting != null)
  3296. map['ProbeApplicationSetting'] = probeApplicationSetting;
  3297. map['ControlType'] = controlType.index;
  3298. return map;
  3299. }
  3300. }
  3301. class UserRemoteConnectRequest {
  3302. TransactionTypeEnum transactionType;
  3303. ConnectStatusEnum statusEnum;
  3304. String? userToken;
  3305. String? deviceToken;
  3306. String? userCode;
  3307. String? roomId;
  3308. String? deviceCode;
  3309. LoginSource loginSource;
  3310. bool isNeedSyn;
  3311. UserRemoteConnectRequest({
  3312. this.transactionType = TransactionTypeEnum.Consultion,
  3313. this.statusEnum = ConnectStatusEnum.UnConnect,
  3314. this.userToken,
  3315. this.deviceToken,
  3316. this.userCode,
  3317. this.roomId,
  3318. this.deviceCode,
  3319. this.loginSource = LoginSource.PC,
  3320. this.isNeedSyn = false,
  3321. });
  3322. factory UserRemoteConnectRequest.fromJson(Map<String, dynamic> map) {
  3323. return UserRemoteConnectRequest(
  3324. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  3325. statusEnum: ConnectStatusEnum.values.firstWhere((e) => e.index == map['StatusEnum']),
  3326. userToken: map['UserToken'],
  3327. deviceToken: map['DeviceToken'],
  3328. userCode: map['UserCode'],
  3329. roomId: map['RoomId'],
  3330. deviceCode: map['DeviceCode'],
  3331. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  3332. isNeedSyn: map['IsNeedSyn'],
  3333. );
  3334. }
  3335. Map<String, dynamic> toJson() {
  3336. final map = Map<String, dynamic>();
  3337. map['TransactionType'] = transactionType.index;
  3338. map['StatusEnum'] = statusEnum.index;
  3339. if(userToken != null)
  3340. map['UserToken'] = userToken;
  3341. if(deviceToken != null)
  3342. map['DeviceToken'] = deviceToken;
  3343. if(userCode != null)
  3344. map['UserCode'] = userCode;
  3345. if(roomId != null)
  3346. map['RoomId'] = roomId;
  3347. if(deviceCode != null)
  3348. map['DeviceCode'] = deviceCode;
  3349. map['LoginSource'] = loginSource.index;
  3350. map['IsNeedSyn'] = isNeedSyn;
  3351. return map;
  3352. }
  3353. }
  3354. class DeviceRemoteConnectRequest {
  3355. TransactionTypeEnum transactionType;
  3356. ConnectStatusEnum statusEnum;
  3357. String? userToken;
  3358. String? deviceToken;
  3359. String? userCode;
  3360. String? roomId;
  3361. String? deviceCode;
  3362. bool isNeedSyn;
  3363. LoginSource loginSource;
  3364. DeviceRemoteConnectRequest({
  3365. this.transactionType = TransactionTypeEnum.Consultion,
  3366. this.statusEnum = ConnectStatusEnum.UnConnect,
  3367. this.userToken,
  3368. this.deviceToken,
  3369. this.userCode,
  3370. this.roomId,
  3371. this.deviceCode,
  3372. this.isNeedSyn = false,
  3373. this.loginSource = LoginSource.PC,
  3374. });
  3375. factory DeviceRemoteConnectRequest.fromJson(Map<String, dynamic> map) {
  3376. return DeviceRemoteConnectRequest(
  3377. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  3378. statusEnum: ConnectStatusEnum.values.firstWhere((e) => e.index == map['StatusEnum']),
  3379. userToken: map['UserToken'],
  3380. deviceToken: map['DeviceToken'],
  3381. userCode: map['UserCode'],
  3382. roomId: map['RoomId'],
  3383. deviceCode: map['DeviceCode'],
  3384. isNeedSyn: map['IsNeedSyn'],
  3385. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  3386. );
  3387. }
  3388. Map<String, dynamic> toJson() {
  3389. final map = Map<String, dynamic>();
  3390. map['TransactionType'] = transactionType.index;
  3391. map['StatusEnum'] = statusEnum.index;
  3392. if(userToken != null)
  3393. map['UserToken'] = userToken;
  3394. if(deviceToken != null)
  3395. map['DeviceToken'] = deviceToken;
  3396. if(userCode != null)
  3397. map['UserCode'] = userCode;
  3398. if(roomId != null)
  3399. map['RoomId'] = roomId;
  3400. if(deviceCode != null)
  3401. map['DeviceCode'] = deviceCode;
  3402. map['IsNeedSyn'] = isNeedSyn;
  3403. map['LoginSource'] = loginSource.index;
  3404. return map;
  3405. }
  3406. }
  3407. class RemoteConnectsRequest {
  3408. List<UserRemoteConnectRequest >? userRemoteConnect;
  3409. List<DeviceRemoteConnectRequest >? deviceRemoteConnect;
  3410. RemoteConnectsRequest({
  3411. this.userRemoteConnect,
  3412. this.deviceRemoteConnect,
  3413. });
  3414. factory RemoteConnectsRequest.fromJson(Map<String, dynamic> map) {
  3415. return RemoteConnectsRequest(
  3416. userRemoteConnect: map['UserRemoteConnect'] != null ? (map['UserRemoteConnect'] as List).map((e)=>UserRemoteConnectRequest.fromJson(e as Map<String,dynamic>)).toList() : null,
  3417. deviceRemoteConnect: map['DeviceRemoteConnect'] != null ? (map['DeviceRemoteConnect'] as List).map((e)=>DeviceRemoteConnectRequest.fromJson(e as Map<String,dynamic>)).toList() : null,
  3418. );
  3419. }
  3420. Map<String, dynamic> toJson() {
  3421. final map = Map<String, dynamic>();
  3422. if(userRemoteConnect != null)
  3423. map['UserRemoteConnect'] = userRemoteConnect;
  3424. if(deviceRemoteConnect != null)
  3425. map['DeviceRemoteConnect'] = deviceRemoteConnect;
  3426. return map;
  3427. }
  3428. }