import 'notification.m.dart'; import 'liveConsultation.m.dart'; import 'organization.m.dart'; class GetUpgradeInfoResult { UpgradeTypeEnum upgradeType; String? upgradeCDNUrl; String? upgradeSourceUrl; String? backUpCDNUrl; String? backUpSourceUrl; UpgradeUpdateTypeEnum upgradeUpdateType; String? newVersion; String? description; GetUpgradeInfoResult({ this.upgradeType = UpgradeTypeEnum.NoUpgrade, this.upgradeCDNUrl, this.upgradeSourceUrl, this.backUpCDNUrl, this.backUpSourceUrl, this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part, this.newVersion, this.description, }); factory GetUpgradeInfoResult.fromJson(Map map) { return GetUpgradeInfoResult( upgradeType: UpgradeTypeEnum.values.firstWhere((e) => e.index == map['UpgradeType']), upgradeCDNUrl: map['UpgradeCDNUrl'], upgradeSourceUrl: map['UpgradeSourceUrl'], backUpCDNUrl: map['BackUpCDNUrl'], backUpSourceUrl: map['BackUpSourceUrl'], upgradeUpdateType: UpgradeUpdateTypeEnum.values.firstWhere((e) => e.index == map['UpgradeUpdateType']), newVersion: map['NewVersion'], description: map['Description'], ); } Map toJson() { final map = Map(); map['UpgradeType'] = upgradeType.index; if(upgradeCDNUrl != null) map['UpgradeCDNUrl'] = upgradeCDNUrl; if(upgradeSourceUrl != null) map['UpgradeSourceUrl'] = upgradeSourceUrl; if(backUpCDNUrl != null) map['BackUpCDNUrl'] = backUpCDNUrl; if(backUpSourceUrl != null) map['BackUpSourceUrl'] = backUpSourceUrl; map['UpgradeUpdateType'] = upgradeUpdateType.index; if(newVersion != null) map['NewVersion'] = newVersion; if(description != null) map['Description'] = description; return map; } } enum UpgradePlatformEnum { PC, Android, IOS, Mac, } enum UpgradeSourceTypeEnum { Client, US, SONOPOST, FISLib, } class GetUpgradeInfoRequest { UpgradePlatformEnum platform; UpgradeSourceTypeEnum sourceType; String? currentVersion; String? language; GetUpgradeInfoRequest({ this.platform = UpgradePlatformEnum.PC, this.sourceType = UpgradeSourceTypeEnum.Client, this.currentVersion, this.language, }); factory GetUpgradeInfoRequest.fromJson(Map map) { return GetUpgradeInfoRequest( platform: UpgradePlatformEnum.values.firstWhere((e) => e.index == map['Platform']), sourceType: UpgradeSourceTypeEnum.values.firstWhere((e) => e.index == map['SourceType']), currentVersion: map['CurrentVersion'], language: map['Language'], ); } Map toJson() { final map = Map(); map['Platform'] = platform.index; map['SourceType'] = sourceType.index; if(currentVersion != null) map['CurrentVersion'] = currentVersion; if(language != null) map['Language'] = language; return map; } } class SetUpgradeInfoRequest { UpgradePlatformEnum platform; UpgradeSourceTypeEnum sourceType; String? currentVersion; String? token; SetUpgradeInfoRequest({ this.platform = UpgradePlatformEnum.PC, this.sourceType = UpgradeSourceTypeEnum.Client, this.currentVersion, this.token, }); factory SetUpgradeInfoRequest.fromJson(Map map) { return SetUpgradeInfoRequest( platform: UpgradePlatformEnum.values.firstWhere((e) => e.index == map['Platform']), sourceType: UpgradeSourceTypeEnum.values.firstWhere((e) => e.index == map['SourceType']), currentVersion: map['CurrentVersion'], token: map['Token'], ); } Map toJson() { final map = Map(); map['Platform'] = platform.index; map['SourceType'] = sourceType.index; if(currentVersion != null) map['CurrentVersion'] = currentVersion; if(token != null) map['Token'] = token; return map; } } enum OrganizationQueryTypeEnum { Wait, Single, AllDep, All, } class GetUserListRequest extends TokenRequest{ String? keyword; OrganizationQueryTypeEnum organizationQueryType; String? organizationCode; String? rankCode; String? positionCode; bool exceptSelf; String? language; List? roleCodes; GetUserListRequest({ this.keyword, this.organizationQueryType = OrganizationQueryTypeEnum.Wait, this.organizationCode, this.rankCode, this.positionCode, this.exceptSelf = false, this.language, this.roleCodes, String? token, }) : super( token: token, ); factory GetUserListRequest.fromJson(Map map) { return GetUserListRequest( keyword: map['Keyword'], organizationQueryType: OrganizationQueryTypeEnum.values.firstWhere((e) => e.index == map['OrganizationQueryType']), organizationCode: map['OrganizationCode'], rankCode: map['RankCode'], positionCode: map['PositionCode'], exceptSelf: map['ExceptSelf'], language: map['Language'], roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast().toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyword != null) map['Keyword'] = keyword; map['OrganizationQueryType'] = organizationQueryType.index; if(organizationCode != null) map['OrganizationCode'] = organizationCode; if(rankCode != null) map['RankCode'] = rankCode; if(positionCode != null) map['PositionCode'] = positionCode; map['ExceptSelf'] = exceptSelf; if(language != null) map['Language'] = language; if(roleCodes != null) map['RoleCodes'] = roleCodes; return map; } } enum CurrentClientSourceTypeEnum { PC, Web, SONOPOST, FISLib, Android, } class GetFlyinsonoVersionRequest { CurrentClientSourceTypeEnum currentClientType; GetFlyinsonoVersionRequest({ this.currentClientType = CurrentClientSourceTypeEnum.PC, }); factory GetFlyinsonoVersionRequest.fromJson(Map map) { return GetFlyinsonoVersionRequest( currentClientType: CurrentClientSourceTypeEnum.values.firstWhere((e) => e.index == map['CurrentClientType']), ); } Map toJson() { final map = Map(); map['CurrentClientType'] = currentClientType.index; return map; } }