ScalingPolicy.fromJson constructor

ScalingPolicy.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ScalingPolicy.fromJson(Map<String, dynamic> json) {
  return ScalingPolicy(
    comparisonOperator:
        (json['ComparisonOperator'] as String?)?.toComparisonOperatorType(),
    evaluationPeriods: json['EvaluationPeriods'] as int?,
    fleetId: json['FleetId'] as String?,
    metricName: (json['MetricName'] as String?)?.toMetricName(),
    name: json['Name'] as String?,
    policyType: (json['PolicyType'] as String?)?.toPolicyType(),
    scalingAdjustment: json['ScalingAdjustment'] as int?,
    scalingAdjustmentType:
        (json['ScalingAdjustmentType'] as String?)?.toScalingAdjustmentType(),
    status: (json['Status'] as String?)?.toScalingStatusType(),
    targetConfiguration: json['TargetConfiguration'] != null
        ? TargetConfiguration.fromJson(
            json['TargetConfiguration'] as Map<String, dynamic>)
        : null,
    threshold: json['Threshold'] as double?,
  );
}