1"""Models for the Mount API."""
2
3from wow.models._common import Document, IdRef, LocalizedString, Model, Ref, TypedName
4
5__all__ = ["Mount", "MountIndex", "MountRequirements", "MountSearchData"]
6
7
[docs]
8class MountIndex(Document):
9 """Every mount."""
10
11 mounts: tuple[Ref, ...]
12
13
[docs]
14class MountRequirements(Model):
15 """Who can use a mount: a faction, and for some mounts only certain classes or races."""
16
17 faction: TypedName | None = None
18 classes: tuple[Ref, ...] = ()
19 races: tuple[Ref, ...] = ()
20
21
[docs]
22class Mount(Document):
23 """A mount."""
24
25 id: int
26 name: str
27 description: str | None
28 creature_displays: tuple[IdRef, ...] = ()
29 faction: TypedName | None = None
30 requirements: MountRequirements | None = None
31 source: TypedName | None = None
32 should_exclude_if_uncollected: bool = False
33
34
35class _MountSearchIdOnly(Model):
36 """A creature display reference stripped down to its id, as search results carry it."""
37
38 id: int
39
40
41class _MountSearchLocalizedType(Model):
42 """A ``type`` constant with its localized label, such as a faction or a source, as search results carry it."""
43
44 type: str
45 name: LocalizedString
46
47
[docs]
48class MountSearchData(Model):
49 """One mount as indexed for search: every locale's name at once, no ``_links``."""
50
51 id: int
52 name: LocalizedString
53 creature_displays: tuple[_MountSearchIdOnly, ...] = ()
54 faction: _MountSearchLocalizedType | None = None
55 source: _MountSearchLocalizedType | None = None