Skip to content

Commit 2c5c1bc

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 149f595 of spec repo
1 parent 8ab418d commit 2c5c1bc

File tree

5 files changed

+174
-2
lines changed

5 files changed

+174
-2
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:

features/v2/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

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4162,6 +4162,7 @@ def overrides
41624162
"v2.sensitive_data_scanner_standard_patterns_response_data" => "SensitiveDataScannerStandardPatternsResponseData",
41634163
"v2.sensitive_data_scanner_standard_patterns_response_item" => "SensitiveDataScannerStandardPatternsResponseItem",
41644164
"v2.sensitive_data_scanner_standard_pattern_type" => "SensitiveDataScannerStandardPatternType",
4165+
"v2.sensitive_data_scanner_suppressions" => "SensitiveDataScannerSuppressions",
41654166
"v2.sensitive_data_scanner_text_replacement" => "SensitiveDataScannerTextReplacement",
41664167
"v2.sensitive_data_scanner_text_replacement_type" => "SensitiveDataScannerTextReplacementType",
41674168
"v2.service_account_create_attributes" => "ServiceAccountCreateAttributes",

lib/datadog_api_client/v2/models/sensitive_data_scanner_rule_attributes.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ class SensitiveDataScannerRuleAttributes
4949
# Integer from 1 (high) to 5 (low) indicating rule issue severity.
5050
attr_reader :priority
5151

52+
# Object describing the suppressions for a rule. There are three types of suppressions, `starts_with`, `ends_with`, and `exact_match`.
53+
# Suppressed matches are not obfuscated, counted in metrics, or displayed in the Findings page.
54+
attr_accessor :suppressions
55+
5256
# List of tags.
5357
attr_accessor :tags
5458

@@ -69,6 +73,7 @@ def self.attribute_map
6973
:'namespaces' => :'namespaces',
7074
:'pattern' => :'pattern',
7175
:'priority' => :'priority',
76+
:'suppressions' => :'suppressions',
7277
:'tags' => :'tags',
7378
:'text_replacement' => :'text_replacement'
7479
}
@@ -86,6 +91,7 @@ def self.openapi_types
8691
:'namespaces' => :'Array<String>',
8792
:'pattern' => :'String',
8893
:'priority' => :'Integer',
94+
:'suppressions' => :'SensitiveDataScannerSuppressions',
8995
:'tags' => :'Array<String>',
9096
:'text_replacement' => :'SensitiveDataScannerTextReplacement'
9197
}
@@ -145,6 +151,10 @@ def initialize(attributes = {})
145151
self.priority = attributes[:'priority']
146152
end
147153

154+
if attributes.key?(:'suppressions')
155+
self.suppressions = attributes[:'suppressions']
156+
end
157+
148158
if attributes.key?(:'tags')
149159
if (value = attributes[:'tags']).is_a?(Array)
150160
self.tags = value
@@ -212,6 +222,7 @@ def ==(o)
212222
namespaces == o.namespaces &&
213223
pattern == o.pattern &&
214224
priority == o.priority &&
225+
suppressions == o.suppressions &&
215226
tags == o.tags &&
216227
text_replacement == o.text_replacement &&
217228
additional_properties == o.additional_properties
@@ -221,7 +232,7 @@ def ==(o)
221232
# @return [Integer] Hash code
222233
# @!visibility private
223234
def hash
224-
[description, excluded_namespaces, included_keyword_configuration, is_enabled, name, namespaces, pattern, priority, tags, text_replacement, additional_properties].hash
235+
[description, excluded_namespaces, included_keyword_configuration, is_enabled, name, namespaces, pattern, priority, suppressions, tags, text_replacement, additional_properties].hash
225236
end
226237
end
227238
end
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Object describing the suppressions for a rule. There are three types of suppressions, `starts_with`, `ends_with`, and `exact_match`.
21+
# Suppressed matches are not obfuscated, counted in metrics, or displayed in the Findings page.
22+
class SensitiveDataScannerSuppressions
23+
include BaseGenericModel
24+
25+
# List of strings to use for suppression of matches ending with these strings.
26+
attr_accessor :ends_with
27+
28+
# List of strings to use for suppression of matches exactly matching these strings.
29+
attr_accessor :exact_match
30+
31+
# List of strings to use for suppression of matches starting with these strings.
32+
attr_accessor :starts_with
33+
34+
attr_accessor :additional_properties
35+
36+
# Attribute mapping from ruby-style variable name to JSON key.
37+
# @!visibility private
38+
def self.attribute_map
39+
{
40+
:'ends_with' => :'ends_with',
41+
:'exact_match' => :'exact_match',
42+
:'starts_with' => :'starts_with'
43+
}
44+
end
45+
46+
# Attribute type mapping.
47+
# @!visibility private
48+
def self.openapi_types
49+
{
50+
:'ends_with' => :'Array<String>',
51+
:'exact_match' => :'Array<String>',
52+
:'starts_with' => :'Array<String>'
53+
}
54+
end
55+
56+
# Initializes the object
57+
# @param attributes [Hash] Model attributes in the form of hash
58+
# @!visibility private
59+
def initialize(attributes = {})
60+
if (!attributes.is_a?(Hash))
61+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SensitiveDataScannerSuppressions` initialize method"
62+
end
63+
64+
self.additional_properties = {}
65+
# check to see if the attribute exists and convert string to symbol for hash key
66+
attributes = attributes.each_with_object({}) { |(k, v), h|
67+
if (!self.class.attribute_map.key?(k.to_sym))
68+
self.additional_properties[k.to_sym] = v
69+
else
70+
h[k.to_sym] = v
71+
end
72+
}
73+
74+
if attributes.key?(:'ends_with')
75+
if (value = attributes[:'ends_with']).is_a?(Array)
76+
self.ends_with = value
77+
end
78+
end
79+
80+
if attributes.key?(:'exact_match')
81+
if (value = attributes[:'exact_match']).is_a?(Array)
82+
self.exact_match = value
83+
end
84+
end
85+
86+
if attributes.key?(:'starts_with')
87+
if (value = attributes[:'starts_with']).is_a?(Array)
88+
self.starts_with = value
89+
end
90+
end
91+
end
92+
93+
# Returns the object in the form of hash, with additionalProperties support.
94+
# @return [Hash] Returns the object in the form of hash
95+
# @!visibility private
96+
def to_hash
97+
hash = {}
98+
self.class.attribute_map.each_pair do |attr, param|
99+
value = self.send(attr)
100+
if value.nil?
101+
is_nullable = self.class.openapi_nullable.include?(attr)
102+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
103+
end
104+
105+
hash[param] = _to_hash(value)
106+
end
107+
self.additional_properties.each_pair do |attr, value|
108+
hash[attr] = value
109+
end
110+
hash
111+
end
112+
113+
# Checks equality by comparing each attribute.
114+
# @param o [Object] Object to be compared
115+
# @!visibility private
116+
def ==(o)
117+
return true if self.equal?(o)
118+
self.class == o.class &&
119+
ends_with == o.ends_with &&
120+
exact_match == o.exact_match &&
121+
starts_with == o.starts_with &&
122+
additional_properties == o.additional_properties
123+
end
124+
125+
# Calculates hash code according to all attributes.
126+
# @return [Integer] Hash code
127+
# @!visibility private
128+
def hash
129+
[ends_with, exact_match, starts_with, additional_properties].hash
130+
end
131+
end
132+
end

0 commit comments

Comments
 (0)