NmWebhookDelivery.fromJson constructor

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

Reads the JSON shape {event, status, createdAt, httpStatus, attempts, nextAt, lastError}.

Implementation

factory NmWebhookDelivery.fromJson(Map<String, dynamic> j) => NmWebhookDelivery(
  event: '${j['event']}',
  status: j['status'] as String? ?? '',
  createdAt: j['createdAt']?.toString(),
  httpStatus: j['httpStatus'] as int?,
  attempts: j['attempts'] as int? ?? 0,
  nextAt: j['nextAt']?.toString(),
  lastError: j['lastError']?.toString(),
);