Class: Verizon::TriggersListOptions
- Defined in:
- lib/verizon/models/triggers_list_options.rb
Overview
TriggersListOptions Model.
Instance Attribute Summary collapse
-
#anomalyattributes ⇒ UsageAnomalyAttributes
The details of the UsageAnomaly trigger.
-
#created_at ⇒ String
Timestamp for whe the trigger was created.
-
#modified_at ⇒ String
Timestamp for the most recent time the trigger was modified.
-
#notification ⇒ TriggerNotification
The notification details of the trigger.
-
#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, anomalyattributes = SKIP, notification = SKIP) ⇒ TriggersListOptions
constructor
A new instance of TriggersListOptions.
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, anomalyattributes = SKIP, notification = SKIP) ⇒ TriggersListOptions
Returns a new instance of TriggersListOptions.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/verizon/models/triggers_list_options.rb', line 85 def initialize(trigger_id = SKIP, trigger_name = SKIP, organization_name = SKIP, trigger_category = SKIP, trigger_attributes = SKIP, created_at = SKIP, modified_at = SKIP, anomalyattributes = SKIP, notification = 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 @anomalyattributes = anomalyattributes unless anomalyattributes == SKIP @notification = notification unless notification == SKIP end |
Instance Attribute Details
#anomalyattributes ⇒ UsageAnomalyAttributes
The details of the UsageAnomaly trigger.
44 45 46 |
# File 'lib/verizon/models/triggers_list_options.rb', line 44 def anomalyattributes @anomalyattributes end |
#created_at ⇒ String
Timestamp for whe the trigger was created.
36 37 38 |
# File 'lib/verizon/models/triggers_list_options.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/triggers_list_options.rb', line 40 def modified_at @modified_at end |
#notification ⇒ TriggerNotification
The notification details of the trigger.
48 49 50 |
# File 'lib/verizon/models/triggers_list_options.rb', line 48 def notification @notification end |
#organization_name ⇒ String
The user assigned name of the organization associated with the trigger.
22 23 24 |
# File 'lib/verizon/models/triggers_list_options.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/triggers_list_options.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/triggers_list_options.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/triggers_list_options.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/triggers_list_options.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.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/verizon/models/triggers_list_options.rb', line 102 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 anomalyattributes = UsageAnomalyAttributes.from_hash(hash['anomalyattributes']) if hash['anomalyattributes'] notification = TriggerNotification.from_hash(hash['notification']) if hash['notification'] # Create object from extracted values. TriggersListOptions.new(trigger_id, trigger_name, organization_name, trigger_category, trigger_attributes, created_at, modified_at, anomalyattributes, notification) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/verizon/models/triggers_list_options.rb', line 51 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['anomalyattributes'] = 'anomalyattributes' @_hash['notification'] = 'notification' @_hash end |
.nullables ⇒ Object
An array for nullable fields
81 82 83 |
# File 'lib/verizon/models/triggers_list_options.rb', line 81 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/verizon/models/triggers_list_options.rb', line 66 def self.optionals %w[ trigger_id trigger_name organization_name trigger_category trigger_attributes created_at modified_at anomalyattributes notification ] end |