#[non_exhaustive]pub struct CreateRulesetRequestDataAttributes {
pub enabled: Option<bool>,
pub rules: Vec<CreateRulesetRequestDataAttributesRulesItems>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The definition of CreateRulesetRequestDataAttributes
object.
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.enabled: Option<bool>
The attributes
enabled
.
rules: Vec<CreateRulesetRequestDataAttributesRulesItems>
The attributes
rules
.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CreateRulesetRequestDataAttributes
impl CreateRulesetRequestDataAttributes
Sourcepub fn new(
rules: Vec<CreateRulesetRequestDataAttributesRulesItems>,
) -> CreateRulesetRequestDataAttributes
pub fn new( rules: Vec<CreateRulesetRequestDataAttributesRulesItems>, ) -> CreateRulesetRequestDataAttributes
Examples found in repository?
examples/v2_cloud-cost-management_CreateRuleset.rs (lines 17-37)
13async fn main() {
14 let body = CreateRulesetRequest::new().data(
15 CreateRulesetRequestData::new(CreateRulesetRequestDataType::CREATE_RULESET)
16 .attributes(
17 CreateRulesetRequestDataAttributes::new(vec![
18 CreateRulesetRequestDataAttributesRulesItems::new(
19 true,
20 "Add Cost Center Tag".to_string(),
21 )
22 .mapping(None)
23 .query(Some(
24 CreateRulesetRequestDataAttributesRulesItemsQuery::new(
25 Some(
26 CreateRulesetRequestDataAttributesRulesItemsQueryAddition::new(
27 "cost_center".to_string(),
28 "engineering".to_string(),
29 ),
30 ),
31 true,
32 r#"account_id:"123456789" AND service:"web-api""#.to_string(),
33 )
34 .case_insensitivity(false),
35 ))
36 .reference_table(None),
37 ])
38 .enabled(true),
39 )
40 .id("New Ruleset".to_string()),
41 );
42 let configuration = datadog::Configuration::new();
43 let api = CloudCostManagementAPI::with_config(configuration);
44 let resp = api.create_ruleset(body).await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
Sourcepub fn enabled(self, value: bool) -> Self
pub fn enabled(self, value: bool) -> Self
Examples found in repository?
examples/v2_cloud-cost-management_CreateRuleset.rs (line 38)
13async fn main() {
14 let body = CreateRulesetRequest::new().data(
15 CreateRulesetRequestData::new(CreateRulesetRequestDataType::CREATE_RULESET)
16 .attributes(
17 CreateRulesetRequestDataAttributes::new(vec![
18 CreateRulesetRequestDataAttributesRulesItems::new(
19 true,
20 "Add Cost Center Tag".to_string(),
21 )
22 .mapping(None)
23 .query(Some(
24 CreateRulesetRequestDataAttributesRulesItemsQuery::new(
25 Some(
26 CreateRulesetRequestDataAttributesRulesItemsQueryAddition::new(
27 "cost_center".to_string(),
28 "engineering".to_string(),
29 ),
30 ),
31 true,
32 r#"account_id:"123456789" AND service:"web-api""#.to_string(),
33 )
34 .case_insensitivity(false),
35 ))
36 .reference_table(None),
37 ])
38 .enabled(true),
39 )
40 .id("New Ruleset".to_string()),
41 );
42 let configuration = datadog::Configuration::new();
43 let api = CloudCostManagementAPI::with_config(configuration);
44 let resp = api.create_ruleset(body).await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CreateRulesetRequestDataAttributes
impl Clone for CreateRulesetRequestDataAttributes
Source§fn clone(&self) -> CreateRulesetRequestDataAttributes
fn clone(&self) -> CreateRulesetRequestDataAttributes
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<'de> Deserialize<'de> for CreateRulesetRequestDataAttributes
impl<'de> Deserialize<'de> for CreateRulesetRequestDataAttributes
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 CreateRulesetRequestDataAttributes
impl PartialEq for CreateRulesetRequestDataAttributes
Source§fn eq(&self, other: &CreateRulesetRequestDataAttributes) -> bool
fn eq(&self, other: &CreateRulesetRequestDataAttributes) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for CreateRulesetRequestDataAttributes
Auto Trait Implementations§
impl Freeze for CreateRulesetRequestDataAttributes
impl RefUnwindSafe for CreateRulesetRequestDataAttributes
impl Send for CreateRulesetRequestDataAttributes
impl Sync for CreateRulesetRequestDataAttributes
impl Unpin for CreateRulesetRequestDataAttributes
impl UnwindSafe for CreateRulesetRequestDataAttributes
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