SavingsPlanRate.fromJson constructor

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

Implementation

factory SavingsPlanRate.fromJson(Map<String, dynamic> json) {
  return SavingsPlanRate(
    currency: (json['currency'] as String?)?.toCurrencyCode(),
    operation: json['operation'] as String?,
    productType: (json['productType'] as String?)?.toSavingsPlanProductType(),
    properties: (json['properties'] as List?)
        ?.whereNotNull()
        .map((e) =>
            SavingsPlanRateProperty.fromJson(e as Map<String, dynamic>))
        .toList(),
    rate: json['rate'] as String?,
    serviceCode:
        (json['serviceCode'] as String?)?.toSavingsPlanRateServiceCode(),
    unit: (json['unit'] as String?)?.toSavingsPlanRateUnit(),
    usageType: json['usageType'] as String?,
  );
}