Skip to content

Commit

Permalink
Add missing TeamMember::role (serenity-rs#2861)
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed May 14, 2024
1 parent 6a2c8e8 commit 86a1816
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/model/application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
/// 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! {
Expand All @@ -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.
///
Expand Down

0 comments on commit 86a1816

Please sign in to comment.