export type DeleteApiV3TopicsTopicIdArgs = {topicId: number}; export type DeleteApiV3TopicsTopicIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * DELETE /v3/topics/{topicId} */ export const deleteApiV3TopicsTopicId = async (args: DeleteApiV3TopicsTopicIdArgs, options: DeleteApiV3TopicsTopicIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v3/topics/${encodeURIComponent(String(args.topicId))}${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 };