pub struct TeamsAPI { /* private fields */ }Expand description
View and manage teams within Datadog. See the Teams page for more information.
Implementations§
source§impl TeamsAPI
impl TeamsAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.get_team(dd_team_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
// there is a valid "user" in the system
let user_data_id = std::env::var("USER_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.get_user_memberships(user_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.delete_team(dd_team_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.get_team_links(dd_team_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}9 10 11 12 13 14 15 16 17 18 19 20 21
async fn main() {
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let response = api.list_teams_with_pagination(ListTeamsOptionalParams::default().page_size(2));
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}- examples/v2_teams_ListTeams_3429963470.rs
- examples/v2_teams_GetTeamPermissionSettings.rs
- examples/v2_teams_DeleteTeamMembership.rs
- examples/v2_teams_GetTeamMemberships.rs
- examples/v2_teams_GetTeamMemberships_3799131168.rs
- examples/v2_teams_UpdateTeamMembership.rs
- examples/v2_teams_GetTeamLink.rs
- examples/v2_teams_DeleteTeamLink.rs
- examples/v2_teams_CreateTeamLink.rs
- examples/v2_teams_CreateTeam.rs
- examples/v2_teams_CreateTeam_252121814.rs
- examples/v2_teams_UpdateTeamLink.rs
- examples/v2_teams_UpdateTeamPermissionSetting.rs
- examples/v2_teams_UpdateTeam.rs
- examples/v2_teams_CreateTeamMembership.rs
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
sourcepub async fn create_team(
&self,
body: TeamCreateRequest,
) -> Result<TeamResponse, Error<CreateTeamError>>
pub async fn create_team( &self, body: TeamCreateRequest, ) -> Result<TeamResponse, Error<CreateTeamError>>
Create a new team.
User IDs passed through the users relationship field are added to the team.
Examples found in repository?
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
async fn main() {
let body = TeamCreateRequest::new(
TeamCreate::new(
TeamCreateAttributes::new(
"test-handle-a0fc0297eb519635".to_string(),
"test-name-a0fc0297eb519635".to_string(),
),
TeamType::TEAM,
)
.relationships(TeamCreateRelationships::new().users(RelationshipToUsers::new(vec![]))),
);
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.create_team(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
async fn main() {
let body = TeamCreateRequest::new(TeamCreate::new(
TeamCreateAttributes::new(
"test-handle-a0fc0297eb519635".to_string(),
"test-name-a0fc0297eb519635".to_string(),
)
.avatar(Some("🥑".to_string()))
.banner(Some(7))
.hidden_modules(vec!["m3".to_string()])
.visible_modules(vec!["m1".to_string(), "m2".to_string()]),
TeamType::TEAM,
));
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.create_team(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_team_with_http_info(
&self,
body: TeamCreateRequest,
) -> Result<ResponseContent<TeamResponse>, Error<CreateTeamError>>
pub async fn create_team_with_http_info( &self, body: TeamCreateRequest, ) -> Result<ResponseContent<TeamResponse>, Error<CreateTeamError>>
Create a new team.
User IDs passed through the users relationship field are added to the team.
sourcepub async fn create_team_link(
&self,
team_id: String,
body: TeamLinkCreateRequest,
) -> Result<TeamLinkResponse, Error<CreateTeamLinkError>>
pub async fn create_team_link( &self, team_id: String, body: TeamLinkCreateRequest, ) -> Result<TeamLinkResponse, Error<CreateTeamLinkError>>
Add a new link to a team.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let body = TeamLinkCreateRequest::new(TeamLinkCreate::new(
TeamLinkAttributes::new("Link label".to_string(), "https://example.com".to_string())
.position(0),
TeamLinkType::TEAM_LINKS,
));
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.create_team_link(dd_team_data_id.clone(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_team_link_with_http_info(
&self,
team_id: String,
body: TeamLinkCreateRequest,
) -> Result<ResponseContent<TeamLinkResponse>, Error<CreateTeamLinkError>>
pub async fn create_team_link_with_http_info( &self, team_id: String, body: TeamLinkCreateRequest, ) -> Result<ResponseContent<TeamLinkResponse>, Error<CreateTeamLinkError>>
Add a new link to a team.
sourcepub async fn create_team_membership(
&self,
team_id: String,
body: UserTeamRequest,
) -> Result<UserTeamResponse, Error<CreateTeamMembershipError>>
pub async fn create_team_membership( &self, team_id: String, body: UserTeamRequest, ) -> Result<UserTeamResponse, Error<CreateTeamMembershipError>>
Add a user to a team.
Examples found in repository?
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
async fn main() {
let body = UserTeamRequest::new(
UserTeamCreate::new(UserTeamType::TEAM_MEMBERSHIPS)
.attributes(UserTeamAttributes::new().role(Some(UserTeamRole::ADMIN)))
.relationships(
UserTeamRelationships::new()
.team(RelationshipToUserTeamTeam::new(
RelationshipToUserTeamTeamData::new(
"d7e15d9d-d346-43da-81d8-3d9e71d9a5e9".to_string(),
UserTeamTeamType::TEAM,
),
))
.user(RelationshipToUserTeamUser::new(
RelationshipToUserTeamUserData::new(
"b8626d7e-cedd-11eb-abf5-da7ad0900001".to_string(),
UserTeamUserType::USERS,
),
)),
),
);
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.create_team_membership("team_id".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_team_membership_with_http_info(
&self,
team_id: String,
body: UserTeamRequest,
) -> Result<ResponseContent<UserTeamResponse>, Error<CreateTeamMembershipError>>
pub async fn create_team_membership_with_http_info( &self, team_id: String, body: UserTeamRequest, ) -> Result<ResponseContent<UserTeamResponse>, Error<CreateTeamMembershipError>>
Add a user to a team.
sourcepub async fn delete_team(
&self,
team_id: String,
) -> Result<(), Error<DeleteTeamError>>
pub async fn delete_team( &self, team_id: String, ) -> Result<(), Error<DeleteTeamError>>
Remove a team using the team’s id.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.delete_team(dd_team_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn delete_team_with_http_info(
&self,
team_id: String,
) -> Result<ResponseContent<()>, Error<DeleteTeamError>>
pub async fn delete_team_with_http_info( &self, team_id: String, ) -> Result<ResponseContent<()>, Error<DeleteTeamError>>
Remove a team using the team’s id.
sourcepub async fn delete_team_link(
&self,
team_id: String,
link_id: String,
) -> Result<(), Error<DeleteTeamLinkError>>
pub async fn delete_team_link( &self, team_id: String, link_id: String, ) -> Result<(), Error<DeleteTeamLinkError>>
Remove a link from a team.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
// there is a valid "team_link" in the system
let team_link_data_id = std::env::var("TEAM_LINK_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.delete_team_link(dd_team_data_id.clone(), team_link_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn delete_team_link_with_http_info(
&self,
team_id: String,
link_id: String,
) -> Result<ResponseContent<()>, Error<DeleteTeamLinkError>>
pub async fn delete_team_link_with_http_info( &self, team_id: String, link_id: String, ) -> Result<ResponseContent<()>, Error<DeleteTeamLinkError>>
Remove a link from a team.
sourcepub async fn delete_team_membership(
&self,
team_id: String,
user_id: String,
) -> Result<(), Error<DeleteTeamMembershipError>>
pub async fn delete_team_membership( &self, team_id: String, user_id: String, ) -> Result<(), Error<DeleteTeamMembershipError>>
Remove a user from a team.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.delete_team_membership(dd_team_data_id.clone(), "user_id".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn delete_team_membership_with_http_info(
&self,
team_id: String,
user_id: String,
) -> Result<ResponseContent<()>, Error<DeleteTeamMembershipError>>
pub async fn delete_team_membership_with_http_info( &self, team_id: String, user_id: String, ) -> Result<ResponseContent<()>, Error<DeleteTeamMembershipError>>
Remove a user from a team.
sourcepub async fn get_team(
&self,
team_id: String,
) -> Result<TeamResponse, Error<GetTeamError>>
pub async fn get_team( &self, team_id: String, ) -> Result<TeamResponse, Error<GetTeamError>>
Get a single team using the team’s id.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.get_team(dd_team_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_team_with_http_info(
&self,
team_id: String,
) -> Result<ResponseContent<TeamResponse>, Error<GetTeamError>>
pub async fn get_team_with_http_info( &self, team_id: String, ) -> Result<ResponseContent<TeamResponse>, Error<GetTeamError>>
Get a single team using the team’s id.
sourcepub async fn get_team_link(
&self,
team_id: String,
link_id: String,
) -> Result<TeamLinkResponse, Error<GetTeamLinkError>>
pub async fn get_team_link( &self, team_id: String, link_id: String, ) -> Result<TeamLinkResponse, Error<GetTeamLinkError>>
Get a single link for a team.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
// there is a valid "team_link" in the system
let team_link_data_id = std::env::var("TEAM_LINK_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.get_team_link(dd_team_data_id.clone(), team_link_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_team_link_with_http_info(
&self,
team_id: String,
link_id: String,
) -> Result<ResponseContent<TeamLinkResponse>, Error<GetTeamLinkError>>
pub async fn get_team_link_with_http_info( &self, team_id: String, link_id: String, ) -> Result<ResponseContent<TeamLinkResponse>, Error<GetTeamLinkError>>
Get a single link for a team.
sourcepub async fn get_team_links(
&self,
team_id: String,
) -> Result<TeamLinksResponse, Error<GetTeamLinksError>>
pub async fn get_team_links( &self, team_id: String, ) -> Result<TeamLinksResponse, Error<GetTeamLinksError>>
Get all links for a given team.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.get_team_links(dd_team_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_team_links_with_http_info(
&self,
team_id: String,
) -> Result<ResponseContent<TeamLinksResponse>, Error<GetTeamLinksError>>
pub async fn get_team_links_with_http_info( &self, team_id: String, ) -> Result<ResponseContent<TeamLinksResponse>, Error<GetTeamLinksError>>
Get all links for a given team.
sourcepub async fn get_team_memberships(
&self,
team_id: String,
params: GetTeamMembershipsOptionalParams,
) -> Result<UserTeamsResponse, Error<GetTeamMembershipsError>>
pub async fn get_team_memberships( &self, team_id: String, params: GetTeamMembershipsOptionalParams, ) -> Result<UserTeamsResponse, Error<GetTeamMembershipsError>>
Get a paginated list of members for a team
Examples found in repository?
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.get_team_memberships(
dd_team_data_id.clone(),
GetTeamMembershipsOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn get_team_memberships_with_pagination(
&self,
team_id: String,
params: GetTeamMembershipsOptionalParams,
) -> impl Stream<Item = Result<UserTeam, Error<GetTeamMembershipsError>>> + '_
pub fn get_team_memberships_with_pagination( &self, team_id: String, params: GetTeamMembershipsOptionalParams, ) -> impl Stream<Item = Result<UserTeam, Error<GetTeamMembershipsError>>> + '_
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let response = api.get_team_memberships_with_pagination(
"2e06bf2c-193b-41d4-b3c2-afccc080458f".to_string(),
GetTeamMembershipsOptionalParams::default().page_size(2),
);
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}sourcepub async fn get_team_memberships_with_http_info(
&self,
team_id: String,
params: GetTeamMembershipsOptionalParams,
) -> Result<ResponseContent<UserTeamsResponse>, Error<GetTeamMembershipsError>>
pub async fn get_team_memberships_with_http_info( &self, team_id: String, params: GetTeamMembershipsOptionalParams, ) -> Result<ResponseContent<UserTeamsResponse>, Error<GetTeamMembershipsError>>
Get a paginated list of members for a team
sourcepub async fn get_team_permission_settings(
&self,
team_id: String,
) -> Result<TeamPermissionSettingsResponse, Error<GetTeamPermissionSettingsError>>
pub async fn get_team_permission_settings( &self, team_id: String, ) -> Result<TeamPermissionSettingsResponse, Error<GetTeamPermissionSettingsError>>
Get all permission settings for a given team.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.get_team_permission_settings(dd_team_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_team_permission_settings_with_http_info(
&self,
team_id: String,
) -> Result<ResponseContent<TeamPermissionSettingsResponse>, Error<GetTeamPermissionSettingsError>>
pub async fn get_team_permission_settings_with_http_info( &self, team_id: String, ) -> Result<ResponseContent<TeamPermissionSettingsResponse>, Error<GetTeamPermissionSettingsError>>
Get all permission settings for a given team.
sourcepub async fn get_user_memberships(
&self,
user_uuid: String,
) -> Result<UserTeamsResponse, Error<GetUserMembershipsError>>
pub async fn get_user_memberships( &self, user_uuid: String, ) -> Result<UserTeamsResponse, Error<GetUserMembershipsError>>
Get a list of memberships for a user
Examples found in repository?
7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
// there is a valid "user" in the system
let user_data_id = std::env::var("USER_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.get_user_memberships(user_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_user_memberships_with_http_info(
&self,
user_uuid: String,
) -> Result<ResponseContent<UserTeamsResponse>, Error<GetUserMembershipsError>>
pub async fn get_user_memberships_with_http_info( &self, user_uuid: String, ) -> Result<ResponseContent<UserTeamsResponse>, Error<GetUserMembershipsError>>
Get a list of memberships for a user
sourcepub async fn list_teams(
&self,
params: ListTeamsOptionalParams,
) -> Result<TeamsResponse, Error<ListTeamsError>>
pub async fn list_teams( &self, params: ListTeamsOptionalParams, ) -> Result<TeamsResponse, Error<ListTeamsError>>
Get all teams.
Can be used to search for teams using the filter[keyword] and filter[me] query parameters.
Examples found in repository?
More examples
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.list_teams(ListTeamsOptionalParams::default().fields_team(vec![
TeamsField::ID,
TeamsField::NAME,
TeamsField::HANDLE,
]))
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn list_teams_with_pagination(
&self,
params: ListTeamsOptionalParams,
) -> impl Stream<Item = Result<Team, Error<ListTeamsError>>> + '_
pub fn list_teams_with_pagination( &self, params: ListTeamsOptionalParams, ) -> impl Stream<Item = Result<Team, Error<ListTeamsError>>> + '_
Examples found in repository?
9 10 11 12 13 14 15 16 17 18 19 20 21
async fn main() {
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let response = api.list_teams_with_pagination(ListTeamsOptionalParams::default().page_size(2));
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}sourcepub async fn list_teams_with_http_info(
&self,
params: ListTeamsOptionalParams,
) -> Result<ResponseContent<TeamsResponse>, Error<ListTeamsError>>
pub async fn list_teams_with_http_info( &self, params: ListTeamsOptionalParams, ) -> Result<ResponseContent<TeamsResponse>, Error<ListTeamsError>>
Get all teams.
Can be used to search for teams using the filter[keyword] and filter[me] query parameters.
sourcepub async fn update_team(
&self,
team_id: String,
body: TeamUpdateRequest,
) -> Result<TeamResponse, Error<UpdateTeamError>>
pub async fn update_team( &self, team_id: String, body: TeamUpdateRequest, ) -> Result<TeamResponse, Error<UpdateTeamError>>
Update a team using the team’s id.
If the team_links relationship is present, the associated links are updated to be in the order they appear in the array, and any existing team links not present are removed.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_attributes_handle = std::env::var("DD_TEAM_DATA_ATTRIBUTES_HANDLE").unwrap();
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let body = TeamUpdateRequest::new(TeamUpdate::new(
TeamUpdateAttributes::new(
dd_team_data_attributes_handle.clone(),
"Example Team updated".to_string(),
)
.avatar(Some("🥑".to_string()))
.banner(Some(7))
.hidden_modules(vec!["m3".to_string()])
.visible_modules(vec!["m1".to_string(), "m2".to_string()]),
TeamType::TEAM,
));
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api.update_team(dd_team_data_id.clone(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_team_with_http_info(
&self,
team_id: String,
body: TeamUpdateRequest,
) -> Result<ResponseContent<TeamResponse>, Error<UpdateTeamError>>
pub async fn update_team_with_http_info( &self, team_id: String, body: TeamUpdateRequest, ) -> Result<ResponseContent<TeamResponse>, Error<UpdateTeamError>>
Update a team using the team’s id.
If the team_links relationship is present, the associated links are updated to be in the order they appear in the array, and any existing team links not present are removed.
sourcepub async fn update_team_link(
&self,
team_id: String,
link_id: String,
body: TeamLinkCreateRequest,
) -> Result<TeamLinkResponse, Error<UpdateTeamLinkError>>
pub async fn update_team_link( &self, team_id: String, link_id: String, body: TeamLinkCreateRequest, ) -> Result<TeamLinkResponse, Error<UpdateTeamLinkError>>
Update a team link.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
// there is a valid "team_link" in the system
let team_link_data_id = std::env::var("TEAM_LINK_DATA_ID").unwrap();
let body = TeamLinkCreateRequest::new(TeamLinkCreate::new(
TeamLinkAttributes::new("New Label".to_string(), "https://example.com".to_string()),
TeamLinkType::TEAM_LINKS,
));
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.update_team_link(dd_team_data_id.clone(), team_link_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_team_link_with_http_info(
&self,
team_id: String,
link_id: String,
body: TeamLinkCreateRequest,
) -> Result<ResponseContent<TeamLinkResponse>, Error<UpdateTeamLinkError>>
pub async fn update_team_link_with_http_info( &self, team_id: String, link_id: String, body: TeamLinkCreateRequest, ) -> Result<ResponseContent<TeamLinkResponse>, Error<UpdateTeamLinkError>>
Update a team link.
sourcepub async fn update_team_membership(
&self,
team_id: String,
user_id: String,
body: UserTeamUpdateRequest,
) -> Result<UserTeamResponse, Error<UpdateTeamMembershipError>>
pub async fn update_team_membership( &self, team_id: String, user_id: String, body: UserTeamUpdateRequest, ) -> Result<UserTeamResponse, Error<UpdateTeamMembershipError>>
Update a user’s membership attributes on a team.
Examples found in repository?
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
async fn main() {
let body = UserTeamUpdateRequest::new(
UserTeamUpdate::new(UserTeamType::TEAM_MEMBERSHIPS)
.attributes(UserTeamAttributes::new().role(Some(UserTeamRole::ADMIN))),
);
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.update_team_membership("team_id".to_string(), "user_id".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_team_membership_with_http_info(
&self,
team_id: String,
user_id: String,
body: UserTeamUpdateRequest,
) -> Result<ResponseContent<UserTeamResponse>, Error<UpdateTeamMembershipError>>
pub async fn update_team_membership_with_http_info( &self, team_id: String, user_id: String, body: UserTeamUpdateRequest, ) -> Result<ResponseContent<UserTeamResponse>, Error<UpdateTeamMembershipError>>
Update a user’s membership attributes on a team.
sourcepub async fn update_team_permission_setting(
&self,
team_id: String,
action: String,
body: TeamPermissionSettingUpdateRequest,
) -> Result<TeamPermissionSettingResponse, Error<UpdateTeamPermissionSettingError>>
pub async fn update_team_permission_setting( &self, team_id: String, action: String, body: TeamPermissionSettingUpdateRequest, ) -> Result<TeamPermissionSettingResponse, Error<UpdateTeamPermissionSettingError>>
Update a team permission setting for a given team.
Examples found in repository?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
async fn main() {
// there is a valid "dd_team" in the system
let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
let body = TeamPermissionSettingUpdateRequest::new(
TeamPermissionSettingUpdate::new(TeamPermissionSettingType::TEAM_PERMISSION_SETTINGS)
.attributes(
TeamPermissionSettingUpdateAttributes::new()
.value(TeamPermissionSettingValue::ADMINS),
),
);
let configuration = datadog::Configuration::new();
let api = TeamsAPI::with_config(configuration);
let resp = api
.update_team_permission_setting(
dd_team_data_id.clone(),
"manage_membership".to_string(),
body,
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_team_permission_setting_with_http_info(
&self,
team_id: String,
action: String,
body: TeamPermissionSettingUpdateRequest,
) -> Result<ResponseContent<TeamPermissionSettingResponse>, Error<UpdateTeamPermissionSettingError>>
pub async fn update_team_permission_setting_with_http_info( &self, team_id: String, action: String, body: TeamPermissionSettingUpdateRequest, ) -> Result<ResponseContent<TeamPermissionSettingResponse>, Error<UpdateTeamPermissionSettingError>>
Update a team permission setting for a given team.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TeamsAPI
impl !RefUnwindSafe for TeamsAPI
impl Send for TeamsAPI
impl Sync for TeamsAPI
impl Unpin for TeamsAPI
impl !UnwindSafe for TeamsAPI
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)