Class: Verizon::CreateTriggerRequestOptions
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::CreateTriggerRequestOptions
- Defined in:
- lib/verizon/models/create_trigger_request_options.rb
Overview
CreateTriggerRequestOptions Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account name.
-
#active ⇒ TrueClass | FalseClass
Indicates anomaly detection is active<br />True - Anomaly detection is active.<br />False - Anomaly detection is not active.
-
#anomaly_trigger_request ⇒ AnomalyTriggerRequest
The details of the UsageAnomaly trigger.
-
#name ⇒ String
Trigger name.
-
#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.
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(name = SKIP, trigger_category = SKIP, account_name = SKIP, anomaly_trigger_request = SKIP, notification = SKIP, active = SKIP) ⇒ CreateTriggerRequestOptions
constructor
A new instance of CreateTriggerRequestOptions.
Methods inherited from BaseModel
Constructor Details
#initialize(name = SKIP, trigger_category = SKIP, account_name = SKIP, anomaly_trigger_request = SKIP, notification = SKIP, active = SKIP) ⇒ CreateTriggerRequestOptions
Returns a new instance of CreateTriggerRequestOptions.
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 68 def initialize(name = SKIP, trigger_category = SKIP, account_name = SKIP, anomaly_trigger_request = SKIP, notification = SKIP, active = SKIP) @name = name unless 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 @active = active unless active == SKIP end |
Instance Attribute Details
#account_name ⇒ String
Account name.
24 25 26 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 24 def account_name @account_name end |
#active ⇒ TrueClass | FalseClass
Indicates anomaly detection is active<br />True - Anomaly detection is active.<br />False - Anomaly detection is not active.
37 38 39 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 37 def active @active end |
#anomaly_trigger_request ⇒ AnomalyTriggerRequest
The details of the UsageAnomaly trigger.
28 29 30 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 28 def anomaly_trigger_request @anomaly_trigger_request end |
#name ⇒ String
Trigger name.
14 15 16 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 14 def name @name end |
#notification ⇒ TriggerNotification
The notification details of the trigger.
32 33 34 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 32 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.
20 21 22 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 20 def trigger_category @trigger_category end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 80 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : 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'] active = hash.key?('active') ? hash['active'] : SKIP # Create object from extracted values. CreateTriggerRequestOptions.new(name, trigger_category, account_name, anomaly_trigger_request, notification, active) end |
.names ⇒ Object
A mapping from model property names to API property names.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 40 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['trigger_category'] = 'triggerCategory' @_hash['account_name'] = 'accountName' @_hash['anomaly_trigger_request'] = 'anomalyTriggerRequest' @_hash['notification'] = 'notification' @_hash['active'] = 'active' @_hash end |
.nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 64 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/verizon/models/create_trigger_request_options.rb', line 52 def self.optionals %w[ name trigger_category account_name anomaly_trigger_request notification active ] end |