SpaceMembership

SpaceMembership

Source:
Space Membership instances

Type Definitions

SpaceMembership

Source:
Properties:
Name Type Description
sys Meta.Sys System metadata
name string
admin boolean User is an admin
roles array Array of Role Links
toPlainObject() function Returns this Space Membership as a plain JS object

Methods

(static) delete() → {Promise}

Source:
Deletes this object on the server.
Example
const contentful = require('contentful-management')

const client = contentful.createClient({
  accessToken: '<content_management_api_key>'
})

client.getSpace('<space_id>')
.then((space) => space.getSpaceMembership('<spaceMembership_id>'))
.then((spaceMembership) => spaceMembership.delete())
.then(() => console.log(`spaceMembership 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.<SpaceMembership>}

Source:
Sends an update to the server with any changes made to the object's properties
Example
const contentful = require('contentful-management')

const client = contentful.createClient({
  accessToken: '<content_management_api_key>'
})

client.getSpace('<space_id>')
.then((space) => space.getSpaceMembership('<spaceMembership_id>'))
.then((spaceMembership) => {
 spaceMembership.name = 'new space membership name'
})
.then((spaceMembership) => console.log(`spaceMembership ${spaceMembership.sys.id} updated.`))
.catch(console.error)
Returns:
Object returned from the server with updated changes.
Type
Promise.<SpaceMembership>