public class ModuleSpaceMemberships
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
ModuleSpaceMemberships.Async
Handler for asynchronous requests.
|
| Constructor and Description |
|---|
ModuleSpaceMemberships(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor,
java.lang.String spaceId,
java.lang.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(java.lang.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(java.util.Map<java.lang.String,java.lang.String> query)
Fetch all memberships of the configured space.
|
CMAArray<CMASpaceMembership> |
fetchAll(java.lang.String spaceId)
Fetch all memberships of the given space.
|
CMAArray<CMASpaceMembership> |
fetchAll(java.lang.String spaceId,
java.util.Map<java.lang.String,java.lang.String> query)
Fetch all memberships of this space.
|
CMASpaceMembership |
fetchOne(java.lang.String membershipId)
Fetches one space membership by its id from Contentful.
|
CMASpaceMembership |
fetchOne(java.lang.String spaceId,
java.lang.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,
java.util.concurrent.Executor callbackExecutor,
java.lang.String spaceId,
java.lang.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()
java.lang.IllegalArgumentException - if configured spaceId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAArray<CMASpaceMembership> fetchAll(java.lang.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.java.lang.IllegalArgumentException - if spaceId is null.public CMAArray<CMASpaceMembership> fetchAll(java.util.Map<java.lang.String,java.lang.String> query)
query - define which space memberships to return.java.lang.IllegalArgumentException - if spaceId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMAArray<CMASpaceMembership> fetchAll(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.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.java.lang.IllegalArgumentException - if spaceId is null.public CMASpaceMembership fetchOne(java.lang.String membershipId)
membershipId - the id of the membership to be found.java.lang.IllegalArgumentException - if configured space id is null.java.lang.IllegalArgumentException - if membership id is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMASpaceMembership fetchOne(java.lang.String spaceId, java.lang.String membershipId)
spaceId - the space this membership is hosted by.membershipId - the id of the membership to be found.java.lang.IllegalArgumentException - if space id is null.java.lang.IllegalArgumentException - if membership id is null.public CMASpaceMembership create(CMASpaceMembership membership)
membership - the new membership to be created.java.lang.IllegalArgumentException - if configured space id is null.java.lang.IllegalArgumentException - if membership is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMASpaceMembership create(java.lang.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.java.lang.IllegalArgumentException - if space id is null.java.lang.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.java.lang.IllegalArgumentException - if space id is null.java.lang.IllegalArgumentException - if membership is null.java.lang.IllegalArgumentException - if membership id is null.java.lang.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.java.lang.IllegalArgumentException - if space id is null.java.lang.IllegalArgumentException - if membership id is null.Copyright © 2019 Contentful, GmbH.. All Rights Reserved.