-
diff --git a/docs/jsdoc/Folders.html b/docs/jsdoc/Folders.html
index 89b20eb1..e18aeed7 100644
--- a/docs/jsdoc/Folders.html
+++ b/docs/jsdoc/Folders.html
@@ -925,7 +925,7 @@
Parameters:
- Source:
@@ -2049,7 +2049,7 @@ Parameters:
- Source:
@@ -2346,7 +2346,7 @@ Properties
- Source:
@@ -3758,7 +3758,7 @@ Parameters:
- Source:
@@ -3994,7 +3994,7 @@ Parameters:
- Source:
@@ -4665,7 +4665,7 @@ Parameters:
- Source:
@@ -5000,7 +5000,7 @@ Properties
- Source:
@@ -5056,6 +5056,299 @@ Returns:
+
+
+
+
+
+
+
+
+ Sets metadata on a folder, overwriting any metadata that exists for the provided keys.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+ Attributes |
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ folderID |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ The folder to set metadata on |
+
+
+
+
+
+
+ scope |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ The scope of the metadata template |
+
+
+
+
+
+
+ template |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ The key of the metadata template |
+
+
+
+
+
+
+ metadata |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ The metadata to set |
+
+
+
+
+
+
+ callback |
+
+
+
+
+
+function
+
+
+
+ |
+
+
+
+
+ <optional>
+
+
+
+
+
+ |
+
+
+
+
+ Called with updated metadata if successful |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ A promise resolving to the updated metadata
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Promise.<Object>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
update(folderID, updates, callbackopt) → {Promise.<Object>}
@@ -5663,7 +5956,7 @@ Modules
-
diff --git a/docs/jsdoc/Groups.html b/docs/jsdoc/Groups.html
index a14d0c46..e79edf16 100644
--- a/docs/jsdoc/Groups.html
+++ b/docs/jsdoc/Groups.html
@@ -3445,7 +3445,7 @@
Modules
-
diff --git a/docs/jsdoc/LegalHoldPolicies.html b/docs/jsdoc/LegalHoldPolicies.html
index 9dbfca64..2d47afbd 100644
--- a/docs/jsdoc/LegalHoldPolicies.html
+++ b/docs/jsdoc/LegalHoldPolicies.html
@@ -3344,7 +3344,7 @@
Modules
-
diff --git a/docs/jsdoc/Metadata.html b/docs/jsdoc/Metadata.html
index be70feba..fe393049 100644
--- a/docs/jsdoc/Metadata.html
+++ b/docs/jsdoc/Metadata.html
@@ -3076,7 +3076,7 @@
Modules
-
diff --git a/docs/jsdoc/PagingIterator.html b/docs/jsdoc/PagingIterator.html
index dd1279cb..906836ec 100644
--- a/docs/jsdoc/PagingIterator.html
+++ b/docs/jsdoc/PagingIterator.html
@@ -608,7 +608,7 @@
Modules
-
diff --git a/docs/jsdoc/PersistentSession.html b/docs/jsdoc/PersistentSession.html
index 175333de..94bb5b2f 100644
--- a/docs/jsdoc/PersistentSession.html
+++ b/docs/jsdoc/PersistentSession.html
@@ -1120,7 +1120,7 @@
Modules
-
diff --git a/docs/jsdoc/RecentItems.html b/docs/jsdoc/RecentItems.html
index 942d240c..f690ff27 100644
--- a/docs/jsdoc/RecentItems.html
+++ b/docs/jsdoc/RecentItems.html
@@ -562,7 +562,7 @@
Modules
-
diff --git a/docs/jsdoc/RetentionPolicies.html b/docs/jsdoc/RetentionPolicies.html
index e0efe367..ffa87b3f 100644
--- a/docs/jsdoc/RetentionPolicies.html
+++ b/docs/jsdoc/RetentionPolicies.html
@@ -3369,7 +3369,7 @@
Modules
-
diff --git a/docs/jsdoc/Search.html b/docs/jsdoc/Search.html
index 2a8f9a14..86faf7bb 100644
--- a/docs/jsdoc/Search.html
+++ b/docs/jsdoc/Search.html
@@ -907,6 +907,80 @@
Properties
+
+
+
+ sort |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+ <optional>
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+ The field on which the results should be sorted, e.g. "modified_at" |
+
+
+
+
+
+
+ direction |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+ <optional>
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+ The sort direction: "ASC" for ascending and "DESC" for descending |
+
+
+
@@ -984,7 +1058,7 @@ Properties
- Source:
@@ -1056,7 +1130,7 @@ Modules
-
diff --git a/docs/jsdoc/SharedItems.html b/docs/jsdoc/SharedItems.html
index b2e15693..520f269f 100644
--- a/docs/jsdoc/SharedItems.html
+++ b/docs/jsdoc/SharedItems.html
@@ -499,7 +499,7 @@
Modules
-
diff --git a/docs/jsdoc/StoragePolicies.html b/docs/jsdoc/StoragePolicies.html
index d243a94e..4d7ab610 100644
--- a/docs/jsdoc/StoragePolicies.html
+++ b/docs/jsdoc/StoragePolicies.html
@@ -2182,7 +2182,7 @@
Modules
-
diff --git a/docs/jsdoc/Tasks.html b/docs/jsdoc/Tasks.html
index 32ff1610..5b7e8ab6 100644
--- a/docs/jsdoc/Tasks.html
+++ b/docs/jsdoc/Tasks.html
@@ -2874,7 +2874,7 @@
Modules
-
diff --git a/docs/jsdoc/TermsOfService.html b/docs/jsdoc/TermsOfService.html
index cb980777..87224770 100644
--- a/docs/jsdoc/TermsOfService.html
+++ b/docs/jsdoc/TermsOfService.html
@@ -2886,7 +2886,7 @@
Modules
-
diff --git a/docs/jsdoc/TokenManager.html b/docs/jsdoc/TokenManager.html
index 7b978810..076b7d88 100644
--- a/docs/jsdoc/TokenManager.html
+++ b/docs/jsdoc/TokenManager.html
@@ -1800,7 +1800,7 @@
Modules
-
diff --git a/docs/jsdoc/Trash.html b/docs/jsdoc/Trash.html
index 09558851..9e3b8c49 100644
--- a/docs/jsdoc/Trash.html
+++ b/docs/jsdoc/Trash.html
@@ -496,7 +496,7 @@
Modules
-
diff --git a/docs/jsdoc/Users.html b/docs/jsdoc/Users.html
index 2931c0cf..0dfe41e3 100644
--- a/docs/jsdoc/Users.html
+++ b/docs/jsdoc/Users.html
@@ -2406,7 +2406,7 @@
Modules
-
diff --git a/docs/jsdoc/WebLinks.html b/docs/jsdoc/WebLinks.html
index 9cbd49b8..6697d2ac 100644
--- a/docs/jsdoc/WebLinks.html
+++ b/docs/jsdoc/WebLinks.html
@@ -2388,7 +2388,7 @@
Modules
-
diff --git a/docs/jsdoc/Webhooks.html b/docs/jsdoc/Webhooks.html
index 95c7942d..31dfa534 100644
--- a/docs/jsdoc/Webhooks.html
+++ b/docs/jsdoc/Webhooks.html
@@ -2517,7 +2517,7 @@
Modules
-
diff --git a/docs/jsdoc/api-request-manager.js.html b/docs/jsdoc/api-request-manager.js.html
index 9e3c17d9..a22c8857 100644
--- a/docs/jsdoc/api-request-manager.js.html
+++ b/docs/jsdoc/api-request-manager.js.html
@@ -117,7 +117,7 @@
Modules
-
diff --git a/docs/jsdoc/api-request.js.html b/docs/jsdoc/api-request.js.html
index 5a539a35..0e6f187b 100644
--- a/docs/jsdoc/api-request.js.html
+++ b/docs/jsdoc/api-request.js.html
@@ -398,7 +398,7 @@
Modules
-
diff --git a/docs/jsdoc/box-client.js.html b/docs/jsdoc/box-client.js.html
index da8aeedf..d92cc9ee 100644
--- a/docs/jsdoc/box-client.js.html
+++ b/docs/jsdoc/box-client.js.html
@@ -833,7 +833,7 @@
Modules
-
diff --git a/docs/jsdoc/box-node-sdk.js.html b/docs/jsdoc/box-node-sdk.js.html
index 72a8a71b..782e6a1b 100644
--- a/docs/jsdoc/box-node-sdk.js.html
+++ b/docs/jsdoc/box-node-sdk.js.html
@@ -427,7 +427,7 @@
Modules
-
diff --git a/docs/jsdoc/chunked-uploader.js.html b/docs/jsdoc/chunked-uploader.js.html
index ba683e04..384da40b 100644
--- a/docs/jsdoc/chunked-uploader.js.html
+++ b/docs/jsdoc/chunked-uploader.js.html
@@ -420,7 +420,7 @@
Modules
-
diff --git a/docs/jsdoc/enterprise-event-stream.js.html b/docs/jsdoc/enterprise-event-stream.js.html
index b4080e11..c1c37492 100644
--- a/docs/jsdoc/enterprise-event-stream.js.html
+++ b/docs/jsdoc/enterprise-event-stream.js.html
@@ -277,7 +277,7 @@
Modules
-
diff --git a/docs/jsdoc/event-stream.js.html b/docs/jsdoc/event-stream.js.html
index e44383bb..15cb6537 100644
--- a/docs/jsdoc/event-stream.js.html
+++ b/docs/jsdoc/event-stream.js.html
@@ -372,7 +372,7 @@
Modules
-
diff --git a/docs/jsdoc/global.html b/docs/jsdoc/global.html
index 702fe67a..fa2cc80a 100644
--- a/docs/jsdoc/global.html
+++ b/docs/jsdoc/global.html
@@ -5783,7 +5783,7 @@
Modules
-
diff --git a/docs/jsdoc/index.html b/docs/jsdoc/index.html
index 17ebe6f6..73f4be38 100644
--- a/docs/jsdoc/index.html
+++ b/docs/jsdoc/index.html
@@ -3697,7 +3697,7 @@
Modules
-
diff --git a/docs/jsdoc/managers_collaboration-whitelist.js.html b/docs/jsdoc/managers_collaboration-whitelist.js.html
index 41df82ba..91a725ab 100644
--- a/docs/jsdoc/managers_collaboration-whitelist.js.html
+++ b/docs/jsdoc/managers_collaboration-whitelist.js.html
@@ -267,7 +267,7 @@
Modules
-
diff --git a/docs/jsdoc/managers_collaborations.js.html b/docs/jsdoc/managers_collaborations.js.html
index 6603e0e8..b38f620d 100644
--- a/docs/jsdoc/managers_collaborations.js.html
+++ b/docs/jsdoc/managers_collaborations.js.html
@@ -318,7 +318,7 @@
Modules
-
diff --git a/docs/jsdoc/managers_collections.js.html b/docs/jsdoc/managers_collections.js.html
index 4d48a29c..8e788720 100644
--- a/docs/jsdoc/managers_collections.js.html
+++ b/docs/jsdoc/managers_collections.js.html
@@ -110,7 +110,7 @@
Modules
-
diff --git a/docs/jsdoc/managers_comments.js.html b/docs/jsdoc/managers_comments.js.html
index 734e74a7..414183cb 100644
--- a/docs/jsdoc/managers_comments.js.html
+++ b/docs/jsdoc/managers_comments.js.html
@@ -233,7 +233,7 @@
Modules
-
diff --git a/docs/jsdoc/managers_device-pins.js.html b/docs/jsdoc/managers_device-pins.js.html
index 536c052f..2341a3f5 100644
--- a/docs/jsdoc/managers_device-pins.js.html
+++ b/docs/jsdoc/managers_device-pins.js.html
@@ -148,7 +148,7 @@
Modules
-
diff --git a/docs/jsdoc/managers_enterprise.js.html b/docs/jsdoc/managers_enterprise.js.html
index 4803b4f7..3d4d4a5c 100644
--- a/docs/jsdoc/managers_enterprise.js.html
+++ b/docs/jsdoc/managers_enterprise.js.html
@@ -264,7 +264,7 @@
Modules
-
diff --git a/docs/jsdoc/managers_events.js.html b/docs/jsdoc/managers_events.js.html
index b5214f2e..cfcb4672 100644
--- a/docs/jsdoc/managers_events.js.html
+++ b/docs/jsdoc/managers_events.js.html
@@ -321,7 +321,7 @@
Modules
-
diff --git a/docs/jsdoc/managers_files.js.html b/docs/jsdoc/managers_files.js.html
index 37973de8..8e242864 100644
--- a/docs/jsdoc/managers_files.js.html
+++ b/docs/jsdoc/managers_files.js.html
@@ -771,6 +771,37 @@
Source: managers/files.js
return this.client.wrapWithDefaultHandler(this.client.put)(apiPath, params, callback);
};
+/**
+ * Sets metadata on a file, overwriting any metadata that exists for the provided keys.
+ *
+ * @param {string} fileID - The file to set metadata on
+ * @param {string} scope - The scope of the metadata template
+ * @param {string} template - The key of the metadata template
+ * @param {Object} metadata - The metadata to set
+ * @param {Function} [callback] - Called with updated metadata if successful
+ * @returns {Promise<Object>} A promise resolving to the updated metadata
+ */
+Files.prototype.setMetadata = function(fileID, scope, template, metadata, callback) {
+
+ return this.addMetadata(fileID, scope, template, metadata)
+ .catch(err => {
+
+ if (err.statusCode !== 409) {
+ throw err;
+ }
+
+ // Metadata already exists on the file; update instead
+ var updates = Object.keys(metadata).map(key => ({
+ op: 'add',
+ path: `/${key}`,
+ value: metadata[key],
+ }));
+
+ return this.updateMetadata(fileID, scope, template, updates);
+ })
+ .asCallback(callback);
+};
+
/**
* Deletes a metadata template from a file.
*
@@ -1592,7 +1623,7 @@ Modules
-
diff --git a/docs/jsdoc/managers_folders.js.html b/docs/jsdoc/managers_folders.js.html
index 6d68f064..783f392d 100644
--- a/docs/jsdoc/managers_folders.js.html
+++ b/docs/jsdoc/managers_folders.js.html
@@ -396,6 +396,37 @@
Source: managers/folders.js
return this.client.wrapWithDefaultHandler(this.client.put)(apiPath, params, callback);
};
+/**
+ * Sets metadata on a folder, overwriting any metadata that exists for the provided keys.
+ *
+ * @param {string} folderID - The folder to set metadata on
+ * @param {string} scope - The scope of the metadata template
+ * @param {string} template - The key of the metadata template
+ * @param {Object} metadata - The metadata to set
+ * @param {Function} [callback] - Called with updated metadata if successful
+ * @returns {Promise<Object>} A promise resolving to the updated metadata
+ */
+Folders.prototype.setMetadata = function(folderID, scope, template, metadata, callback) {
+
+ return this.addMetadata(folderID, scope, template, metadata)
+ .catch(err => {
+
+ if (err.statusCode !== 409) {
+ throw err;
+ }
+
+ // Metadata already exists on the file; update instead
+ var updates = Object.keys(metadata).map(key => ({
+ op: 'add',
+ path: `/${key}`,
+ value: metadata[key],
+ }));
+
+ return this.updateMetadata(folderID, scope, template, updates);
+ })
+ .asCallback(callback);
+};
+
/**
* Deletes a metadata template from a folder.
*
@@ -595,7 +626,7 @@ Modules