ContainerInstance.fromJson constructor
ContainerInstance.fromJson(
- Map<String, dynamic> json
)
Implementation
factory ContainerInstance.fromJson(Map<String, dynamic> json) {
return ContainerInstance(
agentConnected: json['agentConnected'] as bool?,
agentUpdateStatus:
(json['agentUpdateStatus'] as String?)?.toAgentUpdateStatus(),
attachments: (json['attachments'] as List?)
?.whereNotNull()
.map((e) => Attachment.fromJson(e as Map<String, dynamic>))
.toList(),
attributes: (json['attributes'] as List?)
?.whereNotNull()
.map((e) => Attribute.fromJson(e as Map<String, dynamic>))
.toList(),
capacityProviderName: json['capacityProviderName'] as String?,
containerInstanceArn: json['containerInstanceArn'] as String?,
ec2InstanceId: json['ec2InstanceId'] as String?,
pendingTasksCount: json['pendingTasksCount'] as int?,
registeredAt: timeStampFromJson(json['registeredAt']),
registeredResources: (json['registeredResources'] as List?)
?.whereNotNull()
.map((e) => Resource.fromJson(e as Map<String, dynamic>))
.toList(),
remainingResources: (json['remainingResources'] as List?)
?.whereNotNull()
.map((e) => Resource.fromJson(e as Map<String, dynamic>))
.toList(),
runningTasksCount: json['runningTasksCount'] as int?,
status: json['status'] as String?,
statusReason: json['statusReason'] as String?,
tags: (json['tags'] as List?)
?.whereNotNull()
.map((e) => Tag.fromJson(e as Map<String, dynamic>))
.toList(),
version: json['version'] as int?,
versionInfo: json['versionInfo'] != null
? VersionInfo.fromJson(json['versionInfo'] as Map<String, dynamic>)
: null,
);
}