#[non_exhaustive]pub struct CreateRuleRequestData {
pub attributes: Option<RuleAttributes>,
pub type_: Option<RuleType>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Scorecard create rule request data.
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<RuleAttributes>
Details of a rule.
type_: Option<RuleType>
The JSON:API type for scorecard rules.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CreateRuleRequestData
impl CreateRuleRequestData
Sourcepub fn new() -> CreateRuleRequestData
pub fn new() -> CreateRuleRequestData
Examples found in repository?
examples/v2_service-scorecards_CreateScorecardRule.rs (line 12)
10async fn main() {
11 let body = CreateRuleRequest::new().data(
12 CreateRuleRequestData::new()
13 .attributes(
14 RuleAttributes::new()
15 .enabled(true)
16 .name("Example-Service-Scorecard".to_string())
17 .scorecard_name("Observability Best Practices".to_string()),
18 )
19 .type_(RuleType::RULE),
20 );
21 let mut configuration = datadog::Configuration::new();
22 configuration.set_unstable_operation_enabled("v2.CreateScorecardRule", true);
23 let api = ServiceScorecardsAPI::with_config(configuration);
24 let resp = api.create_scorecard_rule(body).await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
Sourcepub fn attributes(self, value: RuleAttributes) -> Self
pub fn attributes(self, value: RuleAttributes) -> Self
Examples found in repository?
examples/v2_service-scorecards_CreateScorecardRule.rs (lines 13-18)
10async fn main() {
11 let body = CreateRuleRequest::new().data(
12 CreateRuleRequestData::new()
13 .attributes(
14 RuleAttributes::new()
15 .enabled(true)
16 .name("Example-Service-Scorecard".to_string())
17 .scorecard_name("Observability Best Practices".to_string()),
18 )
19 .type_(RuleType::RULE),
20 );
21 let mut configuration = datadog::Configuration::new();
22 configuration.set_unstable_operation_enabled("v2.CreateScorecardRule", true);
23 let api = ServiceScorecardsAPI::with_config(configuration);
24 let resp = api.create_scorecard_rule(body).await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
Sourcepub fn type_(self, value: RuleType) -> Self
pub fn type_(self, value: RuleType) -> Self
Examples found in repository?
examples/v2_service-scorecards_CreateScorecardRule.rs (line 19)
10async fn main() {
11 let body = CreateRuleRequest::new().data(
12 CreateRuleRequestData::new()
13 .attributes(
14 RuleAttributes::new()
15 .enabled(true)
16 .name("Example-Service-Scorecard".to_string())
17 .scorecard_name("Observability Best Practices".to_string()),
18 )
19 .type_(RuleType::RULE),
20 );
21 let mut configuration = datadog::Configuration::new();
22 configuration.set_unstable_operation_enabled("v2.CreateScorecardRule", true);
23 let api = ServiceScorecardsAPI::with_config(configuration);
24 let resp = api.create_scorecard_rule(body).await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CreateRuleRequestData
impl Clone for CreateRuleRequestData
Source§fn clone(&self) -> CreateRuleRequestData
fn clone(&self) -> CreateRuleRequestData
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 CreateRuleRequestData
impl Debug for CreateRuleRequestData
Source§impl Default for CreateRuleRequestData
impl Default for CreateRuleRequestData
Source§impl<'de> Deserialize<'de> for CreateRuleRequestData
impl<'de> Deserialize<'de> for CreateRuleRequestData
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 CreateRuleRequestData
impl PartialEq for CreateRuleRequestData
Source§impl Serialize for CreateRuleRequestData
impl Serialize for CreateRuleRequestData
impl StructuralPartialEq for CreateRuleRequestData
Auto Trait Implementations§
impl Freeze for CreateRuleRequestData
impl RefUnwindSafe for CreateRuleRequestData
impl Send for CreateRuleRequestData
impl Sync for CreateRuleRequestData
impl Unpin for CreateRuleRequestData
impl UnwindSafe for CreateRuleRequestData
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