deleteWebhook method

Future<void> deleteWebhook(
  1. String projectId,
  2. String webhookId
)

Corresponds to: DELETE /accounts/projects/{project_id}/webhooks/{webhook_id} Typically returns 200 or 204 on success (no JSON body).

Implementation

Future<void> deleteWebhook(String projectId, String webhookId) async {
  final uri = Uri.parse('$baseUrl/accounts/projects/$projectId/webhooks/$webhookId');
  final response = await http.delete(uri, headers: _getHeaders());

  if (response.statusCode >= 400) {
    throw MeshagentException(
      'Failed to delete project webhook. '
      'Status code: ${response.statusCode}, body: ${response.body}',
    );
  }
  // 200 or 204 on success, no body to parse
  return;
}