Class: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningDuration

Inherits:
Object
  • Object
show all
Includes:
BaseEnumModel
Defined in:
lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_learning_duration.rb,
lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_learning_duration.rb

Overview

The duration in days during which values are learned, and after which signals will be generated for values that weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.

Constant Summary collapse

ZERO_DAYS =
0.freeze
ONE_DAY =
1.freeze
SEVEN_DAYS =
7.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseEnumModel

included

Class Method Details

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



28
29
30
# File 'lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_learning_duration.rb', line 28

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



35
36
37
38
# File 'lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_learning_duration.rb', line 35

def build_from_hash(value)
  constantValues = SecurityMonitoringRuleNewValueOptionsLearningDuration.constants.select { |c| SecurityMonitoringRuleNewValueOptionsLearningDuration::const_get(c) == value }
  constantValues.empty? ? DatadogAPIClient::V2::UnparsedObject.new(value) : value
end