Package com.cumulocity.sdk.client.option
Interface TenantOptionApi
-
- All Known Implementing Classes:
TenantOptionApiImpl
public interface TenantOptionApi
API for creating, updating and retrieving options from the platform.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
delete(OptionPK optionPK)
Deletes option from the platform.List<OptionRepresentation>
getAllOptionsForCategory(String category)
Gets all options from the platform for the specific category Requires role ROLE_OPTION_MANAGEMENT_READOptionRepresentation
getOption(OptionPK optionPK)
Gets an option by id Requires role ROLE_OPTION_MANAGEMENT_READTenantOptionCollection
getOptions()
Gets all options from the platform Requires role ROLE_OPTION_MANAGEMENT_READOptionRepresentation
save(OptionRepresentation option)
Creates or updates an option in the platform.Future
saveAsync(OptionRepresentation option)
Creates or updates an option in the platform.
-
-
-
Method Detail
-
getOption
OptionRepresentation getOption(OptionPK optionPK) throws SDKException
Gets an option by id Requires role ROLE_OPTION_MANAGEMENT_READ- Parameters:
optionPK
- id of the option to search for- Returns:
- the option with the given id
- Throws:
SDKException
- if the option is not found or if the query failed
-
getOptions
TenantOptionCollection getOptions() throws SDKException
Gets all options from the platform Requires role ROLE_OPTION_MANAGEMENT_READ- Returns:
- collection of options with paging functionality
- Throws:
SDKException
- if the query failed
-
save
OptionRepresentation save(OptionRepresentation option) throws SDKException
Creates or updates an option in the platform. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Parameters:
option
- option to be created- Returns:
- the created option with the generated id
- Throws:
SDKException
- if the option could not be created
-
saveAsync
Future saveAsync(OptionRepresentation option) throws SDKException
Creates or updates an option in the platform. Immediate response is available through the Future object. In case of lost connection, buffers data in persistence provider. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Parameters:
option
- option to be created- Returns:
- the created option with the generated id
- Throws:
SDKException
- if the option could not be created
-
delete
void delete(OptionPK optionPK) throws SDKException
Deletes option from the platform. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Parameters:
optionPK
- to be deleted- Throws:
SDKException
- if the measurement could not be deleted
-
getAllOptionsForCategory
List<OptionRepresentation> getAllOptionsForCategory(String category) throws SDKException
Gets all options from the platform for the specific category Requires role ROLE_OPTION_MANAGEMENT_READ- Parameters:
category
- tenant options category- Returns:
- collection of options
- Throws:
SDKException
- if the query failed
-
-