SubscriptionCancelOptions.fromJson constructor

SubscriptionCancelOptions.fromJson(
  1. Object? json
)

Implementation

factory SubscriptionCancelOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return SubscriptionCancelOptions(
    cancellationDetails: map['cancellation_details'] == null
        ? null
        : SubscriptionCancellationDetails.fromJson(
            map['cancellation_details']),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    invoiceNow:
        map['invoice_now'] == null ? null : (map['invoice_now'] as bool),
    prorate: map['prorate'] == null ? null : (map['prorate'] as bool),
  );
}