NmWebhook.fromJson constructor

NmWebhook.fromJson(
  1. Map<String, dynamic> j
)

Reads the JSON shape {id, url, events, secretHint, lastStatus, lastAt}.

Implementation

factory NmWebhook.fromJson(Map<String, dynamic> j) => NmWebhook(
  id: j['id'] as int,
  url: '${j['url']}',
  events: (j['events'] as List? ?? const []).map((e) => '$e').toList(),
  secretHint: j['secretHint'] as String?,
  lastStatus: j['lastStatus']?.toString(),
  lastAt: j['lastAt']?.toString(),
);