LimitRangeItem.fromJson constructor

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

Creates a LimitRangeItem from JSON data.

Implementation

factory LimitRangeItem.fromJson(Map<String, dynamic> json) {
  final tempDefaultJson = json['default'];
  final tempDefaultRequestJson = json['defaultRequest'];
  final tempMaxJson = json['max'];
  final tempMaxLimitRequestRatioJson = json['maxLimitRequestRatio'];
  final tempMinJson = json['min'];
  final tempTypeJson = json['type'];

  final Map<String, String>? tempDefault = tempDefaultJson != null
      ? Map<String, String>.from(tempDefaultJson)
      : null;

  final Map<String, String>? tempDefaultRequest =
      tempDefaultRequestJson != null
          ? Map<String, String>.from(tempDefaultRequestJson)
          : null;

  final Map<String, String>? tempMax =
      tempMaxJson != null ? Map<String, String>.from(tempMaxJson) : null;

  final Map<String, String>? tempMaxLimitRequestRatio =
      tempMaxLimitRequestRatioJson != null
          ? Map<String, String>.from(tempMaxLimitRequestRatioJson)
          : null;

  final Map<String, String>? tempMin =
      tempMinJson != null ? Map<String, String>.from(tempMinJson) : null;

  final String tempType = tempTypeJson;

  return LimitRangeItem(
    $default: tempDefault,
    defaultRequest: tempDefaultRequest,
    max: tempMax,
    maxLimitRequestRatio: tempMaxLimitRequestRatio,
    min: tempMin,
    type: tempType,
  );
}