Struct datadog_api_client::datadogV2::model::model_authn_mapping_create_request::AuthNMappingCreateRequest
source · #[non_exhaustive]pub struct AuthNMappingCreateRequest {
pub data: AuthNMappingCreateData,
/* 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.
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_create_authn_mapping.rs (lines 18-36)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
async fn main() {
// there is a valid "role" in the system
let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
let body = AuthNMappingCreateRequest::new(
AuthNMappingCreateData::new(AuthNMappingsType::AUTHN_MAPPINGS)
.attributes(
AuthNMappingCreateAttributes::new()
.attribute_key("exampleauthnmapping".to_string())
.attribute_value("Example-AuthN-Mapping".to_string()),
)
.relationships(
AuthNMappingCreateRelationships::AuthNMappingRelationshipToRole(Box::new(
AuthNMappingRelationshipToRole::new(
RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id(role_data_id.clone())
.type_(RolesType::ROLES),
),
),
)),
),
);
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api.create_authn_mapping(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Trait Implementations§
source§impl Clone for AuthNMappingCreateRequest
impl Clone for AuthNMappingCreateRequest
source§fn clone(&self) -> AuthNMappingCreateRequest
fn clone(&self) -> AuthNMappingCreateRequest
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 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
source§impl PartialEq for AuthNMappingCreateRequest
impl PartialEq for AuthNMappingCreateRequest
source§fn eq(&self, other: &AuthNMappingCreateRequest) -> bool
fn eq(&self, other: &AuthNMappingCreateRequest) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)