ContainerResourceMetricSource.fromJson constructor

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

Creates a ContainerResourceMetricSource from JSON data.

Implementation

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

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

  return ContainerResourceMetricSource(
    container: tempContainer,
    name: tempName,
    target: tempTarget,
  );
}