export type CreateApihttpLocalhost8000ProjectIdVolumesEntitiesArgs = {project_id: string, volume_ids?: string | undefined}; export type CreateApihttpLocalhost8000ProjectIdVolumesEntitiesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve a mapping of volume IDs to entity (class instance) IDs. * * POST http://localhost:8000/{project_id}/volumes/entities/ */ export const createApihttpLocalhost8000ProjectIdVolumesEntities = async (args: CreateApihttpLocalhost8000ProjectIdVolumesEntitiesArgs, options?: CreateApihttpLocalhost8000ProjectIdVolumesEntitiesOptions) => { const {baseUrl = "http://localhost:8000", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.volume_ids != null) query.append("volume_ids", String(args.volume_ids)) const url = `${baseUrl.replace(/\/+$/, '')}http://localhost:8000/${encodeURIComponent(String(args.project_id))}/volumes/entities/${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 };