export type WorkspaceRole = 'A' | 'M'; export type StaticWorkspaceRoles = 'd7ea77c5-9260-41d0-ab26-52b5add3ee56' | '48436751-ee56-44bd-8a2d-712233977821' | '375cd0db-3bbe-4b79-80f3-954ccf04f3d1' | '578584f1-4319-4c88-9948-38a5184483b6' | 'd79b3027-4eb2-4521-8722-825acfee7d8b' | '252a0825-40b9-4b98-be80-7658956f13e9' | '17aa61c5-1c61-477e-a40a-e52c8ccd74b9' | '348fc8da-f6da-4464-ad3e-af7bc137e221' | 'b23cd6e0-91cd-4a8a-9869-b30366bf3966' | '731eb2be-a74f-4070-b797-35bf7009e553' | 'ff86d432-7f27-47f8-b02f-b5c102ef6a55' | '0f9acbf6-93b5-42c7-a227-fc7652755f65' | '94ef59cf-56bf-4383-9dd6-1fee77d370af' | '7e69e493-caf6-4671-af60-84951754d9fc' | 'b23cd6e0-91cd-4a8a-9869-b30366bf3966'; export type AdminProvisionGroupToWorkspaceIn = {user_group_uuid: string, workspace_uuid: string, workspace_role?: (WorkspaceRole | StaticWorkspaceRoles | null) | undefined, workspace_role_name?: ('billing' | 'user' | 'contributor' | 'dev' | 'dev_contributor' | 'mistral_code_user' | 'cloud_user' | 'mistral_cloud_admin' | 'workspace_contributor' | 'workspace_admin' | 'observability_viewer' | 'workflow_executor' | 'secret_revealer' | 'member' | null) | undefined}; export type CreateApiV1AdminUserGroupsProvisionWorkspaceArgs = {body: AdminProvisionGroupToWorkspaceIn}; export type CreateApiV1AdminUserGroupsProvisionWorkspaceOptions = {baseUrl?: string | undefined, AdminApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Provision Group To Workspace * * POST /v1/admin/user-groups/provision-workspace */ export const createApiV1AdminUserGroupsProvisionWorkspace = async (args: CreateApiV1AdminUserGroupsProvisionWorkspaceArgs, options?: CreateApiV1AdminUserGroupsProvisionWorkspaceOptions) => { 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/provision-workspace${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 };