Skip to content

Commit 5847a9f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 14647613 of spec repo
1 parent 584f4e8 commit 5847a9f

File tree

7 files changed

+179
-11
lines changed

7 files changed

+179
-11
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": "2025-05-27 17:12:13.372089",
8-
"spec_repo_commit": "ed439f7c"
7+
"regenerated": "2025-05-30 17:18:12.541886",
8+
"spec_repo_commit": "14647613"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-27 17:12:13.387673",
13-
"spec_repo_commit": "ed439f7c"
12+
"regenerated": "2025-05-30 17:18:12.557577",
13+
"spec_repo_commit": "14647613"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34675,6 +34675,11 @@ components:
3467534675
items:
3467634676
$ref: '#/components/schemas/SensitiveDataScannerProduct'
3467734677
type: array
34678+
samplings:
34679+
description: List of sampling rates per product type.
34680+
items:
34681+
$ref: '#/components/schemas/SensitiveDataScannerSamplings'
34682+
type: array
3467834683
type: object
3467934684
SensitiveDataScannerGroupCreate:
3468034685
description: Data related to the creation of a group.
@@ -35106,6 +35111,19 @@ components:
3510635111
meta:
3510735112
$ref: '#/components/schemas/SensitiveDataScannerMetaVersionOnly'
3510835113
type: object
35114+
SensitiveDataScannerSamplings:
35115+
description: Sampling configurations for the Scanning Group.
35116+
properties:
35117+
product:
35118+
$ref: '#/components/schemas/SensitiveDataScannerProduct'
35119+
rate:
35120+
description: Rate at which data in product type will be scanned.
35121+
example: 100.0
35122+
format: double
35123+
maximum: 100.0
35124+
minimum: 0.0
35125+
type: number
35126+
type: object
3510935127
SensitiveDataScannerStandardPattern:
3511035128
description: Data containing the standard pattern id.
3511135129
properties:

features/v2/given.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@
773773
"parameters": [
774774
{
775775
"name": "body",
776-
"value": "{\n \"data\": {\n \"type\": \"sensitive_data_scanner_group\",\n \"attributes\": {\n \"name\": \"my-test-group\",\n \"is_enabled\": false,\n \"product_list\": [\n \"logs\"\n ],\n \"filter\": {\n \"query\": \"*\"\n }\n },\n \"relationships\": {\n \"configuration\": {\n \"data\": {\n \"id\": \"{{ configuration.data.id }}\",\n \"type\": \"{{ configuration.data.type }}\"\n }\n },\n \"rules\": {\n \"data\": []\n }\n }\n },\n \"meta\": {}\n}"
776+
"value": "{\n \"data\": {\n \"type\": \"sensitive_data_scanner_group\",\n \"attributes\": {\n \"name\": \"my-test-group\",\n \"is_enabled\": false,\n \"product_list\": [\n \"logs\"\n ],\n \"filter\": {\n \"query\": \"*\"\n },\n \"samplings\": [{\"product\": \"logs\", \"rate\": 100}]\n },\n \"relationships\": {\n \"configuration\": {\n \"data\": {\n \"id\": \"{{ configuration.data.id }}\",\n \"type\": \"{{ configuration.data.type }}\"\n }\n },\n \"rules\": {\n \"data\": []\n }\n }\n },\n \"meta\": {}\n}"
777777
}
778778
],
779779
"step": "there is a valid \"scanning_group\" in the system",

features/v2/sensitive_data_scanner.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Feature: Sensitive Data Scanner
1313
@generated @skip @team:DataDog/sensitive-data-scanner
1414
Scenario: Create Scanning Group returns "Bad Request" response
1515
Given new "CreateScanningGroup" request
16-
And body with value {"data": {"attributes": {"filter": {}, "product_list": ["logs"]}, "relationships": {"configuration": {"data": {"type": "sensitive_data_scanner_configuration"}}, "rules": {"data": [{"type": "sensitive_data_scanner_rule"}]}}, "type": "sensitive_data_scanner_group"}, "meta": {"version": 0}}
16+
And body with value {"data": {"attributes": {"filter": {}, "product_list": ["logs"], "samplings": [{"product": "logs", "rate": 100.0}]}, "relationships": {"configuration": {"data": {"type": "sensitive_data_scanner_configuration"}}, "rules": {"data": [{"type": "sensitive_data_scanner_rule"}]}}, "type": "sensitive_data_scanner_group"}, "meta": {"version": 0}}
1717
When the request is sent
1818
Then the response status is 400 Bad Request
1919

@@ -152,15 +152,15 @@ Feature: Sensitive Data Scanner
152152
Scenario: Update Scanning Group returns "Bad Request" response
153153
Given new "UpdateScanningGroup" request
154154
And request contains "group_id" parameter from "REPLACE.ME"
155-
And body with value {"data": {"attributes": {"filter": {}, "product_list": ["logs"]}, "relationships": {"configuration": {"data": {"type": "sensitive_data_scanner_configuration"}}, "rules": {"data": [{"type": "sensitive_data_scanner_rule"}]}}, "type": "sensitive_data_scanner_group"}, "meta": {"version": 0}}
155+
And body with value {"data": {"attributes": {"filter": {}, "product_list": ["logs"], "samplings": [{"product": "logs", "rate": 100.0}]}, "relationships": {"configuration": {"data": {"type": "sensitive_data_scanner_configuration"}}, "rules": {"data": [{"type": "sensitive_data_scanner_rule"}]}}, "type": "sensitive_data_scanner_group"}, "meta": {"version": 0}}
156156
When the request is sent
157157
Then the response status is 400 Bad Request
158158

159159
@generated @skip @team:DataDog/sensitive-data-scanner
160160
Scenario: Update Scanning Group returns "Not Found" response
161161
Given new "UpdateScanningGroup" request
162162
And request contains "group_id" parameter from "REPLACE.ME"
163-
And body with value {"data": {"attributes": {"filter": {}, "product_list": ["logs"]}, "relationships": {"configuration": {"data": {"type": "sensitive_data_scanner_configuration"}}, "rules": {"data": [{"type": "sensitive_data_scanner_rule"}]}}, "type": "sensitive_data_scanner_group"}, "meta": {"version": 0}}
163+
And body with value {"data": {"attributes": {"filter": {}, "product_list": ["logs"], "samplings": [{"product": "logs", "rate": 100.0}]}, "relationships": {"configuration": {"data": {"type": "sensitive_data_scanner_configuration"}}, "rules": {"data": [{"type": "sensitive_data_scanner_rule"}]}}, "type": "sensitive_data_scanner_group"}, "meta": {"version": 0}}
164164
When the request is sent
165165
Then the response status is 404 Not Found
166166

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3083,6 +3083,7 @@ def overrides
30833083
"v2.sensitive_data_scanner_rule_update" => "SensitiveDataScannerRuleUpdate",
30843084
"v2.sensitive_data_scanner_rule_update_request" => "SensitiveDataScannerRuleUpdateRequest",
30853085
"v2.sensitive_data_scanner_rule_update_response" => "SensitiveDataScannerRuleUpdateResponse",
3086+
"v2.sensitive_data_scanner_samplings" => "SensitiveDataScannerSamplings",
30863087
"v2.sensitive_data_scanner_standard_pattern" => "SensitiveDataScannerStandardPattern",
30873088
"v2.sensitive_data_scanner_standard_pattern_attributes" => "SensitiveDataScannerStandardPatternAttributes",
30883089
"v2.sensitive_data_scanner_standard_pattern_data" => "SensitiveDataScannerStandardPatternData",

lib/datadog_api_client/v2/models/sensitive_data_scanner_group_attributes.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class SensitiveDataScannerGroupAttributes
3636
# List of products the scanning group applies.
3737
attr_accessor :product_list
3838

39+
# List of sampling rates per product type.
40+
attr_accessor :samplings
41+
3942
attr_accessor :additional_properties
4043

4144
# Attribute mapping from ruby-style variable name to JSON key.
@@ -46,7 +49,8 @@ def self.attribute_map
4649
:'filter' => :'filter',
4750
:'is_enabled' => :'is_enabled',
4851
:'name' => :'name',
49-
:'product_list' => :'product_list'
52+
:'product_list' => :'product_list',
53+
:'samplings' => :'samplings'
5054
}
5155
end
5256

@@ -58,7 +62,8 @@ def self.openapi_types
5862
:'filter' => :'SensitiveDataScannerFilter',
5963
:'is_enabled' => :'Boolean',
6064
:'name' => :'String',
61-
:'product_list' => :'Array<SensitiveDataScannerProduct>'
65+
:'product_list' => :'Array<SensitiveDataScannerProduct>',
66+
:'samplings' => :'Array<SensitiveDataScannerSamplings>'
6267
}
6368
end
6469

@@ -101,6 +106,12 @@ def initialize(attributes = {})
101106
self.product_list = value
102107
end
103108
end
109+
110+
if attributes.key?(:'samplings')
111+
if (value = attributes[:'samplings']).is_a?(Array)
112+
self.samplings = value
113+
end
114+
end
104115
end
105116

106117
# Returns the object in the form of hash, with additionalProperties support.
@@ -134,14 +145,15 @@ def ==(o)
134145
is_enabled == o.is_enabled &&
135146
name == o.name &&
136147
product_list == o.product_list &&
148+
samplings == o.samplings &&
137149
additional_properties == o.additional_properties
138150
end
139151

140152
# Calculates hash code according to all attributes.
141153
# @return [Integer] Hash code
142154
# @!visibility private
143155
def hash
144-
[description, filter, is_enabled, name, product_list, additional_properties].hash
156+
[description, filter, is_enabled, name, product_list, samplings, additional_properties].hash
145157
end
146158
end
147159
end
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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+
# Sampling configurations for the Scanning Group.
21+
class SensitiveDataScannerSamplings
22+
include BaseGenericModel
23+
24+
# Datadog product onto which Sensitive Data Scanner can be activated.
25+
attr_accessor :product
26+
27+
# Rate at which data in product type will be scanned.
28+
attr_reader :rate
29+
30+
attr_accessor :additional_properties
31+
32+
# Attribute mapping from ruby-style variable name to JSON key.
33+
# @!visibility private
34+
def self.attribute_map
35+
{
36+
:'product' => :'product',
37+
:'rate' => :'rate'
38+
}
39+
end
40+
41+
# Attribute type mapping.
42+
# @!visibility private
43+
def self.openapi_types
44+
{
45+
:'product' => :'SensitiveDataScannerProduct',
46+
:'rate' => :'Float'
47+
}
48+
end
49+
50+
# Initializes the object
51+
# @param attributes [Hash] Model attributes in the form of hash
52+
# @!visibility private
53+
def initialize(attributes = {})
54+
if (!attributes.is_a?(Hash))
55+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SensitiveDataScannerSamplings` initialize method"
56+
end
57+
58+
self.additional_properties = {}
59+
# check to see if the attribute exists and convert string to symbol for hash key
60+
attributes = attributes.each_with_object({}) { |(k, v), h|
61+
if (!self.class.attribute_map.key?(k.to_sym))
62+
self.additional_properties[k.to_sym] = v
63+
else
64+
h[k.to_sym] = v
65+
end
66+
}
67+
68+
if attributes.key?(:'product')
69+
self.product = attributes[:'product']
70+
end
71+
72+
if attributes.key?(:'rate')
73+
self.rate = attributes[:'rate']
74+
end
75+
end
76+
77+
# Check to see if the all the properties in the model are valid
78+
# @return true if the model is valid
79+
# @!visibility private
80+
def valid?
81+
return false if !@rate.nil? && @rate > 100.0
82+
return false if !@rate.nil? && @rate < 0.0
83+
true
84+
end
85+
86+
# Custom attribute writer method with validation
87+
# @param rate [Object] Object to be assigned
88+
# @!visibility private
89+
def rate=(rate)
90+
if !rate.nil? && rate > 100.0
91+
fail ArgumentError, 'invalid value for "rate", must be smaller than or equal to 100.0.'
92+
end
93+
if !rate.nil? && rate < 0.0
94+
fail ArgumentError, 'invalid value for "rate", must be greater than or equal to 0.0.'
95+
end
96+
@rate = rate
97+
end
98+
99+
# Returns the object in the form of hash, with additionalProperties support.
100+
# @return [Hash] Returns the object in the form of hash
101+
# @!visibility private
102+
def to_hash
103+
hash = {}
104+
self.class.attribute_map.each_pair do |attr, param|
105+
value = self.send(attr)
106+
if value.nil?
107+
is_nullable = self.class.openapi_nullable.include?(attr)
108+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
109+
end
110+
111+
hash[param] = _to_hash(value)
112+
end
113+
self.additional_properties.each_pair do |attr, value|
114+
hash[attr] = value
115+
end
116+
hash
117+
end
118+
119+
# Checks equality by comparing each attribute.
120+
# @param o [Object] Object to be compared
121+
# @!visibility private
122+
def ==(o)
123+
return true if self.equal?(o)
124+
self.class == o.class &&
125+
product == o.product &&
126+
rate == o.rate &&
127+
additional_properties == o.additional_properties
128+
end
129+
130+
# Calculates hash code according to all attributes.
131+
# @return [Integer] Hash code
132+
# @!visibility private
133+
def hash
134+
[product, rate, additional_properties].hash
135+
end
136+
end
137+
end

0 commit comments

Comments
 (0)