InstanceSnapshot.fromJson constructor
InstanceSnapshot.fromJson(
- Map<String, dynamic> json
)
Implementation
factory InstanceSnapshot.fromJson(Map<String, dynamic> json) {
return InstanceSnapshot(
arn: json['arn'] as String?,
createdAt: timeStampFromJson(json['createdAt']),
fromAttachedDisks: (json['fromAttachedDisks'] as List?)
?.whereNotNull()
.map((e) => Disk.fromJson(e as Map<String, dynamic>))
.toList(),
fromBlueprintId: json['fromBlueprintId'] as String?,
fromBundleId: json['fromBundleId'] as String?,
fromInstanceArn: json['fromInstanceArn'] as String?,
fromInstanceName: json['fromInstanceName'] as String?,
isFromAutoSnapshot: json['isFromAutoSnapshot'] as bool?,
location: json['location'] != null
? ResourceLocation.fromJson(json['location'] as Map<String, dynamic>)
: null,
name: json['name'] as String?,
progress: json['progress'] as String?,
resourceType: (json['resourceType'] as String?)?.toResourceType(),
sizeInGb: json['sizeInGb'] as int?,
state: (json['state'] as String?)?.toInstanceSnapshotState(),
supportCode: json['supportCode'] as String?,
tags: (json['tags'] as List?)
?.whereNotNull()
.map((e) => Tag.fromJson(e as Map<String, dynamic>))
.toList(),
);
}