()
| 31 | const controlClient = new StorageControlClient(); |
| 32 | |
| 33 | async function callListFolders() { |
| 34 | const bucketPath = controlClient.bucketPath('_', bucketName); |
| 35 | |
| 36 | // Create the request |
| 37 | const request = { |
| 38 | parent: bucketPath, |
| 39 | }; |
| 40 | |
| 41 | // Run request |
| 42 | const [folders] = await controlClient.listFolders(request); |
| 43 | for (const curFolder of folders) { |
| 44 | console.log(curFolder.name); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | callListFolders(); |
| 49 | // [END storage_control_list_folders] |