export type GetApihttpLocalhost8000ProjectIdVolumesVolumeIdExportExtensionArgs = {project_id: string, volume_id: string, extension: string}; export type GetApihttpLocalhost8000ProjectIdVolumesVolumeIdExportExtensionOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Export volume as a triangle mesh file. * * GET http://localhost:8000/{project_id}/volumes/{volume_id}/export\.{extension} */ export const getApihttpLocalhost8000ProjectIdVolumesVolumeIdExportExtension = async (args: GetApihttpLocalhost8000ProjectIdVolumesVolumeIdExportExtensionArgs, options?: GetApihttpLocalhost8000ProjectIdVolumesVolumeIdExportExtensionOptions) => { const {baseUrl = "http://localhost:8000", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}http://localhost:8000/${encodeURIComponent(String(args.project_id))}/volumes/${encodeURIComponent(String(args.volume_id))}/export\\.${encodeURIComponent(String(args.extension))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };