Organization membership instances
Type Definitions
OrganizationMembership
Properties:
Name | Type | Description |
---|---|---|
sys |
Meta.Sys | System metadata |
role |
string | |
status |
boolean | User is an admin |
toPlainObject() |
function | Returns this Organization Membership as a plain JS object |
OrganizationMembershipCollection
Properties:
Name | Type | Description |
---|---|---|
total |
number | |
limit |
number | |
skip |
number | |
sys |
Object.<{type: "Array"}> | |
items |
Array.<OrganizationMembership.OrganizationMembership> | |
toPlainObject() |
function | Returns the collection as a plain JS object |
Methods
(static) delete() → {Promise}
Deletes this object on the server.
Example
const contentful = require('contentful-management')
const client = contentful.createClient({
accessToken: '<content_management_api_key>'
})
client.getOrganizations()
.then((organizations) => organizations.items[0])
.then(org => org.getOrganizationMembership('organizationMembership_id'))
.then((organizationMembership) => {
organizationMembership.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.<OrganizationMembership>}
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.getOrganizations()
.then((organizations) => organizations.items[0])
.then(org => org.getOrganizationMembership('organizationMembership_id'))
.then((organizationMembership) => {
organizationMembership.role = 'member';
organizationMembership.update();
})
.catch(console.error)
Returns:
Object returned from the server with updated changes.
- Type
- Promise.<OrganizationMembership>