Skip to content

fetch_inputs

fetch_inputs

Service for fetch inputs operations.

Classes

FetchInputsRunner

Bases: BaseRunner[Dict[str, Any]]

Runner for reading all inputs on a scenario.

GET /api/v3/scenarios/{scenario_id}/inputs

Functions
run staticmethod
run(client, scenario, defaults=None, **kwargs)

Execute the fetch inputs operation.

Returns:

Type Description
ServiceResult[Dict[str, Any]]

ServiceResult[Dict[str, Any]]: Success case contains dict with input configurations (keys are input names, values contain min, max, default, unit, and other fields); failure case contains error messages.

Source code in src/pyetm/services/scenario_runners/fetch_inputs.py
@staticmethod
def run(
    client: BaseClient, scenario: Any, defaults: Optional[str] = None, **kwargs: Any
) -> ServiceResult[Dict[str, Any]]:
    """Execute the fetch inputs operation.

    Returns:
        ServiceResult[Dict[str, Any]]: Success case contains dict with input
            configurations (keys are input names, values contain min, max, default,
            unit, and other fields); failure case contains error messages.
    """
    params = {"defaults": defaults} if defaults else None

    return FetchInputsRunner._make_request(
        client=client,
        method="get",
        path=f"/scenarios/{scenario.id}/inputs",
        params=params,
    )