IssuingDisputeCreateOptions.fromJson constructor

IssuingDisputeCreateOptions.fromJson(
  1. Object? json
)

Implementation

factory IssuingDisputeCreateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return IssuingDisputeCreateOptions(
    amount: map['amount'] == null ? null : (map['amount'] as num).toInt(),
    evidence: map['evidence'] == null
        ? null
        : IssuingDisputeCreateOptionsEvidence.fromJson(map['evidence']),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    transaction:
        map['transaction'] == null ? null : (map['transaction'] as String),
    treasury: map['treasury'] == null
        ? null
        : DisputeTreasury.fromJson(map['treasury']),
  );
}