1"""Models for the Auction House API.
2
3Forever has fifteen auction houses per ruleset, in five Alliance, Horde and Blackwater groups; every ruleset lists
4the same fifteen. ``client.auctions`` reads them.
5"""
6
7from typing import Literal
8
9from wow.models._common import Document, Link, Model, Ref
10
11__all__ = [
12 "AuctionEntry",
13 "AuctionHouse",
14 "AuctionHouseIndex",
15 "AuctionItem",
16 "AuctionItemModifier",
17 "AuctionTimeLeft",
18 "CommodityEntry",
19 "CommodityHouse",
20]
21
22type AuctionTimeLeft = Literal["SHORT", "MEDIUM", "LONG", "VERY_LONG"]
23"""How much longer an auction has to run, as a coarse band rather than a timestamp."""
24
25
[docs]
26class AuctionItemModifier(Model):
27 """One modifier on an auctioned item, such as the context a dungeon or raid drop came from."""
28
29 type: int
30 value: int
31
32
[docs]
33class AuctionItem(Model):
34 """The item an auction sells: its id plus whatever bonuses and modifiers make one stack differ from another."""
35
36 id: int
37 context: int | None = None
38 bonus_lists: tuple[int, ...] = ()
39 modifiers: tuple[AuctionItemModifier, ...] = ()
40
41
[docs]
42class AuctionEntry(Model):
43 """One posted auction: a buyout, a starting bid, or both."""
44
45 id: int
46 item: AuctionItem
47 quantity: int
48 time_left: AuctionTimeLeft
49 bid: int | None = None
50 buyout: int | None = None
51
52
[docs]
53class AuctionHouseIndex(Document):
54 """Every auction house for one ruleset."""
55
56 auctions: tuple[Ref, ...]
57
58
[docs]
59class AuctionHouse(Document):
60 """One auction house, with its posted, non-stackable auctions.
61
62 Attributes:
63 ruleset: The ruleset the request was made through, not necessarily the house's own ruleset; Battle.net
64 echoes whichever ruleset id you asked with.
65 auctions: An empty house, such as house 112, carries none.
66 """
67
68 id: int
69 name: str
70 commodities: Link
71 ruleset: Link
72 auctions: tuple[AuctionEntry, ...] = ()
73
74
[docs]
75class CommodityEntry(Model):
76 """One posted stack of a commodity, sold at a fixed unit price with no bidding."""
77
78 id: int
79 item: AuctionItem
80 quantity: int
81 unit_price: int
82 time_left: AuctionTimeLeft
83
84
[docs]
85class CommodityHouse(Document):
86 """The commodities listed at one auction house: stackable items with no item modifiers, sold at a fixed price."""
87
88 auctions: tuple[CommodityEntry, ...] = ()