MonitoredResourceDescriptor.fromJson constructor
MonitoredResourceDescriptor.fromJson(
- Object? j
Implementation
factory MonitoredResourceDescriptor.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return MonitoredResourceDescriptor(
name: switch (json['name']) {
null => '',
Object $1 => decodeString($1),
},
type: switch (json['type']) {
null => '',
Object $1 => decodeString($1),
},
displayName: switch (json['displayName']) {
null => '',
Object $1 => decodeString($1),
},
description: switch (json['description']) {
null => '',
Object $1 => decodeString($1),
},
labels: switch (json['labels']) {
null => [],
List<Object?> $1 => [for (final i in $1) LabelDescriptor.fromJson(i)],
_ => throw const FormatException('"labels" is not a list'),
},
launchStage: switch (json['launchStage']) {
null => LaunchStage.$default,
Object $1 => LaunchStage.fromJson($1),
},
);
}