#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct UserV2 {
    #[serde(rename = "rid")]
    rid: super::UserRid,
    #[serde(rename = "orgRid")]
    org_rid: conjure_object::ResourceIdentifier,
    #[builder(into)]
    #[serde(rename = "email")]
    email: String,
    #[builder(into)]
    #[serde(rename = "displayName")]
    display_name: String,
    #[builder(into)]
    #[serde(rename = "avatarUrl")]
    avatar_url: String,
    #[builder(default, into)]
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none", default)]
    created_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
}
impl UserV2 {
    #[inline]
    pub fn rid(&self) -> &super::UserRid {
        &self.rid
    }
    #[inline]
    pub fn org_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.org_rid
    }
    #[inline]
    pub fn email(&self) -> &str {
        &*self.email
    }
    #[inline]
    pub fn display_name(&self) -> &str {
        &*self.display_name
    }
    /// Avatar URL or a default avatar if the user does not have one.
    #[inline]
    pub fn avatar_url(&self) -> &str {
        &*self.avatar_url
    }
    #[inline]
    pub fn created_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.created_at.as_ref().map(|o| *o)
    }
}
