Skip to content

Commit 88f34cc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add use_recommended_keywords attribute to sensitive data scanner rule spec (#354)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 8f158d1 commit 88f34cc

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
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-10-28 23:07:48.999899",
8-
"spec_repo_commit": "4251a422"
7+
"regenerated": "2024-10-29 20:46:35.814473",
8+
"spec_repo_commit": "c0b9551e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-28 23:07:49.018496",
13-
"spec_repo_commit": "4251a422"
12+
"regenerated": "2024-10-29 20:46:35.833539",
13+
"spec_repo_commit": "c0b9551e"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21870,6 +21870,13 @@ components:
2187021870
items:
2187121871
type: string
2187221872
type: array
21873+
use_recommended_keywords:
21874+
description: 'Should the rule use the underlying standard pattern keyword
21875+
configuration. If set to `true`, the rule must be tied
21876+
21877+
to a standard pattern. If set to `false`, the specified keywords and `character_count`
21878+
are applied.'
21879+
type: boolean
2187321880
required:
2187421881
- keywords
2187521882
- character_count

src/datadogV2/model/model_sensitive_data_scanner_included_keyword_configuration.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ pub struct SensitiveDataScannerIncludedKeywordConfiguration {
2222
/// The number of keywords in the list must be less than or equal to 30.
2323
#[serde(rename = "keywords")]
2424
pub keywords: Vec<String>,
25+
/// Should the rule use the underlying standard pattern keyword configuration. If set to `true`, the rule must be tied
26+
/// to a standard pattern. If set to `false`, the specified keywords and `character_count` are applied.
27+
#[serde(rename = "use_recommended_keywords")]
28+
pub use_recommended_keywords: Option<bool>,
2529
#[serde(flatten)]
2630
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
2731
#[serde(skip)]
@@ -37,11 +41,17 @@ impl SensitiveDataScannerIncludedKeywordConfiguration {
3741
SensitiveDataScannerIncludedKeywordConfiguration {
3842
character_count,
3943
keywords,
44+
use_recommended_keywords: None,
4045
additional_properties: std::collections::BTreeMap::new(),
4146
_unparsed: false,
4247
}
4348
}
4449

50+
pub fn use_recommended_keywords(mut self, value: bool) -> Self {
51+
self.use_recommended_keywords = Some(value);
52+
self
53+
}
54+
4555
pub fn additional_properties(
4656
mut self,
4757
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -70,6 +80,7 @@ impl<'de> Deserialize<'de> for SensitiveDataScannerIncludedKeywordConfiguration
7080
{
7181
let mut character_count: Option<i64> = None;
7282
let mut keywords: Option<Vec<String>> = None;
83+
let mut use_recommended_keywords: Option<bool> = None;
7384
let mut additional_properties: std::collections::BTreeMap<
7485
String,
7586
serde_json::Value,
@@ -85,6 +96,13 @@ impl<'de> Deserialize<'de> for SensitiveDataScannerIncludedKeywordConfiguration
8596
"keywords" => {
8697
keywords = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
8798
}
99+
"use_recommended_keywords" => {
100+
if v.is_null() {
101+
continue;
102+
}
103+
use_recommended_keywords =
104+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
105+
}
88106
&_ => {
89107
if let Ok(value) = serde_json::from_value(v.clone()) {
90108
additional_properties.insert(k, value);
@@ -99,6 +117,7 @@ impl<'de> Deserialize<'de> for SensitiveDataScannerIncludedKeywordConfiguration
99117
let content = SensitiveDataScannerIncludedKeywordConfiguration {
100118
character_count,
101119
keywords,
120+
use_recommended_keywords,
102121
additional_properties,
103122
_unparsed,
104123
};

0 commit comments

Comments
 (0)