SourceMandateNotification.fromJson constructor

SourceMandateNotification.fromJson(
  1. Object? json
)

Implementation

factory SourceMandateNotification.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return SourceMandateNotification(
    acssDebit: map['acss_debit'] == null
        ? null
        : SourceMandateNotificationAcssDebitData.fromJson(map['acss_debit']),
    amount: map['amount'] == null ? null : (map['amount'] as num).toInt(),
    bacsDebit: map['bacs_debit'] == null
        ? null
        : SourceMandateNotificationBacsDebitData.fromJson(map['bacs_debit']),
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    reason: (map['reason'] as String),
    sepaDebit: map['sepa_debit'] == null
        ? null
        : SourceMandateNotificationSepaDebitData.fromJson(map['sepa_debit']),
    source: Source.fromJson(map['source']),
    status: (map['status'] as String),
    type: (map['type'] as String),
  );
}