-
Notifications
You must be signed in to change notification settings - Fork 2
Tree Node
Documentation > TreeNode
A Tree Node is a specialised view of an Account. It provides a recursive and individual balance for an Account. You will never interact with Tree Nodes' directly, instead you will receive lists of Tree Nodes as components of requests for Trees, Positions, and Performances.
Tree Nodes are recursive objects that may contain other Tree Nodes, depending on whether the Account in question has any children.
Trees, Positions, and Performances describe entire Entities. The User from whose perspective you retrieve a Tree, Position, or Performance may not have read access to every Account in the Entity. In such cases, Tree Nodes describing Accounts to which a User does not have read access will be returned with null in their balance fields, and a generic AMType in place of the actual Account name.
.session - Session
The Session used to initialise the higher-order object that owns this TreeNode
.entity - Entity
The Entity to which the Account described by this TreeNode belongs.
The integer identifier of the Account this TreeNode describes.
Example: 42
.account - Account
The Account that this TreeNode describes. Initial access to the .account property causes a new synchronous call to the API. Subsequence accesses return cached data.
Example: See Account
The number of levels into the hierarchy at which the Account this TreeNode describes sits. Top level accounts are 1.
Example: 2
The sum total of all Transactions party to the Account this TreeNode describes, as at the date of the higher-order object that controls this TreeNode.
Example: `Decimal('1142')
The sum total of all Transactions party to the Account this TreeNode describes, and all of the children of that Account.
Example: Decimal('4211')
The string name of the Account this TreeNode describes.
Example: Current Assets
.am_type - AMType
The AMType of the Account this TreeNode describes, one of asset, liability, equity, income, or expense.
Example: AMType.asset
.children - List[TreeNode]
A recursive list of TreeNodes describing the children of the Account this TreeNode describes. It said Account has no children, the list will be empty.
True if the Account this TreeNode describes has any children. When True, you can expect that the list in .children is not empty.
Example: True