Quota.fromJson constructor

Quota.fromJson(
  1. Object? j
)

Implementation

factory Quota.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Quota(
    limits: switch (json['limits']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) QuotaLimit.fromJson(i)],
      _ => throw const FormatException('"limits" is not a list'),
    },
    metricRules: switch (json['metricRules']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) MetricRule.fromJson(i)],
      _ => throw const FormatException('"metricRules" is not a list'),
    },
  );
}