PodsMetricSource.fromJson constructor

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

Creates a PodsMetricSource from JSON data.

Implementation

factory PodsMetricSource.fromJson(Map<String, dynamic> json) {
  final tempMetricJson = json['metric'];
  final tempTargetJson = json['target'];

  final MetricIdentifier tempMetric =
      MetricIdentifier.fromJson(tempMetricJson);
  final MetricTarget tempTarget = MetricTarget.fromJson(tempTargetJson);

  return PodsMetricSource(
    metric: tempMetric,
    target: tempTarget,
  );
}