ReservationPurchaseRecommendation.fromJson constructor

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

Implementation

factory ReservationPurchaseRecommendation.fromJson(
    Map<String, dynamic> json) {
  return ReservationPurchaseRecommendation(
    accountScope: (json['AccountScope'] as String?)?.toAccountScope(),
    lookbackPeriodInDays:
        (json['LookbackPeriodInDays'] as String?)?.toLookbackPeriodInDays(),
    paymentOption: (json['PaymentOption'] as String?)?.toPaymentOption(),
    recommendationDetails: (json['RecommendationDetails'] as List?)
        ?.whereNotNull()
        .map((e) => ReservationPurchaseRecommendationDetail.fromJson(
            e as Map<String, dynamic>))
        .toList(),
    recommendationSummary: json['RecommendationSummary'] != null
        ? ReservationPurchaseRecommendationSummary.fromJson(
            json['RecommendationSummary'] as Map<String, dynamic>)
        : null,
    serviceSpecification: json['ServiceSpecification'] != null
        ? ServiceSpecification.fromJson(
            json['ServiceSpecification'] as Map<String, dynamic>)
        : null,
    termInYears: (json['TermInYears'] as String?)?.toTermInYears(),
  );
}