TimeSeries.fromJson constructor

TimeSeries.fromJson(
  1. Map json_
)

Implementation

TimeSeries.fromJson(core.Map json_)
    : this(
        metadata: json_.containsKey('metadata')
            ? MonitoredResourceMetadata.fromJson(
                json_['metadata'] as core.Map<core.String, core.dynamic>)
            : null,
        metric: json_.containsKey('metric')
            ? Metric.fromJson(
                json_['metric'] as core.Map<core.String, core.dynamic>)
            : null,
        metricKind: json_.containsKey('metricKind')
            ? json_['metricKind'] as core.String
            : null,
        points: json_.containsKey('points')
            ? (json_['points'] as core.List)
                .map((value) => Point.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        resource: json_.containsKey('resource')
            ? MonitoredResource.fromJson(
                json_['resource'] as core.Map<core.String, core.dynamic>)
            : null,
        unit: json_.containsKey('unit') ? json_['unit'] as core.String : null,
        valueType: json_.containsKey('valueType')
            ? json_['valueType'] as core.String
            : null,
      );