IssuingDispute.fromJson constructor

IssuingDispute.fromJson(
  1. Object? json
)

Implementation

factory IssuingDispute.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return IssuingDispute(
    amount: (map['amount'] as num).toInt(),
    balanceTransactions: map['balance_transactions'] == null
        ? null
        : (map['balance_transactions'] as List<Object?>)
            .map((el) => BalanceTransaction.fromJson(el))
            .toList(),
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    currency: (map['currency'] as String),
    evidence: IssuingDisputeEvidence.fromJson(map['evidence']),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    metadata: (map['metadata'] as Map).cast<String, Object?>().map((
          key,
          value,
        ) =>
            MapEntry(
              key,
              (value as String),
            )),
    status: IssuingDisputeStatus.fromJson(map['status']),
    transaction: IssuingTransactionOrId.fromJson(map['transaction']),
    treasury: map['treasury'] == null
        ? null
        : IssuingDisputeTreasury.fromJson(map['treasury']),
  );
}