public final class ModuleContentTypes
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
ModuleContentTypes.Async
Async module.
|
Constructor and Description |
---|
ModuleContentTypes(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor,
java.lang.String spaceId,
java.lang.String environmentId,
boolean environmentIdConfigured)
Create content types module.
|
Modifier and Type | Method and Description |
---|---|
ModuleContentTypes.Async |
async() |
CMAContentType |
create(CMAContentType contentType)
Create a new Content Type in the configured space and environment.
|
CMAContentType |
create(java.lang.String spaceId,
java.lang.String environmentId,
CMAContentType contentType)
Create a new Content Type in an Environment.
|
protected com.contentful.java.cma.ServiceContentTypes |
createService(retrofit2.Retrofit retrofit) |
java.lang.Integer |
delete(CMAContentType contentType)
Delete a Content Type.
|
CMAArray<CMAContentType> |
fetchAll()
Fetch all Content Types from the configured space and environment, using default query
parameter.
|
CMAArray<CMAContentType> |
fetchAll(java.util.Map<java.lang.String,java.lang.String> query)
Fetch all Content Types from the configured space and environment, using default query
parameter.
|
CMAArray<CMAContentType> |
fetchAll(java.lang.String spaceId,
java.lang.String environmentId)
Fetch all Content Types from an Environment, using default query parameter.
|
CMAArray<CMAContentType> |
fetchAll(java.lang.String spaceId,
java.lang.String environmentId,
java.util.Map<java.lang.String,java.lang.String> query)
Fetch all Content Types from a Space with query parameters.
|
CMAArray<CMASnapshot> |
fetchAllSnapshots(CMAContentType contentType)
Fetch all snapshots of this content type.
|
CMAContentType |
fetchOne(java.lang.String contentTypeId)
Fetch a Content Type with the given
contentTypeId from the configured environment and
space. |
CMAContentType |
fetchOne(java.lang.String spaceId,
java.lang.String environmentId,
java.lang.String contentTypeId)
Fetch a Content Type with the given
contentTypeId from a given space environment
combination. |
CMASnapshot |
fetchOneSnapshot(CMAContentType contentType,
java.lang.String snapshotId)
Fetch a specific snapshot of this content type.
|
CMAContentType |
publish(CMAContentType contentType)
Publish a Content Type.
|
CMAContentType |
unPublish(CMAContentType contentType)
Un-Publish a Content Type.
|
CMAContentType |
update(CMAContentType contentType)
Update a Content Type.
|
public ModuleContentTypes(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 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.protected com.contentful.java.cma.ServiceContentTypes createService(retrofit2.Retrofit retrofit)
public CMAContentType create(CMAContentType contentType)
In case the given contentType
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.
contentType
- Content TypeCMAContentType
result instancejava.lang.IllegalArgumentException
- if configured space id is null.java.lang.IllegalArgumentException
- if configured environment id is null.java.lang.IllegalArgumentException
- if contentType is null.CMAClient.Builder.setSpaceId(String)
,
CMAClient.Builder.setEnvironmentId(String)
public CMAContentType create(java.lang.String spaceId, java.lang.String environmentId, CMAContentType contentType)
In case the given contentType
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.
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)
and
CMAClient.Builder.setEnvironmentId(String)
.
spaceId
- Space IDenvironmentId
- Environment IDcontentType
- Content TypeCMAContentType
result instancejava.lang.IllegalArgumentException
- if spaceId is null.java.lang.IllegalArgumentException
- if environmentId is null.java.lang.IllegalArgumentException
- if contentType is null.public java.lang.Integer delete(CMAContentType contentType)
contentType
- Content Typejava.lang.IllegalArgumentException
- if spaceId is null.java.lang.IllegalArgumentException
- if contentTypeId is null.public CMAArray<CMAContentType> fetchAll()
This fetch uses the default parameter defined in DefaultQueryParameter.FETCH
CMAArray
result instancejava.lang.IllegalArgumentException
- if spaceId is null.CMAClient.Builder.setSpaceId(String)
,
CMAClient.Builder.setEnvironmentId(String)
public CMAArray<CMAContentType> fetchAll(java.util.Map<java.lang.String,java.lang.String> query)
This fetch uses the default parameter defined in DefaultQueryParameter.FETCH
query
- to specify to narrow down results.CMAArray
result instancejava.lang.IllegalArgumentException
- if spaceId is null.CMAClient.Builder.setSpaceId(String)
,
CMAClient.Builder.setEnvironmentId(String)
public CMAArray<CMAContentType> fetchAll(java.lang.String spaceId, java.lang.String environmentId)
This fetch uses the default parameter defined in DefaultQueryParameter.FETCH
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)
and
CMAClient.Builder.setEnvironmentId(String)
.
spaceId
- Space IDenvironmentId
- Environment IDCMAArray
result instancejava.lang.IllegalArgumentException
- if spaceId is null.public CMAArray<CMAContentType> fetchAll(java.lang.String spaceId, java.lang.String environmentId, java.util.Map<java.lang.String,java.lang.String> query)
spaceId
- Space IDenvironmentId
- Environment IDquery
- Query to narrow down the content_types to be searched forCMAArray
result instancejava.lang.IllegalArgumentException
- if spaceId is null.java.lang.IllegalArgumentException
- if environmentId is null.public CMAContentType fetchOne(java.lang.String contentTypeId)
contentTypeId
from the configured environment and
space.contentTypeId
- Content Type IDCMAContentType
result instancejava.lang.IllegalArgumentException
- if configured space id is null.java.lang.IllegalArgumentException
- if configured environment id is null.java.lang.IllegalArgumentException
- if contentTypeId is null.CMAClient.Builder.setSpaceId(String)
,
CMAClient.Builder.setEnvironmentId(String)
public CMAContentType fetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String contentTypeId)
contentTypeId
from a given space environment
combination.
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)
and
CMAClient.Builder.setEnvironmentId(String)
.
spaceId
- Space IDenvironmentId
- Environment IDcontentTypeId
- Content Type IDCMAContentType
result instancejava.lang.IllegalArgumentException
- if spaceId is null.java.lang.IllegalArgumentException
- if environmentId is null.java.lang.IllegalArgumentException
- if contentTypeId is null.public CMAContentType publish(CMAContentType contentType)
contentType
- Content TypeCMAContentType
result instancejava.lang.IllegalArgumentException
- if contentType is null.java.lang.IllegalArgumentException
- if contentType's id is null.java.lang.IllegalArgumentException
- if contentType's space id is null.public CMAContentType unPublish(CMAContentType contentType)
contentType
- Content TypeCMAContentType
result instancejava.lang.IllegalArgumentException
- if contentType is null.java.lang.IllegalArgumentException
- if contentType's id is null.java.lang.IllegalArgumentException
- if contentType's space id is null.public CMAContentType update(CMAContentType contentType)
contentType
- Content TypeCMAContentType
result instancejava.lang.IllegalArgumentException
- if contentType is null.java.lang.IllegalArgumentException
- if contentType's name is null.java.lang.IllegalArgumentException
- if contentType's id is null.java.lang.IllegalArgumentException
- if contentType's space id is null.java.lang.IllegalArgumentException
- if contentType's version is null.public CMAArray<CMASnapshot> fetchAllSnapshots(CMAContentType contentType)
contentType
- the contentType whose snapshots to be returned.java.lang.IllegalArgumentException
- if contentType is null.java.lang.IllegalArgumentException
- if contentType's id is null.java.lang.IllegalArgumentException
- if contentType's space id is null.public CMASnapshot fetchOneSnapshot(CMAContentType contentType, java.lang.String snapshotId)
contentType
- the contentType whose snapshot to be returned.snapshotId
- the snapshot to be returned.java.lang.IllegalArgumentException
- if contentType is null.java.lang.IllegalArgumentException
- if contentType's id is null.java.lang.IllegalArgumentException
- if contentType's space id is null.java.lang.IllegalArgumentException
- if snapshotId is null.public ModuleContentTypes.Async async()
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.