Skip to content

Commit cf572e8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2a9c644 of spec repo
1 parent 6be4c93 commit cf572e8

File tree

52 files changed

+2270
-2988
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2270
-2988
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10236,8 +10236,11 @@ components:
1023610236
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
1023710237
type: object
1023810238
CloudWorkloadSecurityAgentRuleActionHash:
10239-
additionalProperties: {}
10240-
description: An empty object indicating the hash action
10239+
description: Hash file specified by the field attribute
10240+
properties:
10241+
field:
10242+
description: The field of the hash action
10243+
type: string
1024110244
type: object
1024210245
CloudWorkloadSecurityAgentRuleActionMetadata:
1024310246
description: The metadata action applied on the scope matching the rule

api/datadogV2/model_cloud_workload_security_agent_rule_action.go

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
type CloudWorkloadSecurityAgentRuleAction struct {
1313
// SECL expression used to target the container to apply the action on
1414
Filter *string `json:"filter,omitempty"`
15-
// An empty object indicating the hash action
16-
Hash map[string]interface{} `json:"hash,omitempty"`
15+
// Hash file specified by the field attribute
16+
Hash *CloudWorkloadSecurityAgentRuleActionHash `json:"hash,omitempty"`
1717
// Kill system call applied on the container matching the rule
1818
Kill *CloudWorkloadSecurityAgentRuleKill `json:"kill,omitempty"`
1919
// The metadata action applied on the scope matching the rule
@@ -71,31 +71,31 @@ func (o *CloudWorkloadSecurityAgentRuleAction) SetFilter(v string) {
7171
}
7272

7373
// GetHash returns the Hash field value if set, zero value otherwise.
74-
func (o *CloudWorkloadSecurityAgentRuleAction) GetHash() map[string]interface{} {
74+
func (o *CloudWorkloadSecurityAgentRuleAction) GetHash() CloudWorkloadSecurityAgentRuleActionHash {
7575
if o == nil || o.Hash == nil {
76-
var ret map[string]interface{}
76+
var ret CloudWorkloadSecurityAgentRuleActionHash
7777
return ret
7878
}
79-
return o.Hash
79+
return *o.Hash
8080
}
8181

8282
// GetHashOk returns a tuple with the Hash field value if set, nil otherwise
8383
// and a boolean to check if the value has been set.
84-
func (o *CloudWorkloadSecurityAgentRuleAction) GetHashOk() (*map[string]interface{}, bool) {
84+
func (o *CloudWorkloadSecurityAgentRuleAction) GetHashOk() (*CloudWorkloadSecurityAgentRuleActionHash, bool) {
8585
if o == nil || o.Hash == nil {
8686
return nil, false
8787
}
88-
return &o.Hash, true
88+
return o.Hash, true
8989
}
9090

9191
// HasHash returns a boolean if a field has been set.
9292
func (o *CloudWorkloadSecurityAgentRuleAction) HasHash() bool {
9393
return o != nil && o.Hash != nil
9494
}
9595

96-
// SetHash gets a reference to the given map[string]interface{} and assigns it to the Hash field.
97-
func (o *CloudWorkloadSecurityAgentRuleAction) SetHash(v map[string]interface{}) {
98-
o.Hash = v
96+
// SetHash gets a reference to the given CloudWorkloadSecurityAgentRuleActionHash and assigns it to the Hash field.
97+
func (o *CloudWorkloadSecurityAgentRuleAction) SetHash(v CloudWorkloadSecurityAgentRuleActionHash) {
98+
o.Hash = &v
9999
}
100100

101101
// GetKill returns the Kill field value if set, zero value otherwise.
@@ -214,7 +214,7 @@ func (o CloudWorkloadSecurityAgentRuleAction) MarshalJSON() ([]byte, error) {
214214
func (o *CloudWorkloadSecurityAgentRuleAction) UnmarshalJSON(bytes []byte) (err error) {
215215
all := struct {
216216
Filter *string `json:"filter,omitempty"`
217-
Hash map[string]interface{} `json:"hash,omitempty"`
217+
Hash *CloudWorkloadSecurityAgentRuleActionHash `json:"hash,omitempty"`
218218
Kill *CloudWorkloadSecurityAgentRuleKill `json:"kill,omitempty"`
219219
Metadata *CloudWorkloadSecurityAgentRuleActionMetadata `json:"metadata,omitempty"`
220220
Set *CloudWorkloadSecurityAgentRuleActionSet `json:"set,omitempty"`
@@ -231,6 +231,9 @@ func (o *CloudWorkloadSecurityAgentRuleAction) UnmarshalJSON(bytes []byte) (err
231231

232232
hasInvalidField := false
233233
o.Filter = all.Filter
234+
if all.Hash != nil && all.Hash.UnparsedObject != nil && o.UnparsedObject == nil {
235+
hasInvalidField = true
236+
}
234237
o.Hash = all.Hash
235238
if all.Kill != nil && all.Kill.UnparsedObject != nil && o.UnparsedObject == nil {
236239
hasInvalidField = true
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
9+
)
10+
11+
// CloudWorkloadSecurityAgentRuleActionHash Hash file specified by the field attribute
12+
type CloudWorkloadSecurityAgentRuleActionHash struct {
13+
// The field of the hash action
14+
Field *string `json:"field,omitempty"`
15+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
16+
UnparsedObject map[string]interface{} `json:"-"`
17+
AdditionalProperties map[string]interface{} `json:"-"`
18+
}
19+
20+
// NewCloudWorkloadSecurityAgentRuleActionHash instantiates a new CloudWorkloadSecurityAgentRuleActionHash object.
21+
// This constructor will assign default values to properties that have it defined,
22+
// and makes sure properties required by API are set, but the set of arguments
23+
// will change when the set of required properties is changed.
24+
func NewCloudWorkloadSecurityAgentRuleActionHash() *CloudWorkloadSecurityAgentRuleActionHash {
25+
this := CloudWorkloadSecurityAgentRuleActionHash{}
26+
return &this
27+
}
28+
29+
// NewCloudWorkloadSecurityAgentRuleActionHashWithDefaults instantiates a new CloudWorkloadSecurityAgentRuleActionHash object.
30+
// This constructor will only assign default values to properties that have it defined,
31+
// but it doesn't guarantee that properties required by API are set.
32+
func NewCloudWorkloadSecurityAgentRuleActionHashWithDefaults() *CloudWorkloadSecurityAgentRuleActionHash {
33+
this := CloudWorkloadSecurityAgentRuleActionHash{}
34+
return &this
35+
}
36+
37+
// GetField returns the Field field value if set, zero value otherwise.
38+
func (o *CloudWorkloadSecurityAgentRuleActionHash) GetField() string {
39+
if o == nil || o.Field == nil {
40+
var ret string
41+
return ret
42+
}
43+
return *o.Field
44+
}
45+
46+
// GetFieldOk returns a tuple with the Field field value if set, nil otherwise
47+
// and a boolean to check if the value has been set.
48+
func (o *CloudWorkloadSecurityAgentRuleActionHash) GetFieldOk() (*string, bool) {
49+
if o == nil || o.Field == nil {
50+
return nil, false
51+
}
52+
return o.Field, true
53+
}
54+
55+
// HasField returns a boolean if a field has been set.
56+
func (o *CloudWorkloadSecurityAgentRuleActionHash) HasField() bool {
57+
return o != nil && o.Field != nil
58+
}
59+
60+
// SetField gets a reference to the given string and assigns it to the Field field.
61+
func (o *CloudWorkloadSecurityAgentRuleActionHash) SetField(v string) {
62+
o.Field = &v
63+
}
64+
65+
// MarshalJSON serializes the struct using spec logic.
66+
func (o CloudWorkloadSecurityAgentRuleActionHash) MarshalJSON() ([]byte, error) {
67+
toSerialize := map[string]interface{}{}
68+
if o.UnparsedObject != nil {
69+
return datadog.Marshal(o.UnparsedObject)
70+
}
71+
if o.Field != nil {
72+
toSerialize["field"] = o.Field
73+
}
74+
75+
for key, value := range o.AdditionalProperties {
76+
toSerialize[key] = value
77+
}
78+
return datadog.Marshal(toSerialize)
79+
}
80+
81+
// UnmarshalJSON deserializes the given payload.
82+
func (o *CloudWorkloadSecurityAgentRuleActionHash) UnmarshalJSON(bytes []byte) (err error) {
83+
all := struct {
84+
Field *string `json:"field,omitempty"`
85+
}{}
86+
if err = datadog.Unmarshal(bytes, &all); err != nil {
87+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
88+
}
89+
additionalProperties := make(map[string]interface{})
90+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
91+
datadog.DeleteKeys(additionalProperties, &[]string{"field"})
92+
} else {
93+
return err
94+
}
95+
o.Field = all.Field
96+
97+
if len(additionalProperties) > 0 {
98+
o.AdditionalProperties = additionalProperties
99+
}
100+
101+
return nil
102+
}

examples/v2/csm-threats/CreateCSMThreatsAgentRule_1295653933.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ func main() {
3636
},
3737
},
3838
{
39-
Hash: map[string]interface{}{},
39+
Hash: &datadogV2.CloudWorkloadSecurityAgentRuleActionHash{
40+
Field: datadog.PtrString("exec.file"),
41+
},
4042
},
4143
},
4244
},

examples/v2/csm-threats/CreateCSMThreatsAgentRule_1363354233.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func main() {
3030
{
3131
Set: &datadogV2.CloudWorkloadSecurityAgentRuleActionSet{
3232
Name: datadog.PtrString("test_set"),
33-
Expression: datadog.PtrString("open.file.path"),
33+
Expression: datadog.PtrString("exec.file.path"),
3434
DefaultValue: datadog.PtrString("/dev/null"),
3535
Scope: datadog.PtrString("process"),
3636
},
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-10T15:20:39.566Z
1+
2025-11-24T13:58:56.166Z

tests/scenarios/cassettes/TestScenarios/v2/Feature_CSM_Threats/Scenario_Create_a_Workload_Protection_agent_rule_returns_Bad_Request_response.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"data":{"attributes":{"description":"My agent policy","enabled":true,"hostTags":["env:staging"],"name":"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1760109639"},"type":"policy"}}
4+
{"data":{"attributes":{"description":"My agent policy","enabled":true,"hostTags":["env:staging"],"name":"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1763992736"},"type":"policy"}}
55
form: {}
66
headers:
77
Accept:
@@ -12,8 +12,8 @@ interactions:
1212
method: POST
1313
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy
1414
response:
15-
body: '{"data":{"id":"sr5-i0h-lty","type":"policy","attributes":{"blockingRulesCount":0,"datadogManaged":false,"description":"My
16-
agent policy","disabledRulesCount":1,"enabled":true,"hostTagsLists":[["env:staging"]],"monitoringRulesCount":7,"name":"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1760109639","pinned":false,"policyVersion":"1","ruleCount":8,"updateDate":1760109639958,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
15+
body: '{"data":{"id":"w9c-4xq-y9a","type":"policy","attributes":{"blockingRulesCount":0,"datadogManaged":false,"description":"My
16+
agent policy","disabledRulesCount":1,"enabled":true,"hostTagsLists":[["env:staging"]],"monitoringRulesCount":7,"name":"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1763992736","pinned":false,"policyVersion":"1","ruleCount":8,"updateDate":1763992736520,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
1717
code: 200
1818
duration: 0ms
1919
headers:
@@ -22,7 +22,7 @@ interactions:
2222
status: 200 OK
2323
- request:
2424
body: |
25-
{"data":{"attributes":{"description":"My Agent rule","enabled":true,"expression":"exec.file.name","filters":[],"name":"my_agent_rule","policy_id":"sr5-i0h-lty","product_tags":[]},"type":"agent_rule"}}
25+
{"data":{"attributes":{"description":"My Agent rule","enabled":true,"expression":"exec.file.name","filters":[],"name":"my_agent_rule","policy_id":"w9c-4xq-y9a","product_tags":[]},"type":"agent_rule"}}
2626
form: {}
2727
headers:
2828
Accept:
@@ -33,8 +33,8 @@ interactions:
3333
method: POST
3434
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules
3535
response:
36-
body: '{"errors":["input_validation_error(Field ''name'' is invalid: the name
37-
''my_agent_rule'' is already used by a custom rule)"]}'
36+
body: '{"errors":["input_validation_error(Field ''expression'' is invalid: rule
37+
`my_agent_rule` error: rule syntax error: bool expected: 1:1: exec.file.name\n^)"]}'
3838
code: 400
3939
duration: 0ms
4040
headers:
@@ -49,7 +49,7 @@ interactions:
4949
- '*/*'
5050
id: 2
5151
method: DELETE
52-
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/sr5-i0h-lty
52+
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/w9c-4xq-y9a
5353
response:
5454
body: ''
5555
code: 204
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-10T15:20:41.757Z
1+
2025-11-24T13:58:58.874Z

tests/scenarios/cassettes/TestScenarios/v2/Feature_CSM_Threats/Scenario_Create_a_Workload_Protection_agent_rule_returns_OK_response.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"data":{"attributes":{"description":"My agent policy","enabled":true,"hostTags":["env:staging"],"name":"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641"},"type":"policy"}}
4+
{"data":{"attributes":{"description":"My agent policy","enabled":true,"hostTags":["env:staging"],"name":"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738"},"type":"policy"}}
55
form: {}
66
headers:
77
Accept:
@@ -12,8 +12,8 @@ interactions:
1212
method: POST
1313
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy
1414
response:
15-
body: '{"data":{"id":"cwy-qfn-4k8","type":"policy","attributes":{"blockingRulesCount":0,"datadogManaged":false,"description":"My
16-
agent policy","disabledRulesCount":1,"enabled":true,"hostTagsLists":[["env:staging"]],"monitoringRulesCount":7,"name":"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641","pinned":false,"policyVersion":"1","ruleCount":8,"updateDate":1760109642133,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
15+
body: '{"data":{"id":"tlt-msl-sfd","type":"policy","attributes":{"blockingRulesCount":0,"datadogManaged":false,"description":"My
16+
agent policy","disabledRulesCount":1,"enabled":true,"hostTagsLists":[["env:staging"]],"monitoringRulesCount":7,"name":"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738","pinned":false,"policyVersion":"1","ruleCount":8,"updateDate":1763992739217,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
1717
code: 200
1818
duration: 0ms
1919
headers:
@@ -22,7 +22,7 @@ interactions:
2222
status: 200 OK
2323
- request:
2424
body: |
25-
{"data":{"attributes":{"agent_version":"\u003e 7.60","description":"My Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","filters":[],"name":"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641","policy_id":"cwy-qfn-4k8","product_tags":[]},"type":"agent_rule"}}
25+
{"data":{"attributes":{"agent_version":"\u003e 7.60","description":"My Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","filters":[],"name":"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738","policy_id":"tlt-msl-sfd","product_tags":[]},"type":"agent_rule"}}
2626
form: {}
2727
headers:
2828
Accept:
@@ -33,10 +33,10 @@ interactions:
3333
method: POST
3434
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules
3535
response:
36-
body: '{"data":{"id":"iua-dxr-uvh","type":"agent_rule","attributes":{"category":"Process
37-
Activity","creationDate":1760109643225,"creator":{"name":"frog","handle":"frog@datadoghq.com"},"defaultRule":false,"description":"My
36+
body: '{"data":{"id":"ps2-esj-nuh","type":"agent_rule","attributes":{"category":"Process
37+
Activity","creationDate":1763992740362,"creator":{"name":"frog","handle":"frog@datadoghq.com"},"defaultRule":false,"description":"My
3838
Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","filters":["os
39-
== \"linux\""],"monitoring":["cwy-qfn-4k8"],"name":"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641","product_tags":[],"updateDate":1760109643225,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
39+
== \"linux\""],"monitoring":["tlt-msl-sfd"],"name":"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738","product_tags":[],"updateDate":1763992740362,"updater":{"name":"frog","handle":"frog@datadoghq.com"}}}}'
4040
code: 200
4141
duration: 0ms
4242
headers:
@@ -51,7 +51,7 @@ interactions:
5151
- '*/*'
5252
id: 2
5353
method: DELETE
54-
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/iua-dxr-uvh
54+
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/ps2-esj-nuh
5555
response:
5656
body: ''
5757
code: 204
@@ -68,7 +68,7 @@ interactions:
6868
- '*/*'
6969
id: 3
7070
method: DELETE
71-
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/cwy-qfn-4k8
71+
url: https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/tlt-msl-sfd
7272
response:
7373
body: ''
7474
code: 204
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-10T15:20:46.004Z
1+
2025-11-24T13:59:02.396Z

0 commit comments

Comments
 (0)