Disk.fromJson constructor
Implementation
factory Disk.fromJson(Map<String, dynamic> json) {
return Disk(
addOns: (json['addOns'] as List?)
?.whereNotNull()
.map((e) => AddOn.fromJson(e as Map<String, dynamic>))
.toList(),
arn: json['arn'] as String?,
attachedTo: json['attachedTo'] as String?,
attachmentState: json['attachmentState'] as String?,
createdAt: timeStampFromJson(json['createdAt']),
gbInUse: json['gbInUse'] as int?,
iops: json['iops'] as int?,
isAttached: json['isAttached'] as bool?,
isSystemDisk: json['isSystemDisk'] as bool?,
location: json['location'] != null
? ResourceLocation.fromJson(json['location'] as Map<String, dynamic>)
: null,
name: json['name'] as String?,
path: json['path'] as String?,
resourceType: (json['resourceType'] as String?)?.toResourceType(),
sizeInGb: json['sizeInGb'] as int?,
state: (json['state'] as String?)?.toDiskState(),
supportCode: json['supportCode'] as String?,
tags: (json['tags'] as List?)
?.whereNotNull()
.map((e) => Tag.fromJson(e as Map<String, dynamic>))
.toList(),
);
}