diff --git a/lib/models/BucketInfo.js b/lib/models/BucketInfo.js index d32821791..75175791d 100644 --- a/lib/models/BucketInfo.js +++ b/lib/models/BucketInfo.js @@ -11,7 +11,7 @@ const NotificationConfiguration = require('./NotificationConfiguration'); // WHEN UPDATING THIS NUMBER, UPDATE BucketInfoModelVersion.md CHANGELOG // BucketInfoModelVersion.md can be found in documentation/ at the root // of this repository -const modelVersion = 9; +const modelVersion = 14; class BucketInfo { /** @@ -663,6 +663,15 @@ class BucketInfo { getUid() { return this._uid; } + /** + * Set unique id of bucket. + * @param {string} uid - unique identifier for the bucket + * @return {BucketInfo} - bucket info instance + */ + setUid(uid) { + this._uid = uid; + return this; + } /** * Check if the bucket is an NFS bucket. * @return {boolean} - Wether the bucket is NFS or not diff --git a/tests/unit/models/BucketInfo.js b/tests/unit/models/BucketInfo.js index 7b80cd9b7..7863406c0 100644 --- a/tests/unit/models/BucketInfo.js +++ b/tests/unit/models/BucketInfo.js @@ -624,6 +624,12 @@ Object.keys(acl).forEach( assert.deepStrictEqual( dummyBucket.getNotificationConfiguration(), newNotifConfig); }); + it('setUid should set bucket uid', () => { + const testUid = '7751ec04-da87-44a1-99b4-95ebb345d40e'; + dummyBucket.setUid(testUid); + assert.deepStrictEqual( + dummyBucket.getUid(), testUid); + }); }); }) );