SourceUpdateOptions.fromJson constructor

SourceUpdateOptions.fromJson(
  1. Object? json
)

Implementation

factory SourceUpdateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return SourceUpdateOptions(
    amount: map['amount'] == null ? null : (map['amount'] as num).toInt(),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    mandate: map['mandate'] == null
        ? null
        : SourceMandate.fromJson(map['mandate']),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    owner: map['owner'] == null ? null : CardOwner.fromJson(map['owner']),
    sourceOrder: map['source_order'] == null
        ? null
        : SourceOrder.fromJson(map['source_order']),
  );
}