export type DeleteApiV3WebhooksWebhookIdArgs = {'webhook-id': string}; export type DeleteApiV3WebhooksWebhookIdOptions = {baseUrl?: string | undefined, Basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete webhook * * DELETE /v3/webhooks/{webhook-id} */ export const deleteApiV3WebhooksWebhookId = async (args: DeleteApiV3WebhooksWebhookIdArgs, options?: DeleteApiV3WebhooksWebhookIdOptions) => { const {baseUrl = "https://www.polaraccesslink.com", fetch: fetchFn = fetch, Basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Basic !== undefined) headers.set('authorization', `Basic ${btoa(`${Basic.username}:${Basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v3/webhooks/${encodeURIComponent(String(args['webhook-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 };