Skip to content

Commit

Permalink
feat(spec): add /v2/achievements/daily and /v2/achievements/daily/tom…
Browse files Browse the repository at this point in the history
…orrow

Closes #37
Closes #38
  • Loading branch information
TheMrMilchmann committed Jan 21, 2021
1 parent 4775ed4 commit 4f0d569
Show file tree
Hide file tree
Showing 7 changed files with 1,208 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/changelog/0.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ _Not Released Yet_
- 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)]
- Added support for `/v2/achievements/categories`. [[GH-36](https://github.com/GW2ToolBelt/api-generator/issues/36)]
- Added support for `/v2/achievements/daily`. [[GH-37](https://github.com/GW2ToolBelt/api-generator/issues/37)]
- Added support for `/v2/achievements/daily/tomorrow`. [[GH-38](https://github.com/GW2ToolBelt/api-generator/issues/38)]
- Added support for `/v2/achievements/groups`. [[GH-39](https://github.com/GW2ToolBelt/api-generator/issues/39)]
- Added support for `/v2/backstory`.
- Added support for `/v2/backstory/answers`. [[GH-43](https://github.com/GW2ToolBelt/api-generator/issues/43)]
Expand Down
48 changes: 48 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 @@ -464,6 +464,54 @@ internal val GW2v2 = GW2APIVersion {
"Achievements"(array(INTEGER), "an array containing the IDs of the achievements that this category contains")
})
}
"/Achievements/Daily" {
summary = "Returns information about daily achievements."

@APIGenDSL
fun SchemaRecordBuilder.DAILY_ACHIEVEMENT() = record(name = "Achievement", description = "Information about a daily achievement.") {
CamelCase("id").."ID"(INTEGER, "the achievement's ID")
"Level"(
description = "the level requirement for the daily achievement to appear",
type = record(name = "LevelRequirement", description = "Information about the level requirement of a daily achievement.") {
"Min"(INTEGER, "the minimum level for a character to the daily achievement")
"Max"(INTEGER, "the maximum level for a character to the daily achievement")
}
)
SerialName("required_access").."RequiredAccess"(array(STRING), "the GW2 campaigns required to see the daily achievement")
}

schema(record(name = "AchievementsDaily", description = "Information about daily achievements.") {
CamelCase("pve").."PvE"(array(DAILY_ACHIEVEMENT()), "the PvE achievements")
CamelCase("pvp").."PvP"(array(DAILY_ACHIEVEMENT()), "the PvP achievements")
CamelCase("wvw").."WvW"(array(DAILY_ACHIEVEMENT()), "the WvW achievements")
"Fractals"(array(DAILY_ACHIEVEMENT()), "the fractal achievements")
"Special"(array(DAILY_ACHIEVEMENT()), "the special achievements (e.g. festival dailies)")
})
}
"/Achievements/Daily/Tomorrow" {
summary = "Returns information about tomorrow's daily achievements."

@APIGenDSL
fun SchemaRecordBuilder.DAILY_ACHIEVEMENT() = record(name = "Achievement", description = "Information about a daily achievement.") {
CamelCase("id").."ID"(INTEGER, "the achievement's ID")
"Level"(
description = "the level requirement for the daily achievement to appear",
type = record(name = "LevelRequirement", description = "Information about the level requirement of a daily achievement.") {
"Min"(INTEGER, "the minimum level for a character to the daily achievement")
"Max"(INTEGER, "the maximum level for a character to the daily achievement")
}
)
SerialName("required_access").."RequiredAccess"(array(STRING), "the GW2 campaigns required to see the daily achievement")
}

schema(record(name = "AchievementsDailyTomorrow", description = "Information about daily achievements.") {
CamelCase("pve").."PvE"(array(DAILY_ACHIEVEMENT()), "the PvE achievements")
CamelCase("pvp").."PvP"(array(DAILY_ACHIEVEMENT()), "the PvP achievements")
CamelCase("wvw").."WvW"(array(DAILY_ACHIEVEMENT()), "the WvW achievements")
"Fractals"(array(DAILY_ACHIEVEMENT()), "the fractal achievements")
"Special"(array(DAILY_ACHIEVEMENT()), "the special achievements (e.g. festival dailies)")
})
}
"/Achievements/Groups" {
summary = "Returns information about achievement groups."
cache = 1.hours
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"pve": [
{
"id": 1974,
"level": {
"min": 70,
"max": 80
}
},
{
"id": 1973,
"level": {
"min": 1,
"max": 69
}
},
{
"id": 1931,
"level": {
"min": 11,
"max": 80
}
},
{
"id": 1956,
"level": {
"min": 15,
"max": 80
}
},
{
"id": 1953,
"level": {
"min": 11,
"max": 14
}
},
{
"id": 1989,
"level": {
"min": 31,
"max": 80
}
}
],
"pvp": [
{
"id": 2817,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 1857,
"level": {
"min": 11,
"max": 80
}
},
{
"id": 3449,
"level": {
"min": 11,
"max": 80
}
},
{
"id": 3450,
"level": {
"min": 31,
"max": 80
}
}
],
"wvw": [
{
"id": 1848,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 1852,
"level": {
"min": 11,
"max": 80
}
},
{
"id": 1843,
"level": {
"min": 11,
"max": 80
}
},
{
"id": 1845,
"level": {
"min": 31,
"max": 80
}
}
],
"fractals": [
{
"id": 2327,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 2592,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 3238,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 2978,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 2899,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 2962,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 2932,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 5447,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 5449,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 5437,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 5446,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 4244,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 4218,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 4210,
"level": {
"min": 1,
"max": 80
}
},
{
"id": 4224,
"level": {
"min": 1,
"max": 80
}
}
],
"special": []
}
Loading

0 comments on commit 4f0d569

Please sign in to comment.