#[non_exhaustive]pub struct RelationshipToPermission {
pub data: Option<RelationshipToPermissionData>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Relationship to a permissions 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.data: Option<RelationshipToPermissionData>
Relationship to permission object.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl RelationshipToPermission
impl RelationshipToPermission
Sourcepub fn new() -> RelationshipToPermission
pub fn new() -> RelationshipToPermission
Examples found in repository?
examples/v2_roles_AddPermissionToRole.rs (line 15)
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 "permission" in the system
14 let permission_id = std::env::var("PERMISSION_ID").unwrap();
15 let body = RelationshipToPermission::new().data(
16 RelationshipToPermissionData::new()
17 .id(permission_id.clone())
18 .type_(PermissionsType::PERMISSIONS),
19 );
20 let configuration = datadog::Configuration::new();
21 let api = RolesAPI::with_config(configuration);
22 let resp = api.add_permission_to_role(role_data_id.clone(), body).await;
23 if let Ok(value) = resp {
24 println!("{:#?}", value);
25 } else {
26 println!("{:#?}", resp.unwrap_err());
27 }
28}
More examples
examples/v2_roles_RemovePermissionFromRole.rs (line 15)
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 "permission" in the system
14 let permission_id = std::env::var("PERMISSION_ID").unwrap();
15 let body = RelationshipToPermission::new().data(
16 RelationshipToPermissionData::new()
17 .id(permission_id.clone())
18 .type_(PermissionsType::PERMISSIONS),
19 );
20 let configuration = datadog::Configuration::new();
21 let api = RolesAPI::with_config(configuration);
22 let resp = api
23 .remove_permission_from_role(role_data_id.clone(), body)
24 .await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
Sourcepub fn data(self, value: RelationshipToPermissionData) -> Self
pub fn data(self, value: RelationshipToPermissionData) -> Self
Examples found in repository?
examples/v2_roles_AddPermissionToRole.rs (lines 15-19)
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 "permission" in the system
14 let permission_id = std::env::var("PERMISSION_ID").unwrap();
15 let body = RelationshipToPermission::new().data(
16 RelationshipToPermissionData::new()
17 .id(permission_id.clone())
18 .type_(PermissionsType::PERMISSIONS),
19 );
20 let configuration = datadog::Configuration::new();
21 let api = RolesAPI::with_config(configuration);
22 let resp = api.add_permission_to_role(role_data_id.clone(), body).await;
23 if let Ok(value) = resp {
24 println!("{:#?}", value);
25 } else {
26 println!("{:#?}", resp.unwrap_err());
27 }
28}
More examples
examples/v2_roles_RemovePermissionFromRole.rs (lines 15-19)
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 "permission" in the system
14 let permission_id = std::env::var("PERMISSION_ID").unwrap();
15 let body = RelationshipToPermission::new().data(
16 RelationshipToPermissionData::new()
17 .id(permission_id.clone())
18 .type_(PermissionsType::PERMISSIONS),
19 );
20 let configuration = datadog::Configuration::new();
21 let api = RolesAPI::with_config(configuration);
22 let resp = api
23 .remove_permission_from_role(role_data_id.clone(), body)
24 .await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for RelationshipToPermission
impl Clone for RelationshipToPermission
Source§fn clone(&self) -> RelationshipToPermission
fn clone(&self) -> RelationshipToPermission
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 RelationshipToPermission
impl Debug for RelationshipToPermission
Source§impl Default for RelationshipToPermission
impl Default for RelationshipToPermission
Source§impl<'de> Deserialize<'de> for RelationshipToPermission
impl<'de> Deserialize<'de> for RelationshipToPermission
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 RelationshipToPermission
impl PartialEq for RelationshipToPermission
Source§impl Serialize for RelationshipToPermission
impl Serialize for RelationshipToPermission
impl StructuralPartialEq for RelationshipToPermission
Auto Trait Implementations§
impl Freeze for RelationshipToPermission
impl RefUnwindSafe for RelationshipToPermission
impl Send for RelationshipToPermission
impl Sync for RelationshipToPermission
impl Unpin for RelationshipToPermission
impl UnwindSafe for RelationshipToPermission
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