WebhookInteractionCompletedEvent.fromJson constructor

WebhookInteractionCompletedEvent.fromJson(
  1. Map<String, dynamic> json
)

Creates a WebhookInteractionCompletedEvent from JSON.

Implementation

factory WebhookInteractionCompletedEvent.fromJson(Map<String, dynamic> json) {
  if (json['type'] != 'interaction.completed') {
    throw FormatException(
      'Expected type "interaction.completed" but got "${json['type']}"',
    );
  }
  return WebhookInteractionCompletedEvent(
    id: _requireDataId(json, 'WebhookInteractionCompletedEvent'),
    version: json['version'] as String?,
    timestamp: _readTimestamp(json),
  );
}