Skip to content

Commit cef6f7d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 77b8031 of spec repo
1 parent 6ba7e3d commit cef6f7d

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
@@ -62071,35 +62071,17 @@ components:
6207162071
type: object
6207262072
SecurityMonitoringRuleNewValueOptionsForgetAfter:
6207362073
description: The duration in days after which a learned value is forgotten.
62074-
enum:
62075-
- 1
62076-
- 2
62077-
- 7
62078-
- 14
62079-
- 21
62080-
- 28
6208162074
format: int32
62075+
maximum: 30
62076+
minimum: 1
6208262077
type: integer
62083-
x-enum-varnames:
62084-
- ONE_DAY
62085-
- TWO_DAYS
62086-
- ONE_WEEK
62087-
- TWO_WEEKS
62088-
- THREE_WEEKS
62089-
- FOUR_WEEKS
6209062078
SecurityMonitoringRuleNewValueOptionsLearningDuration:
6209162079
default: 0
6209262080
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."
62093-
enum:
62094-
- 0
62095-
- 1
62096-
- 7
6209762081
format: int32
62082+
maximum: 30
62083+
minimum: 0
6209862084
type: integer
62099-
x-enum-varnames:
62100-
- ZERO_DAYS
62101-
- ONE_DAY
62102-
- SEVEN_DAYS
6210362085
SecurityMonitoringRuleNewValueOptionsLearningMethod:
6210462086
default: duration
6210562087
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
@@ -5053,8 +5053,6 @@ def overrides
50535053
"v2.security_monitoring_rule_keep_alive" => "SecurityMonitoringRuleKeepAlive",
50545054
"v2.security_monitoring_rule_max_signal_duration" => "SecurityMonitoringRuleMaxSignalDuration",
50555055
"v2.security_monitoring_rule_new_value_options" => "SecurityMonitoringRuleNewValueOptions",
5056-
"v2.security_monitoring_rule_new_value_options_forget_after" => "SecurityMonitoringRuleNewValueOptionsForgetAfter",
5057-
"v2.security_monitoring_rule_new_value_options_learning_duration" => "SecurityMonitoringRuleNewValueOptionsLearningDuration",
50585056
"v2.security_monitoring_rule_new_value_options_learning_method" => "SecurityMonitoringRuleNewValueOptionsLearningMethod",
50595057
"v2.security_monitoring_rule_new_value_options_learning_threshold" => "SecurityMonitoringRuleNewValueOptionsLearningThreshold",
50605058
"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)