UsageRecordSummary.fromJson constructor

UsageRecordSummary.fromJson(
  1. Object? json
)

Implementation

factory UsageRecordSummary.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return UsageRecordSummary(
    id: (map['id'] as String),
    invoice: map['invoice'] == null ? null : (map['invoice'] as String),
    livemode: (map['livemode'] as bool),
    period: Period.fromJson(map['period']),
    subscriptionItem: (map['subscription_item'] as String),
    totalUsage: (map['total_usage'] as num).toInt(),
  );
}