From f744afda9696d3e6cb5e77fd7dda71704457b671 Mon Sep 17 00:00:00 2001 From: Leon Linhart Date: Tue, 19 Jan 2021 13:32:22 +0100 Subject: [PATCH] feat(spec): add /v2/account/luck Closes #15 --- docs/changelog/0.3.0.md | 1 + .../kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt | 12 ++++++++++++ .../resources/com/gw2tb/apigen/v2_account_luck.json | 6 ++++++ src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt | 3 +++ 4 files changed, 22 insertions(+) create mode 100644 src/main/resources/com/gw2tb/apigen/v2_account_luck.json diff --git a/docs/changelog/0.3.0.md b/docs/changelog/0.3.0.md index f1c875ea..3791320d 100644 --- a/docs/changelog/0.3.0.md +++ b/docs/changelog/0.3.0.md @@ -6,6 +6,7 @@ _Not Released Yet_ - Endpoints: - Added support for `/v2/account/home`. [[GH-11](https://github.com/GW2ToolBelt/api-generator/issues/11)] + - 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)] - Added support for `/v2/achievements/categories`. [[GH-36](https://github.com/GW2ToolBelt/api-generator/issues/36)] 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 d2cf2041..e2bdc2a7 100644 --- a/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt +++ b/src/main/kotlin/com/gw2tb/apigen/internal/spec/GW2v2.kt @@ -185,6 +185,18 @@ internal val GW2v2 = GW2APIVersion { } )) } + "/Account/Luck" { + summary = "Returns information about a player's luck." + security = setOf(ACCOUNT, PROGRESSION, UNLOCKS) + + schema(array( + description = "the account's luck", + items = record(name = "Luck", description = "Information about a plyer's luck.") { + CamelCase("id").."ID"(INTEGER, "the type of luck (always \"luck\")") + "Value"(INTEGER, "the amount of luck") + } + )) + } "/Account/Mailcarriers" { summary = "Returns information about a player's unlocked mail carriers." security = setOf(ACCOUNT, UNLOCKS) diff --git a/src/main/resources/com/gw2tb/apigen/v2_account_luck.json b/src/main/resources/com/gw2tb/apigen/v2_account_luck.json new file mode 100644 index 00000000..45fab583 --- /dev/null +++ b/src/main/resources/com/gw2tb/apigen/v2_account_luck.json @@ -0,0 +1,6 @@ +[ + { + "id": "luck", + "value": 2300780 + } +] \ 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 f4436b3a..c208adb6 100644 --- a/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt +++ b/src/test/kotlin/com/gw2tb/apigen/test/spec/GW2v2.kt @@ -67,6 +67,9 @@ class GW2v2 : SpecTest( expectEndpoint("/Account/Inventory") .security(ACCOUNT, INVENTORIES) + expectEndpoint("/Account/Luck") + .security(ACCOUNT, PROGRESSION, UNLOCKS) + expectEndpoint("/Account/Mailcarriers") .security(ACCOUNT, UNLOCKS)