Cluster.fromJson constructor

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

Implementation

factory Cluster.fromJson(Map<String, dynamic> json) {
  return Cluster(
    activeServicesCount: json['activeServicesCount'] as int?,
    attachments: (json['attachments'] as List?)
        ?.whereNotNull()
        .map((e) => Attachment.fromJson(e as Map<String, dynamic>))
        .toList(),
    attachmentsStatus: json['attachmentsStatus'] as String?,
    capacityProviders: (json['capacityProviders'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    clusterArn: json['clusterArn'] as String?,
    clusterName: json['clusterName'] as String?,
    defaultCapacityProviderStrategy: (json['defaultCapacityProviderStrategy']
            as List?)
        ?.whereNotNull()
        .map((e) =>
            CapacityProviderStrategyItem.fromJson(e as Map<String, dynamic>))
        .toList(),
    pendingTasksCount: json['pendingTasksCount'] as int?,
    registeredContainerInstancesCount:
        json['registeredContainerInstancesCount'] as int?,
    runningTasksCount: json['runningTasksCount'] as int?,
    settings: (json['settings'] as List?)
        ?.whereNotNull()
        .map((e) => ClusterSetting.fromJson(e as Map<String, dynamic>))
        .toList(),
    statistics: (json['statistics'] as List?)
        ?.whereNotNull()
        .map((e) => KeyValuePair.fromJson(e as Map<String, dynamic>))
        .toList(),
    status: json['status'] as String?,
    tags: (json['tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}