@@ -22,6 +22,10 @@ pub struct SensitiveDataScannerIncludedKeywordConfiguration {
22
22
/// The number of keywords in the list must be less than or equal to 30.
23
23
#[ serde( rename = "keywords" ) ]
24
24
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 > ,
25
29
#[ serde( flatten) ]
26
30
pub additional_properties : std:: collections:: BTreeMap < String , serde_json:: Value > ,
27
31
#[ serde( skip) ]
@@ -37,11 +41,17 @@ impl SensitiveDataScannerIncludedKeywordConfiguration {
37
41
SensitiveDataScannerIncludedKeywordConfiguration {
38
42
character_count,
39
43
keywords,
44
+ use_recommended_keywords : None ,
40
45
additional_properties : std:: collections:: BTreeMap :: new ( ) ,
41
46
_unparsed : false ,
42
47
}
43
48
}
44
49
50
+ pub fn use_recommended_keywords ( mut self , value : bool ) -> Self {
51
+ self . use_recommended_keywords = Some ( value) ;
52
+ self
53
+ }
54
+
45
55
pub fn additional_properties (
46
56
mut self ,
47
57
value : std:: collections:: BTreeMap < String , serde_json:: Value > ,
@@ -70,6 +80,7 @@ impl<'de> Deserialize<'de> for SensitiveDataScannerIncludedKeywordConfiguration
70
80
{
71
81
let mut character_count: Option < i64 > = None ;
72
82
let mut keywords: Option < Vec < String > > = None ;
83
+ let mut use_recommended_keywords: Option < bool > = None ;
73
84
let mut additional_properties: std:: collections:: BTreeMap <
74
85
String ,
75
86
serde_json:: Value ,
@@ -85,6 +96,13 @@ impl<'de> Deserialize<'de> for SensitiveDataScannerIncludedKeywordConfiguration
85
96
"keywords" => {
86
97
keywords = Some ( serde_json:: from_value ( v) . map_err ( M :: Error :: custom) ?) ;
87
98
}
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
+ }
88
106
& _ => {
89
107
if let Ok ( value) = serde_json:: from_value ( v. clone ( ) ) {
90
108
additional_properties. insert ( k, value) ;
@@ -99,6 +117,7 @@ impl<'de> Deserialize<'de> for SensitiveDataScannerIncludedKeywordConfiguration
99
117
let content = SensitiveDataScannerIncludedKeywordConfiguration {
100
118
character_count,
101
119
keywords,
120
+ use_recommended_keywords,
102
121
additional_properties,
103
122
_unparsed,
104
123
} ;
0 commit comments