#[non_exhaustive]pub struct UserTeamCreate {
pub attributes: Option<UserTeamAttributes>,
pub relationships: Option<UserTeamRelationships>,
pub type_: UserTeamType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
A user’s relationship with a team
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.attributes: Option<UserTeamAttributes>
Team membership attributes
relationships: Option<UserTeamRelationships>
Relationship between membership and a user
type_: UserTeamType
Team membership type
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl UserTeamCreate
impl UserTeamCreate
Sourcepub fn new(type_: UserTeamType) -> UserTeamCreate
pub fn new(type_: UserTeamType) -> UserTeamCreate
Examples found in repository?
examples/v2_teams_CreateTeamMembership.rs (line 21)
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 fn attributes(self, value: UserTeamAttributes) -> Self
pub fn attributes(self, value: UserTeamAttributes) -> Self
Examples found in repository?
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}
Sourcepub fn relationships(self, value: UserTeamRelationships) -> Self
pub fn relationships(self, value: UserTeamRelationships) -> Self
Examples found in repository?
examples/v2_teams_CreateTeamMembership.rs (lines 23-37)
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 UserTeamCreate
impl Clone for UserTeamCreate
Source§fn clone(&self) -> UserTeamCreate
fn clone(&self) -> UserTeamCreate
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 UserTeamCreate
impl Debug for UserTeamCreate
Source§impl<'de> Deserialize<'de> for UserTeamCreate
impl<'de> Deserialize<'de> for UserTeamCreate
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 UserTeamCreate
impl PartialEq for UserTeamCreate
Source§impl Serialize for UserTeamCreate
impl Serialize for UserTeamCreate
impl StructuralPartialEq for UserTeamCreate
Auto Trait Implementations§
impl Freeze for UserTeamCreate
impl RefUnwindSafe for UserTeamCreate
impl Send for UserTeamCreate
impl Sync for UserTeamCreate
impl Unpin for UserTeamCreate
impl UnwindSafe for UserTeamCreate
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