ScalingPlanResource.fromJson constructor

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

Implementation

factory ScalingPlanResource.fromJson(Map<String, dynamic> json) {
  return ScalingPlanResource(
    resourceId: json['ResourceId'] as String,
    scalableDimension:
        (json['ScalableDimension'] as String).toScalableDimension(),
    scalingPlanName: json['ScalingPlanName'] as String,
    scalingPlanVersion: json['ScalingPlanVersion'] as int,
    scalingStatusCode:
        (json['ScalingStatusCode'] as String).toScalingStatusCode(),
    serviceNamespace:
        (json['ServiceNamespace'] as String).toServiceNamespace(),
    scalingPolicies: (json['ScalingPolicies'] as List?)
        ?.whereNotNull()
        .map((e) => ScalingPolicy.fromJson(e as Map<String, dynamic>))
        .toList(),
    scalingStatusMessage: json['ScalingStatusMessage'] as String?,
  );
}