#[non_exhaustive]pub struct AuthNMappingCreateData {
pub attributes: Option<AuthNMappingCreateAttributes>,
pub relationships: Option<AuthNMappingCreateRelationships>,
pub type_: AuthNMappingsType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Data for creating an AuthN Mapping.
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.attributes: Option<AuthNMappingCreateAttributes>
Key/Value pair of attributes used for create request.
relationships: Option<AuthNMappingCreateRelationships>
Relationship of AuthN Mapping create object to a Role or Team.
type_: AuthNMappingsType
AuthN Mappings resource type.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl AuthNMappingCreateData
impl AuthNMappingCreateData
Sourcepub fn new(type_: AuthNMappingsType) -> AuthNMappingCreateData
pub fn new(type_: AuthNMappingsType) -> AuthNMappingCreateData
Examples found in repository?
examples/v2_authn-mappings_CreateAuthNMapping.rs (line 19)
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 attributes(self, value: AuthNMappingCreateAttributes) -> Self
pub fn attributes(self, value: AuthNMappingCreateAttributes) -> Self
Examples found in repository?
examples/v2_authn-mappings_CreateAuthNMapping.rs (lines 20-24)
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 relationships(self, value: AuthNMappingCreateRelationships) -> Self
pub fn relationships(self, value: AuthNMappingCreateRelationships) -> Self
Examples found in repository?
examples/v2_authn-mappings_CreateAuthNMapping.rs (lines 25-35)
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 AuthNMappingCreateData
impl Clone for AuthNMappingCreateData
Source§fn clone(&self) -> AuthNMappingCreateData
fn clone(&self) -> AuthNMappingCreateData
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 AuthNMappingCreateData
impl Debug for AuthNMappingCreateData
Source§impl<'de> Deserialize<'de> for AuthNMappingCreateData
impl<'de> Deserialize<'de> for AuthNMappingCreateData
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 AuthNMappingCreateData
impl PartialEq for AuthNMappingCreateData
Source§impl Serialize for AuthNMappingCreateData
impl Serialize for AuthNMappingCreateData
impl StructuralPartialEq for AuthNMappingCreateData
Auto Trait Implementations§
impl Freeze for AuthNMappingCreateData
impl RefUnwindSafe for AuthNMappingCreateData
impl Send for AuthNMappingCreateData
impl Sync for AuthNMappingCreateData
impl Unpin for AuthNMappingCreateData
impl UnwindSafe for AuthNMappingCreateData
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