#[non_exhaustive]pub struct UpdateOutcomesAsyncRequestData {
pub attributes: Option<UpdateOutcomesAsyncAttributes>,
pub type_: Option<UpdateOutcomesAsyncType>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Scorecard outcomes batch 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<UpdateOutcomesAsyncAttributes>
The JSON:API attributes for a batched set of scorecard outcomes.
type_: Option<UpdateOutcomesAsyncType>
The JSON:API type for scorecard outcomes.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl UpdateOutcomesAsyncRequestData
impl UpdateOutcomesAsyncRequestData
Sourcepub fn new() -> UpdateOutcomesAsyncRequestData
pub fn new() -> UpdateOutcomesAsyncRequestData
Examples found in repository?
examples/v2_service-scorecards_UpdateScorecardOutcomesAsync.rs (line 16)
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 = UpdateOutcomesAsyncRequest::new().data(
16 UpdateOutcomesAsyncRequestData::new()
17 .attributes(UpdateOutcomesAsyncAttributes::new().results(vec![
18 UpdateOutcomesAsyncRequestItem::new(
19 "service:my-service".to_string(),
20 create_scorecard_rule_data_id.clone(),
21 State::PASS,
22 )
23 .remarks(
24 r#"See: <a href="https://app.datadoghq.com/services">Services</a>"#
25 .to_string(),
26 ),
27 ]))
28 .type_(UpdateOutcomesAsyncType::BATCHED_OUTCOME),
29 );
30 let mut configuration = datadog::Configuration::new();
31 configuration.set_unstable_operation_enabled("v2.UpdateScorecardOutcomesAsync", true);
32 let api = ServiceScorecardsAPI::with_config(configuration);
33 let resp = api.update_scorecard_outcomes_async(body).await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
Sourcepub fn attributes(self, value: UpdateOutcomesAsyncAttributes) -> Self
pub fn attributes(self, value: UpdateOutcomesAsyncAttributes) -> Self
Examples found in repository?
examples/v2_service-scorecards_UpdateScorecardOutcomesAsync.rs (lines 17-27)
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 = UpdateOutcomesAsyncRequest::new().data(
16 UpdateOutcomesAsyncRequestData::new()
17 .attributes(UpdateOutcomesAsyncAttributes::new().results(vec![
18 UpdateOutcomesAsyncRequestItem::new(
19 "service:my-service".to_string(),
20 create_scorecard_rule_data_id.clone(),
21 State::PASS,
22 )
23 .remarks(
24 r#"See: <a href="https://app.datadoghq.com/services">Services</a>"#
25 .to_string(),
26 ),
27 ]))
28 .type_(UpdateOutcomesAsyncType::BATCHED_OUTCOME),
29 );
30 let mut configuration = datadog::Configuration::new();
31 configuration.set_unstable_operation_enabled("v2.UpdateScorecardOutcomesAsync", true);
32 let api = ServiceScorecardsAPI::with_config(configuration);
33 let resp = api.update_scorecard_outcomes_async(body).await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
Sourcepub fn type_(self, value: UpdateOutcomesAsyncType) -> Self
pub fn type_(self, value: UpdateOutcomesAsyncType) -> Self
Examples found in repository?
examples/v2_service-scorecards_UpdateScorecardOutcomesAsync.rs (line 28)
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 = UpdateOutcomesAsyncRequest::new().data(
16 UpdateOutcomesAsyncRequestData::new()
17 .attributes(UpdateOutcomesAsyncAttributes::new().results(vec![
18 UpdateOutcomesAsyncRequestItem::new(
19 "service:my-service".to_string(),
20 create_scorecard_rule_data_id.clone(),
21 State::PASS,
22 )
23 .remarks(
24 r#"See: <a href="https://app.datadoghq.com/services">Services</a>"#
25 .to_string(),
26 ),
27 ]))
28 .type_(UpdateOutcomesAsyncType::BATCHED_OUTCOME),
29 );
30 let mut configuration = datadog::Configuration::new();
31 configuration.set_unstable_operation_enabled("v2.UpdateScorecardOutcomesAsync", true);
32 let api = ServiceScorecardsAPI::with_config(configuration);
33 let resp = api.update_scorecard_outcomes_async(body).await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for UpdateOutcomesAsyncRequestData
impl Clone for UpdateOutcomesAsyncRequestData
Source§fn clone(&self) -> UpdateOutcomesAsyncRequestData
fn clone(&self) -> UpdateOutcomesAsyncRequestData
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 UpdateOutcomesAsyncRequestData
impl<'de> Deserialize<'de> for UpdateOutcomesAsyncRequestData
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 UpdateOutcomesAsyncRequestData
impl PartialEq for UpdateOutcomesAsyncRequestData
Source§fn eq(&self, other: &UpdateOutcomesAsyncRequestData) -> bool
fn eq(&self, other: &UpdateOutcomesAsyncRequestData) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for UpdateOutcomesAsyncRequestData
Auto Trait Implementations§
impl Freeze for UpdateOutcomesAsyncRequestData
impl RefUnwindSafe for UpdateOutcomesAsyncRequestData
impl Send for UpdateOutcomesAsyncRequestData
impl Sync for UpdateOutcomesAsyncRequestData
impl Unpin for UpdateOutcomesAsyncRequestData
impl UnwindSafe for UpdateOutcomesAsyncRequestData
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