skipcheck

TM1 client · Docs · Dimensions and hierarchies

AttributeService

using Skipcheck.Tm1.Client.Services;

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 await tm1.Attributes.CreateAsync(
    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.ListAsync(AttributeSet.Cubes(), ODataQuery.None().Select(AttributeDefinition.Fields.Name)).Select(attribute => attribute.Name!);

Members

AttributeService constructorA service that sends its requests through session.
ListAsyncGET the set's attributes, streamed.
GetAsyncGET one attribute of the set, or a Tm1NotFoundException if there's none.
CreateAsyncAdds an attribute, its name and type, to every object of the set's kind; returns the attribute as created.
DeleteAsyncRemoves an attribute, with its values, from every object of the set's kind.

AttributeService

constructor
AttributeService(Tm1Session session)

A service that sends its requests through session.

ListAsync

IAsyncEnumerable<AttributeDefinition> ListAsync(AttributeSet set, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET the set's attributes, streamed.

TM1 REST EntitySet DimensionAttributes Navigation Dimension/HierarchyAttributes Navigation Hierarchy/ElementAttributes Navigation Hierarchy/SubsetAttributes EntitySet CubeAttributes Navigation Cube/ViewAttributes EntitySet ProcessAttributes EntitySet ChoreAttributes

GetAsync

Task<AttributeDefinition> GetAsync(AttributeSet set, string name, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET one attribute of the set, or a Tm1NotFoundException if there's none.

TM1 REST EntitySet DimensionAttributes Navigation Dimension/HierarchyAttributes Navigation Hierarchy/ElementAttributes Navigation Hierarchy/SubsetAttributes EntitySet CubeAttributes Navigation Cube/ViewAttributes EntitySet ProcessAttributes EntitySet ChoreAttributes

CreateAsync

Task<AttributeDefinition> CreateAsync(AttributeSet set, AttributeDefinitionPatch attribute, CancellationToken cancellationToken = default)

POST: adds an attribute, its name and type, to every object of the set's kind; returns the attribute as created.

TM1 REST EntitySet DimensionAttributes Navigation Dimension/HierarchyAttributes Navigation Hierarchy/ElementAttributes Navigation Hierarchy/SubsetAttributes EntitySet CubeAttributes Navigation Cube/ViewAttributes EntitySet ProcessAttributes EntitySet ChoreAttributes

DeleteAsync

Task DeleteAsync(AttributeSet set, string name, CancellationToken cancellationToken = default)

DELETE: removes an attribute, with its values, from every object of the set's kind.

TM1 REST EntitySet DimensionAttributes Navigation Dimension/HierarchyAttributes Navigation Hierarchy/ElementAttributes Navigation Hierarchy/SubsetAttributes EntitySet CubeAttributes Navigation Cube/ViewAttributes EntitySet ProcessAttributes EntitySet ChoreAttributes