updateWebhook method

Future<InventoryWebhook> updateWebhook(
  1. String webhookId, {
  2. String? url,
  3. List<String>? events,
  4. bool? active,
  5. String? description,
  6. bool removeDescription = false,
})

Aendert nur die genannten Felder. removeDescription loescht die Beschreibung (am Draht description: null) und schliesst description aus.

Implementation

Future<InventoryWebhook> updateWebhook(
  String webhookId, {
  String? url,
  List<String>? events,
  bool? active,
  String? description,
  bool removeDescription = false,
}) async {
  const name = Aufrufe.updateWebhook;
  final id = kennung(name, 'webhookId', webhookId);
  if (removeDescription && description != null) {
    throw const KasseneckValidationError(name, 'description und removeDescription zugleich', 'request');
  }
  final params = <String, dynamic>{
    'webhookId': id,
    'url': ?url,
    if (events != null) 'events': [...events],
    'active': ?active,
    'description': ?description,
    if (removeDescription) 'description': null,
  };
  if (params.length == 1) throw const KasseneckValidationError(name, 'Aenderung nennt kein Feld', 'request');
  final daten = await _transport.call(name, params);
  return webhook(const Ort(name, 'webhook'), daten['webhook']);
}