Skip to content

Commit d50f823

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ca200e0 of spec repo
1 parent 557230b commit d50f823

File tree

7 files changed

+47
-47
lines changed

7 files changed

+47
-47
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25864,6 +25864,14 @@ components:
2586425864
FlakyTestsSearchFilter:
2586525865
description: Search filter settings.
2586625866
properties:
25867+
include_history:
25868+
default: false
25869+
description: |-
25870+
Whether to include the status change history for each flaky test in the response.
25871+
When set to true, each test will include a 'history' array with chronological status changes.
25872+
Defaults to false.
25873+
example: true
25874+
type: boolean
2586725875
query:
2586825876
default: "*"
2586925877
description: |-
@@ -25909,14 +25917,6 @@ components:
2590925917
properties:
2591025918
filter:
2591125919
$ref: "#/components/schemas/FlakyTestsSearchFilter"
25912-
include_history:
25913-
default: false
25914-
description: |-
25915-
Whether to include the status change history for each flaky test in the response.
25916-
When set to true, each test will include a `history` array with chronological status changes.
25917-
Defaults to false.
25918-
example: true
25919-
type: boolean
2592025920
page:
2592125921
$ref: "#/components/schemas/FlakyTestsSearchPageOptions"
2592225922
sort:

examples/v2_test-optimization_SearchFlakyTests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ async fn main() {
1919
.attributes(
2020
FlakyTestsSearchRequestAttributes::new()
2121
.filter(
22-
FlakyTestsSearchFilter
23-
::new().query(
24-
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
25-
),
22+
FlakyTestsSearchFilter::new()
23+
.include_history(true)
24+
.query(
25+
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
26+
),
2627
)
27-
.include_history(true)
2828
.page(
2929
FlakyTestsSearchPageOptions::new()
3030
.cursor(

examples/v2_test-optimization_SearchFlakyTests_1224086727.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ async fn main() {
2121
.attributes(
2222
FlakyTestsSearchRequestAttributes::new()
2323
.filter(
24-
FlakyTestsSearchFilter
25-
::new().query(
26-
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
27-
),
24+
FlakyTestsSearchFilter::new()
25+
.include_history(true)
26+
.query(
27+
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
28+
),
2829
)
29-
.include_history(true)
3030
.page(
3131
FlakyTestsSearchPageOptions::new()
3232
.cursor(

examples/v2_test-optimization_SearchFlakyTests_209064879.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ async fn main() {
1919
.attributes(
2020
FlakyTestsSearchRequestAttributes::new()
2121
.filter(
22-
FlakyTestsSearchFilter
23-
::new().query(
24-
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
25-
),
22+
FlakyTestsSearchFilter::new()
23+
.include_history(true)
24+
.query(
25+
r#"flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist""#.to_string(),
26+
),
2627
)
27-
.include_history(true)
2828
.page(FlakyTestsSearchPageOptions::new().limit(10))
2929
.sort(FlakyTestsSearchSort::FQN_ASCENDING),
3030
)

src/datadogV2/model/model_flaky_tests_search_filter.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct FlakyTestsSearchFilter {
14+
/// Whether to include the status change history for each flaky test in the response.
15+
/// When set to true, each test will include a 'history' array with chronological status changes.
16+
/// Defaults to false.
17+
#[serde(rename = "include_history")]
18+
pub include_history: Option<bool>,
1419
/// Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:
1520
/// - `flaky_test_state`
1621
/// - `flaky_test_category`
@@ -34,12 +39,18 @@ pub struct FlakyTestsSearchFilter {
3439
impl FlakyTestsSearchFilter {
3540
pub fn new() -> FlakyTestsSearchFilter {
3641
FlakyTestsSearchFilter {
42+
include_history: None,
3743
query: None,
3844
additional_properties: std::collections::BTreeMap::new(),
3945
_unparsed: false,
4046
}
4147
}
4248

49+
pub fn include_history(mut self, value: bool) -> Self {
50+
self.include_history = Some(value);
51+
self
52+
}
53+
4354
pub fn query(mut self, value: String) -> Self {
4455
self.query = Some(value);
4556
self
@@ -77,6 +88,7 @@ impl<'de> Deserialize<'de> for FlakyTestsSearchFilter {
7788
where
7889
M: MapAccess<'a>,
7990
{
91+
let mut include_history: Option<bool> = None;
8092
let mut query: Option<String> = None;
8193
let mut additional_properties: std::collections::BTreeMap<
8294
String,
@@ -86,6 +98,13 @@ impl<'de> Deserialize<'de> for FlakyTestsSearchFilter {
8698

8799
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
88100
match k.as_str() {
101+
"include_history" => {
102+
if v.is_null() {
103+
continue;
104+
}
105+
include_history =
106+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
107+
}
89108
"query" => {
90109
if v.is_null() {
91110
continue;
@@ -101,6 +120,7 @@ impl<'de> Deserialize<'de> for FlakyTestsSearchFilter {
101120
}
102121

103122
let content = FlakyTestsSearchFilter {
123+
include_history,
104124
query,
105125
additional_properties,
106126
_unparsed,

src/datadogV2/model/model_flaky_tests_search_request_attributes.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ pub struct FlakyTestsSearchRequestAttributes {
1414
/// Search filter settings.
1515
#[serde(rename = "filter")]
1616
pub filter: Option<crate::datadogV2::model::FlakyTestsSearchFilter>,
17-
/// Whether to include the status change history for each flaky test in the response.
18-
/// When set to true, each test will include a `history` array with chronological status changes.
19-
/// Defaults to false.
20-
#[serde(rename = "include_history")]
21-
pub include_history: Option<bool>,
2217
/// Pagination attributes for listing flaky tests.
2318
#[serde(rename = "page")]
2419
pub page: Option<crate::datadogV2::model::FlakyTestsSearchPageOptions>,
@@ -36,7 +31,6 @@ impl FlakyTestsSearchRequestAttributes {
3631
pub fn new() -> FlakyTestsSearchRequestAttributes {
3732
FlakyTestsSearchRequestAttributes {
3833
filter: None,
39-
include_history: None,
4034
page: None,
4135
sort: None,
4236
additional_properties: std::collections::BTreeMap::new(),
@@ -49,11 +43,6 @@ impl FlakyTestsSearchRequestAttributes {
4943
self
5044
}
5145

52-
pub fn include_history(mut self, value: bool) -> Self {
53-
self.include_history = Some(value);
54-
self
55-
}
56-
5746
pub fn page(mut self, value: crate::datadogV2::model::FlakyTestsSearchPageOptions) -> Self {
5847
self.page = Some(value);
5948
self
@@ -97,7 +86,6 @@ impl<'de> Deserialize<'de> for FlakyTestsSearchRequestAttributes {
9786
M: MapAccess<'a>,
9887
{
9988
let mut filter: Option<crate::datadogV2::model::FlakyTestsSearchFilter> = None;
100-
let mut include_history: Option<bool> = None;
10189
let mut page: Option<crate::datadogV2::model::FlakyTestsSearchPageOptions> = None;
10290
let mut sort: Option<crate::datadogV2::model::FlakyTestsSearchSort> = None;
10391
let mut additional_properties: std::collections::BTreeMap<
@@ -114,13 +102,6 @@ impl<'de> Deserialize<'de> for FlakyTestsSearchRequestAttributes {
114102
}
115103
filter = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
116104
}
117-
"include_history" => {
118-
if v.is_null() {
119-
continue;
120-
}
121-
include_history =
122-
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
123-
}
124105
"page" => {
125106
if v.is_null() {
126107
continue;
@@ -151,7 +132,6 @@ impl<'de> Deserialize<'de> for FlakyTestsSearchRequestAttributes {
151132

152133
let content = FlakyTestsSearchRequestAttributes {
153134
filter,
154-
include_history,
155135
page,
156136
sort,
157137
additional_properties,

tests/scenarios/features/v2/test_optimization.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Feature: Test Optimization
8585
Scenario: Search flaky tests returns "Bad Request" response
8686
Given operation "SearchFlakyTests" enabled
8787
And new "SearchFlakyTests" request
88-
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
88+
And body with value {"data": {"attributes": {"filter": {"include_history": true, "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
8989
When the request is sent
9090
Then the response status is 400 Bad Request
9191

@@ -101,7 +101,7 @@ Feature: Test Optimization
101101
Scenario: Search flaky tests returns "OK" response
102102
Given operation "SearchFlakyTests" enabled
103103
And new "SearchFlakyTests" request
104-
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
104+
And body with value {"data": {"attributes": {"filter": {"include_history": true, "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
105105
When the request is sent
106106
Then the response status is 200 OK
107107

@@ -117,7 +117,7 @@ Feature: Test Optimization
117117
Scenario: Search flaky tests returns "OK" response with history
118118
Given operation "SearchFlakyTests" enabled
119119
And new "SearchFlakyTests" request
120-
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"limit": 10}, "sort": "fqn", "include_history": true}, "type": "search_flaky_tests_request"}}
120+
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\"", "include_history": true}, "page": {"limit": 10}, "sort": "fqn"}, "type": "search_flaky_tests_request"}}
121121
When the request is sent
122122
Then the response status is 200 OK
123123
And the response "data[0].attributes" has field "history"
@@ -129,7 +129,7 @@ Feature: Test Optimization
129129
Scenario: Search flaky tests returns "OK" response with pagination
130130
Given operation "SearchFlakyTests" enabled
131131
And new "SearchFlakyTests" request
132-
And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
132+
And body with value {"data": {"attributes": {"filter": {"include_history": true, "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}}
133133
When the request with pagination is sent
134134
Then the response status is 200 OK
135135

0 commit comments

Comments
 (0)