aboutsummaryrefslogtreecommitdiff
path: root/src/api/professions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/professions.rs')
-rw-r--r--src/api/professions.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/api/professions.rs b/src/api/professions.rs
new file mode 100644
index 0000000..2716a1a
--- /dev/null
+++ b/src/api/professions.rs
@@ -0,0 +1,36 @@
+//! Struct definitions for the professions API endpoint.
+//!
+//! * [Example](https://api.guildwars2.com/v2/professions/Engineer)
+//! * [Wiki](https://wiki.guildwars2.com/wiki/API:2/professions)
+
+use super::HasId;
+use serde::{Deserialize, Serialize};
+
+#[derive(Deserialize, Serialize, Debug, Clone)]
+pub struct Profession {
+ /// The profession id.
+ pub id: String,
+ /// The name of the profession.
+ pub name: String,
+ /// List of specialization ids.
+ pub specializations: Vec<u32>,
+ /// List of skills.
+ pub skills: Vec<Skill>,
+}
+
+impl HasId for Profession {
+ type Id = String;
+ fn get_id(&self) -> String {
+ self.id.clone()
+ }
+}
+
+#[derive(Deserialize, Serialize, Debug, Clone)]
+pub struct Skill {
+ /// The id of the skill.
+ pub id: u32,
+ /// The skill bar slot that this skill can be used in.
+ pub slot: String,
+ #[serde(rename = "type")]
+ pub typ: String,
+}