export type GetApiProjectsProjectIdModelEndpointsArgs = {project_id: number, region?: string | undefined}; export type GetApiProjectsProjectIdModelEndpointsOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * List existing model endpoints for all models in particular project * * GET /projects/{project_id}/model_endpoints */ export const getApiProjectsProjectIdModelEndpoints = async (args: GetApiProjectsProjectIdModelEndpointsArgs, options?: GetApiProjectsProjectIdModelEndpointsOptions) => { const {baseUrl = "http://localhost:8080/v1", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.region != null) query.append("region", String(args.region)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.project_id))}/model_endpoints${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 res.blob() };