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 Subject = {id: string, email?: string | undefined, issuer: string}; export type StringList = Array; export type GroupSpec = {subjects?: Array | undefined, userIDs?: StringList | undefined, serviceAccountIDs: StringList, roleIDs: StringList}; export type GroupWrite = {metadata: ResourceMetadata, spec: GroupSpec}; export type UpdateApiApiV1OrganizationsOrganizationIDGroupsGroupidArgs = {body: GroupWrite}; export type UpdateApiApiV1OrganizationsOrganizationIDGroupsGroupidOptions = {baseUrl: string, oauth2Authentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update group * * PUT /api/v1/organizations/{organizationID}/groups/{groupid} */ export const updateApiApiV1OrganizationsOrganizationIDGroupsGroupid = async (args: UpdateApiApiV1OrganizationsOrganizationIDGroupsGroupidArgs, options: UpdateApiApiV1OrganizationsOrganizationIDGroupsGroupidOptions) => { 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))}/groups/${encodeURIComponent(String(args.groupid))}${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 };