#[non_exhaustive]pub struct AuthNMappingCreateRequest {
pub data: AuthNMappingCreateData,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Request 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.data: AuthNMappingCreateData
Data for creating an AuthN Mapping.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl AuthNMappingCreateRequest
impl AuthNMappingCreateRequest
Sourcepub fn new(data: AuthNMappingCreateData) -> AuthNMappingCreateRequest
pub fn new(data: AuthNMappingCreateData) -> AuthNMappingCreateRequest
Examples found in repository?
examples/v2_authn-mappings_CreateAuthNMapping.rs (lines 18-36)
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 AuthNMappingCreateRequest
impl Clone for AuthNMappingCreateRequest
Source§fn clone(&self) -> AuthNMappingCreateRequest
fn clone(&self) -> AuthNMappingCreateRequest
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 AuthNMappingCreateRequest
impl Debug for AuthNMappingCreateRequest
Source§impl<'de> Deserialize<'de> for AuthNMappingCreateRequest
impl<'de> Deserialize<'de> for AuthNMappingCreateRequest
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
impl StructuralPartialEq for AuthNMappingCreateRequest
Auto Trait Implementations§
impl Freeze for AuthNMappingCreateRequest
impl RefUnwindSafe for AuthNMappingCreateRequest
impl Send for AuthNMappingCreateRequest
impl Sync for AuthNMappingCreateRequest
impl Unpin for AuthNMappingCreateRequest
impl UnwindSafe for AuthNMappingCreateRequest
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