Skip to content

Commit 2e6a954

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b296b4b of spec repo
1 parent 87532e1 commit 2e6a954

6 files changed

Lines changed: 47 additions & 90 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61604,35 +61604,17 @@ components:
6160461604
type: object
6160561605
SecurityMonitoringRuleNewValueOptionsForgetAfter:
6160661606
description: The duration in days after which a learned value is forgotten.
61607-
enum:
61608-
- 1
61609-
- 2
61610-
- 7
61611-
- 14
61612-
- 21
61613-
- 28
6161461607
format: int32
61608+
maximum: 30
61609+
minimum: 1
6161561610
type: integer
61616-
x-enum-varnames:
61617-
- ONE_DAY
61618-
- TWO_DAYS
61619-
- ONE_WEEK
61620-
- TWO_WEEKS
61621-
- THREE_WEEKS
61622-
- FOUR_WEEKS
6162361611
SecurityMonitoringRuleNewValueOptionsLearningDuration:
6162461612
default: 0
6162561613
description: "The duration in days during which values are learned, and after which signals will be generated for values that\nweren't learned. If set to 0, a signal will be generated for all new values after the first value is learned."
61626-
enum:
61627-
- 0
61628-
- 1
61629-
- 7
6163061614
format: int32
61615+
maximum: 30
61616+
minimum: 0
6163161617
type: integer
61632-
x-enum-varnames:
61633-
- ZERO_DAYS
61634-
- ONE_DAY
61635-
- SEVEN_DAYS
6163661618
SecurityMonitoringRuleNewValueOptionsLearningMethod:
6163761619
default: duration
6163861620
description: The learning method used to determine when signals should be generated for values that weren't learned.

examples/v2/security-monitoring/ValidateSecurityMonitoringRule_2609327779.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
max_signal_duration: DatadogAPIClient::V2::SecurityMonitoringRuleMaxSignalDuration::TEN_MINUTES,
2323
detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::NEW_VALUE,
2424
new_value_options: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptions.new({
25-
forget_after: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsForgetAfter::ONE_WEEK,
25+
forget_after: 7,
2626
instantaneous_baseline: true,
27-
learning_duration: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningDuration::ONE_DAY,
27+
learning_duration: 1,
2828
learning_threshold: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningThreshold::ZERO_OCCURRENCES,
2929
learning_method: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningMethod::DURATION,
3030
}),

lib/datadog_api_client/inflector.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5036,8 +5036,6 @@ def overrides
50365036
"v2.security_monitoring_rule_keep_alive" => "SecurityMonitoringRuleKeepAlive",
50375037
"v2.security_monitoring_rule_max_signal_duration" => "SecurityMonitoringRuleMaxSignalDuration",
50385038
"v2.security_monitoring_rule_new_value_options" => "SecurityMonitoringRuleNewValueOptions",
5039-
"v2.security_monitoring_rule_new_value_options_forget_after" => "SecurityMonitoringRuleNewValueOptionsForgetAfter",
5040-
"v2.security_monitoring_rule_new_value_options_learning_duration" => "SecurityMonitoringRuleNewValueOptionsLearningDuration",
50415039
"v2.security_monitoring_rule_new_value_options_learning_method" => "SecurityMonitoringRuleNewValueOptionsLearningMethod",
50425040
"v2.security_monitoring_rule_new_value_options_learning_threshold" => "SecurityMonitoringRuleNewValueOptionsLearningThreshold",
50435041
"v2.security_monitoring_rule_options" => "SecurityMonitoringRuleOptions",

lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options.rb

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class SecurityMonitoringRuleNewValueOptions
2222
include BaseGenericModel
2323

2424
# The duration in days after which a learned value is forgotten.
25-
attr_accessor :forget_after
25+
attr_reader :forget_after
2626

2727
# When set to true, Datadog uses previous values that fall within the defined learning window to construct the baseline, enabling the system to establish an accurate baseline more rapidly rather than relying solely on gradual learning over time.
2828
attr_accessor :instantaneous_baseline
2929

3030
# The duration in days during which values are learned, and after which signals will be generated for values that
3131
# weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.
32-
attr_accessor :learning_duration
32+
attr_reader :learning_duration
3333

3434
# The learning method used to determine when signals should be generated for values that weren't learned.
3535
attr_accessor :learning_method
@@ -55,9 +55,9 @@ def self.attribute_map
5555
# @!visibility private
5656
def self.openapi_types
5757
{
58-
:'forget_after' => :'SecurityMonitoringRuleNewValueOptionsForgetAfter',
58+
:'forget_after' => :'Integer',
5959
:'instantaneous_baseline' => :'Boolean',
60-
:'learning_duration' => :'SecurityMonitoringRuleNewValueOptionsLearningDuration',
60+
:'learning_duration' => :'Integer',
6161
:'learning_method' => :'SecurityMonitoringRuleNewValueOptionsLearningMethod',
6262
:'learning_threshold' => :'SecurityMonitoringRuleNewValueOptionsLearningThreshold'
6363
}
@@ -102,6 +102,43 @@ def initialize(attributes = {})
102102
end
103103
end
104104

105+
# Check to see if the all the properties in the model are valid
106+
# @return true if the model is valid
107+
# @!visibility private
108+
def valid?
109+
return false if !@forget_after.nil? && @forget_after > 30
110+
return false if !@forget_after.nil? && @forget_after < 1
111+
return false if !@learning_duration.nil? && @learning_duration > 30
112+
return false if !@learning_duration.nil? && @learning_duration < 0
113+
true
114+
end
115+
116+
# Custom attribute writer method with validation
117+
# @param forget_after [Object] Object to be assigned
118+
# @!visibility private
119+
def forget_after=(forget_after)
120+
if !forget_after.nil? && forget_after > 30
121+
fail ArgumentError, 'invalid value for "forget_after", must be smaller than or equal to 30.'
122+
end
123+
if !forget_after.nil? && forget_after < 1
124+
fail ArgumentError, 'invalid value for "forget_after", must be greater than or equal to 1.'
125+
end
126+
@forget_after = forget_after
127+
end
128+
129+
# Custom attribute writer method with validation
130+
# @param learning_duration [Object] Object to be assigned
131+
# @!visibility private
132+
def learning_duration=(learning_duration)
133+
if !learning_duration.nil? && learning_duration > 30
134+
fail ArgumentError, 'invalid value for "learning_duration", must be smaller than or equal to 30.'
135+
end
136+
if !learning_duration.nil? && learning_duration < 0
137+
fail ArgumentError, 'invalid value for "learning_duration", must be greater than or equal to 0.'
138+
end
139+
@learning_duration = learning_duration
140+
end
141+
105142
# Returns the object in the form of hash, with additionalProperties support.
106143
# @return [Hash] Returns the object in the form of hash
107144
# @!visibility private

lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_forget_after.rb

Lines changed: 0 additions & 31 deletions
This file was deleted.

lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_learning_duration.rb

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)