- Source:
TeamMembership instances
Type Definitions
TeamMembership
- Source:
Properties:
Name | Type | Description |
---|---|---|
sys |
Meta.Sys | System metadata |
admin |
boolean | User is an admin |
toPlainObject() |
function | Returns this Team Membership as a plain JS object |
TeamMembershipCollection
- Source:
Properties:
Name | Type | Description |
---|---|---|
total |
number | |
limit |
number | |
skip |
number | |
sys |
Object.<{type: "Array"}> | |
items |
Array.<TeamMembership.TeamMembership> | |
toPlainObject() |
function | Returns the collection 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.getOrganization('organizationId')
.then(org => org.getTeamMembership('teamId', 'teamMembershipId'))
.then((teamMembership) => {
teamMembership.delete();
})
.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.<TeamMembership>}
- 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.getOrganization('organizationId')
.then(org => org.getTeamMembership('teamId', 'teamMembershipId'))
.then((teamMembership) => {
teamMembership.admin = true;
teamMembership.update();
})
.catch(console.error)
Returns:
Object returned from the server with updated changes.
- Type
- Promise.<TeamMembership>