Class: Verizon::AnomalyTriggerRequest
- Defined in:
- lib/verizon/models/anomaly_trigger_request.rb
Overview
The details of the UsageAnomaly trigger.
Instance Attribute Summary collapse
-
#account_names ⇒ String
The Verizon billing accounts associated with the anomaly triggers for this trigger to be active for devices in those accounts.
-
#include_abnormal ⇒ TrueClass | FalseClass
Whether or not to include anomalies classified as ‘abnormal’.<br />true<br />false<br />Classification is set as part of ThingSpace Intelligence anomaly detection settings.
-
#include_over_expected_usage ⇒ TrueClass | FalseClass
Whether or not to include anomalies that are directionally over the expected usage.
-
#include_under_expected_usage ⇒ TrueClass | FalseClass
Whether or not to include anomalies that are directionally under the expected usage.<br />true<br />false.
-
#include_very_abnormal ⇒ TrueClass | FalseClass
Whether or not to include anomalies classified as ‘very abnormal’.<br />true<br />false<br />Classification is set as part of ThingSpace Intelligence anomaly detection settings.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(account_names: SKIP, include_abnormal: SKIP, include_very_abnormal: SKIP, include_under_expected_usage: SKIP, include_over_expected_usage: SKIP) ⇒ AnomalyTriggerRequest
constructor
A new instance of AnomalyTriggerRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(account_names: SKIP, include_abnormal: SKIP, include_very_abnormal: SKIP, include_under_expected_usage: SKIP, include_over_expected_usage: SKIP) ⇒ AnomalyTriggerRequest
Returns a new instance of AnomalyTriggerRequest.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 67 def initialize(account_names: SKIP, include_abnormal: SKIP, include_very_abnormal: SKIP, include_under_expected_usage: SKIP, include_over_expected_usage: SKIP) @account_names = account_names unless account_names == SKIP @include_abnormal = include_abnormal unless include_abnormal == SKIP @include_very_abnormal = include_very_abnormal unless include_very_abnormal == SKIP unless include_under_expected_usage == SKIP @include_under_expected_usage = include_under_expected_usage end unless include_over_expected_usage == SKIP @include_over_expected_usage = include_over_expected_usage end end |
Instance Attribute Details
#account_names ⇒ String
The Verizon billing accounts associated with the anomaly triggers for this trigger to be active for devices in those accounts. An account name is usually numeric, and must include any leading zeros.
16 17 18 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 16 def account_names @account_names end |
#include_abnormal ⇒ TrueClass | FalseClass
Whether or not to include anomalies classified as ‘abnormal’.<br />true<br />false<br />Classification is set as part of ThingSpace Intelligence anomaly detection settings.
22 23 24 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 22 def include_abnormal @include_abnormal end |
#include_over_expected_usage ⇒ TrueClass | FalseClass
Whether or not to include anomalies that are directionally over the expected usage. <br />true<br />false.
38 39 40 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 38 def include_over_expected_usage @include_over_expected_usage end |
#include_under_expected_usage ⇒ TrueClass | FalseClass
Whether or not to include anomalies that are directionally under the expected usage.<br />true<br />false.
33 34 35 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 33 def include_under_expected_usage @include_under_expected_usage end |
#include_very_abnormal ⇒ TrueClass | FalseClass
Whether or not to include anomalies classified as ‘very abnormal’.<br />true<br />false<br />Classification is set as part of ThingSpace Intelligence anomaly detection settings.
28 29 30 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 28 def include_very_abnormal @include_very_abnormal end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 85 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_names = hash.key?('accountNames') ? hash['accountNames'] : SKIP include_abnormal = hash.key?('includeAbnormal') ? hash['includeAbnormal'] : SKIP include_very_abnormal = hash.key?('includeVeryAbnormal') ? hash['includeVeryAbnormal'] : SKIP include_under_expected_usage = hash.key?('includeUnderExpectedUsage') ? hash['includeUnderExpectedUsage'] : SKIP include_over_expected_usage = hash.key?('includeOverExpectedUsage') ? hash['includeOverExpectedUsage'] : SKIP # Create object from extracted values. AnomalyTriggerRequest.new(account_names: account_names, include_abnormal: include_abnormal, include_very_abnormal: include_very_abnormal, include_under_expected_usage: include_under_expected_usage, include_over_expected_usage: include_over_expected_usage) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['account_names'] = 'accountNames' @_hash['include_abnormal'] = 'includeAbnormal' @_hash['include_very_abnormal'] = 'includeVeryAbnormal' @_hash['include_under_expected_usage'] = 'includeUnderExpectedUsage' @_hash['include_over_expected_usage'] = 'includeOverExpectedUsage' @_hash end |
.nullables ⇒ Object
An array for nullable fields
63 64 65 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 63 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
52 53 54 55 56 57 58 59 60 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 52 def self.optionals %w[ account_names include_abnormal include_very_abnormal include_under_expected_usage include_over_expected_usage ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
109 110 111 112 113 114 115 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 109 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
127 128 129 130 131 132 133 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 127 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_names: #{@account_names.inspect}, include_abnormal:"\ " #{@include_abnormal.inspect}, include_very_abnormal: #{@include_very_abnormal.inspect},"\ " include_under_expected_usage: #{@include_under_expected_usage.inspect},"\ " include_over_expected_usage: #{@include_over_expected_usage.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
118 119 120 121 122 123 124 |
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 118 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_names: #{@account_names}, include_abnormal: #{@include_abnormal},"\ " include_very_abnormal: #{@include_very_abnormal}, include_under_expected_usage:"\ " #{@include_under_expected_usage}, include_over_expected_usage:"\ " #{@include_over_expected_usage}>" end |