MetricTarget.fromJson constructor

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

Creates a MetricTarget from JSON data.

Implementation

factory MetricTarget.fromJson(Map<String, dynamic> json) {
  final tempAverageUtilizationJson = json['averageUtilization'];
  final tempAverageValueJson = json['averageValue'];
  final tempTypeJson = json['type'];
  final tempValueJson = json['value'];

  final int? tempAverageUtilization = tempAverageUtilizationJson;
  final String? tempAverageValue = tempAverageValueJson;
  final String tempType = tempTypeJson;
  final String? tempValue = tempValueJson;

  return MetricTarget(
    averageUtilization: tempAverageUtilization,
    averageValue: tempAverageValue,
    type: tempType,
    value: tempValue,
  );
}