Class AttributeService
java.lang.Object
io.skipcheck.tm1.client.service.attribute.AttributeService
Attribute definitions: which attributes a kind of object has, and their types, for each
AttributeSet. Creating one adds it to every object of that kind; the values are
cells of the matching }…Attributes control cube.
Add an attribute to every element of a hierarchy:
// A text attribute on every element of the Region hierarchy
return tm1.attributes()
.create(AttributeSet.elements("Region", "Region"),
AttributeDefinitionPatch.builder().name("Manager").type(AttributeType.STRING).build());
List the attributes a kind of object has, here cubes:
// The attributes that every cube has
return tm1.attributes()
.list(AttributeSet.cubes(), ODataQuery.none().select(AttributeDefinition.NAME))
.mapNotNull(AttributeDefinition::name);
-
Constructor Summary
ConstructorsConstructorDescriptionAttributeService(Tm1Session session) A service sending its requests throughsession. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<AttributeDefinition> create(AttributeSet set, AttributeDefinitionPatch attribute) POST: adds an attribute to every object of the set's kind.reactor.core.publisher.Mono<Void> delete(AttributeSet set, String name) DELETE: removes an attribute, with its values, from every object of the set's kind.reactor.core.publisher.Mono<AttributeDefinition> get(AttributeSet set, String name, ODataQuery query) GETone attribute of the set.reactor.core.publisher.Flux<AttributeDefinition> list(AttributeSet set, ODataQuery query) GETthe set's attributes, streamed.
-
Constructor Details
-
AttributeService
A service sending its requests throughsession.- Parameters:
session- the session
-
-
Method Details
-
list
@Tm1Endpoint("EntitySet DimensionAttributes") @Tm1Endpoint("Navigation Dimension/HierarchyAttributes") @Tm1Endpoint("Navigation Hierarchy/ElementAttributes") @Tm1Endpoint("Navigation Hierarchy/SubsetAttributes") @Tm1Endpoint("EntitySet CubeAttributes") @Tm1Endpoint("Navigation Cube/ViewAttributes") @Tm1Endpoint("EntitySet ProcessAttributes") @Tm1Endpoint("EntitySet ChoreAttributes") public reactor.core.publisher.Flux<AttributeDefinition> list(AttributeSet set, ODataQuery query) GETthe set's attributes, streamed.- Parameters:
set- which attributesquery- what to select, filter and order- Returns:
- the attribute definitions
-
get
@Tm1Endpoint("EntitySet DimensionAttributes") @Tm1Endpoint("Navigation Dimension/HierarchyAttributes") @Tm1Endpoint("Navigation Hierarchy/ElementAttributes") @Tm1Endpoint("Navigation Hierarchy/SubsetAttributes") @Tm1Endpoint("EntitySet CubeAttributes") @Tm1Endpoint("Navigation Cube/ViewAttributes") @Tm1Endpoint("EntitySet ProcessAttributes") @Tm1Endpoint("EntitySet ChoreAttributes") public reactor.core.publisher.Mono<AttributeDefinition> get(AttributeSet set, String name, ODataQuery query) GETone attribute of the set.- Parameters:
set- which attributesname- the attribute's namequery- what to select- Returns:
- the attribute definition, or a
Tm1NotFoundExceptionif there's none
-
create
@Tm1Endpoint("EntitySet DimensionAttributes") @Tm1Endpoint("Navigation Dimension/HierarchyAttributes") @Tm1Endpoint("Navigation Hierarchy/ElementAttributes") @Tm1Endpoint("Navigation Hierarchy/SubsetAttributes") @Tm1Endpoint("EntitySet CubeAttributes") @Tm1Endpoint("Navigation Cube/ViewAttributes") @Tm1Endpoint("EntitySet ProcessAttributes") @Tm1Endpoint("EntitySet ChoreAttributes") public reactor.core.publisher.Mono<AttributeDefinition> create(AttributeSet set, AttributeDefinitionPatch attribute) POST: adds an attribute to every object of the set's kind.- Parameters:
set- which attributesattribute- the new attribute: its name and type- Returns:
- the attribute as created
-
delete
@Tm1Endpoint("EntitySet DimensionAttributes") @Tm1Endpoint("Navigation Dimension/HierarchyAttributes") @Tm1Endpoint("Navigation Hierarchy/ElementAttributes") @Tm1Endpoint("Navigation Hierarchy/SubsetAttributes") @Tm1Endpoint("EntitySet CubeAttributes") @Tm1Endpoint("Navigation Cube/ViewAttributes") @Tm1Endpoint("EntitySet ProcessAttributes") @Tm1Endpoint("EntitySet ChoreAttributes") public reactor.core.publisher.Mono<Void> delete(AttributeSet set, String name) DELETE: removes an attribute, with its values, from every object of the set's kind.- Parameters:
set- which attributesname- the attribute's name- Returns:
- completes when the attribute is deleted
-