ObjectMetricSource.fromJson constructor

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

Creates a ObjectMetricSource from JSON data.

Implementation

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

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

  return ObjectMetricSource(
    describedObject: tempDescribedObject,
    metric: tempMetric,
    target: tempTarget,
  );
}