Class: Verizon::AnomalyTriggerRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/anomaly_trigger_request.rb

Overview

The details of the UsageAnomaly trigger.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#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( = SKIP, include_abnormal = SKIP,
               include_very_abnormal = SKIP,
               include_under_expected_usage = SKIP,
               include_over_expected_usage = SKIP)
  @account_names =  unless  == 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_namesString

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.

Returns:

  • (String)


16
17
18
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 16

def 
  @account_names
end

#include_abnormalTrueClass | 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.

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 22

def include_abnormal
  @include_abnormal
end

#include_over_expected_usageTrueClass | FalseClass

Whether or not to include anomalies that are directionally over the expected usage. <br />true<br />false.

Returns:

  • (TrueClass | FalseClass)


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_usageTrueClass | FalseClass

Whether or not to include anomalies that are directionally under the expected usage.<br />true<br />false.

Returns:

  • (TrueClass | FalseClass)


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_abnormalTrueClass | 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.

Returns:

  • (TrueClass | FalseClass)


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.
   = 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(,
                            include_abnormal,
                            include_very_abnormal,
                            include_under_expected_usage,
                            include_over_expected_usage)
end

.namesObject

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

.nullablesObject

An array for nullable fields



63
64
65
# File 'lib/verizon/models/anomaly_trigger_request.rb', line 63

def self.nullables
  []
end

.optionalsObject

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