IPWorks Cloud 2020 Node.js Edition

Questions / Feedback?

UpdateSharedDrive Method

Updates a shared drive.

Syntax

googledrive.updateSharedDrive(sharedDriveId, newName, setRestrictions, unsetRestrictions, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method updates the name of and/or restrictions applied to the shared drive specified by SharedDriveId.

If the current user is allowed to rename the shared drive (i.e., if the SharedDriveCapabilities property has the 0x08000 flag set), then a new name can be provided using the NewName parameter. If the user is not allowed to rename the shared drive, or wishes to preserve its current name, pass empty string for NewName.

Similarly, if the current user is allowed to alter one or more of the shared drive's SharedDriveRestrictions (i.e., if the SharedDriveCapabilities property has the 0x00002, 0x00004, and/or 0x00010 flags set), then the desired restrictions can be set or unset by including their associated flags, listed below, in the values passed for the SetRestrictions and UnsetRestrictions parameters.

Hex Value Description
0x0001 Administrative privileges on the shared drive are required to modify restrictions.
0x0002 Readers and commenters cannot copy, print, or download files in the shared drive.
0x0004 Access to the shared drive, and its contents, is restricted to users in its domain.
0x0008 Access to items in the shared drive is restricted to its members.

Note that calls to this method will fail if:

  • A non-empty string is passed for NewName, but the current user isn't allowed to rename the shared drive.
  • The values passed for SetRestrictions and/or UnsetRestrictions contains any flag that corresponds to a restriction the current user isn't allowed to alter.
  • Any restriction flag appears in both SetRestrictions and UnsetRestrictions.

Changes requested using this method are "all-or-nothing"; e.g., if both a new name and a new set of restrictions are requested, but the current user isn't allowed to rename the shared drive, the entire request fails.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Node.js Edition - Version 20.0 [Build 8265]