export type DeleteApiV1TwitterStreamWebhooksWebhookIdArgs = {webhook_id: string}; export type DeleteApiV1TwitterStreamWebhooksWebhookIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete webhook * * DELETE /v1/twitter/stream/webhooks/{webhook_id} */ export const deleteApiV1TwitterStreamWebhooksWebhookId = async (args: DeleteApiV1TwitterStreamWebhooksWebhookIdArgs, options?: DeleteApiV1TwitterStreamWebhooksWebhookIdOptions) => { const {baseUrl = "https://scrapebadger.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("x-api-key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/twitter/stream/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 };