Package com.cumulocity.sdk.client.option
Class TenantOptionApiImpl
java.lang.Object
com.cumulocity.sdk.client.option.TenantOptionApiImpl
- All Implemented Interfaces:
TenantOptionApi
-
Constructor Summary
ConstructorDescriptionTenantOptionApiImpl
(RestConnector restConnector, TenantApiRepresentation tenantApiRepresentation, int pageSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes option from the platform.getAllOptionsForCategory
(String category) Gets all options from the platform for the specific category Requires role ROLE_OPTION_MANAGEMENT_READGets an option by id Requires role ROLE_OPTION_MANAGEMENT_READGets all options from the platform Requires role ROLE_OPTION_MANAGEMENT_READsave
(OptionRepresentation representation) Creates or updates an option in the platform.saveAsync
(OptionRepresentation representation) Creates or updates an option in the platform.
-
Constructor Details
-
TenantOptionApiImpl
public TenantOptionApiImpl(RestConnector restConnector, TenantApiRepresentation tenantApiRepresentation, int pageSize)
-
-
Method Details
-
getOption
Description copied from interface:TenantOptionApi
Gets an option by id Requires role ROLE_OPTION_MANAGEMENT_READ- Specified by:
getOption
in interfaceTenantOptionApi
- 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
Description copied from interface:TenantOptionApi
Gets all options from the platform Requires role ROLE_OPTION_MANAGEMENT_READ- Specified by:
getOptions
in interfaceTenantOptionApi
- Returns:
- collection of options with paging functionality
- Throws:
SDKException
- if the query failed
-
save
Description copied from interface:TenantOptionApi
Creates or updates an option in the platform. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Specified by:
save
in interfaceTenantOptionApi
- Parameters:
representation
- option to be created- Returns:
- the created option with the generated id
- Throws:
SDKException
- if the option could not be created
-
saveAsync
Description copied from interface:TenantOptionApi
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- Specified by:
saveAsync
in interfaceTenantOptionApi
- Parameters:
representation
- option to be created- Returns:
- the created option with the generated id
- Throws:
SDKException
- if the option could not be created
-
delete
Description copied from interface:TenantOptionApi
Deletes option from the platform. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Specified by:
delete
in interfaceTenantOptionApi
- Parameters:
optionPK
- to be deleted- Throws:
SDKException
- if the measurement could not be deleted
-
getAllOptionsForCategory
Description copied from interface:TenantOptionApi
Gets all options from the platform for the specific category Requires role ROLE_OPTION_MANAGEMENT_READ- Specified by:
getAllOptionsForCategory
in interfaceTenantOptionApi
- Parameters:
category
- tenant options category- Returns:
- collection of options
- Throws:
SDKException
- if the query failed
-