Skip to content

Commit

Permalink
feat(spec): add /v2/account/home/cats
Browse files Browse the repository at this point in the history
Closes #12
  • Loading branch information
TheMrMilchmann committed Jan 21, 2021
1 parent 168f158 commit 9c2bf25
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog/0.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ _Not Released Yet_
- Endpoints:
- Added support for `/v2/account/buildstorage`. [[GH-4](https://github.com/GW2ToolBelt/api-generator/issues/4)]
- Added support for `/v2/account/home`. [[GH-11](https://github.com/GW2ToolBelt/api-generator/issues/11)]
- Added support for `/v2/account/home/cats`. [[GH-12](https://github.com/GW2ToolBelt/api-generator/issues/12)]
- Added support for `/v2/account/luck`. [[GH-15](https://github.com/GW2ToolBelt/api-generator/issues/15)]
- Added support for `/v2/account/mounts`. [[GH-23](https://github.com/GW2ToolBelt/api-generator/issues/23)]
- Added support for `/v2/achievements`. [[GH-35](https://github.com/GW2ToolBelt/api-generator/issues/35)]
Expand Down
15 changes: 15 additions & 0 deletions src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,21 @@ internal val GW2v2 = GW2APIVersion {

schema(array(STRING, "the available sub-endpoints"))
}
"/Account/Home/Cats" {
summary = "Returns information about a player's unlock home instance cats."
security = setOf(ACCOUNT, PROGRESSION, UNLOCKS)

schema(
V2_SCHEMA_CLASSIC to array(
description = "the IDs of the player's unlocked home instance cats",
items = record(name = "AccountHomeInstanceCat", description = "Information about a player's unlocked home-instance cat.") {
CamelCase("id").."ID"(INTEGER, "the cat's ID")
"Hint"(STRING, "the unlock hint")
}
),
V2_SCHEMA_2019_03_22T00_00_00_000Z to array(INTEGER, "the IDs of the player's unlocked home instance cats")
)
}
"/Account/Home/Nodes" {
summary = "Returns information about a player's unlocked home instance nodes."
security = setOf(ACCOUNT, PROGRESSION)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
2,
24,
1,
20
]
18 changes: 18 additions & 0 deletions src/main/resources/com/gw2tb/apigen/v2_account_home_cats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"id": 2,
"hint": "grilled_chicken"
},
{
"id": 24,
"hint": "snow_leopard"
},
{
"id": 1,
"hint": "chicken"
},
{
"id": 20,
"hint": "necromancer"
}
]
3 changes: 3 additions & 0 deletions src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class GW2v2 : SpecTest(
expectEndpoint("/Account/Home")
.cacheTime(DURATION_INFINITE)

expectEndpoint("/Account/Home/Cats")
.security(ACCOUNT, PROGRESSION, UNLOCKS)

expectEndpoint("/Account/Home/Nodes")
.security(ACCOUNT, PROGRESSION)

Expand Down

0 comments on commit 9c2bf25

Please sign in to comment.