ScalingInstruction.fromJson constructor
ScalingInstruction.fromJson(
- Map<String, dynamic> json
)
Implementation
factory ScalingInstruction.fromJson(Map<String, dynamic> json) {
return ScalingInstruction(
maxCapacity: json['MaxCapacity'] as int,
minCapacity: json['MinCapacity'] as int,
resourceId: json['ResourceId'] as String,
scalableDimension:
(json['ScalableDimension'] as String).toScalableDimension(),
serviceNamespace:
(json['ServiceNamespace'] as String).toServiceNamespace(),
targetTrackingConfigurations: (json['TargetTrackingConfigurations']
as List)
.whereNotNull()
.map((e) =>
TargetTrackingConfiguration.fromJson(e as Map<String, dynamic>))
.toList(),
customizedLoadMetricSpecification:
json['CustomizedLoadMetricSpecification'] != null
? CustomizedLoadMetricSpecification.fromJson(
json['CustomizedLoadMetricSpecification']
as Map<String, dynamic>)
: null,
disableDynamicScaling: json['DisableDynamicScaling'] as bool?,
predefinedLoadMetricSpecification:
json['PredefinedLoadMetricSpecification'] != null
? PredefinedLoadMetricSpecification.fromJson(
json['PredefinedLoadMetricSpecification']
as Map<String, dynamic>)
: null,
predictiveScalingMaxCapacityBehavior:
(json['PredictiveScalingMaxCapacityBehavior'] as String?)
?.toPredictiveScalingMaxCapacityBehavior(),
predictiveScalingMaxCapacityBuffer:
json['PredictiveScalingMaxCapacityBuffer'] as int?,
predictiveScalingMode:
(json['PredictiveScalingMode'] as String?)?.toPredictiveScalingMode(),
scalingPolicyUpdateBehavior:
(json['ScalingPolicyUpdateBehavior'] as String?)
?.toScalingPolicyUpdateBehavior(),
scheduledActionBufferTime: json['ScheduledActionBufferTime'] as int?,
);
}