SavingsPlan.fromJson constructor

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

Implementation

factory SavingsPlan.fromJson(Map<String, dynamic> json) {
  return SavingsPlan(
    commitment: json['commitment'] as String?,
    currency: (json['currency'] as String?)?.toCurrencyCode(),
    description: json['description'] as String?,
    ec2InstanceFamily: json['ec2InstanceFamily'] as String?,
    end: json['end'] as String?,
    offeringId: json['offeringId'] as String?,
    paymentOption:
        (json['paymentOption'] as String?)?.toSavingsPlanPaymentOption(),
    productTypes: (json['productTypes'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toSavingsPlanProductType())
        .toList(),
    recurringPaymentAmount: json['recurringPaymentAmount'] as String?,
    region: json['region'] as String?,
    savingsPlanArn: json['savingsPlanArn'] as String?,
    savingsPlanId: json['savingsPlanId'] as String?,
    savingsPlanType:
        (json['savingsPlanType'] as String?)?.toSavingsPlanType(),
    start: json['start'] as String?,
    state: (json['state'] as String?)?.toSavingsPlanState(),
    tags: (json['tags'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    termDurationInSeconds: json['termDurationInSeconds'] as int?,
    upfrontPaymentAmount: json['upfrontPaymentAmount'] as String?,
  );
}