#[non_exhaustive]pub struct AuthNMappingCreateAttributes {
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 create 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 AuthNMappingCreateAttributes
impl AuthNMappingCreateAttributes
Sourcepub fn new() -> AuthNMappingCreateAttributes
pub fn new() -> AuthNMappingCreateAttributes
Examples found in repository?
examples/v2_authn-mappings_CreateAuthNMapping.rs (line 21)
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}
Sourcepub fn attribute_key(self, value: String) -> Self
pub fn attribute_key(self, value: String) -> Self
Examples found in repository?
examples/v2_authn-mappings_CreateAuthNMapping.rs (line 22)
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}
Sourcepub fn attribute_value(self, value: String) -> Self
pub fn attribute_value(self, value: String) -> Self
Examples found in repository?
examples/v2_authn-mappings_CreateAuthNMapping.rs (line 23)
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}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for AuthNMappingCreateAttributes
impl Clone for AuthNMappingCreateAttributes
Source§fn clone(&self) -> AuthNMappingCreateAttributes
fn clone(&self) -> AuthNMappingCreateAttributes
Returns a copy 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 AuthNMappingCreateAttributes
impl Debug for AuthNMappingCreateAttributes
Source§impl<'de> Deserialize<'de> for AuthNMappingCreateAttributes
impl<'de> Deserialize<'de> for AuthNMappingCreateAttributes
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 AuthNMappingCreateAttributes
impl PartialEq for AuthNMappingCreateAttributes
Source§fn eq(&self, other: &AuthNMappingCreateAttributes) -> bool
fn eq(&self, other: &AuthNMappingCreateAttributes) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for AuthNMappingCreateAttributes
Auto Trait Implementations§
impl Freeze for AuthNMappingCreateAttributes
impl RefUnwindSafe for AuthNMappingCreateAttributes
impl Send for AuthNMappingCreateAttributes
impl Sync for AuthNMappingCreateAttributes
impl Unpin for AuthNMappingCreateAttributes
impl UnwindSafe for AuthNMappingCreateAttributes
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