import 'authentication.m.dart'; import 'notification.m.dart'; import 'liveConsultation.m.dart'; class ConnectResult { String? token; String? uniqueCode; String? deviceCode; ConnectResult({ this.token, this.uniqueCode, this.deviceCode, }); factory ConnectResult.fromJson(Map map) { return ConnectResult( token: map['Token'], uniqueCode: map['UniqueCode'], deviceCode: map['DeviceCode'], ); } Map toJson() { final map = Map(); if (token != null) { map['Token'] = token; } if (uniqueCode != null) { map['UniqueCode'] = uniqueCode; } if (deviceCode != null) { map['DeviceCode'] = deviceCode; } return map; } } class ConnectRequest { String? deviceUniqueCode; String? password; String? deviceModel; String? deviceType; String? softwareVersion; String? systemVersion; String? cPUModel; String? systemLanguage; String? description; String? name; String? organizationCode; String? departmentCode; Platform platform; LoginSource loginSource; String? installVersion; bool isOldPlatform; String? deviceCode; String? ip; ProxyTypeEnum proxyType; ConnectRequest({ this.deviceUniqueCode, this.password, this.deviceModel, this.deviceType, this.softwareVersion, this.systemVersion, this.cPUModel, this.systemLanguage, this.description, this.name, this.organizationCode, this.departmentCode, this.platform = Platform.Windows, this.loginSource = LoginSource.PC, this.installVersion, this.isOldPlatform = false, this.deviceCode, this.ip, this.proxyType = ProxyTypeEnum.Old, }); factory ConnectRequest.fromJson(Map map) { return ConnectRequest( deviceUniqueCode: map['DeviceUniqueCode'], password: map['Password'], deviceModel: map['DeviceModel'], deviceType: map['DeviceType'], softwareVersion: map['SoftwareVersion'], systemVersion: map['SystemVersion'], cPUModel: map['CPUModel'], systemLanguage: map['SystemLanguage'], description: map['Description'], name: map['Name'], organizationCode: map['OrganizationCode'], departmentCode: map['DepartmentCode'], platform: Platform.values.firstWhere((e) => e.index == map['Platform']), loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), installVersion: map['InstallVersion'], isOldPlatform: map['IsOldPlatform'], deviceCode: map['DeviceCode'], ip: map['Ip'], proxyType: ProxyTypeEnum.values.firstWhere((e) => e.index == map['ProxyType']), ); } Map toJson() { final map = Map(); if (deviceUniqueCode != null) { map['DeviceUniqueCode'] = deviceUniqueCode; } if (password != null) { map['Password'] = password; } if (deviceModel != null) { map['DeviceModel'] = deviceModel; } if (deviceType != null) { map['DeviceType'] = deviceType; } if (softwareVersion != null) { map['SoftwareVersion'] = softwareVersion; } if (systemVersion != null) { map['SystemVersion'] = systemVersion; } if (cPUModel != null) { map['CPUModel'] = cPUModel; } if (systemLanguage != null) { map['SystemLanguage'] = systemLanguage; } if (description != null) { map['Description'] = description; } if (name != null) { map['Name'] = name; } if (organizationCode != null) { map['OrganizationCode'] = organizationCode; } if (departmentCode != null) { map['DepartmentCode'] = departmentCode; } map['Platform'] = platform.index; map['LoginSource'] = loginSource.index; if (installVersion != null) { map['InstallVersion'] = installVersion; } map['IsOldPlatform'] = isOldPlatform; if (deviceCode != null) { map['DeviceCode'] = deviceCode; } if (ip != null) { map['Ip'] = ip; } map['ProxyType'] = proxyType.index; return map; } } class AddOldVersionDeviceRequest { String? terminalName; String? terminalModel; String? terminalPassword; String? organizationName; AddOldVersionDeviceRequest({ this.terminalName, this.terminalModel, this.terminalPassword, this.organizationName, }); factory AddOldVersionDeviceRequest.fromJson(Map map) { return AddOldVersionDeviceRequest( terminalName: map['TerminalName'], terminalModel: map['TerminalModel'], terminalPassword: map['TerminalPassword'], organizationName: map['OrganizationName'], ); } Map toJson() { final map = Map(); if (terminalName != null) { map['TerminalName'] = terminalName; } if (terminalModel != null) { map['TerminalModel'] = terminalModel; } if (terminalPassword != null) { map['TerminalPassword'] = terminalPassword; } if (organizationName != null) { map['OrganizationName'] = organizationName; } return map; } } class CacheDeviceDTO extends DeviceInfoDTO{ String? sourceUrl; CacheDeviceDTO({ bool isOnline = false, this.sourceUrl, String? deviceCode, String? serialNumber, String? password, String? name, String? description, String? deviceModel, String? deviceType, String? headPicUrl, String? deviceSoftwareVersion, String? sDKSoftwareVersion, String? organizationCode, String? departmentCode, String? shortCode, bool isAutoShared = false, bool isEncryptedShow = false, DateTime? lastLoginTime, String? systemVersion, String? cPUModel, String? systemLanguage, List? diagnosisModules, List? reportPosterCodes, bool mergedChannel = false, int mergedVideoOutputWidth = 0, int mergedVideoOutputHeight = 0, List? videoDeviceInfos, DownloadModeSettingEnum downloadModeSetting = DownloadModeSettingEnum.Auto, bool liveOpened = false, bool supportRtc = false, String? displayName, SonopostVersionEnum sonopostVersion = SonopostVersionEnum.Sonopost, List? deviceAttributes, bool isActive = false, List? languageConfigs, String? upgradeVersionCode, DateTime? createTime, DateTime? updateTime, }) : super( deviceCode: deviceCode, serialNumber: serialNumber, password: password, name: name, description: description, deviceModel: deviceModel, deviceType: deviceType, headPicUrl: headPicUrl, deviceSoftwareVersion: deviceSoftwareVersion, sDKSoftwareVersion: sDKSoftwareVersion, organizationCode: organizationCode, departmentCode: departmentCode, shortCode: shortCode, isAutoShared: isAutoShared, isEncryptedShow: isEncryptedShow, lastLoginTime: lastLoginTime, systemVersion: systemVersion, cPUModel: cPUModel, systemLanguage: systemLanguage, diagnosisModules: diagnosisModules, reportPosterCodes: reportPosterCodes, mergedChannel: mergedChannel, mergedVideoOutputWidth: mergedVideoOutputWidth, mergedVideoOutputHeight: mergedVideoOutputHeight, videoDeviceInfos: videoDeviceInfos, downloadModeSetting: downloadModeSetting, liveOpened: liveOpened, supportRtc: supportRtc, displayName: displayName, sonopostVersion: sonopostVersion, deviceAttributes: deviceAttributes, isOnline: isOnline, isActive: isActive, languageConfigs: languageConfigs, upgradeVersionCode: upgradeVersionCode, createTime: createTime, updateTime: updateTime, ); factory CacheDeviceDTO.fromJson(Map map) { return CacheDeviceDTO( isOnline: map['IsOnline'], sourceUrl: map['SourceUrl'], deviceCode: map['DeviceCode'], serialNumber: map['SerialNumber'], password: map['Password'], name: map['Name'], description: map['Description'], deviceModel: map['DeviceModel'], deviceType: map['DeviceType'], headPicUrl: map['HeadPicUrl'], deviceSoftwareVersion: map['DeviceSoftwareVersion'], sDKSoftwareVersion: map['SDKSoftwareVersion'], organizationCode: map['OrganizationCode'], departmentCode: map['DepartmentCode'], shortCode: map['ShortCode'], isAutoShared: map['IsAutoShared'], isEncryptedShow: map['IsEncryptedShow'], lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null, systemVersion: map['SystemVersion'], cPUModel: map['CPUModel'], systemLanguage: map['SystemLanguage'], diagnosisModules: map['DiagnosisModules']?.cast().toList(), reportPosterCodes: map['ReportPosterCodes']?.cast().toList(), mergedChannel: map['MergedChannel'], mergedVideoOutputWidth: map['MergedVideoOutputWidth'], mergedVideoOutputHeight: map['MergedVideoOutputHeight'], videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map)).toList() : null, downloadModeSetting: DownloadModeSettingEnum.values.firstWhere((e) => e.index == map['DownloadModeSetting']), liveOpened: map['LiveOpened'], supportRtc: map['SupportRtc'], displayName: map['DisplayName'], sonopostVersion: SonopostVersionEnum.values.firstWhere((e) => e.index == map['SonopostVersion']), deviceAttributes: map['DeviceAttributes'] != null ? (map['DeviceAttributes'] as List).map((e)=>DataItemDTO.fromJson(e as Map)).toList() : null, isActive: map['IsActive'], languageConfigs: map['LanguageConfigs'] != null ? (map['LanguageConfigs'] as List).map((e)=>DictionaryLanguageConfigDTO.fromJson(e as Map)).toList() : null, upgradeVersionCode: map['UpgradeVersionCode'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if (sourceUrl != null) map['SourceUrl'] = sourceUrl; return map; } } class SetDeviceIsEncryptedShowRequest extends TokenRequest{ bool isEncryptedShow; SetDeviceIsEncryptedShowRequest({ this.isEncryptedShow = false, String? token, }) : super( token: token, ); factory SetDeviceIsEncryptedShowRequest.fromJson(Map map) { return SetDeviceIsEncryptedShowRequest( isEncryptedShow: map['IsEncryptedShow'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); map['IsEncryptedShow'] = isEncryptedShow; return map; } }