ResourceMetricSource.fromJson constructor

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

Creates a ResourceMetricSource from JSON data.

Implementation

factory ResourceMetricSource.fromJson(Map<String, dynamic> json) {
  final tempNameJson = json['name'];
  final tempTargetJson = json['target'];

  final String tempName = tempNameJson;
  final MetricTarget tempTarget = MetricTarget.fromJson(tempTargetJson);

  return ResourceMetricSource(
    name: tempName,
    target: tempTarget,
  );
}