InstanceDetails.fromJson constructor

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

Implementation

factory InstanceDetails.fromJson(Map<String, dynamic> json) {
  return InstanceDetails(
    availabilityZone: json['availabilityZone'] as String?,
    iamInstanceProfile: json['iamInstanceProfile'] != null
        ? IamInstanceProfile.fromJson(
            json['iamInstanceProfile'] as Map<String, dynamic>)
        : null,
    imageDescription: json['imageDescription'] as String?,
    imageId: json['imageId'] as String?,
    instanceId: json['instanceId'] as String?,
    instanceState: json['instanceState'] as String?,
    instanceType: json['instanceType'] as String?,
    launchTime: json['launchTime'] as String?,
    networkInterfaces: (json['networkInterfaces'] as List?)
        ?.whereNotNull()
        .map((e) => NetworkInterface.fromJson(e as Map<String, dynamic>))
        .toList(),
    outpostArn: json['outpostArn'] as String?,
    platform: json['platform'] as String?,
    productCodes: (json['productCodes'] as List?)
        ?.whereNotNull()
        .map((e) => ProductCode.fromJson(e as Map<String, dynamic>))
        .toList(),
    tags: (json['tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}