Async Transactional Client
Note
This Class is not meant to be instantiated directly, but rather accessed through the transactional
Property on an
instance of AsyncClient. For more details, see the Guide.
list_modules
async
list_modules() -> list[Module]
get_model_status
async
get_model_status() -> ModelStatus
Gets the current status of the Model.
Returns:
Type | Description |
---|---|
ModelStatus
|
The current status of the Model. |
list_line_items
async
list_line_items(only_module_id: int | None = None) -> list[LineItem]
Lists all the Line Items in the Model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
only_module_id
|
int | None
|
If provided, only Line Items from this Module will be returned. |
None
|
Returns:
Type | Description |
---|---|
list[LineItem]
|
All Line Items on this Model. |
list_lists
async
list_lists() -> list[List]
get_list_metadata
async
get_list_metadata(list_id: int) -> ListMetadata
Gets the metadata for a List.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_id
|
int
|
The ID of the List. |
required |
Returns:
Type | Description |
---|---|
ListMetadata
|
The metadata for the List. |
get_list_items
async
get_list_items(list_id: int) -> list[ListItem]
Gets all the items in a List.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_id
|
int
|
The ID of the List. |
required |
Returns:
Type | Description |
---|---|
list[ListItem]
|
All items in the List. |
insert_list_items
async
insert_list_items(
list_id: int, items: list[dict[str, str | int | dict]]
) -> InsertionResult
Insert new items to the given list. The items must be a list of dictionaries with at least
the keys code
and name
. You can optionally pass further keys for parents, extra
properties etc.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_id
|
int
|
The ID of the List. |
required |
items
|
list[dict[str, str | int | dict]]
|
The items to insert into the List. |
required |
Returns:
Type | Description |
---|---|
InsertionResult
|
The result of the insertion, indicating how many items were added, ignored or failed. |
delete_list_items
async
delete_list_items(list_id: int, items: list[dict[str, str | int]]) -> int
Deletes items from a List.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_id
|
int
|
The ID of the List. |
required |
items
|
list[dict[str, str | int]]
|
The items to delete from the List. Must be a dict with either |
required |
reset_list_index
async
reset_list_index(list_id: int) -> None
Resets the index of a List. The List must be empty to do so.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_id
|
int
|
The ID of the List. |
required |
update_module_data
async
update_module_data(module_id: int, data: list[dict[str, Any]]) -> int | dict[str, Any]
Write the passed items to the specified module. If successful, the number of cells changed is returned, if only partially successful or unsuccessful, the response with the according details is returned instead. For more details, see: https://anaplan.docs.apiary.io/#UpdateModuleCellData.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
module_id
|
int
|
The ID of the Module. |
required |
data
|
list[dict[str, Any]]
|
The data to write to the Module. |
required |
Returns:
Type | Description |
---|---|
int | dict[str, Any]
|
The number of cells changed or the response with the according error details. |