ExternalMetricSource.fromJson constructor

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

Creates a ExternalMetricSource from JSON data.

Implementation

factory ExternalMetricSource.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 ExternalMetricSource(
    metric: tempMetric,
    target: tempTarget,
  );
}