InstanceGroup.fromJson constructor
InstanceGroup.fromJson(
- Map<String, dynamic> json
)
Implementation
factory InstanceGroup.fromJson(Map<String, dynamic> json) {
return InstanceGroup(
autoScalingPolicy: json['AutoScalingPolicy'] != null
? AutoScalingPolicyDescription.fromJson(
json['AutoScalingPolicy'] as Map<String, dynamic>)
: null,
bidPrice: json['BidPrice'] as String?,
configurations: (json['Configurations'] as List?)
?.whereNotNull()
.map((e) => Configuration.fromJson(e as Map<String, dynamic>))
.toList(),
configurationsVersion: json['ConfigurationsVersion'] as int?,
ebsBlockDevices: (json['EbsBlockDevices'] as List?)
?.whereNotNull()
.map((e) => EbsBlockDevice.fromJson(e as Map<String, dynamic>))
.toList(),
ebsOptimized: json['EbsOptimized'] as bool?,
id: json['Id'] as String?,
instanceGroupType:
(json['InstanceGroupType'] as String?)?.toInstanceGroupType(),
instanceType: json['InstanceType'] as String?,
lastSuccessfullyAppliedConfigurations:
(json['LastSuccessfullyAppliedConfigurations'] as List?)
?.whereNotNull()
.map((e) => Configuration.fromJson(e as Map<String, dynamic>))
.toList(),
lastSuccessfullyAppliedConfigurationsVersion:
json['LastSuccessfullyAppliedConfigurationsVersion'] as int?,
market: (json['Market'] as String?)?.toMarketType(),
name: json['Name'] as String?,
requestedInstanceCount: json['RequestedInstanceCount'] as int?,
runningInstanceCount: json['RunningInstanceCount'] as int?,
shrinkPolicy: json['ShrinkPolicy'] != null
? ShrinkPolicy.fromJson(json['ShrinkPolicy'] as Map<String, dynamic>)
: null,
status: json['Status'] != null
? InstanceGroupStatus.fromJson(json['Status'] as Map<String, dynamic>)
: null,
);
}