#[non_exhaustive]pub struct RelationshipToUserData {
pub id: String,
pub type_: UsersType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Relationship to user object.
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.id: String
A unique identifier that represents the user.
type_: UsersType
Users resource type.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl RelationshipToUserData
impl RelationshipToUserData
Sourcepub fn new(id: String, type_: UsersType) -> RelationshipToUserData
pub fn new(id: String, type_: UsersType) -> RelationshipToUserData
Examples found in repository?
examples/v2_roles_AddUserToRole.rs (lines 15-18)
9async fn main() {
10 // there is a valid "role" in the system
11 let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
12
13 // there is a valid "user" in the system
14 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
15 let body = RelationshipToUser::new(RelationshipToUserData::new(
16 user_data_id.clone(),
17 UsersType::USERS,
18 ));
19 let configuration = datadog::Configuration::new();
20 let api = RolesAPI::with_config(configuration);
21 let resp = api.add_user_to_role(role_data_id.clone(), body).await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
More examples
examples/v2_roles_RemoveUserFromRole.rs (lines 15-18)
9async fn main() {
10 // there is a valid "role" in the system
11 let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
12
13 // there is a valid "user" in the system
14 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
15 let body = RelationshipToUser::new(RelationshipToUserData::new(
16 user_data_id.clone(),
17 UsersType::USERS,
18 ));
19 let configuration = datadog::Configuration::new();
20 let api = RolesAPI::with_config(configuration);
21 let resp = api.remove_user_from_role(role_data_id.clone(), body).await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
examples/v2_users_SendInvitations.rs (lines 17-20)
13async fn main() {
14 // there is a valid "user" in the system
15 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
16 let body = UserInvitationsRequest::new(vec![UserInvitationData::new(
17 UserInvitationRelationships::new(RelationshipToUser::new(RelationshipToUserData::new(
18 user_data_id.clone(),
19 UsersType::USERS,
20 ))),
21 UserInvitationsType::USER_INVITATIONS,
22 )]);
23 let configuration = datadog::Configuration::new();
24 let api = UsersAPI::with_config(configuration);
25 let resp = api.send_invitations(body).await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for RelationshipToUserData
impl Clone for RelationshipToUserData
Source§fn clone(&self) -> RelationshipToUserData
fn clone(&self) -> RelationshipToUserData
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 RelationshipToUserData
impl Debug for RelationshipToUserData
Source§impl<'de> Deserialize<'de> for RelationshipToUserData
impl<'de> Deserialize<'de> for RelationshipToUserData
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 RelationshipToUserData
impl PartialEq for RelationshipToUserData
Source§impl Serialize for RelationshipToUserData
impl Serialize for RelationshipToUserData
impl StructuralPartialEq for RelationshipToUserData
Auto Trait Implementations§
impl Freeze for RelationshipToUserData
impl RefUnwindSafe for RelationshipToUserData
impl Send for RelationshipToUserData
impl Sync for RelationshipToUserData
impl Unpin for RelationshipToUserData
impl UnwindSafe for RelationshipToUserData
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