public final class ModuleEnvironments
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
ModuleEnvironments.Async
Async module.
|
Constructor and Description |
---|
ModuleEnvironments(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor,
java.lang.String spaceId,
java.lang.String environmentId,
boolean environmentIdConfigured)
Create environments module.
|
Modifier and Type | Method and Description |
---|---|
ModuleEnvironments.Async |
async() |
CMAEnvironment |
branch(CMAEnvironment sourceEnvironment,
CMAEnvironment newEnvironment)
Deprecated.
This method has been renamed to
clone(CMAEnvironment, CMAEnvironment) .
It will be removed in the next major release. |
CMAEnvironment |
clone(CMAEnvironment sourceEnvironment,
CMAEnvironment newEnvironment)
Create an environment based on the content of another environment.
|
CMAEnvironment |
create(CMAEnvironment environment)
Create an environment in the configured space.
|
CMAEnvironment |
create(java.lang.String spaceId,
CMAEnvironment environment)
Create an environment using the given space id.
|
protected com.contentful.java.cma.ServiceEnvironments |
createService(retrofit2.Retrofit retrofit) |
java.lang.Integer |
delete(CMAEnvironment environment)
Delete an environment.
|
CMAArray<CMAEnvironment> |
fetchAll()
Fetch all environments of the configured space.
|
CMAArray<CMAEnvironment> |
fetchAll(java.lang.String spaceId)
Fetch all environments of the given space.
|
CMAEnvironment |
fetchOne(java.lang.String environmentId)
Fetch an environment with a given
environmentId from the configured space. |
CMAEnvironment |
fetchOne(java.lang.String spaceId,
java.lang.String environmentId)
Fetch an environment with a given
environmentId and space. |
CMAEnvironment |
update(CMAEnvironment environment)
Update an environment.
|
public ModuleEnvironments(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.ServiceEnvironments createService(retrofit2.Retrofit retrofit)
public CMAEnvironment create(CMAEnvironment environment)
environment
- CMAEnvironmentCMAEnvironment
result instancejava.lang.IllegalArgumentException
- if the configured space id is null.java.lang.IllegalArgumentException
- if environment is null.CMAClient.Builder.setSpaceId(String)
public CMAEnvironment create(java.lang.String spaceId, CMAEnvironment environment)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)
.
spaceId
- the id of the space to be usedenvironment
- CMAEnvironmentCMAEnvironment
result instancejava.lang.IllegalArgumentException
- if space id is null.java.lang.IllegalArgumentException
- if environment is null.public CMAEnvironment clone(CMAEnvironment sourceEnvironment, CMAEnvironment newEnvironment)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)
.
sourceEnvironment
- the environment to be taken as a source of branchingnewEnvironment
- the environment to be created, based on the source.CMAEnvironment
result instancejava.lang.IllegalArgumentException
- if sourceEnvironment is null.java.lang.IllegalArgumentException
- if newEnvironment is null.java.lang.IllegalArgumentException
- if the space of the source environment is not set.@Deprecated public CMAEnvironment branch(CMAEnvironment sourceEnvironment, CMAEnvironment newEnvironment)
clone(CMAEnvironment, CMAEnvironment)
.
It will be removed in the next major release.
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)
.
sourceEnvironment
- the environment to be taken as a source of branchingnewEnvironment
- the environment to be created, based on the source.CMAEnvironment
result instancejava.lang.IllegalArgumentException
- if sourceEnvironment is null.java.lang.IllegalArgumentException
- if newEnvironment is null.java.lang.IllegalArgumentException
- if the space of the source environment is not set.public java.lang.Integer delete(CMAEnvironment environment)
environment
- the environment to be deletedjava.lang.IllegalArgumentException
- if environment's space id is null.java.lang.IllegalArgumentException
- if environment's id is null.java.lang.IllegalArgumentException
- if environment's version is null.public CMAArray<CMAEnvironment> fetchAll()
CMAArray
result instancejava.lang.IllegalArgumentException
- if configured space id is null.CMAClient.Builder.setSpaceId(String)
public CMAArray<CMAEnvironment> fetchAll(java.lang.String spaceId)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)
.
spaceId
- space IDCMAArray
result instancejava.lang.IllegalArgumentException
- if environment's space id is null.public CMAEnvironment fetchOne(java.lang.String environmentId)
environmentId
from the configured space.environmentId
- environment IDCMAEnvironment
result instancejava.lang.IllegalArgumentException
- if the configured space id is null.java.lang.IllegalArgumentException
- if environment's id is null.CMAClient.Builder.setSpaceId(String)
public CMAEnvironment fetchOne(java.lang.String spaceId, java.lang.String environmentId)
environmentId
and space.
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)
.
spaceId
- space IDenvironmentId
- environment IDCMAEnvironment
result instancejava.lang.IllegalArgumentException
- if space id is null.java.lang.IllegalArgumentException
- if environment's id is null.public CMAEnvironment update(CMAEnvironment environment)
environment
- environmentCMAEnvironment
result instancejava.lang.IllegalArgumentException
- if environment is null.java.lang.IllegalArgumentException
- if environment's name is null.java.lang.IllegalArgumentException
- if environment's space id is null.java.lang.IllegalArgumentException
- if environment's environment id is null.java.lang.IllegalArgumentException
- if environment's version is null.public ModuleEnvironments.Async async()
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.