wp_mini/field/
user_field.rs

1use crate::field::{AuthRequiredFields, DefaultableFields};
2use strum_macros::{AsRefStr, Display};
3
4/// Represents the fields that can be requested for a `User` object from the Wattpad API.
5#[derive(Debug, Clone, Display, AsRefStr, PartialEq, Eq, Ord, PartialOrd, Hash)]
6#[strum(serialize_all = "camelCase")]
7pub enum UserField {
8    /// The user's unique, public username.
9    Username,
10    /// The URL for the user's profile picture (avatar).
11    Avatar,
12    /// A boolean flag indicating if the user's profile is private.
13    IsPrivate,
14    /// The URL for the user's profile background image.
15    BackgroundUrl,
16    /// The user's full display name.
17    Name,
18    /// The "About Me" or biography section of the user's profile.
19    Description,
20    /// A list of badges the user has earned.
21    Badges,
22    /// The user's current status message.
23    Status,
24    /// The user's specified gender as a string.
25    Gender,
26    /// A numerical code representing the user's gender.
27    GenderCode,
28    /// The numerical identifier for the user's preferred language.
29    Language,
30    /// The user's locale string (e.g., "en_US").
31    Locale,
32    /// The timestamp when the user's account was created.
33    CreateDate,
34    /// The timestamp when the user's profile was last modified.
35    ModifyDate,
36    /// The user's self-reported location.
37    Location,
38    /// A boolean flag indicating if the user is a verified account (e.g., a celebrity or public figure).
39    Verified,
40    /// A boolean flag indicating if the user is a Wattpad Ambassador.
41    Ambassador,
42    /// A link to the user's Facebook profile.
43    Facebook,
44    /// A link to the user's personal website.
45    Website,
46    /// A link to the user's Lulu profile.
47    Lulu,
48    /// A link to the user's Smashwords profile.
49    Smashwords,
50    /// A link to the user's Bubok profile.
51    Bubok,
52    /// The total number of votes received across all of the user's stories.
53    VotesReceived,
54    /// The number of stories the user has published.
55    NumStoriesPublished,
56    /// The number of other users this user is following.
57    NumFollowing,
58    /// The number of followers this user has.
59    NumFollowers,
60    /// The number of public messages on the user's profile.
61    NumMessages,
62    /// The number of public reading lists the user has created.
63    NumLists,
64    /// A boolean flag indicating if the user has verified their email address.
65    #[strum(serialize = "verified_email")]
66    VerifiedEmail,
67    /// A list of the user's preferred reading categories.
68    #[strum(serialize = "preferred_categories")]
69    PreferredCategories,
70    /// A boolean flag indicating if the user allows search engine crawlers to index their profile.
71    AllowCrawler,
72    /// A deep link URL for the user's profile, often used for mobile app integration.
73    Deeplink,
74}
75
76impl DefaultableFields for UserField {
77    fn default_fields() -> Vec<Self> {
78        vec![
79            Self::Username,
80            Self::Avatar,
81            Self::BackgroundUrl,
82            Self::Name,
83            Self::Description,
84            Self::CreateDate,
85            Self::ModifyDate,
86            Self::VotesReceived,
87            Self::NumStoriesPublished,
88            Self::NumFollowing,
89            Self::NumFollowers,
90            Self::NumMessages,
91            Self::NumLists,
92        ]
93    }
94}
95
96impl AuthRequiredFields for UserField {}