ScalingPolicy.fromJson constructor
ScalingPolicy.fromJson(
- Map<String, dynamic> json
)
Implementation
factory ScalingPolicy.fromJson(Map<String, dynamic> json) {
return ScalingPolicy(
creationTime:
nonNullableTimeStampFromJson(json['CreationTime'] as Object),
policyARN: json['PolicyARN'] as String,
policyName: json['PolicyName'] as String,
policyType: (json['PolicyType'] as String).toPolicyType(),
resourceId: json['ResourceId'] as String,
scalableDimension:
(json['ScalableDimension'] as String).toScalableDimension(),
serviceNamespace:
(json['ServiceNamespace'] as String).toServiceNamespace(),
alarms: (json['Alarms'] as List?)
?.whereNotNull()
.map((e) => Alarm.fromJson(e as Map<String, dynamic>))
.toList(),
stepScalingPolicyConfiguration: json['StepScalingPolicyConfiguration'] !=
null
? StepScalingPolicyConfiguration.fromJson(
json['StepScalingPolicyConfiguration'] as Map<String, dynamic>)
: null,
targetTrackingScalingPolicyConfiguration:
json['TargetTrackingScalingPolicyConfiguration'] != null
? TargetTrackingScalingPolicyConfiguration.fromJson(
json['TargetTrackingScalingPolicyConfiguration']
as Map<String, dynamic>)
: null,
);
}