MetricDescriptor.fromJson constructor

MetricDescriptor.fromJson(
  1. Map json_
)

Implementation

MetricDescriptor.fromJson(core.Map json_)
    : this(
        description: json_.containsKey('description')
            ? json_['description'] as core.String
            : null,
        displayName: json_.containsKey('displayName')
            ? json_['displayName'] as core.String
            : null,
        labels: json_.containsKey('labels')
            ? (json_['labels'] as core.List)
                .map((value) => LabelDescriptor.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        launchStage: json_.containsKey('launchStage')
            ? json_['launchStage'] as core.String
            : null,
        metadata: json_.containsKey('metadata')
            ? MetricDescriptorMetadata.fromJson(
                json_['metadata'] as core.Map<core.String, core.dynamic>)
            : null,
        metricKind: json_.containsKey('metricKind')
            ? json_['metricKind'] as core.String
            : null,
        monitoredResourceTypes: json_.containsKey('monitoredResourceTypes')
            ? (json_['monitoredResourceTypes'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        name: json_.containsKey('name') ? json_['name'] as core.String : null,
        type: json_.containsKey('type') ? json_['type'] as core.String : null,
        unit: json_.containsKey('unit') ? json_['unit'] as core.String : null,
        valueType: json_.containsKey('valueType')
            ? json_['valueType'] as core.String
            : null,
      );