IssuingToken.fromJson constructor

IssuingToken.fromJson(
  1. Object? json
)

Implementation

factory IssuingToken.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return IssuingToken(
    card: IssuingCardOrId.fromJson(map['card']),
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    deviceFingerprint: map['device_fingerprint'] == null
        ? null
        : (map['device_fingerprint'] as String),
    id: (map['id'] as String),
    last4: map['last4'] == null ? null : (map['last4'] as String),
    livemode: (map['livemode'] as bool),
    network: IssuingTokenNetwork.fromJson(map['network']),
    networkData: map['network_data'] == null
        ? null
        : IssuingNetworkTokenNetworkData.fromJson(map['network_data']),
    networkUpdatedAt: DateTime.fromMillisecondsSinceEpoch(
        (map['network_updated_at'] as int).toInt()),
    status: IssuingTokenStatus.fromJson(map['status']),
    walletProvider: map['wallet_provider'] == null
        ? null
        : IssuingTokenWalletProvider.fromJson(map['wallet_provider']),
  );
}