#[non_exhaustive]pub struct CreateRuleRequest {
pub data: Option<CreateRuleRequestData>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Scorecard create rule request.
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: Option<CreateRuleRequestData>
Scorecard create rule request data.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CreateRuleRequest
impl CreateRuleRequest
Sourcepub fn new() -> CreateRuleRequest
pub fn new() -> CreateRuleRequest
Examples found in repository?
examples/v2_service-scorecards_CreateScorecardRule.rs (line 11)
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 data(self, value: CreateRuleRequestData) -> Self
pub fn data(self, value: CreateRuleRequestData) -> Self
Examples found in repository?
examples/v2_service-scorecards_CreateScorecardRule.rs (lines 11-20)
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 CreateRuleRequest
impl Clone for CreateRuleRequest
Source§fn clone(&self) -> CreateRuleRequest
fn clone(&self) -> CreateRuleRequest
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 CreateRuleRequest
impl Debug for CreateRuleRequest
Source§impl Default for CreateRuleRequest
impl Default for CreateRuleRequest
Source§impl<'de> Deserialize<'de> for CreateRuleRequest
impl<'de> Deserialize<'de> for CreateRuleRequest
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 CreateRuleRequest
impl PartialEq for CreateRuleRequest
Source§impl Serialize for CreateRuleRequest
impl Serialize for CreateRuleRequest
impl StructuralPartialEq for CreateRuleRequest
Auto Trait Implementations§
impl Freeze for CreateRuleRequest
impl RefUnwindSafe for CreateRuleRequest
impl Send for CreateRuleRequest
impl Sync for CreateRuleRequest
impl Unpin for CreateRuleRequest
impl UnwindSafe for CreateRuleRequest
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