Class: Verizon::UsageAnomalyAttributes

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/usage_anomaly_attributes.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, device_group = SKIP, include_abnormal = SKIP, include_very_abnormal = SKIP, include_under_expected_usage = SKIP, include_over_expected_usage = SKIP) ⇒ UsageAnomalyAttributes

Returns a new instance of UsageAnomalyAttributes.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 74

def initialize( = SKIP, device_group = SKIP,
               include_abnormal = SKIP, include_very_abnormal = SKIP,
               include_under_expected_usage = SKIP,
               include_over_expected_usage = SKIP)
  @account_names =  unless  == SKIP
  @device_group = device_group unless device_group == 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 account 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/usage_anomaly_attributes.rb', line 16

def 
  @account_names
end

#device_groupString

The names of device groups associated with the anomaly triggers for this trigger to be active for devices in those groups.

Returns:

  • (String)


21
22
23
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 21

def device_group
  @device_group
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)


27
28
29
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 27

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)


43
44
45
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 43

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)


38
39
40
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 38

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)


33
34
35
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 33

def include_very_abnormal
  @include_very_abnormal
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 93

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountNames') ? hash['accountNames'] : SKIP
  device_group = hash.key?('deviceGroup') ? hash['deviceGroup'] : 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.
  UsageAnomalyAttributes.new(,
                             device_group,
                             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.



46
47
48
49
50
51
52
53
54
55
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_names'] = 'accountNames'
  @_hash['device_group'] = 'deviceGroup'
  @_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



70
71
72
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 70

def self.nullables
  []
end

.optionalsObject

An array for optional fields



58
59
60
61
62
63
64
65
66
67
# File 'lib/verizon/models/usage_anomaly_attributes.rb', line 58

def self.optionals
  %w[
    account_names
    device_group
    include_abnormal
    include_very_abnormal
    include_under_expected_usage
    include_over_expected_usage
  ]
end