From 460bbb0fe84598891b5b1984a9d4fb20b952a762 Mon Sep 17 00:00:00 2001 From: Leon Linhart Date: Thu, 21 Jan 2021 12:41:16 +0100 Subject: [PATCH] feat(spec): add /v2/pvp/amulets Closes #113 --- docs/changelog/0.3.0.md | 1 + .../com/gw2tb/apigen/internal/spec/GW2v2.kt | 29 ++- .../com/gw2tb/apigen/v2_pvp_amulets.json | 193 ++++++++++++++++++ .../com/gw2tb/apigen/test/spec/GW2v2.kt | 5 + 4 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/com/gw2tb/apigen/v2_pvp_amulets.json diff --git a/docs/changelog/0.3.0.md b/docs/changelog/0.3.0.md index 5ce8ce59..8b903548 100644 --- a/docs/changelog/0.3.0.md +++ b/docs/changelog/0.3.0.md @@ -33,6 +33,7 @@ _Not Released Yet_ - Added support for `/v2/novelties`. [[GH-108](https://github.com/GW2ToolBelt/api-generator/issues/108)] - Added support for `/v2/pets`. [[GH-110](https://github.com/GW2ToolBelt/api-generator/issues/110)] - Added support for `/v2/pvp`. [[GH-112](https://github.com/GW2ToolBelt/api-generator/issues/112)] + - Added support for `/v2/pvp/amulets`. [[GH-113](https://github.com/GW2ToolBelt/api-generator/issues/113)] - Added support for `/v2/pvp/heroes`. [[GH-115](https://github.com/GW2ToolBelt/api-generator/issues/115)] - Added support for `/v2/pvp/ranks`. [[GH-116](https://github.com/GW2ToolBelt/api-generator/issues/116)] - Added support for `/v2/quaggans`. [[GH-122](https://github.com/GW2ToolBelt/api-generator/issues/122)] diff --git a/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt b/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt index 27dc4514..aeaaf7d3 100644 --- a/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt +++ b/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt @@ -1463,8 +1463,35 @@ internal val GW2v2 = GW2APIVersion { schema(array(STRING, "the available sub-endpoints")) } + "/PvP/Amulets" { + summary = "Returns information about available PvP amulets." + cache = 1.hours + isLocalized = true + + supportedQueries(BY_ID, BY_IDS, BY_PAGE) + schema(record(name = "PvPAmulet", description = "Information about a PvP amulet.") { + CamelCase("id").."ID"(INTEGER, "the amulet's ID") + "Name"(STRING, "the amulet's localized name") + "Icon"(STRING, "a render service URL for the amulet's icon") + "Attributes"( + description = "the amulet's stats", + type = record(name = "Stats", description = "Information about an amulet's stats.") { + optional..SerialName("AgonyResistance").."AgonyResistance"(INTEGER, "the amount of agony resistance given by the amulet") + optional..SerialName("BoonDuration").."BoonDuration"(INTEGER, "the amount of boon duration given by the amulet") + optional..SerialName("ConditionDamage").."ConditionDamage"(INTEGER, "the amount of condition damage given by the amulet") + optional..SerialName("ConditionDuration").."ConditionDuration"(INTEGER, "the amount of condition duration given by the amulet") + optional..SerialName("CritDamage").."CritDamage"(INTEGER, "the amount of crit damage given by the amulet") + optional..SerialName("Healing").."Healing"(INTEGER, "the amount of healing given by the amulet") + optional..SerialName("Power").."Power"(INTEGER, "the amount of power given by the amulet") + optional..SerialName("Precision").."Precision"(INTEGER, "the amount of precision given by the amulet") + optional..SerialName("Toughness").."Toughness"(INTEGER, "the amount of toughness given by the amulet") + optional..SerialName("Vitality").."Vitality"(INTEGER, "the amount of vitality given by the amulet") + } + ) + }) + } "/PvP/Heroes" { - summary = "Returns information about the PvP heroes." + summary = "Returns information about available PvP heroes." cache = 1.hours isLocalized = true diff --git a/src/main/resources/com/gw2tb/apigen/v2_pvp_amulets.json b/src/main/resources/com/gw2tb/apigen/v2_pvp_amulets.json new file mode 100644 index 00000000..a39fadc5 --- /dev/null +++ b/src/main/resources/com/gw2tb/apigen/v2_pvp_amulets.json @@ -0,0 +1,193 @@ +[ + { + "id": 4, + "name": "Meucheler-Amulett", + "icon": "https://render.guildwars2.com/file/02E9EFDEF9587130A25F17AC396913FBBE3C716D/455602.png", + "attributes": { + "Precision": 1200, + "Power": 900, + "CritDamage": 900 + } + }, + { + "id": 8, + "name": "Berserker-Amulett", + "icon": "https://render.guildwars2.com/file/5044509F3DB0F391576CCAD891BC654DC5FE79B3/63600.png", + "attributes": { + "Power": 1200, + "Precision": 900, + "CritDamage": 900 + } + }, + { + "id": 9, + "name": "Faulendes Amulett", + "icon": "https://render.guildwars2.com/file/AA26E9092621670E6C55A65307B7F43C0CC5F138/63595.png", + "attributes": { + "ConditionDamage": 1200, + "Power": 900, + "Vitality": 900 + } + }, + { + "id": 13, + "name": "Tollwütiges Amulett", + "icon": "https://render.guildwars2.com/file/090C47B6BFC5F70B5BA83D3B0F4630A51F07ED34/220642.png", + "attributes": { + "ConditionDamage": 1200, + "Precision": 900, + "Toughness": 900 + } + }, + { + "id": 14, + "name": "Wüter-Amulett", + "icon": "https://render.guildwars2.com/file/E156072918919C4CDCA9C075D04CE365B13F724F/220655.png", + "attributes": { + "Precision": 1200, + "Power": 900, + "ConditionDamage": 900 + } + }, + { + "id": 18, + "name": "Walküren-Amulett", + "icon": "https://render.guildwars2.com/file/B9595BAFC57D70621D0A0C745C6E475FC540707C/66230.png", + "attributes": { + "Power": 1200, + "Vitality": 900, + "CritDamage": 900 + } + }, + { + "id": 20, + "name": "Marodeur-Amulett", + "icon": "https://render.guildwars2.com/file/1A0ED77906F73270CE9CC2E67C68429DD3FAB43E/1010501.png", + "attributes": { + "Power": 1000, + "Precision": 1000, + "CritDamage": 500, + "Vitality": 500 + } + }, + { + "id": 22, + "name": "Finsteres Amulett", + "icon": "https://render.guildwars2.com/file/6504267032DB14B7507F34685409563C283F08C6/222394.png", + "attributes": { + "ConditionDamage": 1200, + "Power": 900, + "Precision": 900 + } + }, + { + "id": 29, + "name": "Heilkundigen-Amulett", + "icon": "https://render.guildwars2.com/file/F5BBC542A696001AAC085192C64EC5E6A2769D56/1341197.png", + "attributes": { + "Power": 1000, + "Healing": 1000, + "Precision": 500, + "Vitality": 500 + } + }, + { + "id": 30, + "name": "Paladin-Amulett", + "icon": "https://render.guildwars2.com/file/690CCB0FF13943ABD065CECC056B9F439F12963F/1341199.png", + "attributes": { + "Power": 1000, + "Precision": 1000, + "Toughness": 400, + "Vitality": 400 + } + }, + { + "id": 31, + "name": "Weisen-Amulett", + "icon": "https://render.guildwars2.com/file/58143BE0060D92D1CD32BBD99DD12102F811960A/1341200.png", + "attributes": { + "Power": 1000, + "ConditionDamage": 1000, + "Vitality": 500, + "Healing": 500 + } + }, + { + "id": 34, + "name": "Demolierer-Amulett", + "icon": "https://render.guildwars2.com/file/C275399647F3744A0E0FEC071938B23EAE370704/1423719.png", + "attributes": { + "Power": 1000, + "Precision": 1000, + "Toughness": 500, + "CritDamage": 500 + } + }, + { + "id": 35, + "name": "Zerstörer-Amulett", + "icon": "https://render.guildwars2.com/file/7FC9D25204099E6B4CB57D0C05BD24993F1E0627/1423720.png", + "attributes": { + "Power": 1000, + "Precision": 1000, + "ConditionDamage": 500, + "CritDamage": 500 + } + }, + { + "id": 40, + "name": "Zauberer-Amulett", + "icon": "https://render.guildwars2.com/file/96079F0EB0C6CE0476D230AF7A05F4AAD4807207/1876172.png", + "attributes": { + "Power": 1000, + "ConditionDamage": 1000, + "Vitality": 500, + "Precision": 500 + } + }, + { + "id": 41, + "name": "Avatar-Amulett", + "icon": "https://render.guildwars2.com/file/AD9E18AA3B1C69200946FA5342B9B5C6A7B05097/1876167.png", + "attributes": { + "Power": 1000, + "Precision": 1000, + "Healing": 500, + "Vitality": 500 + } + }, + { + "id": 43, + "name": "Trauerndes Amulett", + "icon": "https://render.guildwars2.com/file/4C5B130518E4C07641C1CDD2AA0D62A176C852C5/1876168.png", + "attributes": { + "Power": 1000, + "ConditionDamage": 1000, + "Precision": 500, + "CritDamage": 500 + } + }, + { + "id": 44, + "name": "Marschal-Amulett", + "icon": "https://render.guildwars2.com/file/E33ABC39C515C4F776B7F4F8B29C422A0752F478/1876170.png", + "attributes": { + "Power": 1000, + "Healing": 1000, + "Precision": 500, + "ConditionDamage": 500 + } + }, + { + "id": 45, + "name": "Säbelrassler-Amulett", + "icon": "https://render.guildwars2.com/file/11A06FFE4CF0F92EF1BF65E87A99B5E8C4595028/1876171.png", + "attributes": { + "Power": 1000, + "Precision": 1000, + "ConditionDamage": 500, + "Vitality": 500 + } + } +] \ No newline at end of file diff --git a/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt b/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt index 3e7ac8f3..b6e4852e 100644 --- a/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt +++ b/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt @@ -359,6 +359,11 @@ class GW2v2 : SpecTest( expectEndpoint("/PvP") .cacheTime(DURATION_INFINITE) + expectEndpoint("/PvP/Amulets") + .cacheTime(1.hours) + .localized() + .queryTypes(BY_ID, BY_IDS, BY_PAGE) + expectEndpoint("/PvP/Heroes") .cacheTime(1.hours) .localized()