export type KubernetesLabelValue = string; export type Tag = {name: string, value: string}; export type TagList = Array; export type ResourceMetadata = {name: KubernetesLabelValue, description?: string | undefined, tags?: TagList | undefined}; export type GroupIDs = Array; export type ProjectSpec = {groupIDs: GroupIDs}; export type ProjectWrite = {metadata: ResourceMetadata, spec: ProjectSpec}; export type UpdateApiApiV1OrganizationsOrganizationIDProjectsProjectIDArgs = {body: ProjectWrite}; export type UpdateApiApiV1OrganizationsOrganizationIDProjectsProjectIDOptions = {baseUrl: string, oauth2Authentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update project * * PUT /api/v1/organizations/{organizationID}/projects/{projectID} */ export const updateApiApiV1OrganizationsOrganizationIDProjectsProjectID = async (args: UpdateApiApiV1OrganizationsOrganizationIDProjectsProjectIDArgs, options: UpdateApiApiV1OrganizationsOrganizationIDProjectsProjectIDOptions) => { const {baseUrl, fetch: fetchFn = fetch, oauth2Authentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2Authentication !== undefined) headers.set('authorization', `Bearer ${oauth2Authentication}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/organizations/${encodeURIComponent(String(args.organizationID))}/projects/${encodeURIComponent(String(args.projectID))}${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 };