wp_mini/field/
user_stub_field.rs

1use crate::field::DefaultableFields;
2use strum_macros::{Display, EnumIter};
3
4/// Represents the fields for a `UserStub` object.
5///
6/// A `UserStub` is a lightweight or summary representation of a user,
7/// often embedded in other API objects like stories or comments.
8#[derive(Debug, Clone, Copy, Display, EnumIter, PartialEq, Eq, Ord, PartialOrd, Hash)]
9#[strum(serialize_all = "camelCase")]
10pub enum UserStubField {
11    /// The user's unique username.
12    #[strum(serialize = "name")]
13    Username,
14    /// The URL for the user's profile picture (avatar).
15    Avatar,
16    /// The user's full display name.
17    #[strum(serialize = "fullname")]
18    FullName,
19    /// A boolean flag indicating if the user is a verified account.
20    Verified,
21}
22
23impl DefaultableFields for UserStubField {
24    fn default_fields() -> Vec<Self> {
25        vec![Self::Username, Self::Avatar]
26    }
27}