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

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

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

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)
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());
    }
}
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)
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());
    }
}
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)
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());
    }
}

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)
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());
    }
}
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)
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());
    }
}
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)
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());
    }
}

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)
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());
    }
}

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

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)
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());
    }
}
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)
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());
    }
}
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 copy 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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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