Skip to content

Commit d4f657a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove caseIndex from historical jobs api spec (#749)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent d60ad43 commit d4f657a

File tree

6 files changed

+10
-33
lines changed

6 files changed

+10
-33
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-06-26 16:04:30.077573",
8-
"spec_repo_commit": "c051b78b"
7+
"regenerated": "2025-06-26 17:56:17.758022",
8+
"spec_repo_commit": "76086f13"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-26 16:04:30.095080",
13-
"spec_repo_commit": "c051b78b"
12+
"regenerated": "2025-06-26 17:56:17.774479",
13+
"spec_repo_commit": "76086f13"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19592,12 +19592,6 @@ components:
1959219592
JobDefinitionFromRule:
1959319593
description: Definition of a historical job based on a security monitoring rule.
1959419594
properties:
19595-
caseIndex:
19596-
description: Index of the rule case applied by the job.
19597-
example: 0
19598-
format: int32
19599-
maximum: 9
19600-
type: integer
1960119595
from:
1960219596
description: Starting time of data analyzed by the job.
1960319597
example: 1729843470000
@@ -19628,7 +19622,6 @@ components:
1962819622
- from
1962919623
- to
1963019624
- index
19631-
- caseIndex
1963219625
type: object
1963319626
KindAttributes:
1963419627
description: Kind attributes.

src/datadogV2/model/model_job_definition_from_rule.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct JobDefinitionFromRule {
14-
/// Index of the rule case applied by the job.
15-
#[serde(rename = "caseIndex")]
16-
pub case_index: i32,
1714
/// Starting time of data analyzed by the job.
1815
#[serde(rename = "from")]
1916
pub from: i64,
@@ -37,15 +34,8 @@ pub struct JobDefinitionFromRule {
3734
}
3835

3936
impl JobDefinitionFromRule {
40-
pub fn new(
41-
case_index: i32,
42-
from: i64,
43-
id: String,
44-
index: String,
45-
to: i64,
46-
) -> JobDefinitionFromRule {
37+
pub fn new(from: i64, id: String, index: String, to: i64) -> JobDefinitionFromRule {
4738
JobDefinitionFromRule {
48-
case_index,
4939
from,
5040
id,
5141
index,
@@ -87,7 +77,6 @@ impl<'de> Deserialize<'de> for JobDefinitionFromRule {
8777
where
8878
M: MapAccess<'a>,
8979
{
90-
let mut case_index: Option<i32> = None;
9180
let mut from: Option<i64> = None;
9281
let mut id: Option<String> = None;
9382
let mut index: Option<String> = None;
@@ -101,9 +90,6 @@ impl<'de> Deserialize<'de> for JobDefinitionFromRule {
10190

10291
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
10392
match k.as_str() {
104-
"caseIndex" => {
105-
case_index = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
106-
}
10793
"from" => {
10894
from = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
10995
}
@@ -130,14 +116,12 @@ impl<'de> Deserialize<'de> for JobDefinitionFromRule {
130116
}
131117
}
132118
}
133-
let case_index = case_index.ok_or_else(|| M::Error::missing_field("case_index"))?;
134119
let from = from.ok_or_else(|| M::Error::missing_field("from"))?;
135120
let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
136121
let index = index.ok_or_else(|| M::Error::missing_field("index"))?;
137122
let to = to.ok_or_else(|| M::Error::missing_field("to"))?;
138123

139124
let content = JobDefinitionFromRule {
140-
case_index,
141125
from,
142126
id,
143127
index,
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-11-08T09:54:40.192Z
1+
2025-06-26T16:57:47.524Z

tests/scenarios/cassettes/v2/security_monitoring/Run-a-historical-job-returns-Not-Found-response.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"data\":{\"attributes\":{\"fromRule\":{\"caseIndex\":0,\"from\":1730201035064,\"id\":\"non-existng\",\"index\":\"main\",\"notifications\":[],\"to\":1730204635115}},\"type\":\"historicalDetectionsJobCreate\"}}",
6+
"string": "{\"data\":{\"attributes\":{\"fromRule\":{\"from\":1730201035064,\"id\":\"non-existng\",\"index\":\"main\",\"notifications\":[],\"to\":1730204635115}},\"type\":\"historicalDetectionsJobCreate\"}}",
77
"encoding": null
88
},
99
"headers": {
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"errors\":[{\"status\":\"404\",\"detail\":\"failed to get rule details\"}]}",
22+
"string": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,7 +32,7 @@
3232
"message": "Not Found"
3333
}
3434
},
35-
"recorded_at": "Fri, 08 Nov 2024 09:54:40 GMT"
35+
"recorded_at": "Thu, 26 Jun 2025 16:57:47 GMT"
3636
}
3737
],
3838
"recorded_with": "VCR 6.0.0"

tests/scenarios/features/v2/security_monitoring.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ Feature: Security Monitoring
10951095
Scenario: Run a historical job returns "Not Found" response
10961096
Given operation "RunHistoricalJob" enabled
10971097
And new "RunHistoricalJob" request
1098-
And body with value {"data": { "type": "historicalDetectionsJobCreate", "attributes": {"fromRule": {"caseIndex": 0, "from": 1730201035064, "id": "non-existng", "index": "main", "notifications": [], "to": 1730204635115}}}}
1098+
And body with value {"data": { "type": "historicalDetectionsJobCreate", "attributes": {"fromRule": {"from": 1730201035064, "id": "non-existng", "index": "main", "notifications": [], "to": 1730204635115}}}}
10991099
When the request is sent
11001100
Then the response status is 404 Not Found
11011101

0 commit comments

Comments
 (0)