Skip to content

Commit 9fe635d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2a9c644 of spec repo
1 parent 1920b15 commit 9fe635d

File tree

52 files changed

+320
-184
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

+320
-184
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

examples/v2/csm-threats/CreateCSMThreatsAgentRule_1295653933.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.v2.api.CsmThreatsApi;
66
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleAction;
7+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleActionHash;
78
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleActionSet;
89
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateAttributes;
910
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateData;
1011
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateRequest;
1112
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleResponse;
1213
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleType;
1314
import java.util.Arrays;
14-
import java.util.Map;
1515

1616
public class Example {
1717
public static void main(String[] args) {
@@ -44,7 +44,9 @@ public static void main(String[] args) {
4444
.scope("process")
4545
.inherited(true)),
4646
new CloudWorkloadSecurityAgentRuleAction()
47-
.hash(Map.ofEntries()))))
47+
.hash(
48+
new CloudWorkloadSecurityAgentRuleActionHash()
49+
.field("exec.file")))))
4850
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));
4951

5052
try {

examples/v2/csm-threats/CreateCSMThreatsAgentRule_1363354233.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static void main(String[] args) {
3939
.set(
4040
new CloudWorkloadSecurityAgentRuleActionSet()
4141
.name("test_set")
42-
.expression("open.file.path")
42+
.expression("exec.file.path")
4343
.defaultValue("/dev/null")
4444
.scope("process")))))
4545
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));

src/main/java/com/datadog/api/client/v2/model/CloudWorkloadSecurityAgentRuleAction.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class CloudWorkloadSecurityAgentRuleAction {
3232
private String filter;
3333

3434
public static final String JSON_PROPERTY_HASH = "hash";
35-
private Map<String, Object> hash = null;
35+
private CloudWorkloadSecurityAgentRuleActionHash hash;
3636

3737
public static final String JSON_PROPERTY_KILL = "kill";
3838
private CloudWorkloadSecurityAgentRuleKill kill;
@@ -64,32 +64,25 @@ public void setFilter(String filter) {
6464
this.filter = filter;
6565
}
6666

67-
public CloudWorkloadSecurityAgentRuleAction hash(Map<String, Object> hash) {
67+
public CloudWorkloadSecurityAgentRuleAction hash(CloudWorkloadSecurityAgentRuleActionHash hash) {
6868
this.hash = hash;
69-
return this;
70-
}
71-
72-
public CloudWorkloadSecurityAgentRuleAction putHashItem(String key, Object hashItem) {
73-
if (this.hash == null) {
74-
this.hash = new HashMap<>();
75-
}
76-
this.hash.put(key, hashItem);
69+
this.unparsed |= hash.unparsed;
7770
return this;
7871
}
7972

8073
/**
81-
* An empty object indicating the hash action
74+
* Hash file specified by the field attribute
8275
*
8376
* @return hash
8477
*/
8578
@jakarta.annotation.Nullable
8679
@JsonProperty(JSON_PROPERTY_HASH)
8780
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
88-
public Map<String, Object> getHash() {
81+
public CloudWorkloadSecurityAgentRuleActionHash getHash() {
8982
return hash;
9083
}
9184

92-
public void setHash(Map<String, Object> hash) {
85+
public void setHash(CloudWorkloadSecurityAgentRuleActionHash hash) {
9386
this.hash = hash;
9487
}
9588

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
/*
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2019-Present Datadog, Inc.
5+
*/
6+
7+
package com.datadog.api.client.v2.model;
8+
9+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
10+
import com.fasterxml.jackson.annotation.JsonAnySetter;
11+
import com.fasterxml.jackson.annotation.JsonIgnore;
12+
import com.fasterxml.jackson.annotation.JsonInclude;
13+
import com.fasterxml.jackson.annotation.JsonProperty;
14+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
15+
import java.util.HashMap;
16+
import java.util.Map;
17+
import java.util.Objects;
18+
19+
/** Hash file specified by the field attribute */
20+
@JsonPropertyOrder({CloudWorkloadSecurityAgentRuleActionHash.JSON_PROPERTY_FIELD})
21+
@jakarta.annotation.Generated(
22+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
23+
public class CloudWorkloadSecurityAgentRuleActionHash {
24+
@JsonIgnore public boolean unparsed = false;
25+
public static final String JSON_PROPERTY_FIELD = "field";
26+
private String field;
27+
28+
public CloudWorkloadSecurityAgentRuleActionHash field(String field) {
29+
this.field = field;
30+
return this;
31+
}
32+
33+
/**
34+
* The field of the hash action
35+
*
36+
* @return field
37+
*/
38+
@jakarta.annotation.Nullable
39+
@JsonProperty(JSON_PROPERTY_FIELD)
40+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
41+
public String getField() {
42+
return field;
43+
}
44+
45+
public void setField(String field) {
46+
this.field = field;
47+
}
48+
49+
/**
50+
* A container for additional, undeclared properties. This is a holder for any undeclared
51+
* properties as specified with the 'additionalProperties' keyword in the OAS document.
52+
*/
53+
private Map<String, Object> additionalProperties;
54+
55+
/**
56+
* Set the additional (undeclared) property with the specified name and value. If the property
57+
* does not already exist, create it otherwise replace it.
58+
*
59+
* @param key The arbitrary key to set
60+
* @param value The associated value
61+
* @return CloudWorkloadSecurityAgentRuleActionHash
62+
*/
63+
@JsonAnySetter
64+
public CloudWorkloadSecurityAgentRuleActionHash putAdditionalProperty(String key, Object value) {
65+
if (this.additionalProperties == null) {
66+
this.additionalProperties = new HashMap<String, Object>();
67+
}
68+
this.additionalProperties.put(key, value);
69+
return this;
70+
}
71+
72+
/**
73+
* Return the additional (undeclared) property.
74+
*
75+
* @return The additional properties
76+
*/
77+
@JsonAnyGetter
78+
public Map<String, Object> getAdditionalProperties() {
79+
return additionalProperties;
80+
}
81+
82+
/**
83+
* Return the additional (undeclared) property with the specified name.
84+
*
85+
* @param key The arbitrary key to get
86+
* @return The specific additional property for the given key
87+
*/
88+
public Object getAdditionalProperty(String key) {
89+
if (this.additionalProperties == null) {
90+
return null;
91+
}
92+
return this.additionalProperties.get(key);
93+
}
94+
95+
/** Return true if this CloudWorkloadSecurityAgentRuleActionHash object is equal to o. */
96+
@Override
97+
public boolean equals(Object o) {
98+
if (this == o) {
99+
return true;
100+
}
101+
if (o == null || getClass() != o.getClass()) {
102+
return false;
103+
}
104+
CloudWorkloadSecurityAgentRuleActionHash cloudWorkloadSecurityAgentRuleActionHash =
105+
(CloudWorkloadSecurityAgentRuleActionHash) o;
106+
return Objects.equals(this.field, cloudWorkloadSecurityAgentRuleActionHash.field)
107+
&& Objects.equals(
108+
this.additionalProperties,
109+
cloudWorkloadSecurityAgentRuleActionHash.additionalProperties);
110+
}
111+
112+
@Override
113+
public int hashCode() {
114+
return Objects.hash(field, additionalProperties);
115+
}
116+
117+
@Override
118+
public String toString() {
119+
StringBuilder sb = new StringBuilder();
120+
sb.append("class CloudWorkloadSecurityAgentRuleActionHash {\n");
121+
sb.append(" field: ").append(toIndentedString(field)).append("\n");
122+
sb.append(" additionalProperties: ")
123+
.append(toIndentedString(additionalProperties))
124+
.append("\n");
125+
sb.append('}');
126+
return sb.toString();
127+
}
128+
129+
/**
130+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
131+
*/
132+
private String toIndentedString(Object o) {
133+
if (o == null) {
134+
return "null";
135+
}
136+
return o.toString().replace("\n", "\n ");
137+
}
138+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-10T15:20:39.566Z
1+
2025-11-24T13:58:56.166Z

src/test/resources/cassettes/features/v2/Create_a_Workload_Protection_agent_rule_returns_Bad_Request_response.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"httpRequest": {
44
"body": {
55
"type": "JSON",
6-
"json": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1760109639\"},\"type\":\"policy\"}}"
6+
"json": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1763992736\"},\"type\":\"policy\"}}"
77
},
88
"headers": {},
99
"method": "POST",
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"data\":{\"id\":\"sr5-i0h-lty\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My 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 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\"}}}}",
1616
"headers": {
1717
"Content-Type": [
1818
"application/json"
@@ -27,13 +27,13 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "396b2fca-731e-d8ac-1168-76592ae9c6ea"
30+
"id": "f47a34a1-27fb-08d5-ae6b-350bfe218234"
3131
},
3232
{
3333
"httpRequest": {
3434
"body": {
3535
"type": "JSON",
36-
"json": "{\"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\"}}"
36+
"json": "{\"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\"}}"
3737
},
3838
"headers": {},
3939
"method": "POST",
@@ -42,7 +42,7 @@
4242
"secure": true
4343
},
4444
"httpResponse": {
45-
"body": "{\"errors\":[\"input_validation_error(Field 'name' is invalid: the name 'my_agent_rule' is already used by a custom rule)\"]}",
45+
"body": "{\"errors\":[\"input_validation_error(Field 'expression' is invalid: rule `my_agent_rule` error: rule syntax error: bool expected: 1:1: exec.file.name\\n^)\"]}",
4646
"headers": {
4747
"Content-Type": [
4848
"application/json"
@@ -57,13 +57,13 @@
5757
"timeToLive": {
5858
"unlimited": true
5959
},
60-
"id": "c96671f6-8a37-c051-f820-b4c05a204de7"
60+
"id": "3aa7bbb6-714b-2583-19f6-b877fb7a4868"
6161
},
6262
{
6363
"httpRequest": {
6464
"headers": {},
6565
"method": "DELETE",
66-
"path": "/api/v2/remote_config/products/cws/policy/sr5-i0h-lty",
66+
"path": "/api/v2/remote_config/products/cws/policy/w9c-4xq-y9a",
6767
"keepAlive": false,
6868
"secure": true
6969
},
@@ -82,6 +82,6 @@
8282
"timeToLive": {
8383
"unlimited": true
8484
},
85-
"id": "033f489d-6cfa-ff7b-ecf8-fafbf0d27dcc"
85+
"id": "7b6bf245-617a-0459-a722-bd4a1ae296f9"
8686
}
8787
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-10T15:20:41.757Z
1+
2025-11-24T13:58:58.874Z

src/test/resources/cassettes/features/v2/Create_a_Workload_Protection_agent_rule_returns_OK_response.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"httpRequest": {
44
"body": {
55
"type": "JSON",
6-
"json": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641\"},\"type\":\"policy\"}}"
6+
"json": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738\"},\"type\":\"policy\"}}"
77
},
88
"headers": {},
99
"method": "POST",
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"data\":{\"id\":\"cwy-qfn-4k8\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My 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 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\"}}}}",
1616
"headers": {
1717
"Content-Type": [
1818
"application/json"
@@ -27,13 +27,13 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "603ef16c-2dca-d915-a44a-8a6dde147f65"
30+
"id": "aa405038-f323-8f3d-4d7c-e4b4fcff25e0"
3131
},
3232
{
3333
"httpRequest": {
3434
"body": {
3535
"type": "JSON",
36-
"json": "{\"data\":{\"attributes\":{\"agent_version\":\"> 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\"}}"
36+
"json": "{\"data\":{\"attributes\":{\"agent_version\":\"> 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\"}}"
3737
},
3838
"headers": {},
3939
"method": "POST",
@@ -42,7 +42,7 @@
4242
"secure": true
4343
},
4444
"httpResponse": {
45-
"body": "{\"data\":{\"id\":\"iua-dxr-uvh\",\"type\":\"agent_rule\",\"attributes\":{\"category\":\"Process Activity\",\"creationDate\":1760109643225,\"creator\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"monitoring\":[\"cwy-qfn-4k8\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641\",\"product_tags\":[],\"updateDate\":1760109643225,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
45+
"body": "{\"data\":{\"id\":\"ps2-esj-nuh\",\"type\":\"agent_rule\",\"attributes\":{\"category\":\"Process Activity\",\"creationDate\":1763992740362,\"creator\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"monitoring\":[\"tlt-msl-sfd\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738\",\"product_tags\":[],\"updateDate\":1763992740362,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
4646
"headers": {
4747
"Content-Type": [
4848
"application/json"
@@ -57,13 +57,13 @@
5757
"timeToLive": {
5858
"unlimited": true
5959
},
60-
"id": "22c237a1-1512-05b5-ba1b-14fd5787676a"
60+
"id": "0936d464-0d1a-391a-eceb-857861a3978f"
6161
},
6262
{
6363
"httpRequest": {
6464
"headers": {},
6565
"method": "DELETE",
66-
"path": "/api/v2/remote_config/products/cws/agent_rules/iua-dxr-uvh",
66+
"path": "/api/v2/remote_config/products/cws/agent_rules/ps2-esj-nuh",
6767
"keepAlive": false,
6868
"secure": true
6969
},
@@ -82,13 +82,13 @@
8282
"timeToLive": {
8383
"unlimited": true
8484
},
85-
"id": "567fe2bd-32e6-f22a-0729-92a322614bae"
85+
"id": "be686dd5-3173-6809-406e-865fcd6e1007"
8686
},
8787
{
8888
"httpRequest": {
8989
"headers": {},
9090
"method": "DELETE",
91-
"path": "/api/v2/remote_config/products/cws/policy/cwy-qfn-4k8",
91+
"path": "/api/v2/remote_config/products/cws/policy/tlt-msl-sfd",
9292
"keepAlive": false,
9393
"secure": true
9494
},
@@ -107,6 +107,6 @@
107107
"timeToLive": {
108108
"unlimited": true
109109
},
110-
"id": "1c557a34-3768-35b7-435c-ae98d49e1f96"
110+
"id": "f5a970b3-6db6-ade5-b24c-0606a3e7a077"
111111
}
112112
]

0 commit comments

Comments
 (0)