skipcheck

TM1 client · Docs · Queries

ODataPath

from skipcheck_tm1 import ODataPath

A resource path relative to the service root, built from segments and encoded as it's built:

element = ODataPath.of("Dimensions").key("Region").nav("Hierarchies").key("Region").nav("Elements").key("O'Neil")
# Dimensions('Region')/Hierarchies('Region')/Elements('O''Neil')
reserve = ODataPath.of("Cubes").key("Sales").action("tm1.Reserve")
# Cubes('Sales')/tm1.Reserve

Names (entity sets, navigation properties, operations, type casts) must be OData identifiers, optionally qualified; they're checked, never encoded. Key values can be any text: they're written as string literals and percent-encoded. Paths are immutable.

Members

segments
of staticA path starting at an entity set, singleton or operation import, such as Cubes.
metadata staticThe service's metadata document, $metadata.
batch staticThe service's batch endpoint, $batch.
link staticA path TM1 sent (an @odata.id or a Location), re-encoded segment by segment.
function_import staticA function import called from the service root, such as ModelCubes() or TailMessageLog(Top=10).
keyCubes → Cubes('Sales'); a mapping makes a compound key (A='x',B='y').
navAdds a navigation property or structural property segment, such as Views.
castAdds a type-cast segment, such as tm1.NativeView.
actionAdds a bound action segment, such as tm1.Reserve.
functionAdds a bound function call with literal parameters, such as tm1.GetPartition(Begin=0,End=99).
valueAdds $value.
countAdds $count.
refAdds $ref.

segments

segments: tuple[str, ...]

of

static
of(name: str) -> ODataPath

A path starting at an entity set, singleton or operation import, such as Cubes. name must be an OData identifier.

metadata

static
metadata() -> ODataPath

The service's metadata document, $metadata: its CSDL XML. A path of its own, since $metadata isn't an identifier of accepts.

batch

static
batch() -> ODataPath

The service's batch endpoint, $batch: a path of its own, as for metadata.

function_import

static
function_import(name: str, parameters: Mapping[str, Any] | None = None) -> ODataPath

A function import called from the service root, such as ModelCubes() or TailMessageLog(Top=10). name is unqualified; the parameters are written in order, as for function.

key

key(value: Any) -> ODataPath

Cubes → Cubes('Sales'); a mapping makes a compound key (A='x',B='y').

cast

cast(qualified_type: str) -> ODataPath

Adds a type-cast segment, such as tm1.NativeView: the namespace-qualified type name. Returns a new path.

action

action(qualified_name: str) -> ODataPath

Adds a bound action segment, such as tm1.Reserve. Actions are invoked with POST. Returns a new path.

function

function(qualified_name: str, parameters: Mapping[str, Any] | None = None) -> ODataPath

Adds a bound function call with literal parameters, such as tm1.GetPartition(Begin=0,End=99). Use parameter aliases (ODataQuery.alias) for complex or collection parameters. Returns a new path.

value

value() -> ODataPath

Adds $value: a property's or media entity's raw value. Returns a new path.

count

count() -> ODataPath

Adds $count: the number of items in a collection, as plain text. Returns a new path.

ref

ref() -> ODataPath

Adds $ref: references to entities rather than the entities themselves. Returns a new path.