UpcomingSubscriptionItemsItem.fromJson constructor
UpcomingSubscriptionItemsItem.fromJson(
- Object? json
Implementation
factory UpcomingSubscriptionItemsItem.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return UpcomingSubscriptionItemsItem(
billingThresholds: map['billing_thresholds'] == null
? null
: UpcomingSubscriptionItemsItemBillingThresholds.fromJson(
map['billing_thresholds']),
clearUsage:
map['clear_usage'] == null ? null : (map['clear_usage'] as bool),
deleted: map['deleted'] == null ? null : (map['deleted'] as bool),
id: map['id'] == null ? null : (map['id'] as String),
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(),
);
}