public final class ModuleAssets extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
ModuleAssets.Async
Async module.
|
| Constructor and Description |
|---|
ModuleAssets(retrofit2.Retrofit retrofit,
Executor callbackExecutor) |
| Modifier and Type | Method and Description |
|---|---|
CMAAsset |
archive(CMAAsset asset)
Archive an Asset.
|
ModuleAssets.Async |
async() |
CMAAsset |
create(String spaceId,
CMAAsset asset)
Create a new Asset.
|
protected com.contentful.java.cma.ServiceAssets |
createService(retrofit2.Retrofit retrofit) |
Integer |
delete(String spaceId,
String assetId)
Delete an Asset.
|
CMAArray<CMAAsset> |
fetchAll(String spaceId)
Fetch all Assets from a Space.
|
CMAArray<CMAAsset> |
fetchAll(String spaceId,
Map<String,String> query)
Fetch all Assets from a Space with query parameter.
|
CMAAsset |
fetchOne(String spaceId,
String assetId)
Fetch an Asset with the given
assetId from a Space. |
Integer |
process(CMAAsset asset,
String locale)
Process an Asset.
|
CMAAsset |
publish(CMAAsset asset)
Publish an Asset.
|
CMAAsset |
unArchive(CMAAsset asset)
Un-Archive an Asset.
|
CMAAsset |
unPublish(CMAAsset asset)
Un-Publish an Asset.
|
CMAAsset |
update(CMAAsset asset)
Update an Asset.
|
public ModuleAssets(retrofit2.Retrofit retrofit,
Executor callbackExecutor)
protected com.contentful.java.cma.ServiceAssets createService(retrofit2.Retrofit retrofit)
public CMAAsset archive(CMAAsset asset)
asset - AssetCMAAsset result instanceIllegalArgumentException - if asset is null.IllegalArgumentException - if asset id is null.IllegalArgumentException - if asset space id is null.public CMAAsset create(String spaceId, CMAAsset asset)
asset has an ID associated with it, that ID will be used,
otherwise the server will auto-generate an ID that will be contained in the response upon
success.spaceId - Space IDasset - AssetCMAAsset result instanceIllegalArgumentException - if asset is null.IllegalArgumentException - if asset space id is null.public Integer delete(String spaceId, String assetId)
spaceId - Space IDassetId - Asset IDIllegalArgumentException - if spaceId is null.IllegalArgumentException - if assetId is null.public CMAArray<CMAAsset> fetchAll(String spaceId)
This fetch uses the default parameter defined in DefaultQueryParameter.FETCH
spaceId - Space IDCMAArray result instanceIllegalArgumentException - if spaceId is null.public CMAArray<CMAAsset> fetchAll(String spaceId, Map<String,String> query)
spaceId - Space IDquery - specifying details about which assets to fetch.CMAArray result instanceIllegalArgumentException - if spaceId is null.public CMAAsset fetchOne(String spaceId, String assetId)
assetId from a Space.spaceId - Space IDassetId - Asset IDCMAAsset result instanceIllegalArgumentException - if spaceId is null.IllegalArgumentException - if assetId is null.public Integer process(CMAAsset asset, String locale)
asset - Assetlocale - LocaleIllegalArgumentException - if asset is null.IllegalArgumentException - if asset has no id.IllegalArgumentException - if asset has no space.IllegalArgumentException - if locale is null.public CMAAsset publish(CMAAsset asset)
asset - AssetCMAAsset result instanceIllegalArgumentException - if asset is null.IllegalArgumentException - if asset has no id.IllegalArgumentException - if asset has no space id.public CMAAsset unArchive(CMAAsset asset)
asset - AssetCMAAsset result instanceIllegalArgumentException - if asset is null.IllegalArgumentException - if asset id is empty.IllegalArgumentException - if asset's space id is empty.public CMAAsset unPublish(CMAAsset asset)
asset - AssetCMAAsset result instanceIllegalArgumentException - if asset is null.IllegalArgumentException - if asset's id is not set.IllegalArgumentException - if asset's space id is not set.public CMAAsset update(CMAAsset asset)
asset - AssetCMAAsset result instanceIllegalArgumentException - if asset is null.IllegalArgumentException - if asset's id is null.IllegalArgumentException - if asset's space id is null.IllegalArgumentException - if asset's version is null.public ModuleAssets.Async async()
Copyright © 2017 Contentful, GmbH.. All Rights Reserved.