v2_ci_visibility_tests_SearchCIAppTestEvents/
v2_ci-visibility-tests_SearchCIAppTestEvents.rs1use datadog_api_client::datadog;
3use datadog_api_client::datadogV2::api_ci_visibility_tests::CIVisibilityTestsAPI;
4use datadog_api_client::datadogV2::api_ci_visibility_tests::SearchCIAppTestEventsOptionalParams;
5use datadog_api_client::datadogV2::model::CIAppQueryOptions;
6use datadog_api_client::datadogV2::model::CIAppQueryPageOptions;
7use datadog_api_client::datadogV2::model::CIAppSort;
8use datadog_api_client::datadogV2::model::CIAppTestEventsRequest;
9use datadog_api_client::datadogV2::model::CIAppTestsQueryFilter;
10
11#[tokio::main]
12async fn main() {
13 let body = CIAppTestEventsRequest::new()
14 .filter(
15 CIAppTestsQueryFilter::new()
16 .from("now-15m".to_string())
17 .query("@test.service:web-ui-tests AND @test.status:skip".to_string())
18 .to("now".to_string()),
19 )
20 .options(CIAppQueryOptions::new().timezone("GMT".to_string()))
21 .page(CIAppQueryPageOptions::new().limit(25))
22 .sort(CIAppSort::TIMESTAMP_ASCENDING);
23 let configuration = datadog::Configuration::new();
24 let api = CIVisibilityTestsAPI::with_config(configuration);
25 let resp = api
26 .search_ci_app_test_events(SearchCIAppTestEventsOptionalParams::default().body(body))
27 .await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}