class DeviceReport { final dynamic deviceUuid; final dynamic startTime; final dynamic endTime; final List? data; DeviceReport({ this.deviceUuid, this.startTime, this.endTime, this.data, }); DeviceReport.fromJson(Map json) : deviceUuid = json['deviceUuid'] as String?, startTime = json['startTime'] as String?, endTime = json['endTime'] as String?, data = (json['data'] as List?) ?.map((e) => DeviceEvent.fromJson(e as Map)) .toList(); Map toJson() => { 'deviceUuid': deviceUuid, 'startTime': startTime, 'endTime': endTime, 'data': data?.map((e) => e.toJson()).toList(), }; } class DeviceEvent { final String? code; final int? eventTime; final String? value; DeviceEvent({ this.code, this.eventTime, this.value, }); DeviceEvent.fromJson(Map json) : code = json['code'] as String?, eventTime = json['eventTime'] as int?, value = json['value'] as String?; Map toJson() => { 'code': code, 'eventTime': eventTime, 'value': value, }; }