Skip to content

Commit e5c4c80

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add last_login_time to Users v2 API (#960)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0da5a40 commit e5c4c80

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54006,6 +54006,12 @@ components:
5400654006
icon:
5400754007
description: URL of the user's icon.
5400854008
type: string
54009+
last_login_time:
54010+
description: The last time the user logged in.
54011+
format: date-time
54012+
nullable: true
54013+
readOnly: true
54014+
type: string
5400954015
mfa_enabled:
5401054016
description: If user has MFA enabled.
5401154017
readOnly: true

src/datadogV2/model/model_user_attributes.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ pub struct UserAttributes {
2626
/// URL of the user's icon.
2727
#[serde(rename = "icon")]
2828
pub icon: Option<String>,
29+
/// The last time the user logged in.
30+
#[serde(
31+
rename = "last_login_time",
32+
default,
33+
with = "::serde_with::rust::double_option"
34+
)]
35+
pub last_login_time: Option<Option<chrono::DateTime<chrono::Utc>>>,
2936
/// If user has MFA enabled.
3037
#[serde(rename = "mfa_enabled")]
3138
pub mfa_enabled: Option<bool>,
@@ -62,6 +69,7 @@ impl UserAttributes {
6269
email: None,
6370
handle: None,
6471
icon: None,
72+
last_login_time: None,
6573
mfa_enabled: None,
6674
modified_at: None,
6775
name: None,
@@ -99,6 +107,11 @@ impl UserAttributes {
99107
self
100108
}
101109

110+
pub fn last_login_time(mut self, value: Option<chrono::DateTime<chrono::Utc>>) -> Self {
111+
self.last_login_time = Some(value);
112+
self
113+
}
114+
102115
pub fn mfa_enabled(mut self, value: bool) -> Self {
103116
self.mfa_enabled = Some(value);
104117
self
@@ -171,6 +184,7 @@ impl<'de> Deserialize<'de> for UserAttributes {
171184
let mut email: Option<String> = None;
172185
let mut handle: Option<String> = None;
173186
let mut icon: Option<String> = None;
187+
let mut last_login_time: Option<Option<chrono::DateTime<chrono::Utc>>> = None;
174188
let mut mfa_enabled: Option<bool> = None;
175189
let mut modified_at: Option<chrono::DateTime<chrono::Utc>> = None;
176190
let mut name: Option<Option<String>> = None;
@@ -216,6 +230,10 @@ impl<'de> Deserialize<'de> for UserAttributes {
216230
}
217231
icon = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
218232
}
233+
"last_login_time" => {
234+
last_login_time =
235+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
236+
}
219237
"mfa_enabled" => {
220238
if v.is_null() {
221239
continue;
@@ -269,6 +287,7 @@ impl<'de> Deserialize<'de> for UserAttributes {
269287
email,
270288
handle,
271289
icon,
290+
last_login_time,
272291
mfa_enabled,
273292
modified_at,
274293
name,

0 commit comments

Comments
 (0)