#[non_exhaustive]pub struct AuthNMappingUpdateAttributes {
pub attribute_key: Option<String>,
pub attribute_value: Option<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Key/Value pair of attributes used for update request.
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.attribute_key: Option<String>
Key portion of a key/value pair of the attribute sent from the Identity Provider.
attribute_value: Option<String>
Value portion of a key/value pair of the attribute sent from the Identity Provider.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl AuthNMappingUpdateAttributes
impl AuthNMappingUpdateAttributes
Sourcepub fn new() -> AuthNMappingUpdateAttributes
pub fn new() -> AuthNMappingUpdateAttributes
Examples found in repository?
examples/v2_authn-mappings_UpdateAuthNMapping.rs (line 27)
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 attribute_key(self, value: String) -> Self
pub fn attribute_key(self, value: String) -> Self
Examples found in repository?
examples/v2_authn-mappings_UpdateAuthNMapping.rs (line 28)
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 attribute_value(self, value: String) -> Self
pub fn attribute_value(self, value: String) -> Self
Examples found in repository?
examples/v2_authn-mappings_UpdateAuthNMapping.rs (line 29)
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 AuthNMappingUpdateAttributes
impl Clone for AuthNMappingUpdateAttributes
Source§fn clone(&self) -> AuthNMappingUpdateAttributes
fn clone(&self) -> AuthNMappingUpdateAttributes
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 AuthNMappingUpdateAttributes
impl Debug for AuthNMappingUpdateAttributes
Source§impl<'de> Deserialize<'de> for AuthNMappingUpdateAttributes
impl<'de> Deserialize<'de> for AuthNMappingUpdateAttributes
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 AuthNMappingUpdateAttributes
impl PartialEq for AuthNMappingUpdateAttributes
Source§fn eq(&self, other: &AuthNMappingUpdateAttributes) -> bool
fn eq(&self, other: &AuthNMappingUpdateAttributes) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for AuthNMappingUpdateAttributes
Auto Trait Implementations§
impl Freeze for AuthNMappingUpdateAttributes
impl RefUnwindSafe for AuthNMappingUpdateAttributes
impl Send for AuthNMappingUpdateAttributes
impl Sync for AuthNMappingUpdateAttributes
impl Unpin for AuthNMappingUpdateAttributes
impl UnwindSafe for AuthNMappingUpdateAttributes
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