Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50704,6 +50704,12 @@ components:
icon:
description: URL of the user's icon.
type: string
last_login_time:
description: The last time the user logged in.
format: date-time
nullable: true
readOnly: true
type: string
mfa_enabled:
description: If user has MFA enabled.
readOnly: true
Expand Down
19 changes: 19 additions & 0 deletions src/datadogV2/model/model_user_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ pub struct UserAttributes {
/// URL of the user's icon.
#[serde(rename = "icon")]
pub icon: Option<String>,
/// The last time the user logged in.
#[serde(
rename = "last_login_time",
default,
with = "::serde_with::rust::double_option"
)]
pub last_login_time: Option<Option<chrono::DateTime<chrono::Utc>>>,
/// If user has MFA enabled.
#[serde(rename = "mfa_enabled")]
pub mfa_enabled: Option<bool>,
Expand Down Expand Up @@ -62,6 +69,7 @@ impl UserAttributes {
email: None,
handle: None,
icon: None,
last_login_time: None,
mfa_enabled: None,
modified_at: None,
name: None,
Expand Down Expand Up @@ -99,6 +107,11 @@ impl UserAttributes {
self
}

pub fn last_login_time(mut self, value: Option<chrono::DateTime<chrono::Utc>>) -> Self {
self.last_login_time = Some(value);
self
}

pub fn mfa_enabled(mut self, value: bool) -> Self {
self.mfa_enabled = Some(value);
self
Expand Down Expand Up @@ -171,6 +184,7 @@ impl<'de> Deserialize<'de> for UserAttributes {
let mut email: Option<String> = None;
let mut handle: Option<String> = None;
let mut icon: Option<String> = None;
let mut last_login_time: Option<Option<chrono::DateTime<chrono::Utc>>> = None;
let mut mfa_enabled: Option<bool> = None;
let mut modified_at: Option<chrono::DateTime<chrono::Utc>> = None;
let mut name: Option<Option<String>> = None;
Expand Down Expand Up @@ -216,6 +230,10 @@ impl<'de> Deserialize<'de> for UserAttributes {
}
icon = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"last_login_time" => {
last_login_time =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"mfa_enabled" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -269,6 +287,7 @@ impl<'de> Deserialize<'de> for UserAttributes {
email,
handle,
icon,
last_login_time,
mfa_enabled,
modified_at,
name,
Expand Down