UsageStatistics.fromJson constructor

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

Implementation

factory UsageStatistics.fromJson(Map<String, dynamic> json) {
  return UsageStatistics(
    sumByAccount: (json['sumByAccount'] as List?)
        ?.whereNotNull()
        .map((e) => UsageAccountResult.fromJson(e as Map<String, dynamic>))
        .toList(),
    sumByDataSource: (json['sumByDataSource'] as List?)
        ?.whereNotNull()
        .map((e) => UsageDataSourceResult.fromJson(e as Map<String, dynamic>))
        .toList(),
    sumByResource: (json['sumByResource'] as List?)
        ?.whereNotNull()
        .map((e) => UsageResourceResult.fromJson(e as Map<String, dynamic>))
        .toList(),
    topResources: (json['topResources'] as List?)
        ?.whereNotNull()
        .map((e) => UsageResourceResult.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}