fromJson static method

IMeteredResource fromJson(
  1. dynamic value
)

Returns a new IMeteredResource instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static IMeteredResource fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return IMeteredResource(
      limit: mapValueOfType<int>(json, r'Limit'),
      used: mapValueOfType<int>(json, r'Used'),
      remaining: mapValueOfType<int>(json, r'Remaining'),
      unit: mapValueOfType<String>(json, r'Unit'),
      limitExceeded: mapValueOfType<bool>(json, r'LimitExceeded'),
    );
  }
  return null;
}