#[non_exhaustive]pub struct RelationshipToRole {
pub data: Option<RelationshipToRoleData>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Relationship to role.
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<RelationshipToRoleData>
Relationship to role object.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl RelationshipToRole
impl RelationshipToRole
Sourcepub fn new() -> RelationshipToRole
pub fn new() -> RelationshipToRole
Examples found in repository?
examples/v2_logs-archives_AddReadRoleToArchive.rs (line 10)
9async fn main() {
10 let body = RelationshipToRole::new().data(
11 RelationshipToRoleData::new()
12 .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
13 .type_(RolesType::ROLES),
14 );
15 let configuration = datadog::Configuration::new();
16 let api = LogsArchivesAPI::with_config(configuration);
17 let resp = api
18 .add_read_role_to_archive("archive_id".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
More examples
examples/v2_logs-archives_RemoveRoleFromArchive.rs (line 10)
9async fn main() {
10 let body = RelationshipToRole::new().data(
11 RelationshipToRoleData::new()
12 .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
13 .type_(RolesType::ROLES),
14 );
15 let configuration = datadog::Configuration::new();
16 let api = LogsArchivesAPI::with_config(configuration);
17 let resp = api
18 .remove_role_from_archive("archive_id".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
examples/v2_authn-mappings_CreateAuthNMapping.rs (line 28)
15async fn main() {
16 // there is a valid "role" in the system
17 let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
18 let body = AuthNMappingCreateRequest::new(
19 AuthNMappingCreateData::new(AuthNMappingsType::AUTHN_MAPPINGS)
20 .attributes(
21 AuthNMappingCreateAttributes::new()
22 .attribute_key("exampleauthnmapping".to_string())
23 .attribute_value("Example-AuthN-Mapping".to_string()),
24 )
25 .relationships(
26 AuthNMappingCreateRelationships::AuthNMappingRelationshipToRole(Box::new(
27 AuthNMappingRelationshipToRole::new(
28 RelationshipToRole::new().data(
29 RelationshipToRoleData::new()
30 .id(role_data_id.clone())
31 .type_(RolesType::ROLES),
32 ),
33 ),
34 )),
35 ),
36 );
37 let configuration = datadog::Configuration::new();
38 let api = AuthNMappingsAPI::with_config(configuration);
39 let resp = api.create_authn_mapping(body).await;
40 if let Ok(value) = resp {
41 println!("{:#?}", value);
42 } else {
43 println!("{:#?}", resp.unwrap_err());
44 }
45}
examples/v2_authn-mappings_UpdateAuthNMapping.rs (line 34)
15async fn main() {
16 // there is a valid "authn_mapping" in the system
17 let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap();
18
19 // there is a valid "role" in the system
20 let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
21 let body = AuthNMappingUpdateRequest::new(
22 AuthNMappingUpdateData::new(
23 authn_mapping_data_id.clone(),
24 AuthNMappingsType::AUTHN_MAPPINGS,
25 )
26 .attributes(
27 AuthNMappingUpdateAttributes::new()
28 .attribute_key("member-of".to_string())
29 .attribute_value("Development".to_string()),
30 )
31 .relationships(
32 AuthNMappingUpdateRelationships::AuthNMappingRelationshipToRole(Box::new(
33 AuthNMappingRelationshipToRole::new(
34 RelationshipToRole::new().data(
35 RelationshipToRoleData::new()
36 .id(role_data_id.clone())
37 .type_(RolesType::ROLES),
38 ),
39 ),
40 )),
41 ),
42 );
43 let configuration = datadog::Configuration::new();
44 let api = AuthNMappingsAPI::with_config(configuration);
45 let resp = api
46 .update_authn_mapping(authn_mapping_data_id.clone(), body)
47 .await;
48 if let Ok(value) = resp {
49 println!("{:#?}", value);
50 } else {
51 println!("{:#?}", resp.unwrap_err());
52 }
53}
Sourcepub fn data(self, value: RelationshipToRoleData) -> Self
pub fn data(self, value: RelationshipToRoleData) -> Self
Examples found in repository?
examples/v2_logs-archives_AddReadRoleToArchive.rs (lines 10-14)
9async fn main() {
10 let body = RelationshipToRole::new().data(
11 RelationshipToRoleData::new()
12 .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
13 .type_(RolesType::ROLES),
14 );
15 let configuration = datadog::Configuration::new();
16 let api = LogsArchivesAPI::with_config(configuration);
17 let resp = api
18 .add_read_role_to_archive("archive_id".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
More examples
examples/v2_logs-archives_RemoveRoleFromArchive.rs (lines 10-14)
9async fn main() {
10 let body = RelationshipToRole::new().data(
11 RelationshipToRoleData::new()
12 .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
13 .type_(RolesType::ROLES),
14 );
15 let configuration = datadog::Configuration::new();
16 let api = LogsArchivesAPI::with_config(configuration);
17 let resp = api
18 .remove_role_from_archive("archive_id".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
examples/v2_authn-mappings_CreateAuthNMapping.rs (lines 28-32)
15async fn main() {
16 // there is a valid "role" in the system
17 let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
18 let body = AuthNMappingCreateRequest::new(
19 AuthNMappingCreateData::new(AuthNMappingsType::AUTHN_MAPPINGS)
20 .attributes(
21 AuthNMappingCreateAttributes::new()
22 .attribute_key("exampleauthnmapping".to_string())
23 .attribute_value("Example-AuthN-Mapping".to_string()),
24 )
25 .relationships(
26 AuthNMappingCreateRelationships::AuthNMappingRelationshipToRole(Box::new(
27 AuthNMappingRelationshipToRole::new(
28 RelationshipToRole::new().data(
29 RelationshipToRoleData::new()
30 .id(role_data_id.clone())
31 .type_(RolesType::ROLES),
32 ),
33 ),
34 )),
35 ),
36 );
37 let configuration = datadog::Configuration::new();
38 let api = AuthNMappingsAPI::with_config(configuration);
39 let resp = api.create_authn_mapping(body).await;
40 if let Ok(value) = resp {
41 println!("{:#?}", value);
42 } else {
43 println!("{:#?}", resp.unwrap_err());
44 }
45}
examples/v2_authn-mappings_UpdateAuthNMapping.rs (lines 34-38)
15async fn main() {
16 // there is a valid "authn_mapping" in the system
17 let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap();
18
19 // there is a valid "role" in the system
20 let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
21 let body = AuthNMappingUpdateRequest::new(
22 AuthNMappingUpdateData::new(
23 authn_mapping_data_id.clone(),
24 AuthNMappingsType::AUTHN_MAPPINGS,
25 )
26 .attributes(
27 AuthNMappingUpdateAttributes::new()
28 .attribute_key("member-of".to_string())
29 .attribute_value("Development".to_string()),
30 )
31 .relationships(
32 AuthNMappingUpdateRelationships::AuthNMappingRelationshipToRole(Box::new(
33 AuthNMappingRelationshipToRole::new(
34 RelationshipToRole::new().data(
35 RelationshipToRoleData::new()
36 .id(role_data_id.clone())
37 .type_(RolesType::ROLES),
38 ),
39 ),
40 )),
41 ),
42 );
43 let configuration = datadog::Configuration::new();
44 let api = AuthNMappingsAPI::with_config(configuration);
45 let resp = api
46 .update_authn_mapping(authn_mapping_data_id.clone(), body)
47 .await;
48 if let Ok(value) = resp {
49 println!("{:#?}", value);
50 } else {
51 println!("{:#?}", resp.unwrap_err());
52 }
53}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for RelationshipToRole
impl Clone for RelationshipToRole
Source§fn clone(&self) -> RelationshipToRole
fn clone(&self) -> RelationshipToRole
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 RelationshipToRole
impl Debug for RelationshipToRole
Source§impl Default for RelationshipToRole
impl Default for RelationshipToRole
Source§impl<'de> Deserialize<'de> for RelationshipToRole
impl<'de> Deserialize<'de> for RelationshipToRole
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 RelationshipToRole
impl PartialEq for RelationshipToRole
Source§impl Serialize for RelationshipToRole
impl Serialize for RelationshipToRole
impl StructuralPartialEq for RelationshipToRole
Auto Trait Implementations§
impl Freeze for RelationshipToRole
impl RefUnwindSafe for RelationshipToRole
impl Send for RelationshipToRole
impl Sync for RelationshipToRole
impl Unpin for RelationshipToRole
impl UnwindSafe for RelationshipToRole
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