DiskSnapshot.fromJson constructor

DiskSnapshot.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory DiskSnapshot.fromJson(Map<String, dynamic> json) {
  return DiskSnapshot(
    arn: json['arn'] as String?,
    createdAt: timeStampFromJson(json['createdAt']),
    fromDiskArn: json['fromDiskArn'] as String?,
    fromDiskName: json['fromDiskName'] 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?)?.toDiskSnapshotState(),
    supportCode: json['supportCode'] as String?,
    tags: (json['tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}