pub struct UsersAPI { /* private fields */ }Expand description
Create, edit, and disable users.
Implementations§
source§impl UsersAPI
impl UsersAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
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());
}
}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());
}
}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 with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
sourcepub async fn create_user(
&self,
body: User,
) -> Result<UserResponse, Error<CreateUserError>>
pub async fn create_user( &self, body: User, ) -> Result<UserResponse, Error<CreateUserError>>
Create a user for your organization.
Note: Users can only be created with the admin access role if application keys belong to administrators.
Examples found in repository?
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
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());
}
}sourcepub async fn create_user_with_http_info(
&self,
body: User,
) -> Result<ResponseContent<UserResponse>, Error<CreateUserError>>
pub async fn create_user_with_http_info( &self, body: User, ) -> Result<ResponseContent<UserResponse>, Error<CreateUserError>>
Create a user for your organization.
Note: Users can only be created with the admin access role if application keys belong to administrators.
sourcepub async fn disable_user(
&self,
user_handle: String,
) -> Result<UserDisableResponse, Error<DisableUserError>>
pub async fn disable_user( &self, user_handle: String, ) -> Result<UserDisableResponse, Error<DisableUserError>>
Delete a user from an organization.
Note: This endpoint can only be used with application keys belonging to administrators.
sourcepub async fn disable_user_with_http_info(
&self,
user_handle: String,
) -> Result<ResponseContent<UserDisableResponse>, Error<DisableUserError>>
pub async fn disable_user_with_http_info( &self, user_handle: String, ) -> Result<ResponseContent<UserDisableResponse>, Error<DisableUserError>>
Delete a user from an organization.
Note: This endpoint can only be used with application keys belonging to administrators.
sourcepub async fn get_user(
&self,
user_handle: String,
) -> Result<UserResponse, Error<GetUserError>>
pub async fn get_user( &self, user_handle: String, ) -> Result<UserResponse, Error<GetUserError>>
Get a user’s details.
sourcepub async fn get_user_with_http_info(
&self,
user_handle: String,
) -> Result<ResponseContent<UserResponse>, Error<GetUserError>>
pub async fn get_user_with_http_info( &self, user_handle: String, ) -> Result<ResponseContent<UserResponse>, Error<GetUserError>>
Get a user’s details.
sourcepub async fn list_users(
&self,
) -> Result<UserListResponse, Error<ListUsersError>>
pub async fn list_users( &self, ) -> Result<UserListResponse, Error<ListUsersError>>
List all users for your organization.
sourcepub async fn list_users_with_http_info(
&self,
) -> Result<ResponseContent<UserListResponse>, Error<ListUsersError>>
pub async fn list_users_with_http_info( &self, ) -> Result<ResponseContent<UserListResponse>, Error<ListUsersError>>
List all users for your organization.
sourcepub async fn update_user(
&self,
user_handle: String,
body: User,
) -> Result<UserResponse, Error<UpdateUserError>>
pub async fn update_user( &self, user_handle: String, body: User, ) -> Result<UserResponse, Error<UpdateUserError>>
Update a user information.
Note: It can only be used with application keys belonging to administrators.
Examples found in repository?
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 async fn update_user_with_http_info(
&self,
user_handle: String,
body: User,
) -> Result<ResponseContent<UserResponse>, Error<UpdateUserError>>
pub async fn update_user_with_http_info( &self, user_handle: String, body: User, ) -> Result<ResponseContent<UserResponse>, Error<UpdateUserError>>
Update a user information.
Note: It can only be used with application keys belonging to administrators.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UsersAPI
impl !RefUnwindSafe for UsersAPI
impl Send for UsersAPI
impl Sync for UsersAPI
impl Unpin for UsersAPI
impl !UnwindSafe for UsersAPI
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)