Struct datadog_api_client::datadogV1::model::model_user::User
source · #[non_exhaustive]pub struct User {
pub access_role: Option<Option<AccessRole>>,
pub disabled: Option<bool>,
pub email: Option<String>,
pub handle: Option<String>,
pub icon: Option<String>,
pub name: Option<String>,
pub verified: Option<bool>,
/* private fields */
}
Expand description
Create, edit, and disable users.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.access_role: Option<Option<AccessRole>>
The access role of the user. Options are st (standard user), adm (admin user), or ro (read-only user).
disabled: Option<bool>
The new disabled status of the user.
email: Option<String>
The new email of the user.
handle: Option<String>
The user handle, must be a valid email.
icon: Option<String>
Gravatar icon associated to the user.
name: Option<String>
The name of the user.
verified: Option<bool>
Whether or not the user logged in Datadog at least once.
Implementations§
source§impl User
impl User
sourcepub fn new() -> User
pub fn new() -> User
Examples found in repository?
examples/v1_users_create_user_266604071.rs (line 8)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let body = User::new()
.access_role(None)
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
More examples
examples/v1_users_create_user.rs (line 9)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
examples/v1_users_update_user.rs (line 9)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api
.update_user("test@datadoghq.com".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
sourcepub fn access_role(self, value: Option<AccessRole>) -> Self
pub fn access_role(self, value: Option<AccessRole>) -> Self
Examples found in repository?
examples/v1_users_create_user_266604071.rs (line 9)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let body = User::new()
.access_role(None)
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
More examples
examples/v1_users_create_user.rs (line 10)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
examples/v1_users_update_user.rs (line 10)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api
.update_user("test@datadoghq.com".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
sourcepub fn disabled(self, value: bool) -> Self
pub fn disabled(self, value: bool) -> Self
Examples found in repository?
examples/v1_users_create_user_266604071.rs (line 10)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let body = User::new()
.access_role(None)
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
More examples
examples/v1_users_create_user.rs (line 11)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
examples/v1_users_update_user.rs (line 11)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api
.update_user("test@datadoghq.com".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
sourcepub fn email(self, value: String) -> Self
pub fn email(self, value: String) -> Self
Examples found in repository?
examples/v1_users_create_user_266604071.rs (line 11)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let body = User::new()
.access_role(None)
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
More examples
examples/v1_users_create_user.rs (line 12)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
examples/v1_users_update_user.rs (line 12)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api
.update_user("test@datadoghq.com".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
sourcepub fn handle(self, value: String) -> Self
pub fn handle(self, value: String) -> Self
Examples found in repository?
examples/v1_users_create_user_266604071.rs (line 12)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let body = User::new()
.access_role(None)
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
More examples
examples/v1_users_create_user.rs (line 13)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
examples/v1_users_update_user.rs (line 13)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api
.update_user("test@datadoghq.com".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
pub fn icon(self, value: String) -> Self
sourcepub fn name(self, value: String) -> Self
pub fn name(self, value: String) -> Self
Examples found in repository?
examples/v1_users_create_user_266604071.rs (line 13)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let body = User::new()
.access_role(None)
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
More examples
examples/v1_users_create_user.rs (line 14)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
examples/v1_users_update_user.rs (line 14)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api
.update_user("test@datadoghq.com".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
pub fn verified(self, value: bool) -> Self
Trait Implementations§
source§impl<'de> Deserialize<'de> for User
impl<'de> Deserialize<'de> for User
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for User
impl PartialEq for User
impl StructuralPartialEq for User
Auto Trait Implementations§
impl Freeze for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnwindSafe for User
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)