#[non_exhaustive]pub struct RuleAttributes {
pub category: Option<String>,
pub created_at: Option<DateTime<Utc>>,
pub custom: Option<bool>,
pub description: Option<String>,
pub enabled: Option<bool>,
pub modified_at: Option<DateTime<Utc>>,
pub name: Option<String>,
pub owner: Option<String>,
pub scorecard_name: Option<String>,
/* private fields */
}
Expand description
Details of a rule.
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.category: Option<String>
👎Deprecated
The scorecard name to which this rule must belong.
created_at: Option<DateTime<Utc>>
Creation time of the rule outcome.
custom: Option<bool>
Defines if the rule is a custom rule.
description: Option<String>
Explanation of the rule.
enabled: Option<bool>
If enabled, the rule is calculated as part of the score.
modified_at: Option<DateTime<Utc>>
Time of the last rule outcome modification.
name: Option<String>
Name of the rule.
owner: Option<String>
Owner of the rule.
scorecard_name: Option<String>
The scorecard name to which this rule must belong.
Implementations§
source§impl RuleAttributes
impl RuleAttributes
sourcepub fn new() -> RuleAttributes
pub fn new() -> RuleAttributes
Examples found in repository?
examples/v2_service-scorecards_create_scorecard_rule.rs (line 14)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
async fn main() {
let body = CreateRuleRequest::new().data(
CreateRuleRequestData::new()
.attributes(
RuleAttributes::new()
.enabled(true)
.name("Example-Service-Scorecard".to_string())
.scorecard_name("Observability Best Practices".to_string()),
)
.type_(RuleType::RULE),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateScorecardRule", true);
let api = ServiceScorecardsAPI::with_config(configuration);
let resp = api.create_scorecard_rule(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
pub fn category(self, value: String) -> Self
pub fn created_at(self, value: DateTime<Utc>) -> Self
pub fn custom(self, value: bool) -> Self
pub fn description(self, value: String) -> Self
sourcepub fn enabled(self, value: bool) -> Self
pub fn enabled(self, value: bool) -> Self
Examples found in repository?
examples/v2_service-scorecards_create_scorecard_rule.rs (line 15)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
async fn main() {
let body = CreateRuleRequest::new().data(
CreateRuleRequestData::new()
.attributes(
RuleAttributes::new()
.enabled(true)
.name("Example-Service-Scorecard".to_string())
.scorecard_name("Observability Best Practices".to_string()),
)
.type_(RuleType::RULE),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateScorecardRule", true);
let api = ServiceScorecardsAPI::with_config(configuration);
let resp = api.create_scorecard_rule(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
pub fn modified_at(self, value: DateTime<Utc>) -> Self
sourcepub fn name(self, value: String) -> Self
pub fn name(self, value: String) -> Self
Examples found in repository?
examples/v2_service-scorecards_create_scorecard_rule.rs (line 16)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
async fn main() {
let body = CreateRuleRequest::new().data(
CreateRuleRequestData::new()
.attributes(
RuleAttributes::new()
.enabled(true)
.name("Example-Service-Scorecard".to_string())
.scorecard_name("Observability Best Practices".to_string()),
)
.type_(RuleType::RULE),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateScorecardRule", true);
let api = ServiceScorecardsAPI::with_config(configuration);
let resp = api.create_scorecard_rule(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
pub fn owner(self, value: String) -> Self
sourcepub fn scorecard_name(self, value: String) -> Self
pub fn scorecard_name(self, value: String) -> Self
Examples found in repository?
examples/v2_service-scorecards_create_scorecard_rule.rs (line 17)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
async fn main() {
let body = CreateRuleRequest::new().data(
CreateRuleRequestData::new()
.attributes(
RuleAttributes::new()
.enabled(true)
.name("Example-Service-Scorecard".to_string())
.scorecard_name("Observability Best Practices".to_string()),
)
.type_(RuleType::RULE),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateScorecardRule", true);
let api = ServiceScorecardsAPI::with_config(configuration);
let resp = api.create_scorecard_rule(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Trait Implementations§
source§impl Clone for RuleAttributes
impl Clone for RuleAttributes
source§fn clone(&self) -> RuleAttributes
fn clone(&self) -> RuleAttributes
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 RuleAttributes
impl Debug for RuleAttributes
source§impl Default for RuleAttributes
impl Default for RuleAttributes
source§impl<'de> Deserialize<'de> for RuleAttributes
impl<'de> Deserialize<'de> for RuleAttributes
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 RuleAttributes
impl PartialEq for RuleAttributes
source§fn eq(&self, other: &RuleAttributes) -> bool
fn eq(&self, other: &RuleAttributes) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for RuleAttributes
impl Serialize for RuleAttributes
impl StructuralPartialEq for RuleAttributes
Auto Trait Implementations§
impl Freeze for RuleAttributes
impl RefUnwindSafe for RuleAttributes
impl Send for RuleAttributes
impl Sync for RuleAttributes
impl Unpin for RuleAttributes
impl UnwindSafe for RuleAttributes
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
)