- Source:
Space instances.
Methods
(static) delete() → {Promise}
- Source:
Deletes the space
Example
const contentful = require('contentful-management')
const client = contentful.createClient({
accessToken: '<content_management_api_key>'
})
client.getSpace('<space_id>')
.then((space) => space.delete())
.then(() => console.log('Space deleted.'))
.catch(console.error)
Returns:
Promise for the deletion. It contains no data, but the Promise error case should be handled.
- Type
- Promise
(static) update() → {Promise.<Space.Space>}
- Source:
Updates the space
Example
const contentful = require('contentful-management')
const client = contentful.createClient({
accessToken: '<content_management_api_key>'
})
client.getSpace('<space_id>')
.then((space) => {
space.name = 'New name'
return space.update()
})
.then((space) => console.log(`Space ${space.sys.id} renamed.`)
.catch(console.error)
Returns:
Promise for the updated space.
- Type
- Promise.<Space.Space>
Type Definitions
Space
- Source:
Properties:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
sys |
Object | System metadata
Properties
|
|||||||||
name |
string | Space name | |||||||||
toPlainObject() |
function | Returns this Space as a plain JS object |
SpaceCollection
- Source:
Properties:
Name | Type | Description |
---|---|---|
total |
number | |
skip |
number | |
limit |
number | |
items |
Array.<Space.Space> | |
toPlainObject() |
function | Returns this Space collection as a plain JS object |