export type DeleteApiV1DimensionsDimensionIdArgs = {dimension_id: string}; export type DeleteApiV1DimensionsDimensionIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Dimension * * DELETE /v1/dimensions/{dimension_id} */ export const deleteApiV1DimensionsDimensionId = async (args: DeleteApiV1DimensionsDimensionIdArgs, options: DeleteApiV1DimensionsDimensionIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/dimensions/${encodeURIComponent(String(args.dimension_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 };