Skip to content

Commit 9ca5db7

Browse files
authored
Merge pull request #36 from Tornium/torngen/auto
[torngen] Generated v5.2.0
2 parents 59aa86b + 883d10c commit 9ca5db7

File tree

11 files changed

+182
-7
lines changed

11 files changed

+182
-7
lines changed

torngen/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.1.3
1+
5.2.0

torngen/base_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from base_path import Path
77
from base_schema import BaseSchema
88

9-
VERSION = "5.1.3"
9+
VERSION = "5.2.0"
1010

1111

1212
class _URLComponents(typing.NamedTuple):

torngen/path/faction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ class Faction(BaseQuery):
663663
key=Parameter("key", "query", required=False, deprecated=False),
664664
)
665665
"""
666-
`/faction/territoryownership`: Get a list of your faction's territories
666+
`/faction/territoryownership`: Get a list territory ownership
667667
Requires public access key.
668668
669669
# Parameters

torngen/path/market.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from base_query import BaseQuery
33
from parameter import Parameter
44

5+
from ..schema.auction_house_response import AuctionHouseResponse
56
from ..schema.bazaar_response import BazaarResponse
67
from ..schema.market_lookup_response import MarketLookupResponse
78
from ..schema.timestamp_response import TimestampResponse
@@ -32,6 +33,32 @@ class Market(BaseQuery):
3233
3334
"""
3435

36+
auctionhouse = Path(
37+
"/market/auctionhouse",
38+
AuctionHouseResponse,
39+
limit=Parameter("limit", "query", required=False, deprecated=False),
40+
sort=Parameter("sort", "query", required=False, deprecated=False),
41+
from_=Parameter("from", "query", required=False, deprecated=False),
42+
to=Parameter("to", "query", required=False, deprecated=False),
43+
timestamp=Parameter("timestamp", "query", required=False, deprecated=False),
44+
comment=Parameter("comment", "query", required=False, deprecated=False),
45+
key=Parameter("key", "query", required=False, deprecated=False),
46+
)
47+
"""
48+
`/market/auctionhouse`: Get auction house listings
49+
Requires public access key.
50+
51+
# Parameters
52+
- limit : N/A
53+
- sort : Sorted by the greatest timestamps
54+
- from_ : Timestamp that sets the lower limit for the data returned. Data returned will be after this time
55+
- to : Timestamp that sets the upper limit for the data returned. Data returned will be up to and including this time
56+
- timestamp : Timestamp to bypass cache
57+
- comment : Comment for your tool/service/bot/website to be visible in the logs.
58+
- key : API key (Public). It's not required to use this parameter when passing the API key via the Authorization header.
59+
60+
"""
61+
3562
lookup = Path(
3663
"/market/lookup",
3764
MarketLookupResponse,

torngen/path/market_id.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from base_query import BaseQuery
33
from parameter import Parameter
44

5+
from ..schema.auction_house_listing import AuctionHouseListing
6+
from ..schema.auction_house_response import AuctionHouseResponse
57
from ..schema.bazaar_response_specialized import BazaarResponseSpecialized
68
from ..schema.market_item_market_response import MarketItemMarketResponse
79

@@ -57,5 +59,53 @@ class MarketId(BaseQuery):
5759
5860
"""
5961

62+
auctionhouselisting = Path(
63+
"/market/{id}/auctionhouselisting",
64+
AuctionHouseListing,
65+
id=Parameter("id", "path", required=True, deprecated=False),
66+
timestamp=Parameter("timestamp", "query", required=False, deprecated=False),
67+
comment=Parameter("comment", "query", required=False, deprecated=False),
68+
key=Parameter("key", "query", required=False, deprecated=False),
69+
)
70+
"""
71+
`/market/{id}/auctionhouselisting`: Get specific item auction house listings
72+
Requires public access key.
73+
74+
# Parameters
75+
- id : Listing id
76+
- timestamp : Timestamp to bypass cache
77+
- comment : Comment for your tool/service/bot/website to be visible in the logs.
78+
- key : API key (Public). It's not required to use this parameter when passing the API key via the Authorization header.
79+
80+
"""
81+
82+
auctionhouse = Path(
83+
"/market/{id}/auctionhouse",
84+
AuctionHouseResponse,
85+
id=Parameter("id", "path", required=True, deprecated=False),
86+
limit=Parameter("limit", "query", required=False, deprecated=False),
87+
sort=Parameter("sort", "query", required=False, deprecated=False),
88+
from_=Parameter("from", "query", required=False, deprecated=False),
89+
to=Parameter("to", "query", required=False, deprecated=False),
90+
timestamp=Parameter("timestamp", "query", required=False, deprecated=False),
91+
comment=Parameter("comment", "query", required=False, deprecated=False),
92+
key=Parameter("key", "query", required=False, deprecated=False),
93+
)
94+
"""
95+
`/market/{id}/auctionhouse`: Get specific item auction house listings
96+
Requires public access key.
97+
98+
# Parameters
99+
- id : Item id
100+
- limit : N/A
101+
- sort : Sorted by the greatest timestamps
102+
- from_ : Timestamp that sets the lower limit for the data returned. Data returned will be after this time
103+
- to : Timestamp that sets the upper limit for the data returned. Data returned will be up to and including this time
104+
- timestamp : Timestamp to bypass cache
105+
- comment : Comment for your tool/service/bot/website to be visible in the logs.
106+
- key : API key (Public). It's not required to use this parameter when passing the API key via the Authorization header.
107+
108+
"""
109+
60110
def __init__(self):
61111
super().__init__(base_path="market/{id}")
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import typing
2+
from dataclasses import dataclass
3+
4+
from ..base_schema import BaseSchema
5+
from .auction_house_stackable_item import AuctionHouseStackableItem
6+
from .auction_listing_id import AuctionListingId
7+
from .basic_user import BasicUser
8+
from .torn_item_details import TornItemDetails
9+
10+
11+
@dataclass
12+
class AuctionHouseListing(BaseSchema):
13+
"""
14+
JSON object of `AuctionHouseListing`.
15+
"""
16+
17+
timestamp: int
18+
seller: BasicUser
19+
price: int
20+
item: TornItemDetails | AuctionHouseStackableItem
21+
id: AuctionListingId
22+
buyer: BasicUser
23+
bids: int
24+
25+
@staticmethod
26+
def parse(data):
27+
return AuctionHouseListing(
28+
timestamp=BaseSchema.parse(data.get("timestamp"), int),
29+
seller=BaseSchema.parse(data.get("seller"), BasicUser),
30+
price=BaseSchema.parse(data.get("price"), int),
31+
item=BaseSchema.parse(
32+
data.get("item"), TornItemDetails | AuctionHouseStackableItem
33+
),
34+
id=BaseSchema.parse(data.get("id"), AuctionListingId),
35+
buyer=BaseSchema.parse(data.get("buyer"), BasicUser),
36+
bids=BaseSchema.parse(data.get("bids"), int),
37+
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import typing
2+
from dataclasses import dataclass
3+
4+
from ..base_schema import BaseSchema
5+
from .auction_house_listing import AuctionHouseListing
6+
from .request_metadata_with_links import RequestMetadataWithLinks
7+
8+
9+
@dataclass
10+
class AuctionHouseResponse(BaseSchema):
11+
"""
12+
JSON object of `AuctionHouseResponse`.
13+
"""
14+
15+
auctionhouse: typing.List[AuctionHouseListing]
16+
_metadata: RequestMetadataWithLinks
17+
18+
@staticmethod
19+
def parse(data):
20+
return AuctionHouseResponse(
21+
auctionhouse=BaseSchema.parse(
22+
data.get("auctionhouse"), typing.List[AuctionHouseListing]
23+
),
24+
_metadata=BaseSchema.parse(data.get("_metadata"), RequestMetadataWithLinks),
25+
)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import typing
2+
from dataclasses import dataclass
3+
4+
from ..base_schema import BaseSchema
5+
from .item_id import ItemId
6+
from .item_uid import ItemUid
7+
from .torn_item_type_enum import TornItemTypeEnum
8+
9+
10+
@dataclass
11+
class AuctionHouseStackableItem(BaseSchema):
12+
"""
13+
JSON object of `AuctionHouseStackableItem`.
14+
"""
15+
16+
uid: ItemUid
17+
type: TornItemTypeEnum
18+
name: str
19+
id: ItemId
20+
21+
@staticmethod
22+
def parse(data):
23+
return AuctionHouseStackableItem(
24+
uid=BaseSchema.parse(data.get("uid"), ItemUid),
25+
type=BaseSchema.parse(data.get("type"), TornItemTypeEnum),
26+
name=BaseSchema.parse(data.get("name"), str),
27+
id=BaseSchema.parse(data.get("id"), ItemId),
28+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import typing
2+
3+
AuctionListingId = typing.NewType("AuctionListingId", int)

torngen/schema/market_selection_name.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
"lookup",
1111
"timestamp",
1212
"pointsmarket",
13+
"auctionhouse",
14+
"auctionhouselisting",
1315
]
1416
)

0 commit comments

Comments
 (0)