SubscriptionScheduleItemsItem.fromJson constructor

SubscriptionScheduleItemsItem.fromJson(
  1. Object? json
)

Implementation

factory SubscriptionScheduleItemsItem.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return SubscriptionScheduleItemsItem(
    billingThresholds: map['billing_thresholds'] == null
        ? null
        : UpcomingSubscriptionItemsItemBillingThresholds.fromJson(
            map['billing_thresholds']),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    plan: map['plan'] == null ? null : (map['plan'] as String),
    price: map['price'] == null ? null : (map['price'] as String),
    priceData: map['price_data'] == null
        ? null
        : UpcomingSubscriptionItemsItemPriceData.fromJson(map['price_data']),
    quantity:
        map['quantity'] == null ? null : (map['quantity'] as num).toInt(),
    taxRates: map['tax_rates'] == null
        ? null
        : (map['tax_rates'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
  );
}