export type DeleteApiApiV3WebhookEndpointsIdArgs = {id: number}; export type DeleteApiApiV3WebhookEndpointsIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a webhook endpoint * * DELETE /api/v3/webhook_endpoints/{id}/ * * Also accepts auth: cookieAuth */ export const deleteApiApiV3WebhookEndpointsId = async (args: DeleteApiApiV3WebhookEndpointsIdArgs, options?: DeleteApiApiV3WebhookEndpointsIdOptions) => { const {baseUrl = "https://embedded.improvado.io", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/webhook_endpoints/${encodeURIComponent(String(args.id))}/${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 };