#[non_exhaustive]pub struct OutcomesBatchAttributes {
pub results: Option<Vec<OutcomesBatchRequestItem>>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The JSON:API attributes for a batched set of scorecard outcomes.
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.results: Option<Vec<OutcomesBatchRequestItem>>
Set of scorecard outcomes to update.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl OutcomesBatchAttributes
impl OutcomesBatchAttributes
Sourcepub fn new() -> OutcomesBatchAttributes
pub fn new() -> OutcomesBatchAttributes
Examples found in repository?
examples/v2_service-scorecards_CreateScorecardOutcomesBatch.rs (line 18)
12async fn main() {
13 // there is a valid "create_scorecard_rule" in the system
14 let create_scorecard_rule_data_id = std::env::var("CREATE_SCORECARD_RULE_DATA_ID").unwrap();
15 let body = OutcomesBatchRequest::new().data(
16 OutcomesBatchRequestData::new()
17 .attributes(
18 OutcomesBatchAttributes::new().results(vec![OutcomesBatchRequestItem::new(
19 create_scorecard_rule_data_id.clone(),
20 "my-service".to_string(),
21 State::PASS,
22 )
23 .remarks(
24 r#"See: <a href="https://app.datadoghq.com/services">Services</a>"#.to_string(),
25 )]),
26 )
27 .type_(OutcomesBatchType::BATCHED_OUTCOME),
28 );
29 let mut configuration = datadog::Configuration::new();
30 configuration.set_unstable_operation_enabled("v2.CreateScorecardOutcomesBatch", true);
31 let api = ServiceScorecardsAPI::with_config(configuration);
32 let resp = api.create_scorecard_outcomes_batch(body).await;
33 if let Ok(value) = resp {
34 println!("{:#?}", value);
35 } else {
36 println!("{:#?}", resp.unwrap_err());
37 }
38}
Sourcepub fn results(self, value: Vec<OutcomesBatchRequestItem>) -> Self
pub fn results(self, value: Vec<OutcomesBatchRequestItem>) -> Self
Examples found in repository?
examples/v2_service-scorecards_CreateScorecardOutcomesBatch.rs (lines 18-25)
12async fn main() {
13 // there is a valid "create_scorecard_rule" in the system
14 let create_scorecard_rule_data_id = std::env::var("CREATE_SCORECARD_RULE_DATA_ID").unwrap();
15 let body = OutcomesBatchRequest::new().data(
16 OutcomesBatchRequestData::new()
17 .attributes(
18 OutcomesBatchAttributes::new().results(vec![OutcomesBatchRequestItem::new(
19 create_scorecard_rule_data_id.clone(),
20 "my-service".to_string(),
21 State::PASS,
22 )
23 .remarks(
24 r#"See: <a href="https://app.datadoghq.com/services">Services</a>"#.to_string(),
25 )]),
26 )
27 .type_(OutcomesBatchType::BATCHED_OUTCOME),
28 );
29 let mut configuration = datadog::Configuration::new();
30 configuration.set_unstable_operation_enabled("v2.CreateScorecardOutcomesBatch", true);
31 let api = ServiceScorecardsAPI::with_config(configuration);
32 let resp = api.create_scorecard_outcomes_batch(body).await;
33 if let Ok(value) = resp {
34 println!("{:#?}", value);
35 } else {
36 println!("{:#?}", resp.unwrap_err());
37 }
38}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for OutcomesBatchAttributes
impl Clone for OutcomesBatchAttributes
Source§fn clone(&self) -> OutcomesBatchAttributes
fn clone(&self) -> OutcomesBatchAttributes
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 OutcomesBatchAttributes
impl Debug for OutcomesBatchAttributes
Source§impl Default for OutcomesBatchAttributes
impl Default for OutcomesBatchAttributes
Source§impl<'de> Deserialize<'de> for OutcomesBatchAttributes
impl<'de> Deserialize<'de> for OutcomesBatchAttributes
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 OutcomesBatchAttributes
impl PartialEq for OutcomesBatchAttributes
Source§impl Serialize for OutcomesBatchAttributes
impl Serialize for OutcomesBatchAttributes
impl StructuralPartialEq for OutcomesBatchAttributes
Auto Trait Implementations§
impl Freeze for OutcomesBatchAttributes
impl RefUnwindSafe for OutcomesBatchAttributes
impl Send for OutcomesBatchAttributes
impl Sync for OutcomesBatchAttributes
impl Unpin for OutcomesBatchAttributes
impl UnwindSafe for OutcomesBatchAttributes
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