export type SetNestedGroupsIn = {child_group_uuids: Array}; export type PatchApiV1AdminUserGroupsGroupUuidNestedArgs = {group_uuid: string, body: SetNestedGroupsIn}; export type PatchApiV1AdminUserGroupsGroupUuidNestedOptions = {baseUrl?: string | undefined, AdminApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set Nested Groups Admin * * PATCH /v1/admin/user-groups/{group_uuid}/nested */ export const patchApiV1AdminUserGroupsGroupUuidNested = async (args: PatchApiV1AdminUserGroupsGroupUuidNestedArgs, options?: PatchApiV1AdminUserGroupsGroupUuidNestedOptions) => { const {baseUrl = "https://api.mistral.ai", fetch: fetchFn = fetch, AdminApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (AdminApiKey !== undefined) headers.set('authorization', `Bearer ${AdminApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/admin/user-groups/${encodeURIComponent(String(args.group_uuid))}/nested${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 };