import 'package:fis_jsonrpc/utils.dart'; enum NotificationTypeEnum { Unknown, ChatMsgNotification, TokenReplacedNotification, DisconnectNotification, ConnectionNotification, ExamRecordsFinishedNotification, RejectApplyConsultationNotification, CancelInvitingInLiveConsultationNotification, InviteInLiveConsultationNotification, ConsultationRemindNotification, PasswordExpiredWarningNotification, InviteLiveConsultationNotification, AcceptLiveConsultationNotification, RejectLiveConsultationNotification, InviteLiveConsultationToDeviceNotification, CancelLiveConsultationNotification, CloseLiveConsultationNotification, JoinLiveConsultationNotification, NetworkErrConsultationNotification, LeaveConsultationNotification, JoinInLiveConsultationNotification, RejectInviteLiveConsultationNotification, ApplyConsultationNotification, ApprovalApplyConsultationNotification, InviteeConsultationNotification, InviteeApproveApplyConsultationNotification, InviteeRejectApplyConsultationNotification, MuteLiveConsultationNotification, SwitchLiveConsultationVideoNotification, HeartRateJoinConsultationNotification, HeartRateLeaveConsultationNotification, CloseLiveConsultationToDeviceNotification, CancelLiveConsultationToDeviceNotification, AnnouncementPublishNotification, SendInteractiveBoardDataNotification, DeviceParametersNotification, DeviceControlledParametersNotification, EmergencyCallNotification, EmergencyCallFailedNotification, InviteLiveCourseNotification, JoinLiveCourseNotification, InviteLiveCourseToDeviceNotification, HeartRateJoinCoNotification, NetworkErrCourseNotification, CancelLiveCourseNotification, MuteLiveCourseNotification, CancelLiveCourseToDeviceNotification, CloseLiveCourseNotification, CloseLiveCourseToDeviceNotification, HeartRateLeaveCourseNotification, LeaveCoursenNotification, SwitchLiveCourseVideoNotification, ChangeConsultationNotification, ChangeConsultationToDeviceNotification, CourcePaySuccessNotification, CloseConsultationDueToChangeNotification, CloseConsultationDueToChangeToDeviceNotification, CourseStatusNotification, UpgradeNotification, EducationReStartNotification, ConsultationReStartNotification, VersionUpgradeNotification, StartLiveToDeviceNotification, CloseLiveToDeviceNotification, DeviceLiveFinishedNotification, ModifyDeviceMergedVideoSizeNotification, DeviceRejectRemoteControlNotification, DeviceDisconnectRemoteControlNotification, CancelInvitingInLiveCourseNotification, StartConsolutionHeartRateToDeviceNotification, CloseConsolutionHeartRateToDeviceNotification, ConnectStatusToDeviceNotification, ConnectStatusToClientNotification, GetRemoteLogToDeviceNotification, GetRemoteLogToClientNotification, StartCourseHeartRateToDeviceNotification, ExecuteResultNotification, ProgressBarNotification, SendCommandToDeviceNotification, SendResultToClientNotification, PushDevicePatchToDeviceNotification, DeviceDownloadPatchProgressToUserNotification, DevicePrinterResultNotification, DevicePrinterRequestNotification, GetRemoteConnectStatusToDeviceNotification, RestartDeviceNotification, CancelLogDownloadNotification, ApplyProbeApplicationSettingNotification, ProbeApplicationSettingResponseNotification, MeetingMemberNotification, MeetingHangupNotification, RejectMeetingNotification, StartEducationHeartRateToDeviceNotification, AcceptMeetingNotification, SendLiveInteractiveBoardDataNotification, DeviceJoinLiveCourseNotification, CloseCourseHeartRateToDeviceNotification, ChangeShareInLiveCourseNotification, CourseEntryNotification, MeetingPendingMemberTimeoutNotification, ConsultationAnswerTimeout, } class NotificationDTO { NotificationTypeEnum notificationType; String? code; bool isResponse; NotificationDTO({ this.notificationType = NotificationTypeEnum.Unknown, this.code, this.isResponse = false, }); factory NotificationDTO.fromJson(Map map) { return NotificationDTO( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = Map(); map['NotificationType'] = notificationType.index; if(code != null) map['Code'] = code; map['IsResponse'] = isResponse; return map; } } enum ControlDeviceParameterEnum { Start, End, RunExecuteApi, ExecuteProbeApplicationSetting, RejectConnect, EndRunExecuteApi, Get, UserTimeout, UpdateProbeApplication, UpdateAndExitProbeApplication, ExitProbeApplication, GetProbeApplication, } enum LoginSource { PC, Mobile, Pad, Web, US, } class ApplyProbeApplicationSettingNotification extends NotificationDTO{ String? userCode; ControlDeviceParameterEnum controlType; LoginSource loginSource; ApplyProbeApplicationSettingNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.userCode, this.controlType = ControlDeviceParameterEnum.Start, this.loginSource = LoginSource.PC, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ApplyProbeApplicationSettingNotification.fromJson(Map map) { return ApplyProbeApplicationSettingNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), userCode: map['UserCode'], controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']), loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(userCode != null) map['UserCode'] = userCode; map['ControlType'] = controlType.index; map['LoginSource'] = loginSource.index; return map; } } class SendCommandToDeviceNotification extends NotificationDTO{ String? actionType; String? resultCode; String? sender; SendCommandToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.actionType, this.resultCode, this.sender, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory SendCommandToDeviceNotification.fromJson(Map map) { return SendCommandToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), actionType: map['ActionType'], resultCode: map['ResultCode'], sender: map['Sender'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(actionType != null) map['ActionType'] = actionType; if(resultCode != null) map['ResultCode'] = resultCode; if(sender != null) map['Sender'] = sender; return map; } } class SendResultToClientNotification extends NotificationDTO{ String? resultCode; String? sender; SendResultToClientNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.resultCode, this.sender, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory SendResultToClientNotification.fromJson(Map map) { return SendResultToClientNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), resultCode: map['ResultCode'], sender: map['Sender'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(resultCode != null) map['ResultCode'] = resultCode; if(sender != null) map['Sender'] = sender; return map; } } enum AnnouncementTypeEnum { placeHolder_0, Broadcast, Maintenance, } class AnnouncementLanguageConfigDTO { String? language; String? title; String? content; AnnouncementLanguageConfigDTO({ this.language, this.title, this.content, }); factory AnnouncementLanguageConfigDTO.fromJson(Map map) { return AnnouncementLanguageConfigDTO( language: map['Language'], title: map['Title'], content: map['Content'], ); } Map toJson() { final map = Map(); if(language != null) map['Language'] = language; if(title != null) map['Title'] = title; if(content != null) map['Content'] = content; return map; } } class AnnouncementNotification extends NotificationDTO{ AnnouncementTypeEnum announcementType; List? announcementLanguageConfigs; AnnouncementNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.announcementType = AnnouncementTypeEnum.Broadcast, this.announcementLanguageConfigs, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory AnnouncementNotification.fromJson(Map map) { return AnnouncementNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']), announcementLanguageConfigs: map['AnnouncementLanguageConfigs'] != null ? (map['AnnouncementLanguageConfigs'] as List).map((e)=>AnnouncementLanguageConfigDTO.fromJson(e as Map)).toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['AnnouncementType'] = announcementType.index; if(announcementLanguageConfigs != null) map['AnnouncementLanguageConfigs'] = announcementLanguageConfigs; return map; } } enum ChatCmdEnum { Txt, Image, MP4, Voice, Cases, ShareLive, VideoCall, VoiceCall, } class ChatMsgNotification extends NotificationDTO{ String? userCode; String? displayName; String? headImg; ChatCmdEnum chatCmd; DateTime? sendTime; String? message; ChatMsgNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.userCode, this.displayName, this.headImg, this.chatCmd = ChatCmdEnum.Txt, this.sendTime, this.message, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ChatMsgNotification.fromJson(Map map) { return ChatMsgNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), userCode: map['UserCode'], displayName: map['DisplayName'], headImg: map['HeadImg'], chatCmd: ChatCmdEnum.values.firstWhere((e) => e.index == map['ChatCmd']), sendTime: map['SendTime'] != null ? DateTime.parse(map['SendTime']) : null, message: map['Message'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(userCode != null) map['UserCode'] = userCode; if(displayName != null) map['DisplayName'] = displayName; if(headImg != null) map['HeadImg'] = headImg; map['ChatCmd'] = chatCmd.index; if(sendTime != null) map['SendTime'] = JsonRpcUtils.dateFormat(sendTime!); if(message != null) map['Message'] = message; return map; } } class ConnectionNotification extends NotificationDTO{ ConnectionNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ConnectionNotification.fromJson(Map map) { return ConnectionNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); return map; } } class AdditionParameterDTO { String? parameterName; String? parameterType; String? parameterValue; AdditionParameterDTO({ this.parameterName, this.parameterType, this.parameterValue, }); factory AdditionParameterDTO.fromJson(Map map) { return AdditionParameterDTO( parameterName: map['ParameterName'], parameterType: map['ParameterType'], parameterValue: map['ParameterValue'], ); } Map toJson() { final map = Map(); if(parameterName != null) map['ParameterName'] = parameterName; if(parameterType != null) map['ParameterType'] = parameterType; if(parameterValue != null) map['ParameterValue'] = parameterValue; return map; } } class DeviceControlledParametersNotification extends NotificationDTO{ String? controlUserCode; String? controlUserName; ControlDeviceParameterEnum controlType; List? parameters; LoginSource loginSource; DeviceControlledParametersNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.controlUserCode, this.controlUserName, this.controlType = ControlDeviceParameterEnum.Start, this.parameters, this.loginSource = LoginSource.PC, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DeviceControlledParametersNotification.fromJson(Map map) { return DeviceControlledParametersNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), controlUserCode: map['ControlUserCode'], controlUserName: map['ControlUserName'], controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']), parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map)).toList() : null, loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(controlUserCode != null) map['ControlUserCode'] = controlUserCode; if(controlUserName != null) map['ControlUserName'] = controlUserName; map['ControlType'] = controlType.index; if(parameters != null) map['Parameters'] = parameters; map['LoginSource'] = loginSource.index; return map; } } enum RemoteDeviceStateEnum { Unknown, Success, Fail, DownloadPatchFail, CancelDownloadPatch, LogDownloaddFail, DeviceCancelLogDownload, DeviceDisconnect, DeviceTimeOutDisconnect, DownloadPatching, UserTimeOutDisconnect, ProbeApplicationSettingFail, ChangeDeviceOrganization, } class DeviceDisconnectRemoteControlNotification extends NotificationDTO{ String? deviceCode; RemoteDeviceStateEnum remoteDeviceState; DeviceDisconnectRemoteControlNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.deviceCode, this.remoteDeviceState = RemoteDeviceStateEnum.Unknown, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DeviceDisconnectRemoteControlNotification.fromJson(Map map) { return DeviceDisconnectRemoteControlNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), deviceCode: map['DeviceCode'], remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; map['RemoteDeviceState'] = remoteDeviceState.index; return map; } } class DeviceParametersNotification extends NotificationDTO{ String? deviceCode; DeviceParametersNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.deviceCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DeviceParametersNotification.fromJson(Map map) { return DeviceParametersNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), deviceCode: map['DeviceCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; return map; } } class DeviceRejectRemoteControlNotification extends NotificationDTO{ String? deviceCode; DeviceRejectRemoteControlNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.deviceCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DeviceRejectRemoteControlNotification.fromJson(Map map) { return DeviceRejectRemoteControlNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), deviceCode: map['DeviceCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; return map; } } class DisconnectNotification extends NotificationDTO{ DisconnectNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DisconnectNotification.fromJson(Map map) { return DisconnectNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); return map; } } class ExamRecordsFinishedNotification extends NotificationDTO{ List? codes; ExamRecordsFinishedNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.codes, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ExamRecordsFinishedNotification.fromJson(Map map) { return ExamRecordsFinishedNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), codes: map['Codes'] != null ? map['Codes'].cast().toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(codes != null) map['Codes'] = codes; return map; } } class ExecuteResultNotification extends NotificationDTO{ bool isSuccess; String? exportFileToken; ExecuteResultNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.isSuccess = false, this.exportFileToken, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ExecuteResultNotification.fromJson(Map map) { return ExecuteResultNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), isSuccess: map['IsSuccess'], exportFileToken: map['ExportFileToken'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['IsSuccess'] = isSuccess; if(exportFileToken != null) map['ExportFileToken'] = exportFileToken; return map; } } enum VideoDeviceSourceTypeEnum { Desktop, Camera, } class VideoDeviceDTO { String? videoDeviceId; VideoDeviceSourceTypeEnum videoDeviceSourceType; int width; int height; int outputWidth; int outputHeight; int videoFps; int videoBitrate; int minVideoBitrate; VideoDeviceDTO({ this.videoDeviceId, this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop, this.width = 0, this.height = 0, this.outputWidth = 0, this.outputHeight = 0, this.videoFps = 0, this.videoBitrate = 0, this.minVideoBitrate = 0, }); factory VideoDeviceDTO.fromJson(Map map) { return VideoDeviceDTO( videoDeviceId: map['VideoDeviceId'], videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']), width: map['Width'], height: map['Height'], outputWidth: map['OutputWidth'], outputHeight: map['OutputHeight'], videoFps: map['VideoFps'], videoBitrate: map['VideoBitrate'], minVideoBitrate: map['MinVideoBitrate'], ); } Map toJson() { final map = Map(); if(videoDeviceId != null) map['VideoDeviceId'] = videoDeviceId; map['VideoDeviceSourceType'] = videoDeviceSourceType.index; map['Width'] = width; map['Height'] = height; map['OutputWidth'] = outputWidth; map['OutputHeight'] = outputHeight; map['VideoFps'] = videoFps; map['VideoBitrate'] = videoBitrate; map['MinVideoBitrate'] = minVideoBitrate; return map; } } class ModifyDeviceMergedVideoSizeNotification extends NotificationDTO{ bool mergedChannel; String? deviceCode; int mergedVideoOutputWidth; int mergedVideoOutputHeight; List? videoDeviceInfos; ModifyDeviceMergedVideoSizeNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.mergedChannel = false, this.deviceCode, this.mergedVideoOutputWidth = 0, this.mergedVideoOutputHeight = 0, this.videoDeviceInfos, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ModifyDeviceMergedVideoSizeNotification.fromJson(Map map) { return ModifyDeviceMergedVideoSizeNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), mergedChannel: map['MergedChannel'], deviceCode: map['DeviceCode'], mergedVideoOutputWidth: map['MergedVideoOutputWidth'], mergedVideoOutputHeight: map['MergedVideoOutputHeight'], videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map)).toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['MergedChannel'] = mergedChannel; if(deviceCode != null) map['DeviceCode'] = deviceCode; map['MergedVideoOutputWidth'] = mergedVideoOutputWidth; map['MergedVideoOutputHeight'] = mergedVideoOutputHeight; if(videoDeviceInfos != null) map['VideoDeviceInfos'] = videoDeviceInfos; return map; } } class PasswordExpiredWarningNotification extends NotificationDTO{ double surplusTime; PasswordExpiredWarningNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.surplusTime = 0, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory PasswordExpiredWarningNotification.fromJson(Map map) { return PasswordExpiredWarningNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), surplusTime: double.parse(map['SurplusTime'].toString()), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['SurplusTime'] = surplusTime; return map; } } class ProgressBarNotification extends NotificationDTO{ int rate; ProgressBarNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.rate = 0, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ProgressBarNotification.fromJson(Map map) { return ProgressBarNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), rate: map['Rate'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['Rate'] = rate; return map; } } class TokenReplacedNotification extends NotificationDTO{ String? userCode; TokenReplacedNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.userCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory TokenReplacedNotification.fromJson(Map map) { return TokenReplacedNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), userCode: map['UserCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(userCode != null) map['UserCode'] = userCode; return map; } } enum UpgradeTypeEnum { NoUpgrade, Normal, Force, AutoAfterRestart, } enum UpgradeUpdateTypeEnum { Part, All, } class DescriptionInfoDTO { String? description; String? languageCode; DescriptionInfoDTO({ this.description, this.languageCode, }); factory DescriptionInfoDTO.fromJson(Map map) { return DescriptionInfoDTO( description: map['Description'], languageCode: map['LanguageCode'], ); } Map toJson() { final map = Map(); if(description != null) map['Description'] = description; if(languageCode != null) map['LanguageCode'] = languageCode; return map; } } class UpgradeVersionNotification extends NotificationDTO{ UpgradeTypeEnum upgradeType; String? upgradeCDNUrl; String? upgradeSourceUrl; String? backUpCDNUrl; String? backUpSourceUrl; UpgradeUpdateTypeEnum upgradeUpdateType; String? newVersion; List? descriptions; UpgradeVersionNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.upgradeType = UpgradeTypeEnum.NoUpgrade, this.upgradeCDNUrl, this.upgradeSourceUrl, this.backUpCDNUrl, this.backUpSourceUrl, this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part, this.newVersion, this.descriptions, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory UpgradeVersionNotification.fromJson(Map map) { return UpgradeVersionNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), 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'], descriptions: map['Descriptions'] != null ? (map['Descriptions'] as List).map((e)=>DescriptionInfoDTO.fromJson(e as Map)).toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); 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(descriptions != null) map['Descriptions'] = descriptions; return map; } } class CloseLiveToDeviceNotification extends NotificationDTO{ String? liveRoomCode; String? deviceCode; CloseLiveToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.liveRoomCode, this.deviceCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CloseLiveToDeviceNotification.fromJson(Map map) { return CloseLiveToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), liveRoomCode: map['LiveRoomCode'], deviceCode: map['DeviceCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(liveRoomCode != null) map['LiveRoomCode'] = liveRoomCode; if(deviceCode != null) map['DeviceCode'] = deviceCode; return map; } } class ConnectStatusToClientNotification extends NotificationDTO{ String? deviceCode; String? deviceName; ControlDeviceParameterEnum controlType; RemoteDeviceStateEnum remoteDeviceState; ConnectStatusToClientNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.deviceCode, this.deviceName, this.controlType = ControlDeviceParameterEnum.Start, this.remoteDeviceState = RemoteDeviceStateEnum.Unknown, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ConnectStatusToClientNotification.fromJson(Map map) { return ConnectStatusToClientNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), deviceCode: map['DeviceCode'], deviceName: map['DeviceName'], controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']), remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; if(deviceName != null) map['DeviceName'] = deviceName; map['ControlType'] = controlType.index; map['RemoteDeviceState'] = remoteDeviceState.index; return map; } } enum TransactionTypeEnum { placeHolder_0, Consultion, Chat, Announcement, Session, RemoteDia, ControlParameter, Education, Upgrade, Live, AfterSales, } class ConnectStatusToDeviceNotification extends NotificationDTO{ String? controlUserCode; String? controlUserName; ControlDeviceParameterEnum controlType; TransactionTypeEnum transactionType; LoginSource loginSource; ConnectStatusToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.controlUserCode, this.controlUserName, this.controlType = ControlDeviceParameterEnum.Start, this.transactionType = TransactionTypeEnum.Consultion, this.loginSource = LoginSource.PC, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ConnectStatusToDeviceNotification.fromJson(Map map) { return ConnectStatusToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), controlUserCode: map['ControlUserCode'], controlUserName: map['ControlUserName'], controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']), transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']), loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(controlUserCode != null) map['ControlUserCode'] = controlUserCode; if(controlUserName != null) map['ControlUserName'] = controlUserName; map['ControlType'] = controlType.index; map['TransactionType'] = transactionType.index; map['LoginSource'] = loginSource.index; return map; } } class DeviceLiveFinishedNotification extends NotificationDTO{ String? liveRoomCode; DeviceLiveFinishedNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.liveRoomCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DeviceLiveFinishedNotification.fromJson(Map map) { return DeviceLiveFinishedNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), liveRoomCode: map['LiveRoomCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(liveRoomCode != null) map['LiveRoomCode'] = liveRoomCode; return map; } } enum TransactionStatusEnum { placeHolder_0, Applied, Withdrawn, Rejected, ToStart, InProgress, PendingReport, End, Embedded, Common, Tencent, TRTC, VRTC, Expired, } class LiveData { int height; int width; String? rtmpPushUrl; String? rtmpPullUrl; String? httpPullUrl; String? hlsPullUrl; LiveData({ this.height = 0, this.width = 0, this.rtmpPushUrl, this.rtmpPullUrl, this.httpPullUrl, this.hlsPullUrl, }); factory LiveData.fromJson(Map map) { return LiveData( height: map['Height'], width: map['Width'], rtmpPushUrl: map['RtmpPushUrl'], rtmpPullUrl: map['RtmpPullUrl'], httpPullUrl: map['HttpPullUrl'], hlsPullUrl: map['HlsPullUrl'], ); } Map toJson() { final map = Map(); map['Height'] = height; map['Width'] = width; if(rtmpPushUrl != null) map['RtmpPushUrl'] = rtmpPushUrl; if(rtmpPullUrl != null) map['RtmpPullUrl'] = rtmpPullUrl; if(httpPullUrl != null) map['HttpPullUrl'] = httpPullUrl; if(hlsPullUrl != null) map['HlsPullUrl'] = hlsPullUrl; return map; } } class VideoDeviceOutputInfo { String? videoDeviceId; VideoDeviceSourceTypeEnum videoDeviceSourceType; int outputWidth; int outputHeight; int videoFps; int videoBitrate; int minVideoBitrate; String? videoDeviceSign; LiveData? liveData; VideoDeviceOutputInfo({ this.videoDeviceId, this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop, this.outputWidth = 0, this.outputHeight = 0, this.videoFps = 0, this.videoBitrate = 0, this.minVideoBitrate = 0, this.videoDeviceSign, this.liveData, }); factory VideoDeviceOutputInfo.fromJson(Map map) { return VideoDeviceOutputInfo( videoDeviceId: map['VideoDeviceId'], videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']), outputWidth: map['OutputWidth'], outputHeight: map['OutputHeight'], videoFps: map['VideoFps'], videoBitrate: map['VideoBitrate'], minVideoBitrate: map['MinVideoBitrate'], videoDeviceSign: map['VideoDeviceSign'], liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null, ); } Map toJson() { final map = Map(); if(videoDeviceId != null) map['VideoDeviceId'] = videoDeviceId; map['VideoDeviceSourceType'] = videoDeviceSourceType.index; map['OutputWidth'] = outputWidth; map['OutputHeight'] = outputHeight; map['VideoFps'] = videoFps; map['VideoBitrate'] = videoBitrate; map['MinVideoBitrate'] = minVideoBitrate; if(videoDeviceSign != null) map['VideoDeviceSign'] = videoDeviceSign; if(liveData != null) map['LiveData'] = liveData; return map; } } class StartLiveToDeviceNotification extends NotificationDTO{ String? liveRoomCode; int roomNo; TransactionStatusEnum liveProtocol; int appId; bool mergedChannel; int mergedVideoOutputWidth; int mergedVideoOutputHeight; List? videoDeviceOutputList; String? deviceCode; String? deviceSign; StartLiveToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.liveRoomCode, this.roomNo = 0, this.liveProtocol = TransactionStatusEnum.Applied, this.appId = 0, this.mergedChannel = false, this.mergedVideoOutputWidth = 0, this.mergedVideoOutputHeight = 0, this.videoDeviceOutputList, this.deviceCode, this.deviceSign, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory StartLiveToDeviceNotification.fromJson(Map map) { return StartLiveToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), liveRoomCode: map['LiveRoomCode'], roomNo: map['RoomNo'], liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']), appId: map['AppId'], mergedChannel: map['MergedChannel'], mergedVideoOutputWidth: map['MergedVideoOutputWidth'], mergedVideoOutputHeight: map['MergedVideoOutputHeight'], videoDeviceOutputList: map['VideoDeviceOutputList'] != null ? (map['VideoDeviceOutputList'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map)).toList() : null, deviceCode: map['DeviceCode'], deviceSign: map['DeviceSign'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(liveRoomCode != null) map['LiveRoomCode'] = liveRoomCode; map['RoomNo'] = roomNo; map['LiveProtocol'] = liveProtocol.index; map['AppId'] = appId; map['MergedChannel'] = mergedChannel; map['MergedVideoOutputWidth'] = mergedVideoOutputWidth; map['MergedVideoOutputHeight'] = mergedVideoOutputHeight; if(videoDeviceOutputList != null) map['VideoDeviceOutputList'] = videoDeviceOutputList; if(deviceCode != null) map['DeviceCode'] = deviceCode; if(deviceSign != null) map['DeviceSign'] = deviceSign; return map; } } class CancelInvitingInLiveCourseNotification extends NotificationDTO{ String? courseCode; CancelInvitingInLiveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CancelInvitingInLiveCourseNotification.fromJson(Map map) { return CancelInvitingInLiveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; return map; } } class CancelLiveCourseNotification extends NotificationDTO{ String? courseCode; String? teacherCode; CancelLiveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.teacherCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CancelLiveCourseNotification.fromJson(Map map) { return CancelLiveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], teacherCode: map['TeacherCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(teacherCode != null) map['TeacherCode'] = teacherCode; return map; } } enum CourseShareStates { Opened, Closed, } enum CourseShareType { Window, US, } class ShareInfoDTO { CourseShareStates currentShareState; CourseShareType currentShareType; String? currentShareMemberCode; String? currentShareMemberName; ShareInfoDTO({ this.currentShareState = CourseShareStates.Opened, this.currentShareType = CourseShareType.Window, this.currentShareMemberCode, this.currentShareMemberName, }); factory ShareInfoDTO.fromJson(Map map) { return ShareInfoDTO( currentShareState: CourseShareStates.values.firstWhere((e) => e.index == map['CurrentShareState']), currentShareType: CourseShareType.values.firstWhere((e) => e.index == map['CurrentShareType']), currentShareMemberCode: map['CurrentShareMemberCode'], currentShareMemberName: map['CurrentShareMemberName'], ); } Map toJson() { final map = Map(); map['CurrentShareState'] = currentShareState.index; map['CurrentShareType'] = currentShareType.index; if(currentShareMemberCode != null) map['CurrentShareMemberCode'] = currentShareMemberCode; if(currentShareMemberName != null) map['CurrentShareMemberName'] = currentShareMemberName; return map; } } class ChangeShareInLiveCourseNotification extends NotificationDTO{ ShareInfoDTO? shareInfo; String? courseCode; ChangeShareInLiveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.shareInfo, this.courseCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ChangeShareInLiveCourseNotification.fromJson(Map map) { return ChangeShareInLiveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), shareInfo: map['ShareInfo'] != null ? ShareInfoDTO.fromJson(map['ShareInfo']) : null, courseCode: map['CourseCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(shareInfo != null) map['ShareInfo'] = shareInfo; if(courseCode != null) map['CourseCode'] = courseCode; return map; } } class CloseLiveCourseNotification extends NotificationDTO{ String? courseCode; String? teacherCode; CloseLiveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.teacherCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CloseLiveCourseNotification.fromJson(Map map) { return CloseLiveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], teacherCode: map['TeacherCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(teacherCode != null) map['TeacherCode'] = teacherCode; return map; } } class CloseCourseHeartRateToDeviceNotification extends NotificationDTO{ String? liveRoomCode; CloseCourseHeartRateToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.liveRoomCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CloseCourseHeartRateToDeviceNotification.fromJson(Map map) { return CloseCourseHeartRateToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), liveRoomCode: map['LiveRoomCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(liveRoomCode != null) map['LiveRoomCode'] = liveRoomCode; return map; } } class StartEducationHeartRateToDeviceNotification extends NotificationDTO{ String? liveRoomCode; TransactionStatusEnum liveProtocol; int intervalSeconds; StartEducationHeartRateToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.liveRoomCode, this.liveProtocol = TransactionStatusEnum.Applied, this.intervalSeconds = 0, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory StartEducationHeartRateToDeviceNotification.fromJson(Map map) { return StartEducationHeartRateToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), liveRoomCode: map['LiveRoomCode'], liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']), intervalSeconds: map['IntervalSeconds'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(liveRoomCode != null) map['LiveRoomCode'] = liveRoomCode; map['LiveProtocol'] = liveProtocol.index; map['IntervalSeconds'] = intervalSeconds; return map; } } class CourcePaySuccessNotification extends NotificationDTO{ String? paymentOrderCode; String? orderTitle; double orderAmount; DateTime? payTime; CourcePaySuccessNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.paymentOrderCode, this.orderTitle, this.orderAmount = 0, this.payTime, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CourcePaySuccessNotification.fromJson(Map map) { return CourcePaySuccessNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), paymentOrderCode: map['PaymentOrderCode'], orderTitle: map['OrderTitle'], orderAmount: double.parse(map['OrderAmount'].toString()), payTime: map['PayTime'] != null ? DateTime.parse(map['PayTime']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(paymentOrderCode != null) map['PaymentOrderCode'] = paymentOrderCode; if(orderTitle != null) map['OrderTitle'] = orderTitle; map['OrderAmount'] = orderAmount; if(payTime != null) map['PayTime'] = JsonRpcUtils.dateFormat(payTime!); return map; } } class CourseEntryNotification extends NotificationDTO{ String? noticeData; CourseEntryNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.noticeData, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CourseEntryNotification.fromJson(Map map) { return CourseEntryNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), noticeData: map['NoticeData'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(noticeData != null) map['NoticeData'] = noticeData; return map; } } enum CourseStatusEnum { Unknown, NoApproval, Approved, RejectApproval, Started, HasEnded, HasCancelled, Overdue, Offline, } class CourseStatusNotification extends NotificationDTO{ CourseStatusEnum status; String? courseCode; String? courseName; CourseStatusNotification({ this.status = CourseStatusEnum.Unknown, NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.courseName, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CourseStatusNotification.fromJson(Map map) { return CourseStatusNotification( status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']), notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], courseName: map['CourseName'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['Status'] = status.index; if(courseCode != null) map['CourseCode'] = courseCode; if(courseName != null) map['CourseName'] = courseName; return map; } } enum LiveMemberEnum { placeHolder_0, User, Device, } enum UserStatusEnum { placeHolder_0, NotOnline, IsBusy, Idle, } enum LiveMemberStatus { Default, Accepted, Rejected, Joined, Left, } class LiveDataDTO { int width; int height; String? rtmpPushUrl; String? rtmpPullUrl; String? httpPullUrl; String? hlsPullUrl; LiveDataDTO({ this.width = 0, this.height = 0, this.rtmpPushUrl, this.rtmpPullUrl, this.httpPullUrl, this.hlsPullUrl, }); factory LiveDataDTO.fromJson(Map map) { return LiveDataDTO( width: map['Width'], height: map['Height'], rtmpPushUrl: map['RtmpPushUrl'], rtmpPullUrl: map['RtmpPullUrl'], httpPullUrl: map['HttpPullUrl'], hlsPullUrl: map['HlsPullUrl'], ); } Map toJson() { final map = Map(); map['Width'] = width; map['Height'] = height; if(rtmpPushUrl != null) map['RtmpPushUrl'] = rtmpPushUrl; if(rtmpPullUrl != null) map['RtmpPullUrl'] = rtmpPullUrl; if(httpPullUrl != null) map['HttpPullUrl'] = httpPullUrl; if(hlsPullUrl != null) map['HlsPullUrl'] = hlsPullUrl; return map; } } class LiveCourseMember { String? id; String? name; LiveMemberEnum memberType; String? headImageToken; UserStatusEnum userStatusType; bool mute; bool videoOpend; bool isTeacher; bool isExpertUser; bool isAssistantUser; LiveMemberStatus status; String? loginServerUrl; LoginSource loginSource; LiveDataDTO? liveData; List? videoDeviceInfos; bool isControllingParameter; bool mergedChannel; int mergedVideoOutputWidth; int mergedVideoOutputHeight; TransactionStatusEnum liveProtocol; bool backgroundRole; LiveCourseMember({ this.id, this.name, this.memberType = LiveMemberEnum.User, this.headImageToken, this.userStatusType = UserStatusEnum.NotOnline, this.mute = false, this.videoOpend = false, this.isTeacher = false, this.isExpertUser = false, this.isAssistantUser = false, this.status = LiveMemberStatus.Default, this.loginServerUrl, this.loginSource = LoginSource.PC, this.liveData, this.videoDeviceInfos, this.isControllingParameter = false, this.mergedChannel = false, this.mergedVideoOutputWidth = 0, this.mergedVideoOutputHeight = 0, this.liveProtocol = TransactionStatusEnum.Applied, this.backgroundRole = false, }); factory LiveCourseMember.fromJson(Map map) { return LiveCourseMember( id: map['Id'], name: map['Name'], memberType: LiveMemberEnum.values.firstWhere((e) => e.index == map['MemberType']), headImageToken: map['HeadImageToken'], userStatusType: UserStatusEnum.values.firstWhere((e) => e.index == map['UserStatusType']), mute: map['Mute'], videoOpend: map['VideoOpend'], isTeacher: map['IsTeacher'], isExpertUser: map['IsExpertUser'], isAssistantUser: map['IsAssistantUser'], status: LiveMemberStatus.values.firstWhere((e) => e.index == map['Status']), loginServerUrl: map['LoginServerUrl'], loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null, videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map)).toList() : null, isControllingParameter: map['IsControllingParameter'], mergedChannel: map['MergedChannel'], mergedVideoOutputWidth: map['MergedVideoOutputWidth'], mergedVideoOutputHeight: map['MergedVideoOutputHeight'], liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']), backgroundRole: map['BackgroundRole'], ); } Map toJson() { final map = Map(); if(id != null) map['Id'] = id; if(name != null) map['Name'] = name; map['MemberType'] = memberType.index; if(headImageToken != null) map['HeadImageToken'] = headImageToken; map['UserStatusType'] = userStatusType.index; map['Mute'] = mute; map['VideoOpend'] = videoOpend; map['IsTeacher'] = isTeacher; map['IsExpertUser'] = isExpertUser; map['IsAssistantUser'] = isAssistantUser; map['Status'] = status.index; if(loginServerUrl != null) map['LoginServerUrl'] = loginServerUrl; map['LoginSource'] = loginSource.index; if(liveData != null) map['LiveData'] = liveData; if(videoDeviceInfos != null) map['VideoDeviceInfos'] = videoDeviceInfos; map['IsControllingParameter'] = isControllingParameter; map['MergedChannel'] = mergedChannel; map['MergedVideoOutputWidth'] = mergedVideoOutputWidth; map['MergedVideoOutputHeight'] = mergedVideoOutputHeight; map['LiveProtocol'] = liveProtocol.index; map['BackgroundRole'] = backgroundRole; return map; } } class HeartRateJoinCourseNotification extends NotificationDTO{ String? courseCode; LiveCourseMember? joiner; HeartRateJoinCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.joiner, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory HeartRateJoinCourseNotification.fromJson(Map map) { return HeartRateJoinCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], joiner: map['Joiner'] != null ? LiveCourseMember.fromJson(map['Joiner']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(joiner != null) map['Joiner'] = joiner; return map; } } class HeartRateLeaveCourseNotification extends NotificationDTO{ String? courseCode; LiveCourseMember? leaverInfo; HeartRateLeaveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.leaverInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory HeartRateLeaveCourseNotification.fromJson(Map map) { return HeartRateLeaveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], leaverInfo: map['LeaverInfo'] != null ? LiveCourseMember.fromJson(map['LeaverInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(leaverInfo != null) map['LeaverInfo'] = leaverInfo; return map; } } class InviteLiveCourseNotification extends NotificationDTO{ String? courseCode; int roomNo; TransactionStatusEnum liveProtocol; LiveCourseMember? initiator; InviteLiveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.roomNo = 0, this.liveProtocol = TransactionStatusEnum.Applied, this.initiator, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory InviteLiveCourseNotification.fromJson(Map map) { return InviteLiveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], roomNo: map['RoomNo'], liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']), initiator: map['Initiator'] != null ? LiveCourseMember.fromJson(map['Initiator']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; map['RoomNo'] = roomNo; map['LiveProtocol'] = liveProtocol.index; if(initiator != null) map['Initiator'] = initiator; return map; } } class JoinLiveCourseNotification extends NotificationDTO{ String? courseCode; LiveCourseMember? joiner; JoinLiveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.joiner, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory JoinLiveCourseNotification.fromJson(Map map) { return JoinLiveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], joiner: map['Joiner'] != null ? LiveCourseMember.fromJson(map['Joiner']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(joiner != null) map['Joiner'] = joiner; return map; } } class DeviceJoinLiveCourseNotification extends NotificationDTO{ String? courseCode; LiveCourseMember? joiner; DeviceJoinLiveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.joiner, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DeviceJoinLiveCourseNotification.fromJson(Map map) { return DeviceJoinLiveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], joiner: map['Joiner'] != null ? LiveCourseMember.fromJson(map['Joiner']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(joiner != null) map['Joiner'] = joiner; return map; } } class LeaveLiveCourseNotification extends NotificationDTO{ String? courseCode; LiveCourseMember? leaverInfo; LeaveLiveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.leaverInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory LeaveLiveCourseNotification.fromJson(Map map) { return LeaveLiveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], leaverInfo: map['LeaverInfo'] != null ? LiveCourseMember.fromJson(map['LeaverInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(leaverInfo != null) map['LeaverInfo'] = leaverInfo; return map; } } class MuteLiveCourseNotification extends NotificationDTO{ String? courseCode; bool mute; LiveCourseMember? muterInfo; MuteLiveCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.mute = false, this.muterInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory MuteLiveCourseNotification.fromJson(Map map) { return MuteLiveCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], mute: map['Mute'], muterInfo: map['MuterInfo'] != null ? LiveCourseMember.fromJson(map['MuterInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; map['Mute'] = mute; if(muterInfo != null) map['MuterInfo'] = muterInfo; return map; } } class NetworkErrCourseNotification extends NotificationDTO{ String? courseCode; LiveCourseMember? networkErrMemberInfo; NetworkErrCourseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.networkErrMemberInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory NetworkErrCourseNotification.fromJson(Map map) { return NetworkErrCourseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], networkErrMemberInfo: map['NetworkErrMemberInfo'] != null ? LiveCourseMember.fromJson(map['NetworkErrMemberInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(networkErrMemberInfo != null) map['NetworkErrMemberInfo'] = networkErrMemberInfo; return map; } } class SendLiveInteractiveBoardDataNotification extends NotificationDTO{ String? courseCode; bool isClear; String? userCode; String? boardData; SendLiveInteractiveBoardDataNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.isClear = false, this.userCode, this.boardData, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory SendLiveInteractiveBoardDataNotification.fromJson(Map map) { return SendLiveInteractiveBoardDataNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], isClear: map['IsClear'], userCode: map['UserCode'], boardData: map['BoardData'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; map['IsClear'] = isClear; if(userCode != null) map['UserCode'] = userCode; if(boardData != null) map['BoardData'] = boardData; return map; } } class SwitchLiveCourseVideoNotification extends NotificationDTO{ String? courseCode; bool opened; LiveCourseMember? switcherInfo; SwitchLiveCourseVideoNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.courseCode, this.opened = false, this.switcherInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory SwitchLiveCourseVideoNotification.fromJson(Map map) { return SwitchLiveCourseVideoNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), courseCode: map['CourseCode'], opened: map['Opened'], switcherInfo: map['SwitcherInfo'] != null ? LiveCourseMember.fromJson(map['SwitcherInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; map['Opened'] = opened; if(switcherInfo != null) map['SwitcherInfo'] = switcherInfo; return map; } } class UpgradeNotification extends NotificationDTO{ UpgradeTypeEnum upgadeType; String? upgradeCDNUrl; String? upgradeUrl; UpgradeUpdateTypeEnum upgradeUpdateType; String? newVersion; String? description; UpgradeNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.upgadeType = UpgradeTypeEnum.NoUpgrade, this.upgradeCDNUrl, this.upgradeUrl, this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part, this.newVersion, this.description, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory UpgradeNotification.fromJson(Map map) { return UpgradeNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), upgadeType: UpgradeTypeEnum.values.firstWhere((e) => e.index == map['UpgadeType']), upgradeCDNUrl: map['UpgradeCDNUrl'], upgradeUrl: map['UpgradeUrl'], upgradeUpdateType: UpgradeUpdateTypeEnum.values.firstWhere((e) => e.index == map['UpgradeUpdateType']), newVersion: map['NewVersion'], description: map['Description'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['UpgadeType'] = upgadeType.index; if(upgradeCDNUrl != null) map['UpgradeCDNUrl'] = upgradeCDNUrl; if(upgradeUrl != null) map['UpgradeUrl'] = upgradeUrl; map['UpgradeUpdateType'] = upgradeUpdateType.index; if(newVersion != null) map['NewVersion'] = newVersion; if(description != null) map['Description'] = description; return map; } } class ApplyConsultationNotification extends NotificationDTO{ String? consultationCode; String? operatorName; String? patientName; DateTime? applicationTime; String? applyOrganizationName; DateTime? consultationTime; ApplyConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.operatorName, this.patientName, this.applicationTime, this.applyOrganizationName, this.consultationTime, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ApplyConsultationNotification.fromJson(Map map) { return ApplyConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], operatorName: map['OperatorName'], patientName: map['PatientName'], applicationTime: map['ApplicationTime'] != null ? DateTime.parse(map['ApplicationTime']) : null, applyOrganizationName: map['ApplyOrganizationName'], consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(operatorName != null) map['OperatorName'] = operatorName; if(patientName != null) map['PatientName'] = patientName; if(applicationTime != null) map['ApplicationTime'] = JsonRpcUtils.dateFormat(applicationTime!); if(applyOrganizationName != null) map['ApplyOrganizationName'] = applyOrganizationName; if(consultationTime != null) map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!); return map; } } class ApprovalApplyConsultationNotification extends NotificationDTO{ String? consultationCode; String? operatorName; String? patientName; DateTime? consultationTime; DateTime? consultationTimeEnd; String? expertName; ApprovalApplyConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.operatorName, this.patientName, this.consultationTime, this.consultationTimeEnd, this.expertName, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ApprovalApplyConsultationNotification.fromJson(Map map) { return ApprovalApplyConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], operatorName: map['OperatorName'], patientName: map['PatientName'], consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null, consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null, expertName: map['ExpertName'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(operatorName != null) map['OperatorName'] = operatorName; if(patientName != null) map['PatientName'] = patientName; if(consultationTime != null) map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!); if(consultationTimeEnd != null) map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!); if(expertName != null) map['ExpertName'] = expertName; return map; } } class CloseConsolutionHeartRateToDeviceNotification extends NotificationDTO{ String? liveRoomCode; CloseConsolutionHeartRateToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.liveRoomCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CloseConsolutionHeartRateToDeviceNotification.fromJson(Map map) { return CloseConsolutionHeartRateToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), liveRoomCode: map['LiveRoomCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(liveRoomCode != null) map['LiveRoomCode'] = liveRoomCode; return map; } } class ConsultationAnswerTimeoutNotification extends NotificationDTO{ String? consultationCode; String? userCode; String? userName; ConsultationAnswerTimeoutNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.userCode, this.userName, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ConsultationAnswerTimeoutNotification.fromJson(Map map) { return ConsultationAnswerTimeoutNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], userCode: map['UserCode'], userName: map['UserName'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(userCode != null) map['UserCode'] = userCode; if(userName != null) map['UserName'] = userName; return map; } } class ConsultationRemindNotification extends NotificationDTO{ String? consultationCode; int countdownTime; String? patientName; DateTime? consultationTime; DateTime? consultationTimeEnd; String? expertName; ConsultationRemindNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.countdownTime = 0, this.patientName, this.consultationTime, this.consultationTimeEnd, this.expertName, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ConsultationRemindNotification.fromJson(Map map) { return ConsultationRemindNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], countdownTime: map['CountdownTime'], patientName: map['PatientName'], consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null, consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null, expertName: map['ExpertName'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; map['CountdownTime'] = countdownTime; if(patientName != null) map['PatientName'] = patientName; if(consultationTime != null) map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!); if(consultationTimeEnd != null) map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!); if(expertName != null) map['ExpertName'] = expertName; return map; } } class InviteeApproveApplyConsultationNotification extends NotificationDTO{ String? consultationCode; String? operatorName; String? patientName; DateTime? consultationTime; DateTime? consultationTimeEnd; InviteeApproveApplyConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.operatorName, this.patientName, this.consultationTime, this.consultationTimeEnd, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory InviteeApproveApplyConsultationNotification.fromJson(Map map) { return InviteeApproveApplyConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], operatorName: map['OperatorName'], patientName: map['PatientName'], consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null, consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(operatorName != null) map['OperatorName'] = operatorName; if(patientName != null) map['PatientName'] = patientName; if(consultationTime != null) map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!); if(consultationTimeEnd != null) map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!); return map; } } class InviteeConsultationNotification extends NotificationDTO{ String? consultationCode; String? operatorName; String? patientName; DateTime? consultationTime; DateTime? consultationTimeEnd; InviteeConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.operatorName, this.patientName, this.consultationTime, this.consultationTimeEnd, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory InviteeConsultationNotification.fromJson(Map map) { return InviteeConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], operatorName: map['OperatorName'], patientName: map['PatientName'], consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null, consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(operatorName != null) map['OperatorName'] = operatorName; if(patientName != null) map['PatientName'] = patientName; if(consultationTime != null) map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!); if(consultationTimeEnd != null) map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!); return map; } } class InviteeRejectApplyConsultationNotification extends NotificationDTO{ String? consultationCode; String? operatorName; String? patientName; DateTime? consultationTime; DateTime? consultationTimeEnd; String? rejectReason; InviteeRejectApplyConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.operatorName, this.patientName, this.consultationTime, this.consultationTimeEnd, this.rejectReason, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory InviteeRejectApplyConsultationNotification.fromJson(Map map) { return InviteeRejectApplyConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], operatorName: map['OperatorName'], patientName: map['PatientName'], consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null, consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null, rejectReason: map['RejectReason'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(operatorName != null) map['OperatorName'] = operatorName; if(patientName != null) map['PatientName'] = patientName; if(consultationTime != null) map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!); if(consultationTimeEnd != null) map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!); if(rejectReason != null) map['RejectReason'] = rejectReason; return map; } } class RejectApplyConsultationNotification extends NotificationDTO{ String? consultationCode; String? patientName; String? operatorName; String? rejectReason; RejectApplyConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.patientName, this.operatorName, this.rejectReason, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory RejectApplyConsultationNotification.fromJson(Map map) { return RejectApplyConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], patientName: map['PatientName'], operatorName: map['OperatorName'], rejectReason: map['RejectReason'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(patientName != null) map['PatientName'] = patientName; if(operatorName != null) map['OperatorName'] = operatorName; if(rejectReason != null) map['RejectReason'] = rejectReason; return map; } } class StartConsolutionHeartRateToDeviceNotification extends NotificationDTO{ String? liveRoomCode; TransactionStatusEnum liveProtocol; int intervalSeconds; StartConsolutionHeartRateToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.liveRoomCode, this.liveProtocol = TransactionStatusEnum.Applied, this.intervalSeconds = 0, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory StartConsolutionHeartRateToDeviceNotification.fromJson(Map map) { return StartConsolutionHeartRateToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), liveRoomCode: map['LiveRoomCode'], liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']), intervalSeconds: map['IntervalSeconds'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(liveRoomCode != null) map['LiveRoomCode'] = liveRoomCode; map['LiveProtocol'] = liveProtocol.index; map['IntervalSeconds'] = intervalSeconds; return map; } } enum LiveStates { OK, TerminalRequestPush, TerminalIsLiving, TerminalPushTimeout, ServiceIsBusy, AccountUnauthenticated, FriendsAccountIsNotExsiting, TerminalIsLivingInOtherRoom, TerminalNotExist, TerminalOffLine, RtcUrlIsEmpty, FriendsAccountIsOffline, OtherIsBusy, Ignore, TalkIsBusy, TerminalRequestError, TerminalRequestTimeout, Cancelled, NotFoundTerminal, ShareTerminalVideoExpired, TerminalIsPushing, TerminalPushFailed, NotOnline, placeHolder_23, placeHolder_24, placeHolder_25, placeHolder_26, placeHolder_27, placeHolder_28, placeHolder_29, placeHolder_30, placeHolder_31, placeHolder_32, placeHolder_33, placeHolder_34, placeHolder_35, placeHolder_36, placeHolder_37, placeHolder_38, placeHolder_39, placeHolder_40, placeHolder_41, placeHolder_42, placeHolder_43, placeHolder_44, placeHolder_45, placeHolder_46, placeHolder_47, placeHolder_48, placeHolder_49, placeHolder_50, placeHolder_51, placeHolder_52, placeHolder_53, placeHolder_54, placeHolder_55, placeHolder_56, placeHolder_57, placeHolder_58, placeHolder_59, placeHolder_60, placeHolder_61, placeHolder_62, placeHolder_63, placeHolder_64, placeHolder_65, placeHolder_66, placeHolder_67, placeHolder_68, placeHolder_69, placeHolder_70, placeHolder_71, placeHolder_72, placeHolder_73, placeHolder_74, placeHolder_75, placeHolder_76, placeHolder_77, placeHolder_78, placeHolder_79, placeHolder_80, placeHolder_81, placeHolder_82, placeHolder_83, placeHolder_84, placeHolder_85, placeHolder_86, placeHolder_87, placeHolder_88, placeHolder_89, placeHolder_90, placeHolder_91, placeHolder_92, placeHolder_93, placeHolder_94, placeHolder_95, placeHolder_96, placeHolder_97, placeHolder_98, placeHolder_99, RequestChat, ChatRequestArrived, LiveRequestHandledInOldService, ExitTerminalLiveRequestFailed, TerminalStartPushing, InitiatorRequestingChat, RecipientAnswerred, RecipientRejected, RecipientAcceptted, ChatHangup, Idle, AcceptedInOtherDevice, Disconnected, LiveTalkingInProgressInOtherDevice, DeviceIsNotConnected, RecipientAcceptting, IsLivingOnTrainning, TrainningTerminalRoomIsOff, InitiatorChargeGroupNotAvailable, HeartBeatWarning, HeartBeatDown, TerminalOnLocalCapture, Failed, LowVersion, NoImagePushed, InitiativeExit, SessionReplaced, NoSupport, RoomNoExist, MemberNotExist, IsShared, } class MeetingMemberInfo { String? roomId; LiveStates state; String? id; String? displayName; String? avatar; String? userSign; MeetingMemberInfo({ this.roomId, this.state = LiveStates.OK, this.id, this.displayName, this.avatar, this.userSign, }); factory MeetingMemberInfo.fromJson(Map map) { return MeetingMemberInfo( roomId: map['RoomId'], state: LiveStates.values.firstWhere((e) => e.index == map['State']), id: map['Id'], displayName: map['DisplayName'], avatar: map['Avatar'], userSign: map['UserSign'], ); } Map toJson() { final map = Map(); if(roomId != null) map['RoomId'] = roomId; map['State'] = state.index; if(id != null) map['Id'] = id; if(displayName != null) map['DisplayName'] = displayName; if(avatar != null) map['Avatar'] = avatar; if(userSign != null) map['UserSign'] = userSign; return map; } } class PullChannelUrl { String? rtmpUrl; String? flvUrl; String? hlsUrl; int width; int height; String? name; bool enable; String? userId; PullChannelUrl({ this.rtmpUrl, this.flvUrl, this.hlsUrl, this.width = 0, this.height = 0, this.name, this.enable = false, this.userId, }); factory PullChannelUrl.fromJson(Map map) { return PullChannelUrl( rtmpUrl: map['RtmpUrl'], flvUrl: map['FlvUrl'], hlsUrl: map['HlsUrl'], width: map['Width'], height: map['Height'], name: map['Name'], enable: map['Enable'], userId: map['UserId'], ); } Map toJson() { final map = Map(); if(rtmpUrl != null) map['RtmpUrl'] = rtmpUrl; if(flvUrl != null) map['FlvUrl'] = flvUrl; if(hlsUrl != null) map['HlsUrl'] = hlsUrl; map['Width'] = width; map['Height'] = height; if(name != null) map['Name'] = name; map['Enable'] = enable; if(userId != null) map['UserId'] = userId; return map; } } class LiveTerminalInfo { String? id; String? roomId; int integerRoomId; LiveStates state; String? terminalUrl; String? cameraUrl; bool terminalLiveEnabled; bool cameraLiveEnabled; bool isMergeChannel; int terminalWidth; int terminalHeight; int cameraWidth; int cameraHeight; int terminalIntegerRoomId; bool isMultiChannels; List? channels; LiveTerminalInfo({ this.id, this.roomId, this.integerRoomId = 0, this.state = LiveStates.OK, this.terminalUrl, this.cameraUrl, this.terminalLiveEnabled = false, this.cameraLiveEnabled = false, this.isMergeChannel = false, this.terminalWidth = 0, this.terminalHeight = 0, this.cameraWidth = 0, this.cameraHeight = 0, this.terminalIntegerRoomId = 0, this.isMultiChannels = false, this.channels, }); factory LiveTerminalInfo.fromJson(Map map) { return LiveTerminalInfo( id: map['Id'], roomId: map['RoomId'], integerRoomId: map['IntegerRoomId'], state: LiveStates.values.firstWhere((e) => e.index == map['State']), terminalUrl: map['TerminalUrl'], cameraUrl: map['CameraUrl'], terminalLiveEnabled: map['TerminalLiveEnabled'], cameraLiveEnabled: map['CameraLiveEnabled'], isMergeChannel: map['IsMergeChannel'], terminalWidth: map['TerminalWidth'], terminalHeight: map['TerminalHeight'], cameraWidth: map['CameraWidth'], cameraHeight: map['CameraHeight'], terminalIntegerRoomId: map['TerminalIntegerRoomId'], isMultiChannels: map['IsMultiChannels'], channels: map['Channels'] != null ? (map['Channels'] as List).map((e)=>PullChannelUrl.fromJson(e as Map)).toList() : null, ); } Map toJson() { final map = Map(); if(id != null) map['Id'] = id; if(roomId != null) map['RoomId'] = roomId; map['IntegerRoomId'] = integerRoomId; map['State'] = state.index; if(terminalUrl != null) map['TerminalUrl'] = terminalUrl; if(cameraUrl != null) map['CameraUrl'] = cameraUrl; map['TerminalLiveEnabled'] = terminalLiveEnabled; map['CameraLiveEnabled'] = cameraLiveEnabled; map['IsMergeChannel'] = isMergeChannel; map['TerminalWidth'] = terminalWidth; map['TerminalHeight'] = terminalHeight; map['CameraWidth'] = cameraWidth; map['CameraHeight'] = cameraHeight; map['TerminalIntegerRoomId'] = terminalIntegerRoomId; map['IsMultiChannels'] = isMultiChannels; if(channels != null) map['Channels'] = channels; return map; } } class MeetingMemberNotification extends NotificationDTO{ String? roomId; List? members; List? liveTerminals; MeetingMemberNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.roomId, this.members, this.liveTerminals, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory MeetingMemberNotification.fromJson(Map map) { return MeetingMemberNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), roomId: map['RoomId'], members: map['Members'] != null ? (map['Members'] as List).map((e)=>MeetingMemberInfo.fromJson(e as Map)).toList() : null, liveTerminals: map['LiveTerminals'] != null ? (map['LiveTerminals'] as List).map((e)=>LiveTerminalInfo.fromJson(e as Map)).toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(roomId != null) map['RoomId'] = roomId; if(members != null) map['Members'] = members; if(liveTerminals != null) map['LiveTerminals'] = liveTerminals; return map; } } class MeetingHangupNotification extends NotificationDTO{ LiveStates hangupReason; String? roomId; MeetingHangupNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.hangupReason = LiveStates.OK, this.roomId, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory MeetingHangupNotification.fromJson(Map map) { return MeetingHangupNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), hangupReason: LiveStates.values.firstWhere((e) => e.index == map['HangupReason']), roomId: map['RoomId'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['HangupReason'] = hangupReason.index; if(roomId != null) map['RoomId'] = roomId; return map; } } class RejectMeetingNotification extends NotificationDTO{ String? userId; String? roomId; RejectMeetingNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.userId, this.roomId, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory RejectMeetingNotification.fromJson(Map map) { return RejectMeetingNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), userId: map['UserId'], roomId: map['RoomId'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(userId != null) map['UserId'] = userId; if(roomId != null) map['RoomId'] = roomId; return map; } } class AcceptMeetingNotification extends NotificationDTO{ String? subscriberId; String? roomId; LiveStates pushLiveState; AcceptMeetingNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.subscriberId, this.roomId, this.pushLiveState = LiveStates.OK, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory AcceptMeetingNotification.fromJson(Map map) { return AcceptMeetingNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), subscriberId: map['SubscriberId'], roomId: map['RoomId'], pushLiveState: LiveStates.values.firstWhere((e) => e.index == map['PushLiveState']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(subscriberId != null) map['SubscriberId'] = subscriberId; if(roomId != null) map['RoomId'] = roomId; map['PushLiveState'] = pushLiveState.index; return map; } } class MeetingPendingMemberTimeoutNotification extends NotificationDTO{ String? roomId; List? userIds; MeetingPendingMemberTimeoutNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.roomId, this.userIds, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory MeetingPendingMemberTimeoutNotification.fromJson(Map map) { return MeetingPendingMemberTimeoutNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), roomId: map['RoomId'], userIds: map['UserIds'] != null ? map['UserIds'].cast().toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(roomId != null) map['RoomId'] = roomId; if(userIds != null) map['UserIds'] = userIds; return map; } } class ProbeApplicationSettingResponseNotification extends NotificationDTO{ String? deviceCode; ControlDeviceParameterEnum controlType; RemoteDeviceStateEnum remoteDeviceState; ProbeApplicationSettingResponseNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.deviceCode, this.controlType = ControlDeviceParameterEnum.Start, this.remoteDeviceState = RemoteDeviceStateEnum.Unknown, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ProbeApplicationSettingResponseNotification.fromJson(Map map) { return ProbeApplicationSettingResponseNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), deviceCode: map['DeviceCode'], controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']), remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; map['ControlType'] = controlType.index; map['RemoteDeviceState'] = remoteDeviceState.index; return map; } } class CancelLogDownloadNotification extends NotificationDTO{ String? controlUserCode; LoginSource loginSource; CancelLogDownloadNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.controlUserCode, this.loginSource = LoginSource.PC, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CancelLogDownloadNotification.fromJson(Map map) { return CancelLogDownloadNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), controlUserCode: map['ControlUserCode'], loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(controlUserCode != null) map['ControlUserCode'] = controlUserCode; map['LoginSource'] = loginSource.index; return map; } } class DeviceDownloadPatchProgressToUserNotification extends NotificationDTO{ int progress; String? patchCode; String? deviceCode; String? patchName; RemoteDeviceStateEnum remoteDeviceState; DeviceDownloadPatchProgressToUserNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.progress = 0, this.patchCode, this.deviceCode, this.patchName, this.remoteDeviceState = RemoteDeviceStateEnum.Unknown, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DeviceDownloadPatchProgressToUserNotification.fromJson(Map map) { return DeviceDownloadPatchProgressToUserNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), progress: map['Progress'], patchCode: map['PatchCode'], deviceCode: map['DeviceCode'], patchName: map['PatchName'], remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['Progress'] = progress; if(patchCode != null) map['PatchCode'] = patchCode; if(deviceCode != null) map['DeviceCode'] = deviceCode; if(patchName != null) map['PatchName'] = patchName; map['RemoteDeviceState'] = remoteDeviceState.index; return map; } } enum DevicePrinterEnum { GetInstalledPrinters, PrintTestPage, UpdatePrinterConfiguration, GetUninstalledPrinters, InstallPrinterDrive, DeletePrinter, CancelSearchPrinter, SearchPrinter, CancelInstallPrinter, InstallPrinterProgress, } enum DevicePrinterParameterEnum { PrinterName, IPAddress, Port, PrinterModel, DevicePrinterPatchCode, PageSize, PageOrientation, IsNormalSearchType, } class DevicePrinterParameter { DevicePrinterParameterEnum setPrinterEnum; String? parameterValue; DevicePrinterParameter({ this.setPrinterEnum = DevicePrinterParameterEnum.PrinterName, this.parameterValue, }); factory DevicePrinterParameter.fromJson(Map map) { return DevicePrinterParameter( setPrinterEnum: DevicePrinterParameterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']), parameterValue: map['ParameterValue'], ); } Map toJson() { final map = Map(); map['SetPrinterEnum'] = setPrinterEnum.index; if(parameterValue != null) map['ParameterValue'] = parameterValue; return map; } } class BaseDTO { DateTime? createTime; DateTime? updateTime; BaseDTO({ this.createTime, this.updateTime, }); factory BaseDTO.fromJson(Map map) { return BaseDTO( createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = Map(); if(createTime != null) map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!); if(updateTime != null) map['UpdateTime'] = JsonRpcUtils.dateFormat(updateTime!); return map; } } class UploadDeviceFileInfoDTO { int partNum; String? fileUrl; UploadDeviceFileInfoDTO({ this.partNum = 0, this.fileUrl, }); factory UploadDeviceFileInfoDTO.fromJson(Map map) { return UploadDeviceFileInfoDTO( partNum: map['PartNum'], fileUrl: map['FileUrl'], ); } Map toJson() { final map = Map(); map['PartNum'] = partNum; if(fileUrl != null) map['FileUrl'] = fileUrl; return map; } } class DevicePrinterDTO extends BaseDTO{ String? code; String? name; String? driveModelName; String? description; String? osVersion; List? fileUploadInfoList; int fileSize; String? printerBrands; List? printerModels; String? fileName; DevicePrinterDTO({ this.code, this.name, this.driveModelName, this.description, this.osVersion, this.fileUploadInfoList, this.fileSize = 0, this.printerBrands, this.printerModels, this.fileName, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory DevicePrinterDTO.fromJson(Map map) { return DevicePrinterDTO( code: map['Code'], name: map['Name'], driveModelName: map['DriveModelName'], description: map['Description'], osVersion: map['OsVersion'], fileUploadInfoList: map['FileUploadInfoList'] != null ? (map['FileUploadInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map)).toList() : null, fileSize: map['FileSize'], printerBrands: map['PrinterBrands'], printerModels: map['PrinterModels'] != null ? map['PrinterModels'].cast().toList() : null, fileName: map['FileName'], 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; if(name != null) map['Name'] = name; if(driveModelName != null) map['DriveModelName'] = driveModelName; if(description != null) map['Description'] = description; if(osVersion != null) map['OsVersion'] = osVersion; if(fileUploadInfoList != null) map['FileUploadInfoList'] = fileUploadInfoList; map['FileSize'] = fileSize; if(printerBrands != null) map['PrinterBrands'] = printerBrands; if(printerModels != null) map['PrinterModels'] = printerModels; if(fileName != null) map['FileName'] = fileName; return map; } } class DevicePrinterRequestNotification extends NotificationDTO{ DevicePrinterEnum setPrinterEnum; List? parameters; DevicePrinterDTO? devicePrinter; DevicePrinterRequestNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters, this.parameters, this.devicePrinter, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DevicePrinterRequestNotification.fromJson(Map map) { return DevicePrinterRequestNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']), parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>DevicePrinterParameter.fromJson(e as Map)).toList() : null, devicePrinter: map['DevicePrinter'] != null ? DevicePrinterDTO.fromJson(map['DevicePrinter']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); map['SetPrinterEnum'] = setPrinterEnum.index; if(parameters != null) map['Parameters'] = parameters; if(devicePrinter != null) map['DevicePrinter'] = devicePrinter; return map; } } class DevicePrinterParameterDTO { String? name; String? pageSize; String? pageOrientation; List? pageOrientationList; List? pageSizeList; String? brand; int installPrinterProgress; String? iPAddress; DevicePrinterParameterDTO({ this.name, this.pageSize, this.pageOrientation, this.pageOrientationList, this.pageSizeList, this.brand, this.installPrinterProgress = 0, this.iPAddress, }); factory DevicePrinterParameterDTO.fromJson(Map map) { return DevicePrinterParameterDTO( name: map['Name'], pageSize: map['PageSize'], pageOrientation: map['PageOrientation'], pageOrientationList: map['PageOrientationList'] != null ? map['PageOrientationList'].cast().toList() : null, pageSizeList: map['PageSizeList'] != null ? map['PageSizeList'].cast().toList() : null, brand: map['Brand'], installPrinterProgress: map['InstallPrinterProgress'], iPAddress: map['IPAddress'], ); } Map toJson() { final map = Map(); if(name != null) map['Name'] = name; if(pageSize != null) map['PageSize'] = pageSize; if(pageOrientation != null) map['PageOrientation'] = pageOrientation; if(pageOrientationList != null) map['PageOrientationList'] = pageOrientationList; if(pageSizeList != null) map['PageSizeList'] = pageSizeList; if(brand != null) map['Brand'] = brand; map['InstallPrinterProgress'] = installPrinterProgress; if(iPAddress != null) map['IPAddress'] = iPAddress; return map; } } class DevicePrinterResultNotification extends NotificationDTO{ String? deviceCode; DevicePrinterEnum setPrinterEnum; List? devicePrinterList; RemoteDeviceStateEnum remoteDeviceState; DevicePrinterResultNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.deviceCode, this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters, this.devicePrinterList, this.remoteDeviceState = RemoteDeviceStateEnum.Unknown, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory DevicePrinterResultNotification.fromJson(Map map) { return DevicePrinterResultNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), deviceCode: map['DeviceCode'], setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']), devicePrinterList: map['DevicePrinterList'] != null ? (map['DevicePrinterList'] as List).map((e)=>DevicePrinterParameterDTO.fromJson(e as Map)).toList() : null, remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; map['SetPrinterEnum'] = setPrinterEnum.index; if(devicePrinterList != null) map['DevicePrinterList'] = devicePrinterList; map['RemoteDeviceState'] = remoteDeviceState.index; return map; } } class GetRemoteLogToClientNotification extends NotificationDTO{ String? deviceCode; String? logFileToken; int rate; RemoteDeviceStateEnum remoteDeviceState; String? fileName; GetRemoteLogToClientNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.deviceCode, this.logFileToken, this.rate = 0, this.remoteDeviceState = RemoteDeviceStateEnum.Unknown, this.fileName, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory GetRemoteLogToClientNotification.fromJson(Map map) { return GetRemoteLogToClientNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), deviceCode: map['DeviceCode'], logFileToken: map['LogFileToken'], rate: map['Rate'], remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']), fileName: map['FileName'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; if(logFileToken != null) map['LogFileToken'] = logFileToken; map['Rate'] = rate; map['RemoteDeviceState'] = remoteDeviceState.index; if(fileName != null) map['FileName'] = fileName; return map; } } class GetRemoteLogToDeviceNotification extends NotificationDTO{ String? controlUserCode; DateTime? startTime; DateTime? endTime; LoginSource loginSource; GetRemoteLogToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.controlUserCode, this.startTime, this.endTime, this.loginSource = LoginSource.PC, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory GetRemoteLogToDeviceNotification.fromJson(Map map) { return GetRemoteLogToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), controlUserCode: map['ControlUserCode'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null, loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(controlUserCode != null) map['ControlUserCode'] = controlUserCode; if(startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); if(endTime != null) map['EndTime'] = JsonRpcUtils.dateFormat(endTime!); map['LoginSource'] = loginSource.index; return map; } } enum PushDevicePatchEnum { Start, Cancel, } class PushDevicePatchToDeviceNotification extends NotificationDTO{ String? patchName; String? patchCode; List? deviceFileInfoList; int fileSize; PushDevicePatchEnum pushEnum; String? fileName; String? deviceType; PushDevicePatchToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.patchName, this.patchCode, this.deviceFileInfoList, this.fileSize = 0, this.pushEnum = PushDevicePatchEnum.Start, this.fileName, this.deviceType, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory PushDevicePatchToDeviceNotification.fromJson(Map map) { return PushDevicePatchToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), patchName: map['PatchName'], patchCode: map['PatchCode'], deviceFileInfoList: map['DeviceFileInfoList'] != null ? (map['DeviceFileInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map)).toList() : null, fileSize: map['FileSize'], pushEnum: PushDevicePatchEnum.values.firstWhere((e) => e.index == map['PushEnum']), fileName: map['FileName'], deviceType: map['DeviceType'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(patchName != null) map['PatchName'] = patchName; if(patchCode != null) map['PatchCode'] = patchCode; if(deviceFileInfoList != null) map['DeviceFileInfoList'] = deviceFileInfoList; map['FileSize'] = fileSize; map['PushEnum'] = pushEnum.index; if(fileName != null) map['FileName'] = fileName; if(deviceType != null) map['DeviceType'] = deviceType; return map; } } class RestartDeviceNotification extends NotificationDTO{ String? controlUserCode; RestartDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.controlUserCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory RestartDeviceNotification.fromJson(Map map) { return RestartDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), controlUserCode: map['ControlUserCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(controlUserCode != null) map['ControlUserCode'] = controlUserCode; return map; } } class LiveConsultationMemberInfo { String? id; String? name; String? headImageUrl; LiveConsultationMemberInfo({ this.id, this.name, this.headImageUrl, }); factory LiveConsultationMemberInfo.fromJson(Map map) { return LiveConsultationMemberInfo( id: map['Id'], name: map['Name'], headImageUrl: map['HeadImageUrl'], ); } Map toJson() { final map = Map(); if(id != null) map['Id'] = id; if(name != null) map['Name'] = name; if(headImageUrl != null) map['HeadImageUrl'] = headImageUrl; return map; } } class LiveConsultatioAccepterInfo extends LiveConsultationMemberInfo{ bool isOnline; bool mute; bool videoOpend; LoginSource loginSource; LiveData? liveData; LiveConsultatioAccepterInfo({ this.isOnline = false, this.mute = false, this.videoOpend = false, this.loginSource = LoginSource.PC, this.liveData, String? id, String? name, String? headImageUrl, }) : super( id: id, name: name, headImageUrl: headImageUrl, ); factory LiveConsultatioAccepterInfo.fromJson(Map map) { return LiveConsultatioAccepterInfo( isOnline: map['IsOnline'], mute: map['Mute'], videoOpend: map['VideoOpend'], loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null, id: map['Id'], name: map['Name'], headImageUrl: map['HeadImageUrl'], ); } Map toJson() { final map = super.toJson(); map['IsOnline'] = isOnline; map['Mute'] = mute; map['VideoOpend'] = videoOpend; map['LoginSource'] = loginSource.index; if(liveData != null) map['LiveData'] = liveData; return map; } } class AcceptLiveConsultationNotification extends NotificationDTO{ String? consultationCode; LiveConsultatioAccepterInfo? accepter; AcceptLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.accepter, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory AcceptLiveConsultationNotification.fromJson(Map map) { return AcceptLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], accepter: map['Accepter'] != null ? LiveConsultatioAccepterInfo.fromJson(map['Accepter']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(accepter != null) map['Accepter'] = accepter; return map; } } class CancelInvitingInLiveConsultationNotification extends NotificationDTO{ String? consultationCode; List? userCodes; CancelInvitingInLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.userCodes, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CancelInvitingInLiveConsultationNotification.fromJson(Map map) { return CancelInvitingInLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], userCodes: map['UserCodes'] != null ? map['UserCodes'].cast().toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(userCodes != null) map['UserCodes'] = userCodes; return map; } } class CancelLiveConsultationNotification extends NotificationDTO{ String? consultationCode; String? initiatorCode; CancelLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.initiatorCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CancelLiveConsultationNotification.fromJson(Map map) { return CancelLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], initiatorCode: map['InitiatorCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(initiatorCode != null) map['InitiatorCode'] = initiatorCode; return map; } } class CloseLiveConsultationNotification extends NotificationDTO{ String? consultationCode; String? initiatorCode; CloseLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.initiatorCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CloseLiveConsultationNotification.fromJson(Map map) { return CloseLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], initiatorCode: map['InitiatorCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(initiatorCode != null) map['InitiatorCode'] = initiatorCode; return map; } } enum LiveConsultationMemberStatus { Default, Accepted, Rejected, Joined, Left, } class LiveConsultationMember { String? id; String? name; LiveMemberEnum memberType; String? headImageToken; bool isOnline; bool mute; bool videoOpend; bool isInitiator; bool isBusy; LiveConsultationMemberStatus status; String? loginServerUrl; LoginSource loginSource; bool mergedChannel; int mergedVideoOutputWidth; int mergedVideoOutputHeight; LiveData? liveData; List? videoDeviceInfos; bool isControllingParameter; int sortNumber; int sortLevel; LiveConsultationMember({ this.id, this.name, this.memberType = LiveMemberEnum.User, this.headImageToken, this.isOnline = false, this.mute = false, this.videoOpend = false, this.isInitiator = false, this.isBusy = false, this.status = LiveConsultationMemberStatus.Default, this.loginServerUrl, this.loginSource = LoginSource.PC, this.mergedChannel = false, this.mergedVideoOutputWidth = 0, this.mergedVideoOutputHeight = 0, this.liveData, this.videoDeviceInfos, this.isControllingParameter = false, this.sortNumber = 0, this.sortLevel = 0, }); factory LiveConsultationMember.fromJson(Map map) { return LiveConsultationMember( id: map['Id'], name: map['Name'], memberType: LiveMemberEnum.values.firstWhere((e) => e.index == map['MemberType']), headImageToken: map['HeadImageToken'], isOnline: map['IsOnline'], mute: map['Mute'], videoOpend: map['VideoOpend'], isInitiator: map['IsInitiator'], isBusy: map['IsBusy'], status: LiveConsultationMemberStatus.values.firstWhere((e) => e.index == map['Status']), loginServerUrl: map['LoginServerUrl'], loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), mergedChannel: map['MergedChannel'], mergedVideoOutputWidth: map['MergedVideoOutputWidth'], mergedVideoOutputHeight: map['MergedVideoOutputHeight'], liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null, videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map)).toList() : null, isControllingParameter: map['IsControllingParameter'], sortNumber: map['SortNumber'], sortLevel: map['SortLevel'], ); } Map toJson() { final map = Map(); if(id != null) map['Id'] = id; if(name != null) map['Name'] = name; map['MemberType'] = memberType.index; if(headImageToken != null) map['HeadImageToken'] = headImageToken; map['IsOnline'] = isOnline; map['Mute'] = mute; map['VideoOpend'] = videoOpend; map['IsInitiator'] = isInitiator; map['IsBusy'] = isBusy; map['Status'] = status.index; if(loginServerUrl != null) map['LoginServerUrl'] = loginServerUrl; map['LoginSource'] = loginSource.index; map['MergedChannel'] = mergedChannel; map['MergedVideoOutputWidth'] = mergedVideoOutputWidth; map['MergedVideoOutputHeight'] = mergedVideoOutputHeight; if(liveData != null) map['LiveData'] = liveData; if(videoDeviceInfos != null) map['VideoDeviceInfos'] = videoDeviceInfos; map['IsControllingParameter'] = isControllingParameter; map['SortNumber'] = sortNumber; map['SortLevel'] = sortLevel; return map; } } class ChangeConsultationNotification extends NotificationDTO{ String? consultationCode; int roomNo; List? memberLiveDatas; ChangeConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.roomNo = 0, this.memberLiveDatas, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ChangeConsultationNotification.fromJson(Map map) { return ChangeConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], roomNo: map['RoomNo'], memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map)).toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; map['RoomNo'] = roomNo; if(memberLiveDatas != null) map['MemberLiveDatas'] = memberLiveDatas; return map; } } class ChangeConsultationToDeviceNotification extends NotificationDTO{ String? consultationCode; int roomNo; List? memberLiveDatas; ChangeConsultationToDeviceNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.roomNo = 0, this.memberLiveDatas, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory ChangeConsultationToDeviceNotification.fromJson(Map map) { return ChangeConsultationToDeviceNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], roomNo: map['RoomNo'], memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map)).toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; map['RoomNo'] = roomNo; if(memberLiveDatas != null) map['MemberLiveDatas'] = memberLiveDatas; return map; } } class CloseConsultationDueToChangeNotification extends NotificationDTO{ String? consultationCode; CloseConsultationDueToChangeNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory CloseConsultationDueToChangeNotification.fromJson(Map map) { return CloseConsultationDueToChangeNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; return map; } } class EmergencyCallFailedNotification extends NotificationDTO{ String? consultationCode; EmergencyCallFailedNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory EmergencyCallFailedNotification.fromJson(Map map) { return EmergencyCallFailedNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; return map; } } class EmergencyCallNotification extends NotificationDTO{ String? consultationCode; int roomNo; int timeout; LiveConsultationMember? initiator; EmergencyCallNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.roomNo = 0, this.timeout = 0, this.initiator, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory EmergencyCallNotification.fromJson(Map map) { return EmergencyCallNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], roomNo: map['RoomNo'], timeout: map['Timeout'], initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; map['RoomNo'] = roomNo; map['Timeout'] = timeout; if(initiator != null) map['Initiator'] = initiator; return map; } } class LiveConsultationJoinerInfo extends LiveConsultationMemberInfo{ bool isOnline; bool mute; bool videoOpend; bool isInitiator; LoginSource loginSource; LiveData? liveData; int sortNumber; int sortLevel; LiveConsultationJoinerInfo({ this.isOnline = false, this.mute = false, this.videoOpend = false, this.isInitiator = false, this.loginSource = LoginSource.PC, this.liveData, this.sortNumber = 0, this.sortLevel = 0, String? id, String? name, String? headImageUrl, }) : super( id: id, name: name, headImageUrl: headImageUrl, ); factory LiveConsultationJoinerInfo.fromJson(Map map) { return LiveConsultationJoinerInfo( isOnline: map['IsOnline'], mute: map['Mute'], videoOpend: map['VideoOpend'], isInitiator: map['IsInitiator'], loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null, sortNumber: map['SortNumber'], sortLevel: map['SortLevel'], id: map['Id'], name: map['Name'], headImageUrl: map['HeadImageUrl'], ); } Map toJson() { final map = super.toJson(); map['IsOnline'] = isOnline; map['Mute'] = mute; map['VideoOpend'] = videoOpend; map['IsInitiator'] = isInitiator; map['LoginSource'] = loginSource.index; if(liveData != null) map['LiveData'] = liveData; map['SortNumber'] = sortNumber; map['SortLevel'] = sortLevel; return map; } } class HeartRateJoinConsultationNotification extends NotificationDTO{ String? consultationCode; LiveConsultationJoinerInfo? joiner; HeartRateJoinConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.joiner, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory HeartRateJoinConsultationNotification.fromJson(Map map) { return HeartRateJoinConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(joiner != null) map['Joiner'] = joiner; return map; } } class LiveConsultationLeaverInfo extends LiveConsultationMemberInfo{ LiveConsultationLeaverInfo({ String? id, String? name, String? headImageUrl, }) : super( id: id, name: name, headImageUrl: headImageUrl, ); factory LiveConsultationLeaverInfo.fromJson(Map map) { return LiveConsultationLeaverInfo( id: map['Id'], name: map['Name'], headImageUrl: map['HeadImageUrl'], ); } Map toJson() { final map = super.toJson(); return map; } } class HeartRateLeaveConsultationNotification extends NotificationDTO{ String? consultationCode; LiveConsultationLeaverInfo? leaverInfo; HeartRateLeaveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.leaverInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory HeartRateLeaveConsultationNotification.fromJson(Map map) { return HeartRateLeaveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], leaverInfo: map['LeaverInfo'] != null ? LiveConsultationLeaverInfo.fromJson(map['LeaverInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(leaverInfo != null) map['LeaverInfo'] = leaverInfo; return map; } } class InviteLiveConsultationNotification extends NotificationDTO{ String? consultationCode; int roomNo; TransactionStatusEnum liveProtocol; LiveConsultationMember? initiator; InviteLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.roomNo = 0, this.liveProtocol = TransactionStatusEnum.Applied, this.initiator, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory InviteLiveConsultationNotification.fromJson(Map map) { return InviteLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], roomNo: map['RoomNo'], liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']), initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; map['RoomNo'] = roomNo; map['LiveProtocol'] = liveProtocol.index; if(initiator != null) map['Initiator'] = initiator; return map; } } class InviteInLiveConsultationNotification extends NotificationDTO{ String? consultationCode; int roomNo; LiveConsultationMember? operator; List? memberLiveDatas; InviteInLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.roomNo = 0, this.operator, this.memberLiveDatas, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory InviteInLiveConsultationNotification.fromJson(Map map) { return InviteInLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], roomNo: map['RoomNo'], operator: map['Operator'] != null ? LiveConsultationMember.fromJson(map['Operator']) : null, memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map)).toList() : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; map['RoomNo'] = roomNo; if(operator != null) map['Operator'] = operator; if(memberLiveDatas != null) map['MemberLiveDatas'] = memberLiveDatas; return map; } } class JoinInLiveConsultationNotification extends NotificationDTO{ String? consultationCode; LiveConsultationJoinerInfo? joiner; JoinInLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.joiner, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory JoinInLiveConsultationNotification.fromJson(Map map) { return JoinInLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(joiner != null) map['Joiner'] = joiner; return map; } } class LiveConsultationRejecterInfo extends LiveConsultationMemberInfo{ LiveConsultationRejecterInfo({ String? id, String? name, String? headImageUrl, }) : super( id: id, name: name, headImageUrl: headImageUrl, ); factory LiveConsultationRejecterInfo.fromJson(Map map) { return LiveConsultationRejecterInfo( id: map['Id'], name: map['Name'], headImageUrl: map['HeadImageUrl'], ); } Map toJson() { final map = super.toJson(); return map; } } class RejectInviteLiveConsultationNotification extends NotificationDTO{ String? consultationCode; LiveConsultationRejecterInfo? rejecter; RejectInviteLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.rejecter, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory RejectInviteLiveConsultationNotification.fromJson(Map map) { return RejectInviteLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], rejecter: map['Rejecter'] != null ? LiveConsultationRejecterInfo.fromJson(map['Rejecter']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(rejecter != null) map['Rejecter'] = rejecter; return map; } } class JoinLiveConsultationNotification extends NotificationDTO{ String? consultationCode; LiveConsultationJoinerInfo? joiner; JoinLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.joiner, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory JoinLiveConsultationNotification.fromJson(Map map) { return JoinLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(joiner != null) map['Joiner'] = joiner; return map; } } class LeaveLiveConsultationNotification extends NotificationDTO{ String? consultationCode; LiveConsultationLeaverInfo? leaverInfo; LeaveLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.leaverInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory LeaveLiveConsultationNotification.fromJson(Map map) { return LeaveLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], leaverInfo: map['LeaverInfo'] != null ? LiveConsultationLeaverInfo.fromJson(map['LeaverInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(leaverInfo != null) map['LeaverInfo'] = leaverInfo; return map; } } class LiveConsultationMuterInfo extends LiveConsultationMemberInfo{ LiveConsultationMuterInfo({ String? id, String? name, String? headImageUrl, }) : super( id: id, name: name, headImageUrl: headImageUrl, ); factory LiveConsultationMuterInfo.fromJson(Map map) { return LiveConsultationMuterInfo( id: map['Id'], name: map['Name'], headImageUrl: map['HeadImageUrl'], ); } Map toJson() { final map = super.toJson(); return map; } } class MuteLiveConsultationNotification extends NotificationDTO{ String? consultationCode; bool mute; LiveConsultationMuterInfo? muterInfo; MuteLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.mute = false, this.muterInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory MuteLiveConsultationNotification.fromJson(Map map) { return MuteLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], mute: map['Mute'], muterInfo: map['MuterInfo'] != null ? LiveConsultationMuterInfo.fromJson(map['MuterInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; map['Mute'] = mute; if(muterInfo != null) map['MuterInfo'] = muterInfo; return map; } } class LiveConsultationNetworkErrMemberInfo extends LiveConsultationMemberInfo{ LiveConsultationNetworkErrMemberInfo({ String? id, String? name, String? headImageUrl, }) : super( id: id, name: name, headImageUrl: headImageUrl, ); factory LiveConsultationNetworkErrMemberInfo.fromJson(Map map) { return LiveConsultationNetworkErrMemberInfo( id: map['Id'], name: map['Name'], headImageUrl: map['HeadImageUrl'], ); } Map toJson() { final map = super.toJson(); return map; } } class NetworkErrConsultationNotification extends NotificationDTO{ String? consultationCode; LiveConsultationNetworkErrMemberInfo? networkErrMemberInfo; NetworkErrConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.networkErrMemberInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory NetworkErrConsultationNotification.fromJson(Map map) { return NetworkErrConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], networkErrMemberInfo: map['NetworkErrMemberInfo'] != null ? LiveConsultationNetworkErrMemberInfo.fromJson(map['NetworkErrMemberInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(networkErrMemberInfo != null) map['NetworkErrMemberInfo'] = networkErrMemberInfo; return map; } } class RejectLiveConsultationNotification extends NotificationDTO{ String? consultationCode; LiveConsultationRejecterInfo? rejecter; RejectLiveConsultationNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.rejecter, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory RejectLiveConsultationNotification.fromJson(Map map) { return RejectLiveConsultationNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], rejecter: map['Rejecter'] != null ? LiveConsultationRejecterInfo.fromJson(map['Rejecter']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; if(rejecter != null) map['Rejecter'] = rejecter; return map; } } class LiveConsultationSwitcherInfo extends LiveConsultationMemberInfo{ LiveConsultationSwitcherInfo({ String? id, String? name, String? headImageUrl, }) : super( id: id, name: name, headImageUrl: headImageUrl, ); factory LiveConsultationSwitcherInfo.fromJson(Map map) { return LiveConsultationSwitcherInfo( id: map['Id'], name: map['Name'], headImageUrl: map['HeadImageUrl'], ); } Map toJson() { final map = super.toJson(); return map; } } class SwitchLiveConsultationVideoNotification extends NotificationDTO{ String? consultationCode; bool opened; LiveConsultationSwitcherInfo? switcherInfo; SwitchLiveConsultationVideoNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.opened = false, this.switcherInfo, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory SwitchLiveConsultationVideoNotification.fromJson(Map map) { return SwitchLiveConsultationVideoNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], opened: map['Opened'], switcherInfo: map['SwitcherInfo'] != null ? LiveConsultationSwitcherInfo.fromJson(map['SwitcherInfo']) : null, code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; map['Opened'] = opened; if(switcherInfo != null) map['SwitcherInfo'] = switcherInfo; return map; } } class SendInteractiveBoardDataNotification extends NotificationDTO{ String? consultationCode; bool isClear; String? userCode; String? boardData; SendInteractiveBoardDataNotification({ NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown, this.consultationCode, this.isClear = false, this.userCode, this.boardData, String? code, bool isResponse = false, }) : super( notificationType: notificationType, code: code, isResponse: isResponse, ); factory SendInteractiveBoardDataNotification.fromJson(Map map) { return SendInteractiveBoardDataNotification( notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']), consultationCode: map['ConsultationCode'], isClear: map['IsClear'], userCode: map['UserCode'], boardData: map['BoardData'], code: map['Code'], isResponse: map['IsResponse'], ); } Map toJson() { final map = super.toJson(); if(consultationCode != null) map['ConsultationCode'] = consultationCode; map['IsClear'] = isClear; if(userCode != null) map['UserCode'] = userCode; if(boardData != null) map['BoardData'] = boardData; return map; } }