Service.fromJson constructor
Service.fromJson(
- Map<String, dynamic> json
)
Implementation
factory Service.fromJson(Map<String, dynamic> json) {
return Service(
capacityProviderStrategy: (json['capacityProviderStrategy'] as List?)
?.whereNotNull()
.map((e) =>
CapacityProviderStrategyItem.fromJson(e as Map<String, dynamic>))
.toList(),
clusterArn: json['clusterArn'] as String?,
createdAt: timeStampFromJson(json['createdAt']),
createdBy: json['createdBy'] as String?,
deploymentConfiguration: json['deploymentConfiguration'] != null
? DeploymentConfiguration.fromJson(
json['deploymentConfiguration'] as Map<String, dynamic>)
: null,
deploymentController: json['deploymentController'] != null
? DeploymentController.fromJson(
json['deploymentController'] as Map<String, dynamic>)
: null,
deployments: (json['deployments'] as List?)
?.whereNotNull()
.map((e) => Deployment.fromJson(e as Map<String, dynamic>))
.toList(),
desiredCount: json['desiredCount'] as int?,
enableECSManagedTags: json['enableECSManagedTags'] as bool?,
events: (json['events'] as List?)
?.whereNotNull()
.map((e) => ServiceEvent.fromJson(e as Map<String, dynamic>))
.toList(),
healthCheckGracePeriodSeconds:
json['healthCheckGracePeriodSeconds'] as int?,
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?,
placementConstraints: (json['placementConstraints'] as List?)
?.whereNotNull()
.map((e) => PlacementConstraint.fromJson(e as Map<String, dynamic>))
.toList(),
placementStrategy: (json['placementStrategy'] as List?)
?.whereNotNull()
.map((e) => PlacementStrategy.fromJson(e as Map<String, dynamic>))
.toList(),
platformVersion: json['platformVersion'] as String?,
propagateTags: (json['propagateTags'] as String?)?.toPropagateTags(),
roleArn: json['roleArn'] as String?,
runningCount: json['runningCount'] as int?,
schedulingStrategy:
(json['schedulingStrategy'] as String?)?.toSchedulingStrategy(),
serviceArn: json['serviceArn'] as String?,
serviceName: json['serviceName'] as String?,
serviceRegistries: (json['serviceRegistries'] as List?)
?.whereNotNull()
.map((e) => ServiceRegistry.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(),
taskDefinition: json['taskDefinition'] as String?,
taskSets: (json['taskSets'] as List?)
?.whereNotNull()
.map((e) => TaskSet.fromJson(e as Map<String, dynamic>))
.toList(),
);
}