SavingsPlansPurchaseRecommendation.fromJson constructor

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

Implementation

factory SavingsPlansPurchaseRecommendation.fromJson(
    Map<String, dynamic> json) {
  return SavingsPlansPurchaseRecommendation(
    accountScope: (json['AccountScope'] as String?)?.toAccountScope(),
    lookbackPeriodInDays:
        (json['LookbackPeriodInDays'] as String?)?.toLookbackPeriodInDays(),
    paymentOption: (json['PaymentOption'] as String?)?.toPaymentOption(),
    savingsPlansPurchaseRecommendationDetails:
        (json['SavingsPlansPurchaseRecommendationDetails'] as List?)
            ?.whereNotNull()
            .map((e) => SavingsPlansPurchaseRecommendationDetail.fromJson(
                e as Map<String, dynamic>))
            .toList(),
    savingsPlansPurchaseRecommendationSummary:
        json['SavingsPlansPurchaseRecommendationSummary'] != null
            ? SavingsPlansPurchaseRecommendationSummary.fromJson(
                json['SavingsPlansPurchaseRecommendationSummary']
                    as Map<String, dynamic>)
            : null,
    savingsPlansType:
        (json['SavingsPlansType'] as String?)?.toSupportedSavingsPlansType(),
    termInYears: (json['TermInYears'] as String?)?.toTermInYears(),
  );
}