Server.fromJson constructor
Implementation
factory Server.fromJson(Map<String, dynamic> json) {
return Server(
associatePublicIpAddress: json['AssociatePublicIpAddress'] as bool?,
backupRetentionCount: json['BackupRetentionCount'] as int?,
cloudFormationStackArn: json['CloudFormationStackArn'] as String?,
createdAt: timeStampFromJson(json['CreatedAt']),
customDomain: json['CustomDomain'] as String?,
disableAutomatedBackup: json['DisableAutomatedBackup'] as bool?,
endpoint: json['Endpoint'] as String?,
engine: json['Engine'] as String?,
engineAttributes: (json['EngineAttributes'] as List?)
?.whereNotNull()
.map((e) => EngineAttribute.fromJson(e as Map<String, dynamic>))
.toList(),
engineModel: json['EngineModel'] as String?,
engineVersion: json['EngineVersion'] as String?,
instanceProfileArn: json['InstanceProfileArn'] as String?,
instanceType: json['InstanceType'] as String?,
keyPair: json['KeyPair'] as String?,
maintenanceStatus:
(json['MaintenanceStatus'] as String?)?.toMaintenanceStatus(),
preferredBackupWindow: json['PreferredBackupWindow'] as String?,
preferredMaintenanceWindow: json['PreferredMaintenanceWindow'] as String?,
securityGroupIds: (json['SecurityGroupIds'] as List?)
?.whereNotNull()
.map((e) => e as String)
.toList(),
serverArn: json['ServerArn'] as String?,
serverName: json['ServerName'] as String?,
serviceRoleArn: json['ServiceRoleArn'] as String?,
status: (json['Status'] as String?)?.toServerStatus(),
statusReason: json['StatusReason'] as String?,
subnetIds: (json['SubnetIds'] as List?)
?.whereNotNull()
.map((e) => e as String)
.toList(),
);
}