Skip to content

Commit

Permalink
feat(spec): added support for /v2/characters/:id/equipment
Browse files Browse the repository at this point in the history
Closes #53
  • Loading branch information
TheMrMilchmann committed Apr 3, 2022
1 parent 38b6616 commit c2becd6
Show file tree
Hide file tree
Showing 7 changed files with 530 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/api-generator.api
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public final class com/gw2tb/apigen/APIv2Endpoint : java/lang/Enum {
public static final field V2_CHARACTERS_BUILDTABS Lcom/gw2tb/apigen/APIv2Endpoint;
public static final field V2_CHARACTERS_CORE Lcom/gw2tb/apigen/APIv2Endpoint;
public static final field V2_CHARACTERS_CRAFTING Lcom/gw2tb/apigen/APIv2Endpoint;
public static final field V2_CHARACTERS_EQUIPMENT Lcom/gw2tb/apigen/APIv2Endpoint;
public static final field V2_CHARACTERS_EQUIPMENTTABS Lcom/gw2tb/apigen/APIv2Endpoint;
public static final field V2_CHARACTERS_EQUIPMENTTABS_ACTIVE Lcom/gw2tb/apigen/APIv2Endpoint;
public static final field V2_CHARACTERS_HEROPOINTS Lcom/gw2tb/apigen/APIv2Endpoint;
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/0.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ _Not Released Yet_

- Endpoints:
- Added support for `/v2/account/legendaryarmory`. [[GH-179](https://github.com/GW2ToolBelt/api-generator/issues/179)]
- Added support for `/v2/characters/:id/equipment`. [[GH-53](https://github.com/GW2ToolBelt/api-generator/issues/53)]
- Added support for `/v2/characters/:id/equipmenttabs`. [[GH-54](https://github.com/GW2ToolBelt/api-generator/issues/54)]
- Added support for `/v2/characters/:id/equipmenttabs/active`. [[GH-55](https://github.com/GW2ToolBelt/api-generator/issues/55)]
- Added support for `/v2/guild/:id/log`. [[GH-82](https://github.com/GW2ToolBelt/api-generator/issues/82)]
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/com/gw2tb/apigen/APIv2Endpoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public enum class APIv2Endpoint(internal val endpointName: String) {
V2_CHARACTERS_BUILDTABS("/Characters/:ID/BuildTabs"),
V2_CHARACTERS_CORE("/Characters/:ID/Core"),
V2_CHARACTERS_CRAFTING("/Characters/:ID/Crafting"),
V2_CHARACTERS_EQUIPMENT("/Characters/:ID/Equipment"),
V2_CHARACTERS_EQUIPMENTTABS("/Characters/:ID/EquipmentTabs"),
V2_CHARACTERS_EQUIPMENTTABS_ACTIVE("/Characters/:ID/EquipmentTabs/Active"),
V2_CHARACTERS_HEROPOINTS("/Characters/:ID/HeroPoints"),
Expand Down
46 changes: 46 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 @@ -806,6 +806,52 @@ internal val GW2v2 = GW2APISpecV2 {
)
})
}
V2_CHARACTERS_EQUIPMENT(
summary = "Returns information about a character's equipment.",
security = security(ACCOUNT, BUILDS, CHARACTERS)
) {
pathParameter("ID", STRING, "the character's ID", camelCase = "id")

schema(record(name = "CharactersEquipment", description = "Information about a character's equipment.") {
"Equipment"(
description = "the character's equipment",
type = array(record(name = "EquipmentSlot", description = "Information a character's equipment slot.") {
CamelCase("id").."ID"(INTEGER, "the equipment piece's item ID")
until(V2_SCHEMA_2019_12_19T00_00_00_000Z).."Slot"(STRING, "the equipment piece's slot")
since(V2_SCHEMA_2019_12_19T00_00_00_000Z)..optional.."Slot"(STRING, "the equipment piece's slot")
optional.."Skin"(SKIN_ID, "the ID of the skin transmuted onto the equipment piece")
optional.."Dyes"(array(INTEGER, nullableItems = true), "the IDs of the dyes applied to the item")
optional.."Upgrades"(array(INTEGER), "the IDs of the upgrade components slotted into the item")
optional.."Infusions"(array(INTEGER), "the IDs of the infusions slotted into the item")
optional.."Charges"(INTEGER, "the amount of charges remaining on the item")
optional.."Binding"(STRING, "the binding of the item")
optional..SerialName("bound_to").."BoundTo"(STRING, "name of the character the item is bound to")
optional.."Stats"(
description = "contains information on the stats chosen if the item offers an option for stats/prefix",
type = record(name = "Stats", description = "Information about an item's stats.") {
CamelCase("id").."ID"(INTEGER, "the itemstat ID")
"Attributes"(
description = "the item's attributes",
type = record(name = "Attributes", description = "Information about an item's attributes.") {
optional..SerialName("Power").."Power"(INTEGER, "the amount of power given by the item")
optional..SerialName("Precision").."Precision"(INTEGER, "the amount of precision given by the item")
optional..SerialName("CritDamage").."CritDamage"(INTEGER, "the amount of crit damage given by the item")
optional..SerialName("Toughness").."Toughness"(INTEGER, "the amount of toughness given by the item")
optional..SerialName("Vitality").."Vitality"(INTEGER, "the amount of vitality given by the item")
optional..SerialName("ConditionDamage").."ConditionDamage"(INTEGER, "the amount of condition damage given by the item")
optional..SerialName("ConditionDuration").."ConditionDuration"(INTEGER, "the amount of condition duration given by the item")
optional..SerialName("Healing").."Healing"(INTEGER, "the amount of healing given by the item")
optional..SerialName("BoonDuration").."BoonDuration"(INTEGER, "the amount of boon duration given by the item")
}
)
}
)
since(V2_SCHEMA_2019_12_19T00_00_00_000Z).."Location"(STRING, "the storage location of the equipment piece")
since(V2_SCHEMA_2019_12_19T00_00_00_000Z)..optional.."Tabs"(array(INTEGER), "the IDs of the tabs in which this item is used")
})
)
})
}
V2_CHARACTERS_EQUIPMENTTABS(
idTypeKey = "tab",
summary = "Returns information about a character's equipment.",
Expand Down
Loading

0 comments on commit c2becd6

Please sign in to comment.