export type DeleteApiCompanyV1WebhooksWebhookIdArgs = {webhookId: number}; export type DeleteApiCompanyV1WebhooksWebhookIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete an Outgoing Webhook * * DELETE /company/v1/webhooks/{webhookId} */ export const deleteApiCompanyV1WebhooksWebhookId = async (args: DeleteApiCompanyV1WebhooksWebhookIdArgs, options: DeleteApiCompanyV1WebhooksWebhookIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/company/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 };