Class: Verizon::AnomalyTriggerValue
- Defined in:
- lib/verizon/models/anomaly_trigger_value.rb
Overview
Trigger details.
Instance Attribute Summary collapse
-
#created_at ⇒ String
Timestamp for whe the trigger was created.
-
#modified_at ⇒ String
Timestamp for the most recent time the trigger was modified.
-
#organization_name ⇒ String
The user assigned name of the organization associated with the trigger.
-
#trigger_attributes ⇒ Array[TriggerAttributesOptions]
Additional details and keys for the trigger.
-
#trigger_category ⇒ String
This is the value to use in the request body to detect anomalous behaivior.
-
#trigger_id ⇒ String
The system assigned name of the trigger being updated.
-
#trigger_name ⇒ String
The user defined name of the trigger.
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.
Instance Method Summary collapse
-
#initialize(trigger_id = SKIP, trigger_name = SKIP, organization_name = SKIP, trigger_category = SKIP, trigger_attributes = SKIP, created_at = SKIP, modified_at = SKIP) ⇒ AnomalyTriggerValue
constructor
A new instance of AnomalyTriggerValue.
Methods inherited from BaseModel
Constructor Details
#initialize(trigger_id = SKIP, trigger_name = SKIP, organization_name = SKIP, trigger_category = SKIP, trigger_attributes = SKIP, created_at = SKIP, modified_at = SKIP) ⇒ AnomalyTriggerValue
Returns a new instance of AnomalyTriggerValue.
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 73 def initialize(trigger_id = SKIP, trigger_name = SKIP, organization_name = SKIP, trigger_category = SKIP, trigger_attributes = SKIP, created_at = SKIP, modified_at = SKIP) @trigger_id = trigger_id unless trigger_id == SKIP @trigger_name = trigger_name unless trigger_name == SKIP @organization_name = organization_name unless organization_name == SKIP @trigger_category = trigger_category unless trigger_category == SKIP @trigger_attributes = trigger_attributes unless trigger_attributes == SKIP @created_at = created_at unless created_at == SKIP @modified_at = modified_at unless modified_at == SKIP end |
Instance Attribute Details
#created_at ⇒ String
Timestamp for whe the trigger was created.
36 37 38 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 36 def created_at @created_at end |
#modified_at ⇒ String
Timestamp for the most recent time the trigger was modified.
40 41 42 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 40 def modified_at @modified_at end |
#organization_name ⇒ String
The user assigned name of the organization associated with the trigger.
22 23 24 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 22 def organization_name @organization_name end |
#trigger_attributes ⇒ Array[TriggerAttributesOptions]
Additional details and keys for the trigger.
32 33 34 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 32 def trigger_attributes @trigger_attributes end |
#trigger_category ⇒ String
This is the value to use in the request body to detect anomalous behaivior. The values in this table will only be relevant when this parameter is set to this value.
28 29 30 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 28 def trigger_category @trigger_category end |
#trigger_id ⇒ String
The system assigned name of the trigger being updated.
14 15 16 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 14 def trigger_id @trigger_id end |
#trigger_name ⇒ String
The user defined name of the trigger.
18 19 20 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 18 def trigger_name @trigger_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 87 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. trigger_id = hash.key?('triggerId') ? hash['triggerId'] : SKIP trigger_name = hash.key?('triggerName') ? hash['triggerName'] : SKIP organization_name = hash.key?('organizationName') ? hash['organizationName'] : SKIP trigger_category = hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP # Parameter is an array, so we need to iterate through it trigger_attributes = nil unless hash['triggerAttributes'].nil? trigger_attributes = [] hash['triggerAttributes'].each do |structure| trigger_attributes << (TriggerAttributesOptions.from_hash(structure) if structure) end end trigger_attributes = SKIP unless hash.key?('triggerAttributes') created_at = hash.key?('createdAt') ? hash['createdAt'] : SKIP modified_at = hash.key?('modifiedAt') ? hash['modifiedAt'] : SKIP # Create object from extracted values. AnomalyTriggerValue.new(trigger_id, trigger_name, organization_name, trigger_category, trigger_attributes, created_at, modified_at) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['trigger_id'] = 'triggerId' @_hash['trigger_name'] = 'triggerName' @_hash['organization_name'] = 'organizationName' @_hash['trigger_category'] = 'triggerCategory' @_hash['trigger_attributes'] = 'triggerAttributes' @_hash['created_at'] = 'createdAt' @_hash['modified_at'] = 'modifiedAt' @_hash end |
.nullables ⇒ Object
An array for nullable fields
69 70 71 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 69 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/verizon/models/anomaly_trigger_value.rb', line 56 def self.optionals %w[ trigger_id trigger_name organization_name trigger_category trigger_attributes created_at modified_at ] end |