#[non_exhaustive]pub struct CIAppTestsAggregateRequest {
pub compute: Option<Vec<CIAppCompute>>,
pub filter: Option<CIAppTestsQueryFilter>,
pub group_by: Option<Vec<CIAppTestsGroupBy>>,
pub options: Option<CIAppQueryOptions>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The object sent with the request to retrieve aggregation buckets of test events from your organization.
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.compute: Option<Vec<CIAppCompute>>
The list of metrics or timeseries to compute for the retrieved buckets.
filter: Option<CIAppTestsQueryFilter>
The search and filter query settings.
group_by: Option<Vec<CIAppTestsGroupBy>>
The rules for the group-by.
options: Option<CIAppQueryOptions>
Global query options that are used during the query. Only supply timezone or time offset, not both. Otherwise, the query fails.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CIAppTestsAggregateRequest
impl CIAppTestsAggregateRequest
Sourcepub fn new() -> CIAppTestsAggregateRequest
pub fn new() -> CIAppTestsAggregateRequest
Examples found in repository?
examples/v2_ci-visibility-tests_AggregateCIAppTestEvents.rs (line 17)
16async fn main() {
17 let body = CIAppTestsAggregateRequest::new()
18 .compute(vec![CIAppCompute::new(CIAppAggregationFunction::COUNT)
19 .metric("@test.is_flaky".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppTestsQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@language:(python OR go)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppTestsGroupBy::new("@git.branch".to_string())
28 .limit(10)
29 .sort(CIAppAggregateSort::new().order(CIAppSortOrder::ASCENDING))
30 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
31 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
32 let configuration = datadog::Configuration::new();
33 let api = CIVisibilityTestsAPI::with_config(configuration);
34 let resp = api.aggregate_ci_app_test_events(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
Sourcepub fn compute(self, value: Vec<CIAppCompute>) -> Self
pub fn compute(self, value: Vec<CIAppCompute>) -> Self
Examples found in repository?
examples/v2_ci-visibility-tests_AggregateCIAppTestEvents.rs (lines 18-20)
16async fn main() {
17 let body = CIAppTestsAggregateRequest::new()
18 .compute(vec![CIAppCompute::new(CIAppAggregationFunction::COUNT)
19 .metric("@test.is_flaky".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppTestsQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@language:(python OR go)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppTestsGroupBy::new("@git.branch".to_string())
28 .limit(10)
29 .sort(CIAppAggregateSort::new().order(CIAppSortOrder::ASCENDING))
30 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
31 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
32 let configuration = datadog::Configuration::new();
33 let api = CIVisibilityTestsAPI::with_config(configuration);
34 let resp = api.aggregate_ci_app_test_events(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
Sourcepub fn filter(self, value: CIAppTestsQueryFilter) -> Self
pub fn filter(self, value: CIAppTestsQueryFilter) -> Self
Examples found in repository?
examples/v2_ci-visibility-tests_AggregateCIAppTestEvents.rs (lines 21-26)
16async fn main() {
17 let body = CIAppTestsAggregateRequest::new()
18 .compute(vec![CIAppCompute::new(CIAppAggregationFunction::COUNT)
19 .metric("@test.is_flaky".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppTestsQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@language:(python OR go)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppTestsGroupBy::new("@git.branch".to_string())
28 .limit(10)
29 .sort(CIAppAggregateSort::new().order(CIAppSortOrder::ASCENDING))
30 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
31 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
32 let configuration = datadog::Configuration::new();
33 let api = CIVisibilityTestsAPI::with_config(configuration);
34 let resp = api.aggregate_ci_app_test_events(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
Sourcepub fn group_by(self, value: Vec<CIAppTestsGroupBy>) -> Self
pub fn group_by(self, value: Vec<CIAppTestsGroupBy>) -> Self
Examples found in repository?
examples/v2_ci-visibility-tests_AggregateCIAppTestEvents.rs (lines 27-30)
16async fn main() {
17 let body = CIAppTestsAggregateRequest::new()
18 .compute(vec![CIAppCompute::new(CIAppAggregationFunction::COUNT)
19 .metric("@test.is_flaky".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppTestsQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@language:(python OR go)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppTestsGroupBy::new("@git.branch".to_string())
28 .limit(10)
29 .sort(CIAppAggregateSort::new().order(CIAppSortOrder::ASCENDING))
30 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
31 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
32 let configuration = datadog::Configuration::new();
33 let api = CIVisibilityTestsAPI::with_config(configuration);
34 let resp = api.aggregate_ci_app_test_events(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
Sourcepub fn options(self, value: CIAppQueryOptions) -> Self
pub fn options(self, value: CIAppQueryOptions) -> Self
Examples found in repository?
examples/v2_ci-visibility-tests_AggregateCIAppTestEvents.rs (line 31)
16async fn main() {
17 let body = CIAppTestsAggregateRequest::new()
18 .compute(vec![CIAppCompute::new(CIAppAggregationFunction::COUNT)
19 .metric("@test.is_flaky".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppTestsQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@language:(python OR go)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppTestsGroupBy::new("@git.branch".to_string())
28 .limit(10)
29 .sort(CIAppAggregateSort::new().order(CIAppSortOrder::ASCENDING))
30 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
31 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
32 let configuration = datadog::Configuration::new();
33 let api = CIVisibilityTestsAPI::with_config(configuration);
34 let resp = api.aggregate_ci_app_test_events(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CIAppTestsAggregateRequest
impl Clone for CIAppTestsAggregateRequest
Source§fn clone(&self) -> CIAppTestsAggregateRequest
fn clone(&self) -> CIAppTestsAggregateRequest
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 CIAppTestsAggregateRequest
impl Debug for CIAppTestsAggregateRequest
Source§impl Default for CIAppTestsAggregateRequest
impl Default for CIAppTestsAggregateRequest
Source§impl<'de> Deserialize<'de> for CIAppTestsAggregateRequest
impl<'de> Deserialize<'de> for CIAppTestsAggregateRequest
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
impl StructuralPartialEq for CIAppTestsAggregateRequest
Auto Trait Implementations§
impl Freeze for CIAppTestsAggregateRequest
impl RefUnwindSafe for CIAppTestsAggregateRequest
impl Send for CIAppTestsAggregateRequest
impl Sync for CIAppTestsAggregateRequest
impl Unpin for CIAppTestsAggregateRequest
impl UnwindSafe for CIAppTestsAggregateRequest
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