import 'liveConsultation.m.dart'; import 'notification.m.dart'; import 'device.m.dart'; class CreateUpgradeRequest extends TokenRequest{ String? code; String? version; String? upgradeNotes; String? upgradeFileUrl; List? applicableEquipment; bool isGatedLaunch; CreateUpgradeRequest({ this.code, this.version, this.upgradeNotes, this.upgradeFileUrl, this.applicableEquipment, this.isGatedLaunch = false, String? token, }) : super( token: token, ); factory CreateUpgradeRequest.fromJson(Map map) { return CreateUpgradeRequest( code: map['Code'], version: map['Version'], upgradeNotes: map['UpgradeNotes'], upgradeFileUrl: map['UpgradeFileUrl'], applicableEquipment: map['ApplicableEquipment']?.cast().toList(), isGatedLaunch: map['IsGatedLaunch'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (version != null) map['Version'] = version; if (upgradeNotes != null) map['UpgradeNotes'] = upgradeNotes; if (upgradeFileUrl != null) map['UpgradeFileUrl'] = upgradeFileUrl; if (applicableEquipment != null) map['ApplicableEquipment'] = applicableEquipment; map['IsGatedLaunch'] = isGatedLaunch; return map; } } class UpgradeDTO extends BaseDTO{ String? code; bool isNeedUpdate; String? version; String? upgradeNotes; String? upgradeFileUrl; List? applicableEquipment; bool isGatedLaunch; bool isCoerce; UpgradeDTO({ this.code, this.isNeedUpdate = false, this.version, this.upgradeNotes, this.upgradeFileUrl, this.applicableEquipment, this.isGatedLaunch = false, this.isCoerce = false, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory UpgradeDTO.fromJson(Map map) { return UpgradeDTO( code: map['Code'], isNeedUpdate: map['IsNeedUpdate'], version: map['Version'], upgradeNotes: map['UpgradeNotes'], upgradeFileUrl: map['UpgradeFileUrl'], applicableEquipment: map['ApplicableEquipment']?.cast().toList(), isGatedLaunch: map['IsGatedLaunch'], isCoerce: map['IsCoerce'], 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 (code != null) map['Code'] = code; map['IsNeedUpdate'] = isNeedUpdate; if (version != null) map['Version'] = version; if (upgradeNotes != null) map['UpgradeNotes'] = upgradeNotes; if (upgradeFileUrl != null) map['UpgradeFileUrl'] = upgradeFileUrl; if (applicableEquipment != null) map['ApplicableEquipment'] = applicableEquipment; map['IsGatedLaunch'] = isGatedLaunch; map['IsCoerce'] = isCoerce; return map; } } class GetUpgradeRequest extends TokenRequest{ String? code; GetUpgradeRequest({ this.code, String? token, }) : super( token: token, ); factory GetUpgradeRequest.fromJson(Map map) { return GetUpgradeRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class UpgradePageRequest extends PageRequest{ UpgradePageRequest({ int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory UpgradePageRequest.fromJson(Map map) { return UpgradePageRequest( pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); return map; } } class GetLastUpgradeRequest extends TokenRequest{ String? clientVersion; String? deviceSerialNumber; GetLastUpgradeRequest({ this.clientVersion, this.deviceSerialNumber, String? token, }) : super( token: token, ); factory GetLastUpgradeRequest.fromJson(Map map) { return GetLastUpgradeRequest( clientVersion: map['ClientVersion'], deviceSerialNumber: map['DeviceSerialNumber'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (clientVersion != null) map['ClientVersion'] = clientVersion; if (deviceSerialNumber != null) map['DeviceSerialNumber'] = deviceSerialNumber; return map; } }