#[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>,
pub additional_properties: BTreeMap<String, Value>,
/* 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.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl User
impl User
Sourcepub fn new() -> User
pub fn new() -> User
Examples found in repository?
examples/v1_users_CreateUser_266604071.rs (line 8)
7async fn main() {
8 let body = User::new()
9 .access_role(None)
10 .disabled(false)
11 .email("test@datadoghq.com".to_string())
12 .handle("test@datadoghq.com".to_string())
13 .name("test user".to_string());
14 let configuration = datadog::Configuration::new();
15 let api = UsersAPI::with_config(configuration);
16 let resp = api.create_user(body).await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
More examples
examples/v1_users_CreateUser.rs (line 9)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api.create_user(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
examples/v1_users_UpdateUser.rs (line 9)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api
18 .update_user("test@datadoghq.com".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
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_CreateUser_266604071.rs (line 9)
7async fn main() {
8 let body = User::new()
9 .access_role(None)
10 .disabled(false)
11 .email("test@datadoghq.com".to_string())
12 .handle("test@datadoghq.com".to_string())
13 .name("test user".to_string());
14 let configuration = datadog::Configuration::new();
15 let api = UsersAPI::with_config(configuration);
16 let resp = api.create_user(body).await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
More examples
examples/v1_users_CreateUser.rs (line 10)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api.create_user(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
examples/v1_users_UpdateUser.rs (line 10)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api
18 .update_user("test@datadoghq.com".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
Sourcepub fn disabled(self, value: bool) -> Self
pub fn disabled(self, value: bool) -> Self
Examples found in repository?
examples/v1_users_CreateUser_266604071.rs (line 10)
7async fn main() {
8 let body = User::new()
9 .access_role(None)
10 .disabled(false)
11 .email("test@datadoghq.com".to_string())
12 .handle("test@datadoghq.com".to_string())
13 .name("test user".to_string());
14 let configuration = datadog::Configuration::new();
15 let api = UsersAPI::with_config(configuration);
16 let resp = api.create_user(body).await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
More examples
examples/v1_users_CreateUser.rs (line 11)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api.create_user(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
examples/v1_users_UpdateUser.rs (line 11)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api
18 .update_user("test@datadoghq.com".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
Sourcepub fn email(self, value: String) -> Self
pub fn email(self, value: String) -> Self
Examples found in repository?
examples/v1_users_CreateUser_266604071.rs (line 11)
7async fn main() {
8 let body = User::new()
9 .access_role(None)
10 .disabled(false)
11 .email("test@datadoghq.com".to_string())
12 .handle("test@datadoghq.com".to_string())
13 .name("test user".to_string());
14 let configuration = datadog::Configuration::new();
15 let api = UsersAPI::with_config(configuration);
16 let resp = api.create_user(body).await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
More examples
examples/v1_users_CreateUser.rs (line 12)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api.create_user(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
examples/v1_users_UpdateUser.rs (line 12)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api
18 .update_user("test@datadoghq.com".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
Sourcepub fn handle(self, value: String) -> Self
pub fn handle(self, value: String) -> Self
Examples found in repository?
examples/v1_users_CreateUser_266604071.rs (line 12)
7async fn main() {
8 let body = User::new()
9 .access_role(None)
10 .disabled(false)
11 .email("test@datadoghq.com".to_string())
12 .handle("test@datadoghq.com".to_string())
13 .name("test user".to_string());
14 let configuration = datadog::Configuration::new();
15 let api = UsersAPI::with_config(configuration);
16 let resp = api.create_user(body).await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
More examples
examples/v1_users_CreateUser.rs (line 13)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api.create_user(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
examples/v1_users_UpdateUser.rs (line 13)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api
18 .update_user("test@datadoghq.com".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
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_CreateUser_266604071.rs (line 13)
7async fn main() {
8 let body = User::new()
9 .access_role(None)
10 .disabled(false)
11 .email("test@datadoghq.com".to_string())
12 .handle("test@datadoghq.com".to_string())
13 .name("test user".to_string());
14 let configuration = datadog::Configuration::new();
15 let api = UsersAPI::with_config(configuration);
16 let resp = api.create_user(body).await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
More examples
examples/v1_users_CreateUser.rs (line 14)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api.create_user(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
examples/v1_users_UpdateUser.rs (line 14)
8async fn main() {
9 let body = User::new()
10 .access_role(Some(AccessRole::READ_ONLY))
11 .disabled(false)
12 .email("test@datadoghq.com".to_string())
13 .handle("test@datadoghq.com".to_string())
14 .name("test user".to_string());
15 let configuration = datadog::Configuration::new();
16 let api = UsersAPI::with_config(configuration);
17 let resp = api
18 .update_user("test@datadoghq.com".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
pub fn verified(self, value: bool) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> 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
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