1"""Models for the Achievement API."""
2
3from wow.models._common import Document, IdRef, Model, Ref, TypedName
4
5__all__ = [
6 "Achievement",
7 "AchievementCategory",
8 "AchievementCategoryIndex",
9 "AchievementCriteria",
10 "AchievementFactionAggregate",
11 "AchievementIndex",
12]
13
14
[docs]
15class AchievementIndex(Document):
16 """Every achievement."""
17
18 achievements: tuple[Ref, ...]
19
20
[docs]
21class AchievementCategoryIndex(Document):
22 """Every achievement category, plus the subset that are root categories."""
23
24 categories: tuple[Ref, ...]
25 root_categories: tuple[Ref, ...]
26
27
[docs]
28class AchievementCriteria(Model):
29 """The condition that completes an achievement, or one part of it.
30
31 A criteria with ``child_criteria`` completes when its ``operator`` (such as ``AND``) holds over its children.
32 """
33
34 id: int
35 description: str | None
36 amount: int
37 operator: TypedName | None = None
38 child_criteria: tuple[AchievementCriteria, ...] = ()
39 achievement: Ref | None = None
40 faction: TypedName | None = None
41 show_progress_bar: bool = False
42
43
[docs]
44class Achievement(Document):
45 """A single achievement."""
46
47 id: int
48 name: str
49 description: str
50 points: int
51 is_account_wide: bool
52 category: Ref
53 criteria: AchievementCriteria
54 media: IdRef
55 display_order: int
56 reward_description: str | None = None
57
58
[docs]
59class AchievementFactionAggregate(Model):
60 """Points and achievement count earned by one faction within a category."""
61
62 quantity: int
63 points: int
64
65
[docs]
66class AchievementCategory(Document):
67 """A group of related achievements, such as a class or a zone."""
68
69 id: int
70 name: str
71 is_guild_category: bool
72 display_order: int
73 subcategories: tuple[Ref, ...] = ()
74 achievements: tuple[Ref, ...] = ()
75 parent_category: Ref | None = None
76 aggregates_by_faction: dict[str, AchievementFactionAggregate] | None = None