Package com.contentful.java.cma
Class ModuleTags
- java.lang.Object
-
- com.contentful.java.cma.ModuleTags
-
public class ModuleTags extends java.lang.ObjectContent tags Module.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classModuleTags.AsyncAsync module.
-
Constructor Summary
Constructors Constructor Description ModuleTags(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)Create tags module.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModuleTags.Asyncasync()CMATagcreate(java.lang.String environmentId, java.lang.String spaceId, java.lang.String tagId, java.lang.String name, CMAVisibility visibility)Create an tag using the given tag id.protected com.contentful.java.cma.ServiceContentTagscreateService(retrofit2.Retrofit retrofit)java.lang.Integerdelete(java.lang.String spaceId, java.lang.String environmentId, java.lang.String tagId)Delete an tag.CMAArray<CMATag>fetchAll()Fetch all tags of the configured space.CMAArray<CMATag>fetchAll(java.lang.String spaceId, java.lang.String environmentId, java.util.Map<java.lang.String,java.lang.String> query)Fetch all tag of the given space with queryCMATagfetchOne(java.lang.String tagId)Fetch a tag with a givenenvironmentIdfrom the configured space.CMATagfetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String tagId)Fetch a tag with a givenenvironmentIdand space.CMATagupdate(java.lang.String name, java.lang.String tagId)Update a tag.
-
-
-
Constructor Detail
-
ModuleTags
public ModuleTags(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)Create tags module.- Parameters:
retrofit- the retrofit instance to be used to create the service.callbackExecutor- to tell on which thread it should run.spaceId- the space to be used when not given.environmentId- the environment to be used when not given.environmentIdConfigured- internal helper to see if environment was set.
-
-
Method Detail
-
createService
protected com.contentful.java.cma.ServiceContentTags createService(retrofit2.Retrofit retrofit)
-
create
public CMATag create(java.lang.String environmentId, java.lang.String spaceId, java.lang.String tagId, java.lang.String name, CMAVisibility visibility)
Create an tag using the given tag id.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String).- Returns:
CMATagresult instance- Throws:
java.lang.IllegalArgumentException- if space id is null.
-
delete
public java.lang.Integer delete(java.lang.String spaceId, java.lang.String environmentId, java.lang.String tagId)Delete an tag.- Returns:
- Integer representing the result (204, or an error code)
- Throws:
java.lang.IllegalArgumentException- if environment's space id is null.java.lang.IllegalArgumentException- if tag's id is null.
-
fetchAll
public CMAArray<CMATag> fetchAll()
Fetch all tags of the configured space.- Returns:
CMAArrayresult instance- Throws:
java.lang.IllegalArgumentException- if configured space id is null.- See Also:
CMAClient.Builder.setSpaceId(String)
-
fetchAll
public CMAArray<CMATag> fetchAll(java.lang.String spaceId, java.lang.String environmentId, java.util.Map<java.lang.String,java.lang.String> query)
Fetch all tag of the given space with queryThis method will override the configuration specified through
CMAClient.Builder.setSpaceId(String).- Parameters:
spaceId- space ID- Returns:
CMAArrayresult instance- Throws:
java.lang.IllegalArgumentException- if environment's space id is null.
-
fetchOne
public CMATag fetchOne(java.lang.String tagId)
Fetch a tag with a givenenvironmentIdfrom the configured space.- Parameters:
tagId- tag ID- Returns:
CMATagresult instance- Throws:
java.lang.IllegalArgumentException- if the configured space id is null.java.lang.IllegalArgumentException- if environment's id is null.- See Also:
CMAClient.Builder.setSpaceId(String)
-
fetchOne
public CMATag fetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String tagId)
Fetch a tag with a givenenvironmentIdand space.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String).- Parameters:
spaceId- space IDenvironmentId- environment ID- Returns:
CMATagresult instance- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if environment's id is null.
-
update
public CMATag update(java.lang.String name, java.lang.String tagId)
Update a tag.- Returns:
CMATagresult instance- Throws:
java.lang.IllegalArgumentException- if tag's name is null.java.lang.IllegalArgumentException- if tag's id is null.
-
async
public ModuleTags.Async async()
- Returns:
- a module with a set of asynchronous methods.
-
-