TaskSet.fromJson constructor

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

Implementation

factory TaskSet.fromJson(Map<String, dynamic> json) {
  return TaskSet(
    capacityProviderStrategy: (json['capacityProviderStrategy'] as List?)
        ?.whereNotNull()
        .map((e) =>
            CapacityProviderStrategyItem.fromJson(e as Map<String, dynamic>))
        .toList(),
    clusterArn: json['clusterArn'] as String?,
    computedDesiredCount: json['computedDesiredCount'] as int?,
    createdAt: timeStampFromJson(json['createdAt']),
    externalId: json['externalId'] as String?,
    id: json['id'] as String?,
    launchType: (json['launchType'] as String?)?.toLaunchType(),
    loadBalancers: (json['loadBalancers'] as List?)
        ?.whereNotNull()
        .map((e) => LoadBalancer.fromJson(e as Map<String, dynamic>))
        .toList(),
    networkConfiguration: json['networkConfiguration'] != null
        ? NetworkConfiguration.fromJson(
            json['networkConfiguration'] as Map<String, dynamic>)
        : null,
    pendingCount: json['pendingCount'] as int?,
    platformVersion: json['platformVersion'] as String?,
    runningCount: json['runningCount'] as int?,
    scale: json['scale'] != null
        ? Scale.fromJson(json['scale'] as Map<String, dynamic>)
        : null,
    serviceArn: json['serviceArn'] as String?,
    serviceRegistries: (json['serviceRegistries'] as List?)
        ?.whereNotNull()
        .map((e) => ServiceRegistry.fromJson(e as Map<String, dynamic>))
        .toList(),
    stabilityStatus:
        (json['stabilityStatus'] as String?)?.toStabilityStatus(),
    stabilityStatusAt: timeStampFromJson(json['stabilityStatusAt']),
    startedBy: json['startedBy'] as String?,
    status: json['status'] as String?,
    tags: (json['tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
    taskDefinition: json['taskDefinition'] as String?,
    taskSetArn: json['taskSetArn'] as String?,
    updatedAt: timeStampFromJson(json['updatedAt']),
  );
}