outcome_from_dict

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

outcome_from_dict(payload: dict) → Outcome[source]

Rebuild an endpoint declaration from its serialised mapping.

Parameters:

payload – Mapping produced by outcome_to_dict() (or written by hand in a YAML document). Must carry a task key.

Returns:

The corresponding Outcome implementation.

Raises:

HABITAPIError – If the task is missing or not a built-in one.