export type UpdateApiRestRxVersionResetIdArgs = {version: string, id: string}; export type UpdateApiRestRxVersionResetIdOptions = {baseUrl?: string | undefined, apiKeyScheme?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset an Rx entry * * PUT /rest/rx/{version}/reset/{id} */ export const updateApiRestRxVersionResetId = async (args: UpdateApiRestRxVersionResetIdArgs, options?: UpdateApiRestRxVersionResetIdOptions) => { const {baseUrl = "https://api.seer.cancer.gov", fetch: fetchFn = fetch, apiKeyScheme} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKeyScheme !== undefined) headers.set("X-SEERAPI-Key", apiKeyScheme) const url = `${baseUrl.replace(/\/+$/, '')}/rest/rx/${encodeURIComponent(String(args.version))}/reset/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };