Instance.fromJson constructor

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

Implementation

factory Instance.fromJson(Map<String, dynamic> json) {
  return Instance(
    agentVersion: json['AgentVersion'] as String?,
    amiId: json['AmiId'] as String?,
    architecture: (json['Architecture'] as String?)?.toArchitecture(),
    arn: json['Arn'] as String?,
    autoScalingType:
        (json['AutoScalingType'] as String?)?.toAutoScalingType(),
    availabilityZone: json['AvailabilityZone'] as String?,
    blockDeviceMappings: (json['BlockDeviceMappings'] as List?)
        ?.whereNotNull()
        .map((e) => BlockDeviceMapping.fromJson(e as Map<String, dynamic>))
        .toList(),
    createdAt: json['CreatedAt'] as String?,
    ebsOptimized: json['EbsOptimized'] as bool?,
    ec2InstanceId: json['Ec2InstanceId'] as String?,
    ecsClusterArn: json['EcsClusterArn'] as String?,
    ecsContainerInstanceArn: json['EcsContainerInstanceArn'] as String?,
    elasticIp: json['ElasticIp'] as String?,
    hostname: json['Hostname'] as String?,
    infrastructureClass: json['InfrastructureClass'] as String?,
    installUpdatesOnBoot: json['InstallUpdatesOnBoot'] as bool?,
    instanceId: json['InstanceId'] as String?,
    instanceProfileArn: json['InstanceProfileArn'] as String?,
    instanceType: json['InstanceType'] as String?,
    lastServiceErrorId: json['LastServiceErrorId'] as String?,
    layerIds: (json['LayerIds'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    os: json['Os'] as String?,
    platform: json['Platform'] as String?,
    privateDns: json['PrivateDns'] as String?,
    privateIp: json['PrivateIp'] as String?,
    publicDns: json['PublicDns'] as String?,
    publicIp: json['PublicIp'] as String?,
    registeredBy: json['RegisteredBy'] as String?,
    reportedAgentVersion: json['ReportedAgentVersion'] as String?,
    reportedOs: json['ReportedOs'] != null
        ? ReportedOs.fromJson(json['ReportedOs'] as Map<String, dynamic>)
        : null,
    rootDeviceType: (json['RootDeviceType'] as String?)?.toRootDeviceType(),
    rootDeviceVolumeId: json['RootDeviceVolumeId'] as String?,
    securityGroupIds: (json['SecurityGroupIds'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    sshHostDsaKeyFingerprint: json['SshHostDsaKeyFingerprint'] as String?,
    sshHostRsaKeyFingerprint: json['SshHostRsaKeyFingerprint'] as String?,
    sshKeyName: json['SshKeyName'] as String?,
    stackId: json['StackId'] as String?,
    status: json['Status'] as String?,
    subnetId: json['SubnetId'] as String?,
    tenancy: json['Tenancy'] as String?,
    virtualizationType:
        (json['VirtualizationType'] as String?)?.toVirtualizationType(),
  );
}