From 86a1816ee6ed0b48a70f7b588c524a0ba5fd5379 Mon Sep 17 00:00:00 2001 From: Gnome! Date: Tue, 14 May 2024 01:08:55 +0100 Subject: [PATCH] Add missing TeamMember::role (#2861) --- src/model/application/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/model/application/mod.rs b/src/model/application/mod.rs index 769af479018..4beb12a254d 100644 --- a/src/model/application/mod.rs +++ b/src/model/application/mod.rs @@ -156,11 +156,14 @@ pub struct TeamMember { /// The list of permissions of the member on the team. /// /// NOTE: Will always be "*" for now. + #[deprecated = "This field is not sent by the API anymore"] pub permissions: Vec, /// The ID of the team they are a member of. pub team_id: GenericId, /// The user type of the team member. pub user: User, + /// The [`TeamMemberRole`] of the team member. + pub role: TeamMemberRole, } enum_number! { @@ -175,6 +178,17 @@ enum_number! { } } +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(rename_all = "snake_case")] +#[non_exhaustive] +pub enum TeamMemberRole { + Admin, + Developer, + ReadOnly, + #[serde(untagged)] + Other(String), +} + bitflags! { /// The flags of the application. ///