export type DeleteApiV10WebhookSubscribeIdArgs = {subscribeId: number, Authorization: string, 'Content-Type': string}; export type DeleteApiV10WebhookSubscribeIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Webhook * * DELETE /v1.0/webhook/{subscribeId} */ export const deleteApiV10WebhookSubscribeId = async (args: DeleteApiV10WebhookSubscribeIdArgs, options?: DeleteApiV10WebhookSubscribeIdOptions) => { const {baseUrl = "https://api.lofty.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1.0/webhook/${encodeURIComponent(String(args.subscribeId))}${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 };