Models
steamlayer_core.domain.models
Canonical domain models for the steamlayer-core public API.
These are the only types that cross the library boundary. Internal implementation details (e.g., raw dicts from the Steam API) never appear in public function signatures.
Versioning contract
Fields added here are always keyword-only with defaults so that existing callers don't break when new fields are introduced.
Model hierarchy
DiscoveryResult
Lightweight internal result produced and consumed within the resolution
waterfall. Returned by ResolutionEngine.resolve() and passed through
disambiguation handlers.
ResolvedGame
Rich output of api.resolve_game(). Everything a UI needs to display
results and decide on next steps (DLC count, source badge, etc.).
Candidate
A single plausible AppID match accumulated during the waterfall.
Embedded in DisambiguationRequest and ResolutionResult.
ResolutionResult
Intermediate result produced by ResolutionEngine.
Richer than DiscoveryResult — includes candidates_seen for audit.
DisambiguationRequest
Payload carried by DisambiguationRequired exceptions.
SteamlayerOptions
Caller-supplied configuration for a single resolution run.
DLCInfo
Metadata for a single DLC item.
Candidate
dataclass
A single plausible AppID match produced during the resolution waterfall.
Returned inside DisambiguationRequest when the resolver cannot
auto-select. Also embedded in ResolutionResult as candidates_seen
for audit/logging.
Source code in steamlayer_core/domain/models.py
DLCInfo
dataclass
DiscoveryResult
dataclass
Lightweight result object produced and consumed within the resolution waterfall.
Returned by ResolutionEngine.resolve() and by all disambiguation /
confirmation handlers (see steamlayer_core.protocols).
Note: this is intentionally simpler than ResolvedGame — it carries
only what the engine needs to operate. The public api.resolve_game()
function wraps it in ResolvedGame before returning to callers.
Attributes:
| Name | Type | Description |
|---|---|---|
appid |
int | None
|
The resolved Steam App ID. |
source |
ResolutionSource | None
|
Which strategy produced this result. |
confidence |
float
|
Heuristic match score, 0.0 – 1.0. |
game_name |
str | None
|
Steam display name for the matched game. |
user_selected |
bool
|
|
Source code in steamlayer_core/domain/models.py
ResolutionResult
dataclass
Returned by ResolutionEngine.resolve() on success.
Attributes:
| Name | Type | Description |
|---|---|---|
appid |
int
|
The resolved Steam App ID. |
game_name |
str | None
|
Display name as reported by the source. May be |
source |
ResolutionSource
|
Which strategy succeeded. |
confidence |
float
|
Match score (1.0 for manual/local-file; heuristic score otherwise). |
user_selected |
bool
|
|
candidates_seen |
list[Candidate]
|
All candidates evaluated during the waterfall (useful for logging / debugging false positives). |
Source code in steamlayer_core/domain/models.py
ResolutionSource
Bases: Enum
Records how an AppID was determined — useful for telemetry and display.
Source code in steamlayer_core/domain/models.py
ResolvedGame
dataclass
Final output of a successful resolution run.
This is what api.resolve_game() returns.
Source code in steamlayer_core/domain/models.py
is_hydrated
property
Whether DLC metadata has been fetched for this game.
A freshly resolved game is not hydrated — dlcs is None
until fetch_dlcs() has been called and the result assigned.
This distinguishes "not yet fetched" from "fetched but no DLCs exist"
(the latter being an empty dict).
Use this to guard against accidentally treating an unhydrated result as if it had no DLCs::
if not game.is_hydrated:
game.dlcs = fetch_dlcs(game.appid, http_client=client)
SteamlayerOptions
dataclass
Controls resolution behaviour, DLC hydration, and cache configuration.
Designed to be constructed once by the caller and passed into
resolve_game() or SteamLayerClient. All fields have sensible
defaults so callers only need to set what they care about.
Attributes:
| Name | Type | Description |
|---|---|---|
appid |
int | None
|
If set, skip all discovery and treat this as the authoritative ID. |
strict |
bool
|
When |
fetch_dlcs |
bool
|
Whether to hydrate DLC metadata after resolving the AppID. |
dlc_cache_ttl_seconds |
int
|
How long DLC cache entries are considered fresh before a network refresh is attempted. Default: 7 days. |
cache_dir |
Path | str
|
Directory for on-disk DLC cache files.
Default: |