MetricSpec.fromJson constructor

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

Creates a MetricSpec from JSON data.

Implementation

MetricSpec.fromJson(Map<String, dynamic> json)
    : this(
        containerResource: json['containerResource'] != null
            ? ContainerResourceMetricSource.fromJson(
                json['containerResource'])
            : null,
        external: json['external'] != null
            ? ExternalMetricSource.fromJson(json['external'])
            : null,
        object: json['object'] != null
            ? ObjectMetricSource.fromJson(json['object'])
            : null,
        pods: json['pods'] != null
            ? PodsMetricSource.fromJson(json['pods'])
            : null,
        resource: json['resource'] != null
            ? ResourceMetricSource.fromJson(json['resource'])
            : null,
        type: json['type'],
      );