export type CreateApiV1OrgRolesArgs = {body: {name: string, 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 CreateApiV1OrgRolesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create org role * * POST /v1/org-roles */ export const createApiV1OrgRoles = async (args: CreateApiV1OrgRolesArgs, options?: CreateApiV1OrgRolesOptions) => { 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${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };