#[non_exhaustive]pub struct RelationshipToUser {
pub data: RelationshipToUserData,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Relationship to user.
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.data: RelationshipToUserData
Relationship to user object.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl RelationshipToUser
impl RelationshipToUser
Sourcepub fn new(data: RelationshipToUserData) -> RelationshipToUser
pub fn new(data: RelationshipToUserData) -> RelationshipToUser
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 RelationshipToUser
impl Clone for RelationshipToUser
Source§fn clone(&self) -> RelationshipToUser
fn clone(&self) -> RelationshipToUser
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 RelationshipToUser
impl Debug for RelationshipToUser
Source§impl<'de> Deserialize<'de> for RelationshipToUser
impl<'de> Deserialize<'de> for RelationshipToUser
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 RelationshipToUser
impl PartialEq for RelationshipToUser
Source§impl Serialize for RelationshipToUser
impl Serialize for RelationshipToUser
impl StructuralPartialEq for RelationshipToUser
Auto Trait Implementations§
impl Freeze for RelationshipToUser
impl RefUnwindSafe for RelationshipToUser
impl Send for RelationshipToUser
impl Sync for RelationshipToUser
impl Unpin for RelationshipToUser
impl UnwindSafe for RelationshipToUser
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