MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / callRenameFolder

Function callRenameFolder

storage-control/renameFolder.js:39–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 const controlClient = new StorageControlClient();
38
39 async function callRenameFolder() {
40 const folderPath = controlClient.folderPath(
41 '_',
42 bucketName,
43 sourceFolderName
44 );
45
46 // Create the request
47 const request = {
48 name: folderPath,
49 destinationFolderId: destinationFolderName,
50 };
51
52 // Run request
53 await controlClient.renameFolder(request);
54 console.log(
55 `Renamed folder ${sourceFolderName} to ${destinationFolderName}.`
56 );
57 }
58
59 callRenameFolder();
60 // [END storage_control_rename_folder]

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected