class GetTotalEnergyConsumptionParam { final DateTime? monthDate; final String? spaceId; const GetTotalEnergyConsumptionParam({ this.monthDate, this.spaceId, }); Map toJson() { return { 'monthDate': '${monthDate?.year}-${monthDate?.month.toString().padLeft(2, '0')}', if (spaceId == null || spaceId == null) 'spaceUuid': spaceId, 'groupByDevice': false, }; } }