export type SensitivityLabelAssignmentMethod = 'standard' | 'privileged' | 'auto' | 'unknownFutureValue'; export type DriveItemIdMicrosoftGraphAssignSensitivityLabelBody = {sensitivityLabelId?: (string | null) | undefined, assignmentMethod?: SensitivityLabelAssignmentMethod | undefined, justificationText?: (string | null) | undefined} | {[key: string]: unknown}; export type CreateApiDrivesDriveIdRootMicrosoftGraphAssignSensitivityLabelArgs = {driveId: string, body: DriveItemIdMicrosoftGraphAssignSensitivityLabelBody}; export type CreateApiDrivesDriveIdRootMicrosoftGraphAssignSensitivityLabelOptions = {baseUrl?: string | undefined, azureaadv2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Invoke action assignSensitivityLabel * * POST /drives/{driveId}/root/microsoft.graph.assignSensitivityLabel */ export const createApiDrivesDriveIdRootMicrosoftGraphAssignSensitivityLabel = async (args: CreateApiDrivesDriveIdRootMicrosoftGraphAssignSensitivityLabelArgs, options?: CreateApiDrivesDriveIdRootMicrosoftGraphAssignSensitivityLabelOptions) => { const {baseUrl = "https://graph.microsoft.com/v1.0", fetch: fetchFn = fetch, azureaadv2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (azureaadv2 !== undefined) headers.set('authorization', `Bearer ${azureaadv2}`) const url = `${baseUrl.replace(/\/+$/, '')}/drives/${encodeURIComponent(String(args.driveId))}/root/microsoft.graph.assignSensitivityLabel${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 };