Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-26 16:04:31.568102",
"spec_repo_commit": "c051b78b"
"regenerated": "2025-06-26 17:56:23.043504",
"spec_repo_commit": "76086f13"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-26 16:04:31.584584",
"spec_repo_commit": "c051b78b"
"regenerated": "2025-06-26 17:56:23.062756",
"spec_repo_commit": "76086f13"
}
}
}
7 changes: 0 additions & 7 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19592,12 +19592,6 @@ components:
JobDefinitionFromRule:
description: Definition of a historical job based on a security monitoring rule.
properties:
caseIndex:
description: Index of the rule case applied by the job.
example: 0
format: int32
maximum: 9
type: integer
from:
description: Starting time of data analyzed by the job.
example: 1729843470000
Expand Down Expand Up @@ -19628,7 +19622,6 @@ components:
- from
- to
- index
- caseIndex
type: object
KindAttributes:
description: Kind attributes.
Expand Down
36 changes: 2 additions & 34 deletions api/datadogV2/model_job_definition_from_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (

// JobDefinitionFromRule Definition of a historical job based on a security monitoring rule.
type JobDefinitionFromRule struct {
// Index of the rule case applied by the job.
CaseIndex int32 `json:"caseIndex"`
// Starting time of data analyzed by the job.
From int64 `json:"from"`
// ID of the detection rule used to create the job.
Expand All @@ -33,9 +31,8 @@ type JobDefinitionFromRule struct {
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewJobDefinitionFromRule(caseIndex int32, from int64, id string, index string, to int64) *JobDefinitionFromRule {
func NewJobDefinitionFromRule(from int64, id string, index string, to int64) *JobDefinitionFromRule {
this := JobDefinitionFromRule{}
this.CaseIndex = caseIndex
this.From = from
this.Id = id
this.Index = index
Expand All @@ -51,29 +48,6 @@ func NewJobDefinitionFromRuleWithDefaults() *JobDefinitionFromRule {
return &this
}

// GetCaseIndex returns the CaseIndex field value.
func (o *JobDefinitionFromRule) GetCaseIndex() int32 {
if o == nil {
var ret int32
return ret
}
return o.CaseIndex
}

// GetCaseIndexOk returns a tuple with the CaseIndex field value
// and a boolean to check if the value has been set.
func (o *JobDefinitionFromRule) GetCaseIndexOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.CaseIndex, true
}

// SetCaseIndex sets field value.
func (o *JobDefinitionFromRule) SetCaseIndex(v int32) {
o.CaseIndex = v
}

// GetFrom returns the From field value.
func (o *JobDefinitionFromRule) GetFrom() int64 {
if o == nil {
Expand Down Expand Up @@ -200,7 +174,6 @@ func (o JobDefinitionFromRule) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
toSerialize["caseIndex"] = o.CaseIndex
toSerialize["from"] = o.From
toSerialize["id"] = o.Id
toSerialize["index"] = o.Index
Expand All @@ -218,7 +191,6 @@ func (o JobDefinitionFromRule) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *JobDefinitionFromRule) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
CaseIndex *int32 `json:"caseIndex"`
From *int64 `json:"from"`
Id *string `json:"id"`
Index *string `json:"index"`
Expand All @@ -228,9 +200,6 @@ func (o *JobDefinitionFromRule) UnmarshalJSON(bytes []byte) (err error) {
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.CaseIndex == nil {
return fmt.Errorf("required field caseIndex missing")
}
if all.From == nil {
return fmt.Errorf("required field from missing")
}
Expand All @@ -245,11 +214,10 @@ func (o *JobDefinitionFromRule) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"caseIndex", "from", "id", "index", "notifications", "to"})
datadog.DeleteKeys(additionalProperties, &[]string{"from", "id", "index", "notifications", "to"})
} else {
return err
}
o.CaseIndex = *all.CaseIndex
o.From = *all.From
o.Id = *all.Id
o.Index = *all.Index
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-08T09:54:40.192Z
2025-06-26T16:57:47.524Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"data":{"attributes":{"fromRule":{"caseIndex":0,"from":1730201035064,"id":"non-existng","index":"main","notifications":[],"to":1730204635115}},"type":"historicalDetectionsJobCreate"}}
{"data":{"attributes":{"fromRule":{"from":1730201035064,"id":"non-existng","index":"main","notifications":[],"to":1730204635115}},"type":"historicalDetectionsJobCreate"}}
form: {}
headers:
Accept:
Expand All @@ -12,7 +12,7 @@ interactions:
method: POST
url: https://api.datadoghq.com/api/v2/siem-historical-detections/jobs
response:
body: '{"errors":[{"status":"404","detail":"failed to get rule details"}]}'
body: '{"errors":[{"status":"404","title":"Not Found"}]}'
code: 404
duration: 0ms
headers:
Expand Down
2 changes: 1 addition & 1 deletion tests/scenarios/features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ Feature: Security Monitoring
Scenario: Run a historical job returns "Not Found" response
Given operation "RunHistoricalJob" enabled
And new "RunHistoricalJob" request
And body with value {"data": { "type": "historicalDetectionsJobCreate", "attributes": {"fromRule": {"caseIndex": 0, "from": 1730201035064, "id": "non-existng", "index": "main", "notifications": [], "to": 1730204635115}}}}
And body with value {"data": { "type": "historicalDetectionsJobCreate", "attributes": {"fromRule": {"from": 1730201035064, "id": "non-existng", "index": "main", "notifications": [], "to": 1730204635115}}}}
When the request is sent
Then the response status is 404 Not Found

Expand Down
Loading