Skip to content

Commit 06e466b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1fa7a4c of spec repo
1 parent 816a98e commit 06e466b

File tree

55 files changed

+687
-195
lines changed

Some content is hidden

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

55 files changed

+687
-195
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10205,11 +10205,11 @@ components:
1020510205
CloudWorkloadSecurityAgentPolicyVersion:
1020610206
description: The versions of the policy
1020710207
properties:
10208-
Date:
10208+
date:
1020910209
description: The date and time the version was created
1021010210
nullable: true
1021110211
type: string
10212-
Name:
10212+
name:
1021310213
description: The version of the policy
1021410214
example: 1.47.0-rc2
1021510215
type: string
@@ -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
@@ -10285,9 +10288,14 @@ components:
1028510288
format: int64
1028610289
type: integer
1028710290
value:
10288-
description: The value of the set action
10289-
type: string
10291+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSetValue'
1029010292
type: object
10293+
CloudWorkloadSecurityAgentRuleActionSetValue:
10294+
description: The value of the set action
10295+
oneOf:
10296+
- type: string
10297+
- type: integer
10298+
- type: boolean
1029110299
CloudWorkloadSecurityAgentRuleActions:
1029210300
description: The array of actions the rule can perform if triggered
1029310301
items:

examples/v2/csm-threats/CreateCSMThreatsAgentRule_1295653933.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
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;
9+
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleActionSetValue;
810
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateAttributes;
911
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateData;
1012
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateRequest;
1113
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleResponse;
1214
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleType;
1315
import java.util.Arrays;
14-
import java.util.Map;
1516

1617
public class Example {
1718
public static void main(String[] args) {
@@ -40,11 +41,15 @@ public static void main(String[] args) {
4041
.set(
4142
new CloudWorkloadSecurityAgentRuleActionSet()
4243
.name("test_set")
43-
.value("test_value")
44+
.value(
45+
new CloudWorkloadSecurityAgentRuleActionSetValue(
46+
"test_value"))
4447
.scope("process")
4548
.inherited(true)),
4649
new CloudWorkloadSecurityAgentRuleAction()
47-
.hash(Map.ofEntries()))))
50+
.hash(
51+
new CloudWorkloadSecurityAgentRuleActionHash()
52+
.field("exec.file")))))
4853
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));
4954

5055
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/CloudWorkloadSecurityAgentPolicyVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
2727
public class CloudWorkloadSecurityAgentPolicyVersion {
2828
@JsonIgnore public boolean unparsed = false;
29-
public static final String JSON_PROPERTY_DATE = "Date";
29+
public static final String JSON_PROPERTY_DATE = "date";
3030
private JsonNullable<String> date = JsonNullable.<String>undefined();
3131

32-
public static final String JSON_PROPERTY_NAME = "Name";
32+
public static final String JSON_PROPERTY_NAME = "name";
3333
private String name;
3434

3535
public CloudWorkloadSecurityAgentPolicyVersion date(String date) {

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+
}

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class CloudWorkloadSecurityAgentRuleActionSet {
6161
private Long ttl;
6262

6363
public static final String JSON_PROPERTY_VALUE = "value";
64-
private String value;
64+
private CloudWorkloadSecurityAgentRuleActionSetValue value;
6565

6666
public CloudWorkloadSecurityAgentRuleActionSet append(Boolean append) {
6767
this.append = append;
@@ -252,8 +252,10 @@ public void setTtl(Long ttl) {
252252
this.ttl = ttl;
253253
}
254254

255-
public CloudWorkloadSecurityAgentRuleActionSet value(String value) {
255+
public CloudWorkloadSecurityAgentRuleActionSet value(
256+
CloudWorkloadSecurityAgentRuleActionSetValue value) {
256257
this.value = value;
258+
this.unparsed |= value.unparsed;
257259
return this;
258260
}
259261

@@ -265,11 +267,11 @@ public CloudWorkloadSecurityAgentRuleActionSet value(String value) {
265267
@jakarta.annotation.Nullable
266268
@JsonProperty(JSON_PROPERTY_VALUE)
267269
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
268-
public String getValue() {
270+
public CloudWorkloadSecurityAgentRuleActionSetValue getValue() {
269271
return value;
270272
}
271273

272-
public void setValue(String value) {
274+
public void setValue(CloudWorkloadSecurityAgentRuleActionSetValue value) {
273275
this.value = value;
274276
}
275277

0 commit comments

Comments
 (0)