Skip to content

Commit 0b66f21

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ebeec66b of spec repo
1 parent 38227a6 commit 0b66f21

20 files changed

Lines changed: 1119 additions & 55 deletions

.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-05-13 01:19:32.866177",
8-
"spec_repo_commit": "dc3b522f"
7+
"regenerated": "2025-05-13 11:46:15.191749",
8+
"spec_repo_commit": "ebeec66b"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-13 01:19:32.881522",
13-
"spec_repo_commit": "dc3b522f"
12+
"regenerated": "2025-05-13 11:46:15.209126",
13+
"spec_repo_commit": "ebeec66b"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7318,6 +7318,8 @@ components:
73187318
CloudWorkloadSecurityAgentPolicyCreateAttributes:
73197319
description: Create a new Cloud Workload Security Agent policy
73207320
properties:
7321+
actions:
7322+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
73217323
description:
73227324
description: The description of the policy
73237325
example: My agent policy
@@ -7399,6 +7401,8 @@ components:
73997401
CloudWorkloadSecurityAgentPolicyUpdateAttributes:
74007402
description: Update an existing Cloud Workload Security Agent policy
74017403
properties:
7404+
actions:
7405+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
74027406
description:
74037407
description: The description of the policy
74047408
example: My agent policy
@@ -7469,6 +7473,59 @@ components:
74697473
type: string
74707474
kill:
74717475
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleKill'
7476+
metadata:
7477+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionMetadata'
7478+
set:
7479+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
7480+
type: object
7481+
CloudWorkloadSecurityAgentRuleActionMetadata:
7482+
description: The metadata action applied on the scope matching the rule
7483+
properties:
7484+
image_tag:
7485+
description: The image tag of the metadata action
7486+
type: string
7487+
service:
7488+
description: The service of the metadata action
7489+
type: string
7490+
short_image:
7491+
description: The short image of the metadata action
7492+
type: string
7493+
type: object
7494+
CloudWorkloadSecurityAgentRuleActionSet:
7495+
description: The set action applied on the scope matching the rule
7496+
properties:
7497+
append:
7498+
description: Whether the value should be appended to the field
7499+
type: boolean
7500+
field:
7501+
description: The field of the set action
7502+
type: string
7503+
name:
7504+
description: The name of the set action
7505+
type: string
7506+
scope:
7507+
description: The scope of the set action
7508+
type: string
7509+
size:
7510+
description: The size of the set action
7511+
format: int64
7512+
type: integer
7513+
ttl:
7514+
description: The time to live of the set action
7515+
format: int64
7516+
type: integer
7517+
value:
7518+
anyOf:
7519+
- type: string
7520+
- format: double
7521+
type: number
7522+
- format: int64
7523+
type: integer
7524+
- type: boolean
7525+
- items: {}
7526+
type: array
7527+
- type: object
7528+
description: The value of the set action
74727529
type: object
74737530
CloudWorkloadSecurityAgentRuleActions:
74747531
description: The array of actions the rule can perform if triggered
@@ -7554,6 +7611,8 @@ components:
75547611
CloudWorkloadSecurityAgentRuleCreateAttributes:
75557612
description: Create a new Cloud Workload Security Agent rule.
75567613
properties:
7614+
actions:
7615+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
75577616
description:
75587617
description: The description of the Agent rule.
75597618
example: My Agent rule
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Create a CSM Threats Agent rule with set action returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.CsmThreatsApi;
6+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleAction;
7+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleActionSet;
8+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateAttributes;
9+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateData;
10+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateRequest;
11+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleResponse;
12+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleType;
13+
import java.util.Collections;
14+
15+
public class Example {
16+
public static void main(String[] args) {
17+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
18+
CsmThreatsApi apiInstance = new CsmThreatsApi(defaultClient);
19+
20+
// there is a valid "policy_rc" in the system
21+
String POLICY_DATA_ID = System.getenv("POLICY_DATA_ID");
22+
23+
CloudWorkloadSecurityAgentRuleCreateRequest body =
24+
new CloudWorkloadSecurityAgentRuleCreateRequest()
25+
.data(
26+
new CloudWorkloadSecurityAgentRuleCreateData()
27+
.attributes(
28+
new CloudWorkloadSecurityAgentRuleCreateAttributes()
29+
.description("My Agent rule with set action")
30+
.enabled(true)
31+
.expression("""
32+
exec.file.name == "sh"
33+
""")
34+
.name("examplecsmthreat")
35+
.policyId(POLICY_DATA_ID)
36+
.actions(
37+
Collections.singletonList(
38+
new CloudWorkloadSecurityAgentRuleAction()
39+
.set(
40+
new CloudWorkloadSecurityAgentRuleActionSet()
41+
.name("test_set")
42+
.value("test_value")
43+
.scope("process")))))
44+
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));
45+
46+
try {
47+
CloudWorkloadSecurityAgentRuleResponse result = apiInstance.createCSMThreatsAgentRule(body);
48+
System.out.println(result);
49+
} catch (ApiException e) {
50+
System.err.println("Exception when calling CsmThreatsApi#createCSMThreatsAgentRule");
51+
System.err.println("Status code: " + e.getCode());
52+
System.err.println("Reason: " + e.getResponseBody());
53+
System.err.println("Response headers: " + e.getResponseHeaders());
54+
e.printStackTrace();
55+
}
56+
}
57+
}

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

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
import java.util.List;
1919
import java.util.Map;
2020
import java.util.Objects;
21+
import org.openapitools.jackson.nullable.JsonNullable;
2122

2223
/** Create a new Cloud Workload Security Agent policy */
2324
@JsonPropertyOrder({
25+
CloudWorkloadSecurityAgentPolicyCreateAttributes.JSON_PROPERTY_ACTIONS,
2426
CloudWorkloadSecurityAgentPolicyCreateAttributes.JSON_PROPERTY_DESCRIPTION,
2527
CloudWorkloadSecurityAgentPolicyCreateAttributes.JSON_PROPERTY_ENABLED,
2628
CloudWorkloadSecurityAgentPolicyCreateAttributes.JSON_PROPERTY_HOST_TAGS,
@@ -31,6 +33,10 @@
3133
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
3234
public class CloudWorkloadSecurityAgentPolicyCreateAttributes {
3335
@JsonIgnore public boolean unparsed = false;
36+
public static final String JSON_PROPERTY_ACTIONS = "actions";
37+
private JsonNullable<List<CloudWorkloadSecurityAgentRuleAction>> actions =
38+
JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>undefined();
39+
3440
public static final String JSON_PROPERTY_DESCRIPTION = "description";
3541
private String description;
3642

@@ -54,6 +60,52 @@ public CloudWorkloadSecurityAgentPolicyCreateAttributes(
5460
this.name = name;
5561
}
5662

63+
public CloudWorkloadSecurityAgentPolicyCreateAttributes actions(
64+
List<CloudWorkloadSecurityAgentRuleAction> actions) {
65+
this.actions = JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>of(actions);
66+
return this;
67+
}
68+
69+
public CloudWorkloadSecurityAgentPolicyCreateAttributes addActionsItem(
70+
CloudWorkloadSecurityAgentRuleAction actionsItem) {
71+
if (this.actions == null || !this.actions.isPresent()) {
72+
this.actions = JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>of(new ArrayList<>());
73+
}
74+
try {
75+
this.actions.get().add(actionsItem);
76+
} catch (java.util.NoSuchElementException e) {
77+
// this can never happen, as we make sure above that the value is present
78+
}
79+
return this;
80+
}
81+
82+
/**
83+
* The array of actions the rule can perform if triggered
84+
*
85+
* @return actions
86+
*/
87+
@jakarta.annotation.Nullable
88+
@JsonIgnore
89+
public List<CloudWorkloadSecurityAgentRuleAction> getActions() {
90+
return actions.orElse(null);
91+
}
92+
93+
@JsonProperty(JSON_PROPERTY_ACTIONS)
94+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
95+
public JsonNullable<List<CloudWorkloadSecurityAgentRuleAction>> getActions_JsonNullable() {
96+
return actions;
97+
}
98+
99+
@JsonProperty(JSON_PROPERTY_ACTIONS)
100+
public void setActions_JsonNullable(
101+
JsonNullable<List<CloudWorkloadSecurityAgentRuleAction>> actions) {
102+
this.actions = actions;
103+
}
104+
105+
public void setActions(List<CloudWorkloadSecurityAgentRuleAction> actions) {
106+
this.actions = JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>of(actions);
107+
}
108+
57109
public CloudWorkloadSecurityAgentPolicyCreateAttributes description(String description) {
58110
this.description = description;
59111
return this;
@@ -236,7 +288,8 @@ public boolean equals(Object o) {
236288
CloudWorkloadSecurityAgentPolicyCreateAttributes
237289
cloudWorkloadSecurityAgentPolicyCreateAttributes =
238290
(CloudWorkloadSecurityAgentPolicyCreateAttributes) o;
239-
return Objects.equals(
291+
return Objects.equals(this.actions, cloudWorkloadSecurityAgentPolicyCreateAttributes.actions)
292+
&& Objects.equals(
240293
this.description, cloudWorkloadSecurityAgentPolicyCreateAttributes.description)
241294
&& Objects.equals(this.enabled, cloudWorkloadSecurityAgentPolicyCreateAttributes.enabled)
242295
&& Objects.equals(this.hostTags, cloudWorkloadSecurityAgentPolicyCreateAttributes.hostTags)
@@ -250,13 +303,15 @@ public boolean equals(Object o) {
250303

251304
@Override
252305
public int hashCode() {
253-
return Objects.hash(description, enabled, hostTags, hostTagsLists, name, additionalProperties);
306+
return Objects.hash(
307+
actions, description, enabled, hostTags, hostTagsLists, name, additionalProperties);
254308
}
255309

256310
@Override
257311
public String toString() {
258312
StringBuilder sb = new StringBuilder();
259313
sb.append("class CloudWorkloadSecurityAgentPolicyCreateAttributes {\n");
314+
sb.append(" actions: ").append(toIndentedString(actions)).append("\n");
260315
sb.append(" description: ").append(toIndentedString(description)).append("\n");
261316
sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n");
262317
sb.append(" hostTags: ").append(toIndentedString(hostTags)).append("\n");

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

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
import java.util.List;
1818
import java.util.Map;
1919
import java.util.Objects;
20+
import org.openapitools.jackson.nullable.JsonNullable;
2021

2122
/** Update an existing Cloud Workload Security Agent policy */
2223
@JsonPropertyOrder({
24+
CloudWorkloadSecurityAgentPolicyUpdateAttributes.JSON_PROPERTY_ACTIONS,
2325
CloudWorkloadSecurityAgentPolicyUpdateAttributes.JSON_PROPERTY_DESCRIPTION,
2426
CloudWorkloadSecurityAgentPolicyUpdateAttributes.JSON_PROPERTY_ENABLED,
2527
CloudWorkloadSecurityAgentPolicyUpdateAttributes.JSON_PROPERTY_HOST_TAGS,
@@ -30,6 +32,10 @@
3032
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
3133
public class CloudWorkloadSecurityAgentPolicyUpdateAttributes {
3234
@JsonIgnore public boolean unparsed = false;
35+
public static final String JSON_PROPERTY_ACTIONS = "actions";
36+
private JsonNullable<List<CloudWorkloadSecurityAgentRuleAction>> actions =
37+
JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>undefined();
38+
3339
public static final String JSON_PROPERTY_DESCRIPTION = "description";
3440
private String description;
3541

@@ -45,6 +51,52 @@ public class CloudWorkloadSecurityAgentPolicyUpdateAttributes {
4551
public static final String JSON_PROPERTY_NAME = "name";
4652
private String name;
4753

54+
public CloudWorkloadSecurityAgentPolicyUpdateAttributes actions(
55+
List<CloudWorkloadSecurityAgentRuleAction> actions) {
56+
this.actions = JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>of(actions);
57+
return this;
58+
}
59+
60+
public CloudWorkloadSecurityAgentPolicyUpdateAttributes addActionsItem(
61+
CloudWorkloadSecurityAgentRuleAction actionsItem) {
62+
if (this.actions == null || !this.actions.isPresent()) {
63+
this.actions = JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>of(new ArrayList<>());
64+
}
65+
try {
66+
this.actions.get().add(actionsItem);
67+
} catch (java.util.NoSuchElementException e) {
68+
// this can never happen, as we make sure above that the value is present
69+
}
70+
return this;
71+
}
72+
73+
/**
74+
* The array of actions the rule can perform if triggered
75+
*
76+
* @return actions
77+
*/
78+
@jakarta.annotation.Nullable
79+
@JsonIgnore
80+
public List<CloudWorkloadSecurityAgentRuleAction> getActions() {
81+
return actions.orElse(null);
82+
}
83+
84+
@JsonProperty(JSON_PROPERTY_ACTIONS)
85+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
86+
public JsonNullable<List<CloudWorkloadSecurityAgentRuleAction>> getActions_JsonNullable() {
87+
return actions;
88+
}
89+
90+
@JsonProperty(JSON_PROPERTY_ACTIONS)
91+
public void setActions_JsonNullable(
92+
JsonNullable<List<CloudWorkloadSecurityAgentRuleAction>> actions) {
93+
this.actions = actions;
94+
}
95+
96+
public void setActions(List<CloudWorkloadSecurityAgentRuleAction> actions) {
97+
this.actions = JsonNullable.<List<CloudWorkloadSecurityAgentRuleAction>>of(actions);
98+
}
99+
48100
public CloudWorkloadSecurityAgentPolicyUpdateAttributes description(String description) {
49101
this.description = description;
50102
return this;
@@ -228,7 +280,8 @@ public boolean equals(Object o) {
228280
CloudWorkloadSecurityAgentPolicyUpdateAttributes
229281
cloudWorkloadSecurityAgentPolicyUpdateAttributes =
230282
(CloudWorkloadSecurityAgentPolicyUpdateAttributes) o;
231-
return Objects.equals(
283+
return Objects.equals(this.actions, cloudWorkloadSecurityAgentPolicyUpdateAttributes.actions)
284+
&& Objects.equals(
232285
this.description, cloudWorkloadSecurityAgentPolicyUpdateAttributes.description)
233286
&& Objects.equals(this.enabled, cloudWorkloadSecurityAgentPolicyUpdateAttributes.enabled)
234287
&& Objects.equals(this.hostTags, cloudWorkloadSecurityAgentPolicyUpdateAttributes.hostTags)
@@ -242,13 +295,15 @@ public boolean equals(Object o) {
242295

243296
@Override
244297
public int hashCode() {
245-
return Objects.hash(description, enabled, hostTags, hostTagsLists, name, additionalProperties);
298+
return Objects.hash(
299+
actions, description, enabled, hostTags, hostTagsLists, name, additionalProperties);
246300
}
247301

248302
@Override
249303
public String toString() {
250304
StringBuilder sb = new StringBuilder();
251305
sb.append("class CloudWorkloadSecurityAgentPolicyUpdateAttributes {\n");
306+
sb.append(" actions: ").append(toIndentedString(actions)).append("\n");
252307
sb.append(" description: ").append(toIndentedString(description)).append("\n");
253308
sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n");
254309
sb.append(" hostTags: ").append(toIndentedString(hostTags)).append("\n");

0 commit comments

Comments
 (0)