- Source:
Folders refer to Asset Folders.
Methods
(static) update() → {Promise.<Folder.Folder>}
- Source:
The Update Folder call lets you update the name and description of an existing Folder.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).asset().folder('uid').fetch()
.then((folder) => {
folder.name = 'My New folder'
return folder.update()
})
.then((folder) => console.log(folder))
Returns:
Promise for Folder instance
- Type
- Promise.<Folder.Folder>
(static) delete() → {Object}
- Source:
The Delete folder call will delete an existing folder from the stack.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).asset().folder('uid').delete()
.then((response) => console.log(response.notice))
Returns:
Response Object.
- Type
- Object
(static) fetch() → {Promise.<Folder.Folder>}
- Source:
The fetch an asset call returns comprehensive information about a specific version of an asset of a stack.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).asset().folder('uid').fetch()
.then((folder) => console.log(folder))
Returns:
Promise for Folder instance
- Type
- Promise.<Folder.Folder>
(static) create() → {Promise.<Folder.Folder>}
- Source:
The Create a folder into the assets.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
const asset = {name: 'My New contentType'}
client.stack().asset().folder().create({ asset })
.then((folder) => console.log(folder))
Returns:
Promise for Folder instance
- Type
- Promise.<Folder.Folder>