InstanceFleet.fromJson constructor
InstanceFleet.fromJson(
- Map<String, dynamic> json
)
Implementation
factory InstanceFleet.fromJson(Map<String, dynamic> json) {
return InstanceFleet(
id: json['Id'] as String?,
instanceFleetType:
(json['InstanceFleetType'] as String?)?.toInstanceFleetType(),
instanceTypeSpecifications: (json['InstanceTypeSpecifications'] as List?)
?.whereNotNull()
.map((e) =>
InstanceTypeSpecification.fromJson(e as Map<String, dynamic>))
.toList(),
launchSpecifications: json['LaunchSpecifications'] != null
? InstanceFleetProvisioningSpecifications.fromJson(
json['LaunchSpecifications'] as Map<String, dynamic>)
: null,
name: json['Name'] as String?,
provisionedOnDemandCapacity: json['ProvisionedOnDemandCapacity'] as int?,
provisionedSpotCapacity: json['ProvisionedSpotCapacity'] as int?,
status: json['Status'] != null
? InstanceFleetStatus.fromJson(json['Status'] as Map<String, dynamic>)
: null,
targetOnDemandCapacity: json['TargetOnDemandCapacity'] as int?,
targetSpotCapacity: json['TargetSpotCapacity'] as int?,
);
}