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