Learn R Programming

Microsoft365R (version 1.0.0)

ms_site: Office 365 SharePoint site

Description

Class representing a SharePoint site.

Arguments

Format

An R6 object of class ms_site, inheriting from ms_object.

Fields

  • token: The token used to authenticate with the Graph host.

  • tenant: The Azure Active Directory tenant for this site.

  • type: always "site" for a site object.

  • properties: The site properties.

Methods

  • new(...): Initialize a new site object. Do not call this directly; see 'Initialization' below.

  • delete(confirm=TRUE): Delete a site. By default, ask for confirmation first.

  • update(...): Update the site metadata in Microsoft Graph.

  • do_operation(...): Carry out an arbitrary operation on the site.

  • sync_fields(): Synchronise the R object with the site metadata in Microsoft Graph.

  • list_drives(): List the drives (shared document libraries) associated with this site.

  • get_drive(drive_id): Retrieve a shared document library for this site. If the ID is not specified, this returns the default document library.

  • list_subsites(): List the subsites of this site.

  • get_lists(): Returns the lists that are part of this site.

  • get_list(list_name, list_id): Returns a specific list, either by name or ID.

Initialization

Creating new objects of this class should be done via the get_sharepoint_site method of the ms_graph or az_group classes. 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 site.

See Also

ms_graph, ms_drive, az_user

Microsoft Graph overview, SharePoint sites API reference

Examples

Run this code
# NOT RUN {
site <- sharepoint_site("https://mycompany.sharepoint.com/sites/my-site-name")
site$list_drives()
site$get_drive()

# }

Run the code above in your browser using DataLab