export type DeleteApiDrivesDriveIdItemsDriveItemIdArgs = {driveId: string, driveItemId: string, 'If-Match'?: string | undefined}; export type DeleteApiDrivesDriveIdItemsDriveItemIdOptions = {baseUrl?: string | undefined, azureaadv2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete navigation property items for drives * * DELETE /drives/{driveId}/items/{driveItemId} */ export const deleteApiDrivesDriveIdItemsDriveItemId = async (args: DeleteApiDrivesDriveIdItemsDriveItemIdArgs, options?: DeleteApiDrivesDriveIdItemsDriveItemIdOptions) => { const {baseUrl = "https://graph.microsoft.com/v1.0", fetch: fetchFn = fetch, azureaadv2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['If-Match'] != null) headers.set("If-Match", String(args['If-Match'])) if (azureaadv2 !== undefined) headers.set('authorization', `Bearer ${azureaadv2}`) const url = `${baseUrl.replace(/\/+$/, '')}/drives/${encodeURIComponent(String(args.driveId))}/items/${encodeURIComponent(String(args.driveItemId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };