()
| 33 | const controlClient = new StorageControlClient(); |
| 34 | |
| 35 | async function callCreateFolder() { |
| 36 | const bucketPath = controlClient.bucketPath('_', bucketName); |
| 37 | |
| 38 | // Create the request |
| 39 | const request = { |
| 40 | parent: bucketPath, |
| 41 | folderId: folderName, |
| 42 | }; |
| 43 | |
| 44 | // Run request |
| 45 | const [response] = await controlClient.createFolder(request); |
| 46 | console.log(`Created folder: ${response.name}.`); |
| 47 | } |
| 48 | |
| 49 | callCreateFolder(); |
| 50 | // [END storage_control_create_folder] |