Skip to content
Hugh Jeremy edited this page Oct 4, 2018 · 4 revisions

Documentation > Entity

An Amatino entity is a economic unit to be described by accounting information. Entities are described by accounts, transactions, and entries.

An example of an entity might be a legal company, a consolidated group of companies, a project, or even a person.

Properties

.session - Session

The underlying credentials used to retrieve this Entity


.id_ - str

The unique identifier of this Entity across all of Amatino

Example: '8AXpUrZx5fpBtl1o'


.name - str

The human-friendly name of this Entity

Example: 'Mega Corporation


.description - str

The description of this Entity

Example: 'A company devoted to complete and utter world domination'


.region_id - int

The integer identifier of the physical region in which this Entity's data is stored

Example: 4


.owner_id - int

The integer identifier of the User who owns this Entity

Example: 869067642534


.active - bool

A indicator of whether this Entity is in an active (True) or deleted (False) state.


.permissions_graph - PermissionsGraph

An object containing the permissions granted in this Entity to Users. For example, read access on a particular account.

Methods

classmethod .create() -> Entity

Create a new Entity.

Parameters

  1. session: Session
  2. name: str
  3. description: Optional[str]
  4. region: Optional[Region]

Example

mega_corp = Entity.create(
  session=session,
  name='Mega Corporation'
)

classmethod .retrieve() -> Entity

Retrieve an existing Entity.

Parameters

  1. session: Session
  2. entity_id: str

Example

mega_corp = Entity.retrieve(
  session=session,
  entity_id='8AXpUrZx5fpBtl1o'
)

.update() -> Entity

Replace metadata describing this Entity. All parameters are optional, and those that you do not provide will default to the Entity's existing properties.

NB that .update() does not modify the Entity instance in place. The returned Entity instance is updated.

Parameters

  1. name: Optional[str]
  2. description: Optional[str]
  3. owner: Optional[User]
  4. permissions_graph: Optional[PermissionsGraph]

Example

updated_entity = mega_corp.update(
  description="New, fancier description"
)

Clone this wiki locally