public class ModuleSpaceMemberships extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
ModuleSpaceMemberships.Async
Handler for asynchronous requests.
|
| Constructor and Description |
|---|
ModuleSpaceMemberships(retrofit2.Retrofit retrofit,
Executor callbackExecutor,
String spaceId,
String environmentId,
boolean environmentIdConfigured)
Create a new membership module.
|
| Modifier and Type | Method and Description |
|---|---|
ModuleSpaceMemberships.Async |
async()
Use all functionalities of this module asynchronously.
|
CMASpaceMembership |
create(CMASpaceMembership membership)
Create a new membership.
|
CMASpaceMembership |
create(String spaceId,
CMASpaceMembership membership)
Create a new membership.
|
protected ServiceSpaceMemberships |
createService(retrofit2.Retrofit retrofit)
Initialize retrofit with the current service.
|
int |
delete(CMASpaceMembership membership)
Delete the given membership instance.
|
CMAArray<CMASpaceMembership> |
fetchAll()
Fetch all memberships of the configured space.
|
CMAArray<CMASpaceMembership> |
fetchAll(Map<String,String> query)
Fetch all memberships of the configured space.
|
CMAArray<CMASpaceMembership> |
fetchAll(String spaceId)
Fetch all memberships of the given space.
|
CMAArray<CMASpaceMembership> |
fetchAll(String spaceId,
Map<String,String> query)
Fetch all memberships of this space.
|
CMASpaceMembership |
fetchOne(String membershipId)
Fetches one space membership by its id from Contentful.
|
CMASpaceMembership |
fetchOne(String spaceId,
String membershipId)
Fetches one space membership by its id from Contentful.
|
CMASpaceMembership |
update(CMASpaceMembership membership)
Update the given membership instance on Contentful.
|
public ModuleSpaceMemberships(retrofit2.Retrofit retrofit,
Executor callbackExecutor,
String spaceId,
String environmentId,
boolean environmentIdConfigured)
retrofit - the retrofit instance to be used to create the service.callbackExecutor - to tell on which thread it should run.spaceId - the id of the space to be used if not specified in the module
call.environmentId - the id of the environment used, if not specified before.environmentIdConfigured - internal helper to see if environment was set.protected ServiceSpaceMemberships createService(retrofit2.Retrofit retrofit)
retrofit - the instance to use the service with.public ModuleSpaceMemberships.Async async()
public CMAArray<CMASpaceMembership> fetchAll()
IllegalArgumentException - if configured spaceId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAArray<CMASpaceMembership> fetchAll(String spaceId)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
spaceId - the space identifier identifying the space.IllegalArgumentException - if spaceId is null.public CMAArray<CMASpaceMembership> fetchAll(Map<String,String> query)
query - define which space memberships to return.IllegalArgumentException - if spaceId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAArray<CMASpaceMembership> fetchAll(String spaceId, Map<String,String> query)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
spaceId - the space identifier identifying the space.query - define which space memberships to return.IllegalArgumentException - if spaceId is null.public CMASpaceMembership fetchOne(String membershipId)
membershipId - the id of the membership to be found.IllegalArgumentException - if configured space id is null.IllegalArgumentException - if membership id is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMASpaceMembership fetchOne(String spaceId, String membershipId)
spaceId - the space this membership is hosted by.membershipId - the id of the membership to be found.IllegalArgumentException - if space id is null.IllegalArgumentException - if membership id is null.public CMASpaceMembership create(CMASpaceMembership membership)
membership - the new membership to be created.IllegalArgumentException - if configured space id is null.IllegalArgumentException - if membership is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMASpaceMembership create(String spaceId, CMASpaceMembership membership)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
spaceId - the space id to host the membership.membership - the new membership to be created.IllegalArgumentException - if space id is null.IllegalArgumentException - if membership is null.public CMASpaceMembership update(CMASpaceMembership membership)
Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
membership - the membership fetched from Contentful, updated by caller, to be updated.IllegalArgumentException - if space id is null.IllegalArgumentException - if membership is null.IllegalArgumentException - if membership id is null.IllegalArgumentException - if membership does not have a version attached.public int delete(CMASpaceMembership membership)
Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
membership - the membership fetched from Contentful, updated by caller, to be deleted.IllegalArgumentException - if space id is null.IllegalArgumentException - if membership id is null.Copyright © 2026 Contentful, GmbH.. All rights reserved.