CoverageByTime.fromJson constructor

CoverageByTime.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CoverageByTime.fromJson(Map<String, dynamic> json) {
  return CoverageByTime(
    groups: (json['Groups'] as List?)
        ?.whereNotNull()
        .map((e) =>
            ReservationCoverageGroup.fromJson(e as Map<String, dynamic>))
        .toList(),
    timePeriod: json['TimePeriod'] != null
        ? DateInterval.fromJson(json['TimePeriod'] as Map<String, dynamic>)
        : null,
    total: json['Total'] != null
        ? Coverage.fromJson(json['Total'] as Map<String, dynamic>)
        : null,
  );
}