update_sortables
update_sortables
Service for updating a 'sortable'
Classes
UpdateSortablesRunner
Bases: BaseRunner[Dict[str, Any]]
Runner for updating a single user sortable on a scenario.
PUT /api/v3/scenarios/{scenario_id}/user_sortables/{sortable_type} PUT /api/v3/scenarios/{scenario_id}/user_sortables/{sortable_type}?subtype={subtype}
Functions
build_request
staticmethod
Build sortables update request for concurrent batching.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
Any
|
The scenario object (must have an 'id' attribute) |
required |
sortable_type
|
str
|
The type of sortable |
required |
order
|
List[Any]
|
The new order for the sortable |
required |
subtype
|
Optional[str]
|
Optional subtype for heat_network |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Request dict ready for AsyncBatchRunner |
Source code in src/pyetm/services/scenario_runners/update_sortables.py
run
staticmethod
Update a single sortable for a scenario - the endpoint doesn't handle bulk updates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
BaseClient
|
The HTTP client to use |
required |
scenario
|
Any
|
The scenario object (must have an 'id' attribute) |
required |
sortable_type
|
str
|
The type of sortable (e.g., "demand", "heat_network") |
required |
order
|
List[Any]
|
The new order for the sortable |
required |
subtype
|
Optional[str]
|
Optional subtype for heat_network (e.g., "lt", "mt", "ht") |
None
|
**kwargs
|
Any
|
Additional arguments passed to the request |
{}
|