Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TeamSpaceMembership

Hierarchy

Index

Properties

Methods

Properties

admin

admin: boolean

Is admin

roles

roles: { sys: MetaLinkProps }[]

Roles

sys

sys: MetaSysProps & { space: { sys: MetaLinkProps }; team: { sys: MetaLinkProps } }

System metadata

Methods

delete

  • delete(): Promise<void>
  • 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.getTeamSpaceMembership('<team_space_membership_id>'))
    .then((teamSpaceMembership) => teamSpaceMembership.delete())
    .then(() => console.log(`spaceMembership deleted.`))
    .catch(console.error)

    Returns Promise<void>

    Promise for the deletion. It contains no data, but the Promise error case should be handled.

toPlainObject

update

  • 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.getTeamSpaceMembership('team_space_membership_id'))
     .then((teamSpaceMembership) => {
       item.roles = [
         {
           sys: {
             type: 'Link',
             linkType: 'Role',
             id: 'role_id'
           }
         }
       ]
     })
     .then((spaceMembership) => console.log(`spaceMembership ${spaceMembership.sys.id} updated.`))
     .catch(console.error)

    Returns Promise<TeamSpaceMembership>

    Object returned from the server with updated changes.