export type CreateApiTopicsTopicIdHistoryStopArgs = {topicId: number}; export type CreateApiTopicsTopicIdHistoryStopOptions = {baseUrl?: string | undefined, ApiKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Stop history collection * * POST /topics/{topicId}/history/stop * * Also accepts auth: ApiKeyQuery */ export const createApiTopicsTopicIdHistoryStop = async (args: CreateApiTopicsTopicIdHistoryStopArgs, options?: CreateApiTopicsTopicIdHistoryStopOptions) => { const {baseUrl = "https://api.youscan.io/api/external", fetch: fetchFn = fetch, ApiKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyHeader !== undefined) headers.set("X-API-KEY", ApiKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/topics/${encodeURIComponent(String(args.topicId))}/history/stop${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };