Description Format Fields Methods Initialization See Also Examples
Class representing an item (file or folder) in a OneDrive or SharePoint document library.
An R6 object of class ms_drive_item
, inheriting from ms_object
.
token
: The token used to authenticate with the Graph host.
tenant
: The Azure Active Directory tenant for the parent drive.
type
: always "drive item" for a drive item object.
properties
: The item properties (metadata).
new(...)
: Initialize a new object. Do not call this directly; see 'Initialization' below.
delete(confirm=TRUE)
: Delete this item. By default, ask for confirmation first.
update(...)
: Update the item's properties (metadata) in Microsoft Graph.
do_operation(...)
: Carry out an arbitrary operation on the item.
sync_fields()
: Synchronise the R object with the item metadata in Microsoft Graph.
open()
: Opens the item in your browser.
Creating new objects of this class should be done via the get_item_properties
method of the ms_drive class. Calling the new()
method for this class only constructs the R object; it does not call the Microsoft Graph API to retrieve or create the actual item.
ms_graph, ms_site, ms_drive
Microsoft Graph overview, OneDrive API reference
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
# personal OneDrive
gr2 <- get_graph_login("consumers")
me <- gr2$get_user()
mydrv <- me$get_drive()
myfile <- drv$get_item_properties("myfile.docx")
myfile$properties
# rename a file
myfile$update(name="newname.docx")
# open the file in the browser
myfile$open()
# delete the file (will ask for confirmation first)
myfile$delete()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.