export type PatchApiV1OrgRolesRoleIdArgs = {roleId: string, body: {description?: string | undefined, permissions?: ({teamScope?: Array | undefined, projectScope?: Array | undefined, orgScope?: Array | undefined}) | undefined, restrictions?: ({enabled: boolean, teams?: (Array<{teamId: string, restrictions?: ({enabled: boolean, projects?: Array | undefined, restrictionMode?: ('in' | 'notIn') | undefined}) | undefined}>) | undefined}) | undefined, directoryGroups?: Array | undefined}}; export type PatchApiV1OrgRolesRoleIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update org role * * PATCH /v1/org-roles/{roleId} */ export const patchApiV1OrgRolesRoleId = async (args: PatchApiV1OrgRolesRoleIdArgs, options?: PatchApiV1OrgRolesRoleIdOptions) => { const {baseUrl = "https://placeholder/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/org-roles/${encodeURIComponent(String(args.roleId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };