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
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api.get_team(dd_team_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
7async fn main() {
8 // there is a valid "user" in the system
9 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
10 let configuration = datadog::Configuration::new();
11 let api = TeamsAPI::with_config(configuration);
12 let resp = api.get_user_memberships(user_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api.delete_team(dd_team_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api.get_team_links(dd_team_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
9async fn main() {
10 let configuration = datadog::Configuration::new();
11 let api = TeamsAPI::with_config(configuration);
12 let response = api.list_teams_with_pagination(ListTeamsOptionalParams::default().page_size(2));
13 pin_mut!(response);
14 while let Some(resp) = response.next().await {
15 if let Ok(value) = resp {
16 println!("{:#?}", value);
17 } else {
18 println!("{:#?}", resp.unwrap_err());
19 }
20 }
21}
- examples/v2_teams_RemoveMemberTeam.rs
- examples/v2_teams_ListTeams_3429963470.rs
- examples/v2_teams_GetTeamPermissionSettings.rs
- examples/v2_teams_DeleteTeamMembership.rs
- examples/v2_teams_ListMemberTeams.rs
- examples/v2_teams_GetTeamMemberships.rs
- examples/v2_teams_GetTeamMemberships_3799131168.rs
- examples/v2_teams_UpdateTeamMembership.rs
- examples/v2_teams_AddMemberTeam.rs
- examples/v2_teams_ListMemberTeams_1662850354.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 add_member_team(
&self,
super_team_id: String,
body: AddMemberTeamRequest,
) -> Result<(), Error<AddMemberTeamError>>
pub async fn add_member_team( &self, super_team_id: String, body: AddMemberTeamRequest, ) -> Result<(), Error<AddMemberTeamError>>
Add a member team.
Adds the team given by the id
in the body as a member team of the super team.
Examples found in repository?
9async fn main() {
10 let body = AddMemberTeamRequest::new(MemberTeam::new(
11 "aeadc05e-98a8-11ec-ac2c-da7ad0900001".to_string(),
12 MemberTeamType::MEMBER_TEAMS,
13 ));
14 let mut configuration = datadog::Configuration::new();
15 configuration.set_unstable_operation_enabled("v2.AddMemberTeam", true);
16 let api = TeamsAPI::with_config(configuration);
17 let resp = api.add_member_team("super_team_id".to_string(), body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
Sourcepub async fn add_member_team_with_http_info(
&self,
super_team_id: String,
body: AddMemberTeamRequest,
) -> Result<ResponseContent<()>, Error<AddMemberTeamError>>
pub async fn add_member_team_with_http_info( &self, super_team_id: String, body: AddMemberTeamRequest, ) -> Result<ResponseContent<()>, Error<AddMemberTeamError>>
Add a member team.
Adds the team given by the id
in the body as a member team of the super team.
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?
12async fn main() {
13 let body = TeamCreateRequest::new(
14 TeamCreate::new(
15 TeamCreateAttributes::new(
16 "test-handle-a0fc0297eb519635".to_string(),
17 "test-name-a0fc0297eb519635".to_string(),
18 ),
19 TeamType::TEAM,
20 )
21 .relationships(TeamCreateRelationships::new().users(RelationshipToUsers::new(vec![]))),
22 );
23 let configuration = datadog::Configuration::new();
24 let api = TeamsAPI::with_config(configuration);
25 let resp = api.create_team(body).await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
More examples
10async fn main() {
11 let body = TeamCreateRequest::new(TeamCreate::new(
12 TeamCreateAttributes::new(
13 "test-handle-a0fc0297eb519635".to_string(),
14 "test-name-a0fc0297eb519635".to_string(),
15 )
16 .avatar(Some("🥑".to_string()))
17 .banner(Some(7))
18 .hidden_modules(vec!["m3".to_string()])
19 .visible_modules(vec!["m1".to_string(), "m2".to_string()]),
20 TeamType::TEAM,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = TeamsAPI::with_config(configuration);
24 let resp = api.create_team(body).await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
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?
10async fn main() {
11 // there is a valid "dd_team" in the system
12 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
13 let body = TeamLinkCreateRequest::new(TeamLinkCreate::new(
14 TeamLinkAttributes::new("Link label".to_string(), "https://example.com".to_string())
15 .position(0),
16 TeamLinkType::TEAM_LINKS,
17 ));
18 let configuration = datadog::Configuration::new();
19 let api = TeamsAPI::with_config(configuration);
20 let resp = api.create_team_link(dd_team_data_id.clone(), body).await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
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?
19async fn main() {
20 let body = UserTeamRequest::new(
21 UserTeamCreate::new(UserTeamType::TEAM_MEMBERSHIPS)
22 .attributes(UserTeamAttributes::new().role(Some(UserTeamRole::ADMIN)))
23 .relationships(
24 UserTeamRelationships::new()
25 .team(RelationshipToUserTeamTeam::new(
26 RelationshipToUserTeamTeamData::new(
27 "d7e15d9d-d346-43da-81d8-3d9e71d9a5e9".to_string(),
28 UserTeamTeamType::TEAM,
29 ),
30 ))
31 .user(RelationshipToUserTeamUser::new(
32 RelationshipToUserTeamUserData::new(
33 "b8626d7e-cedd-11eb-abf5-da7ad0900001".to_string(),
34 UserTeamUserType::USERS,
35 ),
36 )),
37 ),
38 );
39 let configuration = datadog::Configuration::new();
40 let api = TeamsAPI::with_config(configuration);
41 let resp = api
42 .create_team_membership("team_id".to_string(), body)
43 .await;
44 if let Ok(value) = resp {
45 println!("{:#?}", value);
46 } else {
47 println!("{:#?}", resp.unwrap_err());
48 }
49}
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?
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api.delete_team(dd_team_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
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?
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9
10 // there is a valid "team_link" in the system
11 let team_link_data_id = std::env::var("TEAM_LINK_DATA_ID").unwrap();
12 let configuration = datadog::Configuration::new();
13 let api = TeamsAPI::with_config(configuration);
14 let resp = api
15 .delete_team_link(dd_team_data_id.clone(), team_link_data_id.clone())
16 .await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
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?
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api
12 .delete_team_membership(dd_team_data_id.clone(), "user_id".to_string())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
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?
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api.get_team(dd_team_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
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?
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9
10 // there is a valid "team_link" in the system
11 let team_link_data_id = std::env::var("TEAM_LINK_DATA_ID").unwrap();
12 let configuration = datadog::Configuration::new();
13 let api = TeamsAPI::with_config(configuration);
14 let resp = api
15 .get_team_link(dd_team_data_id.clone(), team_link_data_id.clone())
16 .await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
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?
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api.get_team_links(dd_team_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
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?
8async fn main() {
9 // there is a valid "dd_team" in the system
10 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
11 let configuration = datadog::Configuration::new();
12 let api = TeamsAPI::with_config(configuration);
13 let resp = api
14 .get_team_memberships(
15 dd_team_data_id.clone(),
16 GetTeamMembershipsOptionalParams::default(),
17 )
18 .await;
19 if let Ok(value) = resp {
20 println!("{:#?}", value);
21 } else {
22 println!("{:#?}", resp.unwrap_err());
23 }
24}
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?
10async fn main() {
11 let configuration = datadog::Configuration::new();
12 let api = TeamsAPI::with_config(configuration);
13 let response = api.get_team_memberships_with_pagination(
14 "2e06bf2c-193b-41d4-b3c2-afccc080458f".to_string(),
15 GetTeamMembershipsOptionalParams::default().page_size(2),
16 );
17 pin_mut!(response);
18 while let Some(resp) = response.next().await {
19 if let Ok(value) = resp {
20 println!("{:#?}", value);
21 } else {
22 println!("{:#?}", resp.unwrap_err());
23 }
24 }
25}
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?
6async fn main() {
7 // there is a valid "dd_team" in the system
8 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api
12 .get_team_permission_settings(dd_team_data_id.clone())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
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?
7async fn main() {
8 // there is a valid "user" in the system
9 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
10 let configuration = datadog::Configuration::new();
11 let api = TeamsAPI::with_config(configuration);
12 let resp = api.get_user_memberships(user_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
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_member_teams(
&self,
super_team_id: String,
params: ListMemberTeamsOptionalParams,
) -> Result<TeamsResponse, Error<ListMemberTeamsError>>
pub async fn list_member_teams( &self, super_team_id: String, params: ListMemberTeamsOptionalParams, ) -> Result<TeamsResponse, Error<ListMemberTeamsError>>
Get all member teams.
Examples found in repository?
7async fn main() {
8 let mut configuration = datadog::Configuration::new();
9 configuration.set_unstable_operation_enabled("v2.ListMemberTeams", true);
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api
12 .list_member_teams(
13 "super_team_id".to_string(),
14 ListMemberTeamsOptionalParams::default(),
15 )
16 .await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
Sourcepub fn list_member_teams_with_pagination(
&self,
super_team_id: String,
params: ListMemberTeamsOptionalParams,
) -> impl Stream<Item = Result<Team, Error<ListMemberTeamsError>>> + '_
pub fn list_member_teams_with_pagination( &self, super_team_id: String, params: ListMemberTeamsOptionalParams, ) -> impl Stream<Item = Result<Team, Error<ListMemberTeamsError>>> + '_
Examples found in repository?
9async fn main() {
10 let mut configuration = datadog::Configuration::new();
11 configuration.set_unstable_operation_enabled("v2.ListMemberTeams", true);
12 let api = TeamsAPI::with_config(configuration);
13 let response = api.list_member_teams_with_pagination(
14 "super_team_id".to_string(),
15 ListMemberTeamsOptionalParams::default(),
16 );
17 pin_mut!(response);
18 while let Some(resp) = response.next().await {
19 if let Ok(value) = resp {
20 println!("{:#?}", value);
21 } else {
22 println!("{:#?}", resp.unwrap_err());
23 }
24 }
25}
Sourcepub async fn list_member_teams_with_http_info(
&self,
super_team_id: String,
params: ListMemberTeamsOptionalParams,
) -> Result<ResponseContent<TeamsResponse>, Error<ListMemberTeamsError>>
pub async fn list_member_teams_with_http_info( &self, super_team_id: String, params: ListMemberTeamsOptionalParams, ) -> Result<ResponseContent<TeamsResponse>, Error<ListMemberTeamsError>>
Get all member teams.
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
8async fn main() {
9 let configuration = datadog::Configuration::new();
10 let api = TeamsAPI::with_config(configuration);
11 let resp = api
12 .list_teams(ListTeamsOptionalParams::default().fields_team(vec![
13 TeamsField::ID,
14 TeamsField::NAME,
15 TeamsField::HANDLE,
16 ]))
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
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?
9async fn main() {
10 let configuration = datadog::Configuration::new();
11 let api = TeamsAPI::with_config(configuration);
12 let response = api.list_teams_with_pagination(ListTeamsOptionalParams::default().page_size(2));
13 pin_mut!(response);
14 while let Some(resp) = response.next().await {
15 if let Ok(value) = resp {
16 println!("{:#?}", value);
17 } else {
18 println!("{:#?}", resp.unwrap_err());
19 }
20 }
21}
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 remove_member_team(
&self,
super_team_id: String,
member_team_id: String,
) -> Result<(), Error<RemoveMemberTeamError>>
pub async fn remove_member_team( &self, super_team_id: String, member_team_id: String, ) -> Result<(), Error<RemoveMemberTeamError>>
Remove a super team’s member team identified by member_team_id
.
Examples found in repository?
6async fn main() {
7 let mut configuration = datadog::Configuration::new();
8 configuration.set_unstable_operation_enabled("v2.RemoveMemberTeam", true);
9 let api = TeamsAPI::with_config(configuration);
10 let resp = api
11 .remove_member_team("super_team_id".to_string(), "member_team_id".to_string())
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub async fn remove_member_team_with_http_info(
&self,
super_team_id: String,
member_team_id: String,
) -> Result<ResponseContent<()>, Error<RemoveMemberTeamError>>
pub async fn remove_member_team_with_http_info( &self, super_team_id: String, member_team_id: String, ) -> Result<ResponseContent<()>, Error<RemoveMemberTeamError>>
Remove a super team’s member team identified by member_team_id
.
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?
10async fn main() {
11 // there is a valid "dd_team" in the system
12 let dd_team_data_attributes_handle = std::env::var("DD_TEAM_DATA_ATTRIBUTES_HANDLE").unwrap();
13 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
14 let body = TeamUpdateRequest::new(TeamUpdate::new(
15 TeamUpdateAttributes::new(
16 dd_team_data_attributes_handle.clone(),
17 "Example Team updated".to_string(),
18 )
19 .avatar(Some("🥑".to_string()))
20 .banner(Some(7))
21 .hidden_modules(vec!["m3".to_string()])
22 .visible_modules(vec!["m1".to_string(), "m2".to_string()]),
23 TeamType::TEAM,
24 ));
25 let configuration = datadog::Configuration::new();
26 let api = TeamsAPI::with_config(configuration);
27 let resp = api.update_team(dd_team_data_id.clone(), body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
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?
10async fn main() {
11 // there is a valid "dd_team" in the system
12 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
13
14 // there is a valid "team_link" in the system
15 let team_link_data_id = std::env::var("TEAM_LINK_DATA_ID").unwrap();
16 let body = TeamLinkCreateRequest::new(TeamLinkCreate::new(
17 TeamLinkAttributes::new("New Label".to_string(), "https://example.com".to_string()),
18 TeamLinkType::TEAM_LINKS,
19 ));
20 let configuration = datadog::Configuration::new();
21 let api = TeamsAPI::with_config(configuration);
22 let resp = api
23 .update_team_link(dd_team_data_id.clone(), team_link_data_id.clone(), body)
24 .await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
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?
12async fn main() {
13 let body = UserTeamUpdateRequest::new(
14 UserTeamUpdate::new(UserTeamType::TEAM_MEMBERSHIPS)
15 .attributes(UserTeamAttributes::new().role(Some(UserTeamRole::ADMIN))),
16 );
17 let configuration = datadog::Configuration::new();
18 let api = TeamsAPI::with_config(configuration);
19 let resp = api
20 .update_team_membership("team_id".to_string(), "user_id".to_string(), body)
21 .await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
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?
11async fn main() {
12 // there is a valid "dd_team" in the system
13 let dd_team_data_id = std::env::var("DD_TEAM_DATA_ID").unwrap();
14 let body = TeamPermissionSettingUpdateRequest::new(
15 TeamPermissionSettingUpdate::new(TeamPermissionSettingType::TEAM_PERMISSION_SETTINGS)
16 .attributes(
17 TeamPermissionSettingUpdateAttributes::new()
18 .value(TeamPermissionSettingValue::ADMINS),
19 ),
20 );
21 let configuration = datadog::Configuration::new();
22 let api = TeamsAPI::with_config(configuration);
23 let resp = api
24 .update_team_permission_setting(
25 dd_team_data_id.clone(),
26 "manage_membership".to_string(),
27 body,
28 )
29 .await;
30 if let Ok(value) = resp {
31 println!("{:#?}", value);
32 } else {
33 println!("{:#?}", resp.unwrap_err());
34 }
35}
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.