export type DeleteApiV2WebhookEndpointsWebhookEndpointIdOptions = {baseUrl?: string | undefined, httpBasic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete webhook endpoint * * DELETE /v2/webhook-endpoints/{webhookEndpointId} */ export const deleteApiV2WebhookEndpointsWebhookEndpointId = async (options?: DeleteApiV2WebhookEndpointsWebhookEndpointIdOptions) => { const {baseUrl = "https://api.prod.goaugment.com", fetch: fetchFn = fetch, httpBasic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpBasic !== undefined) headers.set('authorization', `Basic ${btoa(`${httpBasic.username}:${httpBasic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/webhook-endpoints/${encodeURIComponent(String(args.webhookEndpointId))}${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 };