public class ModuleLocales
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
ModuleLocales.Async
Handler for asynchronous requests.
|
| Constructor and Description |
|---|
ModuleLocales(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor)
Create a new locale module.
|
| Modifier and Type | Method and Description |
|---|---|
ModuleLocales.Async |
async()
Use all functionalities of this module asynchronously.
|
CMALocale |
create(java.lang.String spaceId,
CMALocale locale)
Create a new locale.
|
protected ServiceLocales |
createService(retrofit2.Retrofit retrofit)
Initialize retrofit with the current service.
|
int |
delete(java.lang.String spaceId,
CMALocale locale)
Delete the given locale instance.
|
CMAArray<CMALocale> |
fetchAll(java.lang.String spaceId)
Fetch all locales of this space.
|
CMAArray<CMALocale> |
fetchAll(java.lang.String spaceId,
java.util.Map<java.lang.String,java.lang.String> query)
Fetch specific locales of this space.
|
CMALocale |
fetchOne(java.lang.String spaceId,
java.lang.String localeId)
Fetches one locale by its id from Contentful.
|
CMALocale |
update(CMALocale locale)
Update the given locale instance on Contentful.
|
public ModuleLocales(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor)
retrofit - the retrofit instance to be used to create the service.callbackExecutor - to tell on which thread it should run.protected ServiceLocales createService(retrofit2.Retrofit retrofit)
retrofit - the instance to use the service with.public ModuleLocales.Async async()
public CMAArray<CMALocale> fetchAll(java.lang.String spaceId)
spaceId - the space identifier identifying the space.java.lang.IllegalArgumentException - if spaceId is null.public CMAArray<CMALocale> fetchAll(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.String> query)
spaceId - the space identifier identifying the space.query - the search criteria to search for.java.lang.IllegalArgumentException - if spaceId is null.public CMALocale fetchOne(java.lang.String spaceId, java.lang.String localeId)
spaceId - the space this locale is hosted by.localeId - the id of the locale to be found.java.lang.IllegalArgumentException - if space id is null.java.lang.IllegalArgumentException - if locale id is null.public CMALocale create(java.lang.String spaceId, CMALocale locale)
spaceId - the space id to host the locale.locale - the new locale to be created.java.lang.IllegalArgumentException - if space id is null.java.lang.IllegalArgumentException - if locale is null.public CMALocale update(CMALocale locale)
Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
locale - the locale fetched from Contentful, updated by caller, to be updated.java.lang.IllegalArgumentException - if space id is null.java.lang.IllegalArgumentException - if locale is null.java.lang.IllegalArgumentException - if locale id is null.java.lang.IllegalArgumentException - if locale does not have a version attached.public int delete(java.lang.String spaceId,
CMALocale locale)
Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
spaceId - the id of the space to be used.locale - the locale fetched from Contentful, updated by caller, to be deleted.java.lang.IllegalArgumentException - if space id is null.java.lang.IllegalArgumentException - if locale id is null.Copyright © 2018 Contentful, GmbH.. All Rights Reserved.