Skip to content

Commit fb2bde9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 149f595 of spec repo
1 parent 00ccc5b commit fb2bde9

File tree

4 files changed

+284
-1
lines changed

4 files changed

+284
-1
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50893,6 +50893,8 @@ components:
5089350893
maximum: 5
5089450894
minimum: 1
5089550895
type: integer
50896+
suppressions:
50897+
$ref: '#/components/schemas/SensitiveDataScannerSuppressions'
5089650898
tags:
5089750899
description: List of tags.
5089850900
items:
@@ -51114,6 +51116,32 @@ components:
5111451116
type:
5111551117
$ref: '#/components/schemas/SensitiveDataScannerStandardPatternType'
5111651118
type: object
51119+
SensitiveDataScannerSuppressions:
51120+
description: 'Object describing the suppressions for a rule. There are three
51121+
types of suppressions, `starts_with`, `ends_with`, and `exact_match`.
51122+
51123+
Suppressed matches are not obfuscated, counted in metrics, or displayed in
51124+
the Findings page.'
51125+
properties:
51126+
ends_with:
51127+
description: List of strings to use for suppression of matches ending with
51128+
these strings.
51129+
items:
51130+
type: string
51131+
type: array
51132+
exact_match:
51133+
description: List of strings to use for suppression of matches exactly matching
51134+
these strings.
51135+
items:
51136+
type: string
51137+
type: array
51138+
starts_with:
51139+
description: List of strings to use for suppression of matches starting
51140+
with these strings.
51141+
items:
51142+
type: string
51143+
type: array
51144+
type: object
5111751145
SensitiveDataScannerTextReplacement:
5111851146
description: Object describing how the scanned event will be replaced.
5111951147
properties:

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
SensitiveDataScannerRuleAttributes.JSON_PROPERTY_NAMESPACES,
2929
SensitiveDataScannerRuleAttributes.JSON_PROPERTY_PATTERN,
3030
SensitiveDataScannerRuleAttributes.JSON_PROPERTY_PRIORITY,
31+
SensitiveDataScannerRuleAttributes.JSON_PROPERTY_SUPPRESSIONS,
3132
SensitiveDataScannerRuleAttributes.JSON_PROPERTY_TAGS,
3233
SensitiveDataScannerRuleAttributes.JSON_PROPERTY_TEXT_REPLACEMENT
3334
})
@@ -60,6 +61,9 @@ public class SensitiveDataScannerRuleAttributes {
6061
public static final String JSON_PROPERTY_PRIORITY = "priority";
6162
private Long priority;
6263

64+
public static final String JSON_PROPERTY_SUPPRESSIONS = "suppressions";
65+
private SensitiveDataScannerSuppressions suppressions;
66+
6367
public static final String JSON_PROPERTY_TAGS = "tags";
6468
private List<String> tags = null;
6569

@@ -259,6 +263,31 @@ public void setPriority(Long priority) {
259263
this.priority = priority;
260264
}
261265

266+
public SensitiveDataScannerRuleAttributes suppressions(
267+
SensitiveDataScannerSuppressions suppressions) {
268+
this.suppressions = suppressions;
269+
this.unparsed |= suppressions.unparsed;
270+
return this;
271+
}
272+
273+
/**
274+
* Object describing the suppressions for a rule. There are three types of suppressions, <code>
275+
* starts_with</code>, <code>ends_with</code>, and <code>exact_match</code>. Suppressed matches
276+
* are not obfuscated, counted in metrics, or displayed in the Findings page.
277+
*
278+
* @return suppressions
279+
*/
280+
@jakarta.annotation.Nullable
281+
@JsonProperty(JSON_PROPERTY_SUPPRESSIONS)
282+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
283+
public SensitiveDataScannerSuppressions getSuppressions() {
284+
return suppressions;
285+
}
286+
287+
public void setSuppressions(SensitiveDataScannerSuppressions suppressions) {
288+
this.suppressions = suppressions;
289+
}
290+
262291
public SensitiveDataScannerRuleAttributes tags(List<String> tags) {
263292
this.tags = tags;
264293
return this;
@@ -379,6 +408,7 @@ public boolean equals(Object o) {
379408
&& Objects.equals(this.namespaces, sensitiveDataScannerRuleAttributes.namespaces)
380409
&& Objects.equals(this.pattern, sensitiveDataScannerRuleAttributes.pattern)
381410
&& Objects.equals(this.priority, sensitiveDataScannerRuleAttributes.priority)
411+
&& Objects.equals(this.suppressions, sensitiveDataScannerRuleAttributes.suppressions)
382412
&& Objects.equals(this.tags, sensitiveDataScannerRuleAttributes.tags)
383413
&& Objects.equals(this.textReplacement, sensitiveDataScannerRuleAttributes.textReplacement)
384414
&& Objects.equals(
@@ -396,6 +426,7 @@ public int hashCode() {
396426
namespaces,
397427
pattern,
398428
priority,
429+
suppressions,
399430
tags,
400431
textReplacement,
401432
additionalProperties);
@@ -415,6 +446,7 @@ public String toString() {
415446
sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n");
416447
sb.append(" pattern: ").append(toIndentedString(pattern)).append("\n");
417448
sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
449+
sb.append(" suppressions: ").append(toIndentedString(suppressions)).append("\n");
418450
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
419451
sb.append(" textReplacement: ").append(toIndentedString(textReplacement)).append("\n");
420452
sb.append(" additionalProperties: ")
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
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.ArrayList;
16+
import java.util.HashMap;
17+
import java.util.List;
18+
import java.util.Map;
19+
import java.util.Objects;
20+
21+
/**
22+
* Object describing the suppressions for a rule. There are three types of suppressions, <code>
23+
* starts_with</code>, <code>ends_with</code>, and <code>exact_match</code>. Suppressed matches are
24+
* not obfuscated, counted in metrics, or displayed in the Findings page.
25+
*/
26+
@JsonPropertyOrder({
27+
SensitiveDataScannerSuppressions.JSON_PROPERTY_ENDS_WITH,
28+
SensitiveDataScannerSuppressions.JSON_PROPERTY_EXACT_MATCH,
29+
SensitiveDataScannerSuppressions.JSON_PROPERTY_STARTS_WITH
30+
})
31+
@jakarta.annotation.Generated(
32+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
33+
public class SensitiveDataScannerSuppressions {
34+
@JsonIgnore public boolean unparsed = false;
35+
public static final String JSON_PROPERTY_ENDS_WITH = "ends_with";
36+
private List<String> endsWith = null;
37+
38+
public static final String JSON_PROPERTY_EXACT_MATCH = "exact_match";
39+
private List<String> exactMatch = null;
40+
41+
public static final String JSON_PROPERTY_STARTS_WITH = "starts_with";
42+
private List<String> startsWith = null;
43+
44+
public SensitiveDataScannerSuppressions endsWith(List<String> endsWith) {
45+
this.endsWith = endsWith;
46+
return this;
47+
}
48+
49+
public SensitiveDataScannerSuppressions addEndsWithItem(String endsWithItem) {
50+
if (this.endsWith == null) {
51+
this.endsWith = new ArrayList<>();
52+
}
53+
this.endsWith.add(endsWithItem);
54+
return this;
55+
}
56+
57+
/**
58+
* List of strings to use for suppression of matches ending with these strings.
59+
*
60+
* @return endsWith
61+
*/
62+
@jakarta.annotation.Nullable
63+
@JsonProperty(JSON_PROPERTY_ENDS_WITH)
64+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
65+
public List<String> getEndsWith() {
66+
return endsWith;
67+
}
68+
69+
public void setEndsWith(List<String> endsWith) {
70+
this.endsWith = endsWith;
71+
}
72+
73+
public SensitiveDataScannerSuppressions exactMatch(List<String> exactMatch) {
74+
this.exactMatch = exactMatch;
75+
return this;
76+
}
77+
78+
public SensitiveDataScannerSuppressions addExactMatchItem(String exactMatchItem) {
79+
if (this.exactMatch == null) {
80+
this.exactMatch = new ArrayList<>();
81+
}
82+
this.exactMatch.add(exactMatchItem);
83+
return this;
84+
}
85+
86+
/**
87+
* List of strings to use for suppression of matches exactly matching these strings.
88+
*
89+
* @return exactMatch
90+
*/
91+
@jakarta.annotation.Nullable
92+
@JsonProperty(JSON_PROPERTY_EXACT_MATCH)
93+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
94+
public List<String> getExactMatch() {
95+
return exactMatch;
96+
}
97+
98+
public void setExactMatch(List<String> exactMatch) {
99+
this.exactMatch = exactMatch;
100+
}
101+
102+
public SensitiveDataScannerSuppressions startsWith(List<String> startsWith) {
103+
this.startsWith = startsWith;
104+
return this;
105+
}
106+
107+
public SensitiveDataScannerSuppressions addStartsWithItem(String startsWithItem) {
108+
if (this.startsWith == null) {
109+
this.startsWith = new ArrayList<>();
110+
}
111+
this.startsWith.add(startsWithItem);
112+
return this;
113+
}
114+
115+
/**
116+
* List of strings to use for suppression of matches starting with these strings.
117+
*
118+
* @return startsWith
119+
*/
120+
@jakarta.annotation.Nullable
121+
@JsonProperty(JSON_PROPERTY_STARTS_WITH)
122+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
123+
public List<String> getStartsWith() {
124+
return startsWith;
125+
}
126+
127+
public void setStartsWith(List<String> startsWith) {
128+
this.startsWith = startsWith;
129+
}
130+
131+
/**
132+
* A container for additional, undeclared properties. This is a holder for any undeclared
133+
* properties as specified with the 'additionalProperties' keyword in the OAS document.
134+
*/
135+
private Map<String, Object> additionalProperties;
136+
137+
/**
138+
* Set the additional (undeclared) property with the specified name and value. If the property
139+
* does not already exist, create it otherwise replace it.
140+
*
141+
* @param key The arbitrary key to set
142+
* @param value The associated value
143+
* @return SensitiveDataScannerSuppressions
144+
*/
145+
@JsonAnySetter
146+
public SensitiveDataScannerSuppressions putAdditionalProperty(String key, Object value) {
147+
if (this.additionalProperties == null) {
148+
this.additionalProperties = new HashMap<String, Object>();
149+
}
150+
this.additionalProperties.put(key, value);
151+
return this;
152+
}
153+
154+
/**
155+
* Return the additional (undeclared) property.
156+
*
157+
* @return The additional properties
158+
*/
159+
@JsonAnyGetter
160+
public Map<String, Object> getAdditionalProperties() {
161+
return additionalProperties;
162+
}
163+
164+
/**
165+
* Return the additional (undeclared) property with the specified name.
166+
*
167+
* @param key The arbitrary key to get
168+
* @return The specific additional property for the given key
169+
*/
170+
public Object getAdditionalProperty(String key) {
171+
if (this.additionalProperties == null) {
172+
return null;
173+
}
174+
return this.additionalProperties.get(key);
175+
}
176+
177+
/** Return true if this SensitiveDataScannerSuppressions object is equal to o. */
178+
@Override
179+
public boolean equals(Object o) {
180+
if (this == o) {
181+
return true;
182+
}
183+
if (o == null || getClass() != o.getClass()) {
184+
return false;
185+
}
186+
SensitiveDataScannerSuppressions sensitiveDataScannerSuppressions =
187+
(SensitiveDataScannerSuppressions) o;
188+
return Objects.equals(this.endsWith, sensitiveDataScannerSuppressions.endsWith)
189+
&& Objects.equals(this.exactMatch, sensitiveDataScannerSuppressions.exactMatch)
190+
&& Objects.equals(this.startsWith, sensitiveDataScannerSuppressions.startsWith)
191+
&& Objects.equals(
192+
this.additionalProperties, sensitiveDataScannerSuppressions.additionalProperties);
193+
}
194+
195+
@Override
196+
public int hashCode() {
197+
return Objects.hash(endsWith, exactMatch, startsWith, additionalProperties);
198+
}
199+
200+
@Override
201+
public String toString() {
202+
StringBuilder sb = new StringBuilder();
203+
sb.append("class SensitiveDataScannerSuppressions {\n");
204+
sb.append(" endsWith: ").append(toIndentedString(endsWith)).append("\n");
205+
sb.append(" exactMatch: ").append(toIndentedString(exactMatch)).append("\n");
206+
sb.append(" startsWith: ").append(toIndentedString(startsWith)).append("\n");
207+
sb.append(" additionalProperties: ")
208+
.append(toIndentedString(additionalProperties))
209+
.append("\n");
210+
sb.append('}');
211+
return sb.toString();
212+
}
213+
214+
/**
215+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
216+
*/
217+
private String toIndentedString(Object o) {
218+
if (o == null) {
219+
return "null";
220+
}
221+
return o.toString().replace("\n", "\n ");
222+
}
223+
}

src/test/resources/com/datadog/api/client/v2/api/sensitive_data_scanner.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Feature: Sensitive Data Scanner
200200
Scenario: Update Scanning Rule returns "Not Found" response
201201
Given new "UpdateScanningRule" request
202202
And request contains "rule_id" parameter from "REPLACE.ME"
203-
And body with value {"data": {"attributes": {"excluded_namespaces": ["admin.name"], "included_keyword_configuration": {"character_count": 30, "keywords": ["credit card", "cc"]}, "namespaces": ["admin"], "tags": [], "text_replacement": {"type": "none"}}, "relationships": {"group": {"data": {"type": "sensitive_data_scanner_group"}}, "standard_pattern": {"data": {"type": "sensitive_data_scanner_standard_pattern"}}}, "type": "sensitive_data_scanner_rule"}, "meta": {"version": 0}}
203+
And body with value {"data": {"attributes": {"excluded_namespaces": ["admin.name"], "included_keyword_configuration": {"character_count": 30, "keywords": ["credit card", "cc"]}, "namespaces": ["admin"], "suppressions": {"ends_with": [], "exact_match": [], "starts_with": []}, "tags": [], "text_replacement": {"type": "none"}}, "relationships": {"group": {"data": {"type": "sensitive_data_scanner_group"}}, "standard_pattern": {"data": {"type": "sensitive_data_scanner_standard_pattern"}}}, "type": "sensitive_data_scanner_rule"}, "meta": {"version": 0}}
204204
When the request is sent
205205
Then the response status is 404 Not Found
206206

0 commit comments

Comments
 (0)