#[non_exhaustive]pub struct UserTeamAttributes {
pub provisioned_by: Option<Option<String>>,
pub provisioned_by_id: Option<Option<String>>,
pub role: Option<Option<UserTeamRole>>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Team membership attributes
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.provisioned_by: Option<Option<String>>
The mechanism responsible for provisioning the team relationship. Possible values: null for added by a user, “service_account” if added by a service account, and “saml_mapping” if provisioned via SAML mapping.
provisioned_by_id: Option<Option<String>>
UUID of the User or Service Account who provisioned this team membership, or null if provisioned via SAML mapping.
role: Option<Option<UserTeamRole>>
The user’s role within the team
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl UserTeamAttributes
impl UserTeamAttributes
Sourcepub fn new() -> UserTeamAttributes
pub fn new() -> UserTeamAttributes
Examples found in repository?
examples/v2_teams_UpdateTeamMembership.rs (line 15)
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}
More examples
examples/v2_teams_CreateTeamMembership.rs (line 22)
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}
pub fn provisioned_by(self, value: Option<String>) -> Self
pub fn provisioned_by_id(self, value: Option<String>) -> Self
Sourcepub fn role(self, value: Option<UserTeamRole>) -> Self
pub fn role(self, value: Option<UserTeamRole>) -> Self
Examples found in repository?
examples/v2_teams_UpdateTeamMembership.rs (line 15)
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}
More examples
examples/v2_teams_CreateTeamMembership.rs (line 22)
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}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for UserTeamAttributes
impl Clone for UserTeamAttributes
Source§fn clone(&self) -> UserTeamAttributes
fn clone(&self) -> UserTeamAttributes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UserTeamAttributes
impl Debug for UserTeamAttributes
Source§impl Default for UserTeamAttributes
impl Default for UserTeamAttributes
Source§impl<'de> Deserialize<'de> for UserTeamAttributes
impl<'de> Deserialize<'de> for UserTeamAttributes
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for UserTeamAttributes
impl PartialEq for UserTeamAttributes
Source§impl Serialize for UserTeamAttributes
impl Serialize for UserTeamAttributes
impl StructuralPartialEq for UserTeamAttributes
Auto Trait Implementations§
impl Freeze for UserTeamAttributes
impl RefUnwindSafe for UserTeamAttributes
impl Send for UserTeamAttributes
impl Sync for UserTeamAttributes
impl Unpin for UserTeamAttributes
impl UnwindSafe for UserTeamAttributes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more