Webhook.fromMap constructor

Webhook.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory Webhook.fromMap(
  Map<String, dynamic> map,
) {
  map = {
    '\$id': "",
    '\$createdAt': "",
    '\$updatedAt': "",
    'name': "",
    'description': "",
    'url': "",
    'events': [],
    'tls': true,
    'authUsername': "",
    'authPassword': "",
    'secret': "",
    'enabled': true,
    'logs': "",
    'attempts': 0,
    ...map,
  };

  return Webhook(
    $id: map['\$id'].toString(),
    $createdAt: map['\$createdAt'].toString(),
    $updatedAt: map['\$updatedAt'].toString(),
    name: map['name'].toString(),
    description: map['description'].toString(),
    url: map['url'].toString(),
    events: List.from(map['events'] ?? []),
    tls: map['tls'],
    authUsername: map['authUsername'].toString(),
    authPassword: map['authPassword'].toString(),
    secret: map['secret'].toString(),
    enabled: map['enabled'],
    logs: map['logs'].toString(),
    attempts: map['attempts'],
  );
}