UpcomingSubscriptionItemsItemPriceData.fromJson constructor

UpcomingSubscriptionItemsItemPriceData.fromJson(
  1. Object? json
)

Implementation

factory UpcomingSubscriptionItemsItemPriceData.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return UpcomingSubscriptionItemsItemPriceData(
    currency: (map['currency'] as String),
    product: (map['product'] as String),
    recurring: SessionRecurring.fromJson(map['recurring']),
    taxBehavior: map['tax_behavior'] == null
        ? null
        : ShippingRateCurrencyOptionTaxBehavior.fromJson(map['tax_behavior']),
    unitAmount: map['unit_amount'] == null
        ? null
        : (map['unit_amount'] as num).toInt(),
    unitAmountDecimal: map['unit_amount_decimal'] == null
        ? null
        : (map['unit_amount_decimal'] as String),
  );
}