export type ProjectMetadata = {public?: string | undefined, enable_content_trust?: (string | null) | undefined, enable_content_trust_cosign?: (string | null) | undefined, prevent_vul?: (string | null) | undefined, severity?: (string | null) | undefined, auto_scan?: (string | null) | undefined, auto_sbom_generation?: (string | null) | undefined, reuse_sys_cve_allowlist?: (string | null) | undefined, retention_id?: (string | null) | undefined, proxy_speed_kb?: (string | null) | undefined, max_upstream_conn?: (string | null) | undefined, proxy_cache_local_on_not_found?: (string | null) | undefined}; export type CVEAllowlistItem = {cve_id?: string | undefined}; export type CVEAllowlist = {id?: number | undefined, project_id?: number | undefined, expires_at?: (number | null) | undefined, items?: Array | undefined, creation_time?: string | undefined, update_time?: string | undefined}; export type ProjectReq = {project_name?: string | undefined, public?: (boolean | null) | undefined, metadata?: ProjectMetadata | undefined, cve_allowlist?: CVEAllowlist | undefined, storage_limit?: (number | null) | undefined, registry_id?: (number | null) | undefined}; export type UpdateApiProjectsProjectNameOrIdArgs = {'X-Request-Id'?: string | undefined, 'X-Is-Resource-Name'?: boolean | undefined, project_name_or_id: string, body: ProjectReq}; export type UpdateApiProjectsProjectNameOrIdOptions = {baseUrl?: string | undefined, basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Update properties for a selected project. * * PUT /projects/{project_name_or_id} */ export const updateApiProjectsProjectNameOrId = async (args: UpdateApiProjectsProjectNameOrIdArgs, options?: UpdateApiProjectsProjectNameOrIdOptions) => { const {baseUrl = "http://localhost/api/v2.0", fetch: fetchFn = fetch, basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Request-Id'] != null) headers.set("X-Request-Id", String(args['X-Request-Id'])) if (args['X-Is-Resource-Name'] != null) headers.set("X-Is-Resource-Name", String(args['X-Is-Resource-Name'])) if (basic !== undefined) headers.set('authorization', `Basic ${btoa(`${basic.username}:${basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.project_name_or_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };