export type DeleteApiApiV1WebhooksWebhookIdArgs = {webhookId: number}; export type DeleteApiApiV1WebhooksWebhookIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Un-register a webhook * * DELETE /api/v1/webhooks/{webhookId} */ export const deleteApiApiV1WebhooksWebhookId = async (args: DeleteApiApiV1WebhooksWebhookIdArgs, options?: DeleteApiApiV1WebhooksWebhookIdOptions) => { const {baseUrl = "https://app.visotrust.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/webhooks/${encodeURIComponent(String(args.webhookId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };