Class: Verizon::TriggerType3
- Defined in:
- lib/verizon/models/trigger_type3.rb
Overview
Trigger details.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account name.
-
#anomaly_trigger_request ⇒ AnomalyTriggerRequest
The details of the UsageAnomaly trigger.
-
#notification ⇒ TriggerNotification
The notification details of the trigger.
-
#trigger_category ⇒ String
This is the value to use in the request body to detect anomalous behaivior.
-
#trigger_id ⇒ String
Trigger ID.
-
#trigger_name ⇒ String
Trigger name.
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(trigger_id: SKIP, trigger_name: SKIP, trigger_category: SKIP, account_name: SKIP, anomaly_trigger_request: SKIP, notification: SKIP) ⇒ TriggerType3
constructor
A new instance of TriggerType3.
-
#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(trigger_id: SKIP, trigger_name: SKIP, trigger_category: SKIP, account_name: SKIP, anomaly_trigger_request: SKIP, notification: SKIP) ⇒ TriggerType3
Returns a new instance of TriggerType3.
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/verizon/models/trigger_type3.rb', line 67 def initialize(trigger_id: SKIP, trigger_name: SKIP, trigger_category: SKIP, account_name: SKIP, anomaly_trigger_request: SKIP, notification: SKIP) @trigger_id = trigger_id unless trigger_id == SKIP @trigger_name = trigger_name unless trigger_name == SKIP @trigger_category = trigger_category unless trigger_category == SKIP @account_name = account_name unless account_name == SKIP @anomaly_trigger_request = anomaly_trigger_request unless anomaly_trigger_request == SKIP @notification = notification unless notification == SKIP end |
Instance Attribute Details
#account_name ⇒ String
Account name.
28 29 30 |
# File 'lib/verizon/models/trigger_type3.rb', line 28 def account_name @account_name end |
#anomaly_trigger_request ⇒ AnomalyTriggerRequest
The details of the UsageAnomaly trigger.
32 33 34 |
# File 'lib/verizon/models/trigger_type3.rb', line 32 def anomaly_trigger_request @anomaly_trigger_request end |
#notification ⇒ TriggerNotification
The notification details of the trigger.
36 37 38 |
# File 'lib/verizon/models/trigger_type3.rb', line 36 def notification @notification 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.
24 25 26 |
# File 'lib/verizon/models/trigger_type3.rb', line 24 def trigger_category @trigger_category end |
#trigger_id ⇒ String
Trigger ID.
14 15 16 |
# File 'lib/verizon/models/trigger_type3.rb', line 14 def trigger_id @trigger_id end |
#trigger_name ⇒ String
Trigger name.
18 19 20 |
# File 'lib/verizon/models/trigger_type3.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.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/verizon/models/trigger_type3.rb', line 79 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 trigger_category = hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP account_name = hash.key?('accountName') ? hash['accountName'] : SKIP anomaly_trigger_request = AnomalyTriggerRequest.from_hash(hash['anomalyTriggerRequest']) if hash['anomalyTriggerRequest'] notification = TriggerNotification.from_hash(hash['notification']) if hash['notification'] # Create object from extracted values. TriggerType3.new(trigger_id: trigger_id, trigger_name: trigger_name, trigger_category: trigger_category, account_name: account_name, anomaly_trigger_request: anomaly_trigger_request, notification: notification) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/verizon/models/trigger_type3.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['trigger_id'] = 'triggerId' @_hash['trigger_name'] = 'triggerName' @_hash['trigger_category'] = 'triggerCategory' @_hash['account_name'] = 'accountName' @_hash['anomaly_trigger_request'] = 'anomalyTriggerRequest' @_hash['notification'] = 'notification' @_hash end |
.nullables ⇒ Object
An array for nullable fields
63 64 65 |
# File 'lib/verizon/models/trigger_type3.rb', line 63 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/verizon/models/trigger_type3.rb', line 51 def self.optionals %w[ trigger_id trigger_name trigger_category account_name anomaly_trigger_request notification ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
103 104 105 106 107 108 109 |
# File 'lib/verizon/models/trigger_type3.rb', line 103 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.
120 121 122 123 124 125 126 |
# File 'lib/verizon/models/trigger_type3.rb', line 120 def inspect class_name = self.class.name.split('::').last "<#{class_name} trigger_id: #{@trigger_id.inspect}, trigger_name: #{@trigger_name.inspect},"\ " trigger_category: #{@trigger_category.inspect}, account_name: #{@account_name.inspect},"\ " anomaly_trigger_request: #{@anomaly_trigger_request.inspect}, notification:"\ " #{@notification.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
112 113 114 115 116 117 |
# File 'lib/verizon/models/trigger_type3.rb', line 112 def to_s class_name = self.class.name.split('::').last "<#{class_name} trigger_id: #{@trigger_id}, trigger_name: #{@trigger_name},"\ " trigger_category: #{@trigger_category}, account_name: #{@account_name},"\ " anomaly_trigger_request: #{@anomaly_trigger_request}, notification: #{@notification}>" end |