create_collection
create_collection
Service for creating collections.
Classes
CreateCollectionRunner
Bases: BaseRunner[Dict[str, Any]]
Runner for creating a Collection in MyETM.
POST /api/v3/collections
Functions
run
staticmethod
Create a new Collection in MyETM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
BaseClient
|
The HTTP client to use |
required |
collection_data
|
Dict[str, Any]
|
Dictionary with collection attributes - title (required): Collection title - scenario_ids (optional): List of ETEngine scenario IDs - saved_scenario_ids (optional): List of MyETM saved scenario IDs - area_code (optional): Area code for interpolated collections - end_year (optional): End year for interpolated collections - interpolation (optional): Whether this is an interpolated collection |
required |
**kwargs
|
Any
|
Additional arguments passed to the request |
{}
|
Returns:
| Type | Description |
|---|---|
ServiceResult[Dict[str, Any]]
|
ServiceResult with created collection data |
Example usage
result = CreateCollectionRunner.run( client=client, collection_data={ "title": "My Collection", "saved_scenario_ids": [1, 2, 3], "interpolation": False } )