export type DeleteApiDrivesDriveIdRootPathToItemContentArgs = {driveId: string, pathToItem: string, 'If-Match'?: string | undefined}; export type DeleteApiDrivesDriveIdRootPathToItemContentOptions = {baseUrl?: string | undefined, azureaadv2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete content for the navigation property children in drives * * DELETE /drives/{driveId}/root:{pathToItem}:/content */ export const deleteApiDrivesDriveIdRootPathToItemContent = async (args: DeleteApiDrivesDriveIdRootPathToItemContentArgs, options?: DeleteApiDrivesDriveIdRootPathToItemContentOptions) => { 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))}/root:${encodeURIComponent(String(args.pathToItem))}:/content${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 };