Skip to content

Commit 3919c13

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add referenceTables field to security monitoring endpoints (#2488)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent efa3b40 commit 3919c13

12 files changed

+528
-12
lines changed

.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": "2024-09-30 14:37:33.047156",
8-
"spec_repo_commit": "60bc9127"
7+
"regenerated": "2024-09-30 19:44:25.543007",
8+
"spec_repo_commit": "909e369c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-30 14:37:33.070295",
13-
"spec_repo_commit": "60bc9127"
12+
"regenerated": "2024-09-30 19:44:25.557128",
13+
"spec_repo_commit": "909e369c"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19089,6 +19089,25 @@ components:
1908919089
meta:
1909019090
$ref: '#/components/schemas/ResponseMetaAttributes'
1909119091
type: object
19092+
SecurityMonitoringReferenceTable:
19093+
description: Reference table for the rule.
19094+
properties:
19095+
checkPresence:
19096+
description: Whether to include or exclude the matched values.
19097+
type: boolean
19098+
columnName:
19099+
description: The name of the column in the reference table.
19100+
type: string
19101+
logFieldPath:
19102+
description: The field in the log to match against the reference table.
19103+
type: string
19104+
ruleQueryName:
19105+
description: The name of the rule query to apply the reference table to.
19106+
type: string
19107+
tableName:
19108+
description: The name of the reference table.
19109+
type: string
19110+
type: object
1909219111
SecurityMonitoringRuleCase:
1909319112
description: Case when signal is generated.
1909419113
properties:
@@ -19594,6 +19613,11 @@ components:
1959419613
items:
1959519614
$ref: '#/components/schemas/SecurityMonitoringRuleQuery'
1959619615
type: array
19616+
referenceTables:
19617+
description: Reference tables for the rule.
19618+
items:
19619+
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
19620+
type: array
1959719621
tags:
1959819622
description: Tags for generated signals.
1959919623
items:
@@ -20298,6 +20322,11 @@ components:
2029820322
items:
2029920323
$ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery'
2030020324
type: array
20325+
referenceTables:
20326+
description: Reference tables for the rule.
20327+
items:
20328+
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
20329+
type: array
2030120330
tags:
2030220331
description: Tags for generated signals.
2030320332
example:
@@ -20365,6 +20394,11 @@ components:
2036520394
items:
2036620395
$ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery'
2036720396
type: array
20397+
referenceTables:
20398+
description: Reference tables for the rule.
20399+
items:
20400+
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
20401+
type: array
2036820402
tags:
2036920403
description: Tags for generated signals.
2037020404
example:
@@ -20505,6 +20539,11 @@ components:
2050520539
items:
2050620540
$ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery'
2050720541
type: array
20542+
referenceTables:
20543+
description: Reference tables for the rule.
20544+
items:
20545+
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
20546+
type: array
2050820547
tags:
2050920548
description: Tags for generated signals.
2051020549
items:
@@ -20569,6 +20608,11 @@ components:
2056920608
items:
2057020609
$ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery'
2057120610
type: array
20611+
referenceTables:
20612+
description: Reference tables for the rule.
20613+
items:
20614+
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
20615+
type: array
2057220616
tags:
2057320617
description: Tags for generated signals.
2057420618
example:

examples/v2/security-monitoring/CreateSecurityMonitoringRule.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.datadog.api.client.ApiClient;
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.model.SecurityMonitoringReferenceTable;
67
import com.datadog.api.client.v2.model.SecurityMonitoringRuleCaseCreate;
78
import com.datadog.api.client.v2.model.SecurityMonitoringRuleCreatePayload;
89
import com.datadog.api.client.v2.model.SecurityMonitoringRuleEvaluationWindow;
@@ -45,7 +46,15 @@ public static void main(String[] args) {
4546
.maxSignalDuration(SecurityMonitoringRuleMaxSignalDuration.ONE_DAY))
4647
.message("Test rule")
4748
.isEnabled(true)
48-
.type(SecurityMonitoringRuleTypeCreate.LOG_DETECTION));
49+
.type(SecurityMonitoringRuleTypeCreate.LOG_DETECTION)
50+
.referenceTables(
51+
Collections.singletonList(
52+
new SecurityMonitoringReferenceTable()
53+
.tableName("synthetics_test_reference_table_dont_delete")
54+
.columnName("value")
55+
.logFieldPath("testtag")
56+
.checkPresence(true)
57+
.ruleQueryName("a"))));
4958

5059
try {
5160
SecurityMonitoringRuleResponse result = apiInstance.createSecurityMonitoringRule(body);
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
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+
/** Reference table for the rule. */
20+
@JsonPropertyOrder({
21+
SecurityMonitoringReferenceTable.JSON_PROPERTY_CHECK_PRESENCE,
22+
SecurityMonitoringReferenceTable.JSON_PROPERTY_COLUMN_NAME,
23+
SecurityMonitoringReferenceTable.JSON_PROPERTY_LOG_FIELD_PATH,
24+
SecurityMonitoringReferenceTable.JSON_PROPERTY_RULE_QUERY_NAME,
25+
SecurityMonitoringReferenceTable.JSON_PROPERTY_TABLE_NAME
26+
})
27+
@jakarta.annotation.Generated(
28+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
29+
public class SecurityMonitoringReferenceTable {
30+
@JsonIgnore public boolean unparsed = false;
31+
public static final String JSON_PROPERTY_CHECK_PRESENCE = "checkPresence";
32+
private Boolean checkPresence;
33+
34+
public static final String JSON_PROPERTY_COLUMN_NAME = "columnName";
35+
private String columnName;
36+
37+
public static final String JSON_PROPERTY_LOG_FIELD_PATH = "logFieldPath";
38+
private String logFieldPath;
39+
40+
public static final String JSON_PROPERTY_RULE_QUERY_NAME = "ruleQueryName";
41+
private String ruleQueryName;
42+
43+
public static final String JSON_PROPERTY_TABLE_NAME = "tableName";
44+
private String tableName;
45+
46+
public SecurityMonitoringReferenceTable checkPresence(Boolean checkPresence) {
47+
this.checkPresence = checkPresence;
48+
return this;
49+
}
50+
51+
/**
52+
* Whether to include or exclude the matched values.
53+
*
54+
* @return checkPresence
55+
*/
56+
@jakarta.annotation.Nullable
57+
@JsonProperty(JSON_PROPERTY_CHECK_PRESENCE)
58+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
59+
public Boolean getCheckPresence() {
60+
return checkPresence;
61+
}
62+
63+
public void setCheckPresence(Boolean checkPresence) {
64+
this.checkPresence = checkPresence;
65+
}
66+
67+
public SecurityMonitoringReferenceTable columnName(String columnName) {
68+
this.columnName = columnName;
69+
return this;
70+
}
71+
72+
/**
73+
* The name of the column in the reference table.
74+
*
75+
* @return columnName
76+
*/
77+
@jakarta.annotation.Nullable
78+
@JsonProperty(JSON_PROPERTY_COLUMN_NAME)
79+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
80+
public String getColumnName() {
81+
return columnName;
82+
}
83+
84+
public void setColumnName(String columnName) {
85+
this.columnName = columnName;
86+
}
87+
88+
public SecurityMonitoringReferenceTable logFieldPath(String logFieldPath) {
89+
this.logFieldPath = logFieldPath;
90+
return this;
91+
}
92+
93+
/**
94+
* The field in the log to match against the reference table.
95+
*
96+
* @return logFieldPath
97+
*/
98+
@jakarta.annotation.Nullable
99+
@JsonProperty(JSON_PROPERTY_LOG_FIELD_PATH)
100+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
101+
public String getLogFieldPath() {
102+
return logFieldPath;
103+
}
104+
105+
public void setLogFieldPath(String logFieldPath) {
106+
this.logFieldPath = logFieldPath;
107+
}
108+
109+
public SecurityMonitoringReferenceTable ruleQueryName(String ruleQueryName) {
110+
this.ruleQueryName = ruleQueryName;
111+
return this;
112+
}
113+
114+
/**
115+
* The name of the rule query to apply the reference table to.
116+
*
117+
* @return ruleQueryName
118+
*/
119+
@jakarta.annotation.Nullable
120+
@JsonProperty(JSON_PROPERTY_RULE_QUERY_NAME)
121+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
122+
public String getRuleQueryName() {
123+
return ruleQueryName;
124+
}
125+
126+
public void setRuleQueryName(String ruleQueryName) {
127+
this.ruleQueryName = ruleQueryName;
128+
}
129+
130+
public SecurityMonitoringReferenceTable tableName(String tableName) {
131+
this.tableName = tableName;
132+
return this;
133+
}
134+
135+
/**
136+
* The name of the reference table.
137+
*
138+
* @return tableName
139+
*/
140+
@jakarta.annotation.Nullable
141+
@JsonProperty(JSON_PROPERTY_TABLE_NAME)
142+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
143+
public String getTableName() {
144+
return tableName;
145+
}
146+
147+
public void setTableName(String tableName) {
148+
this.tableName = tableName;
149+
}
150+
151+
/**
152+
* A container for additional, undeclared properties. This is a holder for any undeclared
153+
* properties as specified with the 'additionalProperties' keyword in the OAS document.
154+
*/
155+
private Map<String, Object> additionalProperties;
156+
157+
/**
158+
* Set the additional (undeclared) property with the specified name and value. If the property
159+
* does not already exist, create it otherwise replace it.
160+
*
161+
* @param key The arbitrary key to set
162+
* @param value The associated value
163+
* @return SecurityMonitoringReferenceTable
164+
*/
165+
@JsonAnySetter
166+
public SecurityMonitoringReferenceTable putAdditionalProperty(String key, Object value) {
167+
if (this.additionalProperties == null) {
168+
this.additionalProperties = new HashMap<String, Object>();
169+
}
170+
this.additionalProperties.put(key, value);
171+
return this;
172+
}
173+
174+
/**
175+
* Return the additional (undeclared) property.
176+
*
177+
* @return The additional properties
178+
*/
179+
@JsonAnyGetter
180+
public Map<String, Object> getAdditionalProperties() {
181+
return additionalProperties;
182+
}
183+
184+
/**
185+
* Return the additional (undeclared) property with the specified name.
186+
*
187+
* @param key The arbitrary key to get
188+
* @return The specific additional property for the given key
189+
*/
190+
public Object getAdditionalProperty(String key) {
191+
if (this.additionalProperties == null) {
192+
return null;
193+
}
194+
return this.additionalProperties.get(key);
195+
}
196+
197+
/** Return true if this SecurityMonitoringReferenceTable object is equal to o. */
198+
@Override
199+
public boolean equals(Object o) {
200+
if (this == o) {
201+
return true;
202+
}
203+
if (o == null || getClass() != o.getClass()) {
204+
return false;
205+
}
206+
SecurityMonitoringReferenceTable securityMonitoringReferenceTable =
207+
(SecurityMonitoringReferenceTable) o;
208+
return Objects.equals(this.checkPresence, securityMonitoringReferenceTable.checkPresence)
209+
&& Objects.equals(this.columnName, securityMonitoringReferenceTable.columnName)
210+
&& Objects.equals(this.logFieldPath, securityMonitoringReferenceTable.logFieldPath)
211+
&& Objects.equals(this.ruleQueryName, securityMonitoringReferenceTable.ruleQueryName)
212+
&& Objects.equals(this.tableName, securityMonitoringReferenceTable.tableName)
213+
&& Objects.equals(
214+
this.additionalProperties, securityMonitoringReferenceTable.additionalProperties);
215+
}
216+
217+
@Override
218+
public int hashCode() {
219+
return Objects.hash(
220+
checkPresence, columnName, logFieldPath, ruleQueryName, tableName, additionalProperties);
221+
}
222+
223+
@Override
224+
public String toString() {
225+
StringBuilder sb = new StringBuilder();
226+
sb.append("class SecurityMonitoringReferenceTable {\n");
227+
sb.append(" checkPresence: ").append(toIndentedString(checkPresence)).append("\n");
228+
sb.append(" columnName: ").append(toIndentedString(columnName)).append("\n");
229+
sb.append(" logFieldPath: ").append(toIndentedString(logFieldPath)).append("\n");
230+
sb.append(" ruleQueryName: ").append(toIndentedString(ruleQueryName)).append("\n");
231+
sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n");
232+
sb.append(" additionalProperties: ")
233+
.append(toIndentedString(additionalProperties))
234+
.append("\n");
235+
sb.append('}');
236+
return sb.toString();
237+
}
238+
239+
/**
240+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
241+
*/
242+
private String toIndentedString(Object o) {
243+
if (o == null) {
244+
return "null";
245+
}
246+
return o.toString().replace("\n", "\n ");
247+
}
248+
}

0 commit comments

Comments
 (0)