export type UpdateApiV1TeamsTeamIdRolesArgs = {teamId: string, body: {name: string, description?: string | undefined, permissions?: ({teamScope?: Array | undefined, projectScope?: Array | undefined}) | undefined, restrictions?: ({enabled: boolean, projects?: Array | undefined, restrictionMode?: ('in' | 'notIn') | undefined}) | undefined}}; export type UpdateApiV1TeamsTeamIdRolesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create or update role * * PUT /v1/teams/{teamId}/roles */ export const updateApiV1TeamsTeamIdRoles = async (args: UpdateApiV1TeamsTeamIdRolesArgs, options?: UpdateApiV1TeamsTeamIdRolesOptions) => { 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/teams/${encodeURIComponent(String(args.teamId))}/roles${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 };