Struct TeamsAPI

Source
pub struct TeamsAPI { /* private fields */ }
Expand description

View and manage teams within Datadog. See the Teams page for more information.

Implementations§

Source§

impl TeamsAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_teams_ListTeams.rs (line 9)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = TeamsAPI::with_config(configuration);
10    let resp = api.list_teams(ListTeamsOptionalParams::default()).await;
11    if let Ok(value) = resp {
12        println!("{:#?}", value);
13    } else {
14        println!("{:#?}", resp.unwrap_err());
15    }
16}
More examples
Hide additional examples
examples/v2_teams_GetTeam.rs (line 10)
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}
examples/v2_teams_GetUserMemberships.rs (line 11)
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}
examples/v2_teams_DeleteTeam.rs (line 10)
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}
examples/v2_teams_GetTeamLinks.rs (line 10)
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}
examples/v2_teams_ListTeams_3592098458.rs (line 11)
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}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

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?
examples/v2_teams_AddMemberTeam.rs (line 17)
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}
Source

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.

Source

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?
examples/v2_teams_CreateTeam.rs (line 25)
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
Hide additional examples
examples/v2_teams_CreateTeam_252121814.rs (line 24)
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}
Source

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.

Add a new link to a team.

Examples found in repository?
examples/v2_teams_CreateTeamLink.rs (line 20)
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}

Add a new link to a team.

Source

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?
examples/v2_teams_CreateTeamMembership.rs (line 42)
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}
Source

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.

Source

pub async fn delete_team( &self, team_id: String, ) -> Result<(), Error<DeleteTeamError>>

Remove a team using the team’s id.

Examples found in repository?
examples/v2_teams_DeleteTeam.rs (line 11)
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}
Source

pub async fn delete_team_with_http_info( &self, team_id: String, ) -> Result<ResponseContent<()>, Error<DeleteTeamError>>

Remove a team using the team’s id.

Remove a link from a team.

Examples found in repository?
examples/v2_teams_DeleteTeamLink.rs (line 15)
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}

Remove a link from a team.

Source

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?
examples/v2_teams_DeleteTeamMembership.rs (line 12)
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}
Source

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.

Source

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?
examples/v2_teams_GetTeam.rs (line 11)
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}
Source

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.

Get a single link for a team.

Examples found in repository?
examples/v2_teams_GetTeamLink.rs (line 15)
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}

Get a single link for a team.

Get all links for a given team.

Examples found in repository?
examples/v2_teams_GetTeamLinks.rs (line 11)
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}

Get all links for a given team.

Source

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?
examples/v2_teams_GetTeamMemberships.rs (lines 14-17)
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}
Source

pub fn get_team_memberships_with_pagination( &self, team_id: String, params: GetTeamMembershipsOptionalParams, ) -> impl Stream<Item = Result<UserTeam, Error<GetTeamMembershipsError>>> + '_

Examples found in repository?
examples/v2_teams_GetTeamMemberships_3799131168.rs (lines 13-16)
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}
Source

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

Source

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?
examples/v2_teams_GetTeamPermissionSettings.rs (line 12)
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}
Source

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.

Source

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?
examples/v2_teams_GetUserMemberships.rs (line 12)
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}
Source

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

Source

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?
examples/v2_teams_ListMemberTeams.rs (lines 12-15)
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}
Source

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?
examples/v2_teams_ListMemberTeams_1662850354.rs (lines 13-16)
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}
Source

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.

Source

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?
examples/v2_teams_ListTeams.rs (line 10)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = TeamsAPI::with_config(configuration);
10    let resp = api.list_teams(ListTeamsOptionalParams::default()).await;
11    if let Ok(value) = resp {
12        println!("{:#?}", value);
13    } else {
14        println!("{:#?}", resp.unwrap_err());
15    }
16}
More examples
Hide additional examples
examples/v2_teams_ListTeams_3429963470.rs (lines 12-16)
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}
Source

pub fn list_teams_with_pagination( &self, params: ListTeamsOptionalParams, ) -> impl Stream<Item = Result<Team, Error<ListTeamsError>>> + '_

Examples found in repository?
examples/v2_teams_ListTeams_3592098458.rs (line 12)
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}
Source

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.

Source

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?
examples/v2_teams_RemoveMemberTeam.rs (line 11)
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}
Source

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.

Source

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?
examples/v2_teams_UpdateTeam.rs (line 27)
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}
Source

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.

Update a team link.

Examples found in repository?
examples/v2_teams_UpdateTeamLink.rs (line 23)
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}

Update a team link.

Source

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?
examples/v2_teams_UpdateTeamMembership.rs (line 20)
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}
Source

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.

Source

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?
examples/v2_teams_UpdateTeamPermissionSetting.rs (lines 24-28)
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}
Source

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§

Source§

impl Clone for TeamsAPI

Source§

fn clone(&self) -> TeamsAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TeamsAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TeamsAPI

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,