public class CMASpaceMembership extends CMAResource
Constructor and Description |
---|
CMASpaceMembership()
Create a new membership.
|
Modifier and Type | Method and Description |
---|---|
CMASpaceMembership |
addRole(CMALink role)
Add a role to the list of roles.
|
java.lang.String |
getEmail()
Get email of membership.
|
java.util.List<CMALink> |
getRoles() |
CMALink |
getUser() |
boolean |
isAdmin() |
CMASpaceMembership |
setAdmin(boolean admin)
Update admin flag.
|
CMASpaceMembership |
setEmail(java.lang.String email)
Set the email address when creating a new membership.
|
CMASpaceMembership |
setId(java.lang.String id)
Sets the id of this space membership.
|
CMASpaceMembership |
setIsAdmin(boolean admin)
Update administrator state of this membership.
|
CMASpaceMembership |
setRoles(CMALink... roles)
Replace all roles with the given argument.
|
CMASpaceMembership |
setSpaceId(java.lang.String id)
Sets the id of this space memberships space.
|
CMASpaceMembership |
setUser(CMALink user)
Update or set the user for this membership.
|
CMASpaceMembership |
setVersion(java.lang.Integer version)
Set the version of this space membership.
|
java.lang.String |
toString() |
getEnvironmentId, getId, getSpaceId, getSystem, getVersion, isArchived, isPublished, setEnvironmentId, setSystem
public CMALink getUser()
public CMASpaceMembership setUser(CMALink user)
user
- which user should be part of this membership?public java.util.List<CMALink> getRoles()
public CMASpaceMembership setRoles(CMALink... roles)
roles
- the roles to be used.java.lang.IllegalArgumentException
- if roles is null.java.lang.IllegalArgumentException
- if roles does not contain any elements.public CMASpaceMembership addRole(CMALink role)
role
- the role to be used, needs to be not null.java.lang.IllegalArgumentException
- if role is null.public java.lang.String getEmail()
This email will only be available, if this membership is created a new. You will never see this email address coming back from memberships.
public CMASpaceMembership setEmail(java.lang.String email)
email
- to be used for inviting people.java.lang.IllegalArgumentException
- if email is null.java.lang.IllegalArgumentException
- if email does not contain an '@'.public boolean isAdmin()
public CMASpaceMembership setAdmin(boolean admin)
If you set this flag to false, you have to provide some roles this membership should be part of.
admin
- true, if this membership should be an admin.setRoles(CMALink...)
,
addRole(CMALink)
public CMASpaceMembership setIsAdmin(boolean admin)
admin
- state of this membership.public CMASpaceMembership setId(java.lang.String id)
setId
in class CMAResource
id
- to be set.public CMASpaceMembership setVersion(java.lang.Integer version)
setVersion
in class CMAResource
version
- the version to be set.public CMASpaceMembership setSpaceId(java.lang.String id)
setSpaceId
in class CMAResource
id
- the id to be set.setId(String)
public java.lang.String toString()
toString
in class CMAResource
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.