Class: Verizon::CreateTriggerRequest
- Defined in:
- lib/verizon/models/create_trigger_request.rb
Overview
CreateTriggerRequest Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
TODO: Write general description for this method.
-
#anomaly_trigger_request ⇒ AnomalyTriggerRequest
The details of the UsageAnomaly trigger.
-
#data_trigger_request ⇒ DataTriggerRequest
The details of the UsageAnomaly trigger.
-
#group_name ⇒ String
The details of the UsageAnomaly trigger.
-
#name ⇒ String
The details of the UsageAnomaly trigger.
-
#session_trigger_request ⇒ SessionTriggerRequest
The details of the UsageAnomaly trigger.
-
#sms_trigger_request ⇒ SMSTriggerRequest
The details of the UsageAnomaly trigger.
-
#trigger_category ⇒ String
The details of the UsageAnomaly trigger.
-
#trigger_cycle ⇒ String
The details of the UsageAnomaly 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(account_name = SKIP, anomaly_trigger_request = SKIP, data_trigger_request = SKIP, group_name = SKIP, name = SKIP, session_trigger_request = SKIP, sms_trigger_request = SKIP, trigger_category = SKIP, trigger_cycle = SKIP) ⇒ CreateTriggerRequest
constructor
A new instance of CreateTriggerRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = SKIP, anomaly_trigger_request = SKIP, data_trigger_request = SKIP, group_name = SKIP, name = SKIP, session_trigger_request = SKIP, sms_trigger_request = SKIP, trigger_category = SKIP, trigger_cycle = SKIP) ⇒ CreateTriggerRequest
Returns a new instance of CreateTriggerRequest.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/verizon/models/create_trigger_request.rb', line 83 def initialize(account_name = SKIP, anomaly_trigger_request = SKIP, data_trigger_request = SKIP, group_name = SKIP, name = SKIP, session_trigger_request = SKIP, sms_trigger_request = SKIP, trigger_category = SKIP, trigger_cycle = SKIP) @account_name = account_name unless account_name == SKIP @anomaly_trigger_request = anomaly_trigger_request unless anomaly_trigger_request == SKIP @data_trigger_request = data_trigger_request unless data_trigger_request == SKIP @group_name = group_name unless group_name == SKIP @name = name unless name == SKIP @session_trigger_request = session_trigger_request unless session_trigger_request == SKIP @sms_trigger_request = sms_trigger_request unless sms_trigger_request == SKIP @trigger_category = trigger_category unless trigger_category == SKIP @trigger_cycle = trigger_cycle unless trigger_cycle == SKIP end |
Instance Attribute Details
#account_name ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/create_trigger_request.rb', line 14 def account_name @account_name end |
#anomaly_trigger_request ⇒ AnomalyTriggerRequest
The details of the UsageAnomaly trigger.
18 19 20 |
# File 'lib/verizon/models/create_trigger_request.rb', line 18 def anomaly_trigger_request @anomaly_trigger_request end |
#data_trigger_request ⇒ DataTriggerRequest
The details of the UsageAnomaly trigger.
22 23 24 |
# File 'lib/verizon/models/create_trigger_request.rb', line 22 def data_trigger_request @data_trigger_request end |
#group_name ⇒ String
The details of the UsageAnomaly trigger.
26 27 28 |
# File 'lib/verizon/models/create_trigger_request.rb', line 26 def group_name @group_name end |
#name ⇒ String
The details of the UsageAnomaly trigger.
30 31 32 |
# File 'lib/verizon/models/create_trigger_request.rb', line 30 def name @name end |
#session_trigger_request ⇒ SessionTriggerRequest
The details of the UsageAnomaly trigger.
34 35 36 |
# File 'lib/verizon/models/create_trigger_request.rb', line 34 def session_trigger_request @session_trigger_request end |
#sms_trigger_request ⇒ SMSTriggerRequest
The details of the UsageAnomaly trigger.
38 39 40 |
# File 'lib/verizon/models/create_trigger_request.rb', line 38 def sms_trigger_request @sms_trigger_request end |
#trigger_category ⇒ String
The details of the UsageAnomaly trigger.
42 43 44 |
# File 'lib/verizon/models/create_trigger_request.rb', line 42 def trigger_category @trigger_category end |
#trigger_cycle ⇒ String
The details of the UsageAnomaly trigger.
46 47 48 |
# File 'lib/verizon/models/create_trigger_request.rb', line 46 def trigger_cycle @trigger_cycle end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
99 100 101 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 |
# File 'lib/verizon/models/create_trigger_request.rb', line 99 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : SKIP anomaly_trigger_request = AnomalyTriggerRequest.from_hash(hash['anomalyTriggerRequest']) if hash['anomalyTriggerRequest'] data_trigger_request = DataTriggerRequest.from_hash(hash['dataTriggerRequest']) if hash['dataTriggerRequest'] group_name = hash.key?('groupName') ? hash['groupName'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP session_trigger_request = SessionTriggerRequest.from_hash(hash['sessionTriggerRequest']) if hash['sessionTriggerRequest'] sms_trigger_request = SMSTriggerRequest.from_hash(hash['smsTriggerRequest']) if hash['smsTriggerRequest'] trigger_category = hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP trigger_cycle = hash.key?('triggerCycle') ? hash['triggerCycle'] : SKIP # Create object from extracted values. CreateTriggerRequest.new(account_name, anomaly_trigger_request, data_trigger_request, group_name, name, session_trigger_request, sms_trigger_request, trigger_category, trigger_cycle) end |
.names ⇒ Object
A mapping from model property names to API property names.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/verizon/models/create_trigger_request.rb', line 49 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['anomaly_trigger_request'] = 'anomalyTriggerRequest' @_hash['data_trigger_request'] = 'dataTriggerRequest' @_hash['group_name'] = 'groupName' @_hash['name'] = 'name' @_hash['session_trigger_request'] = 'sessionTriggerRequest' @_hash['sms_trigger_request'] = 'smsTriggerRequest' @_hash['trigger_category'] = 'triggerCategory' @_hash['trigger_cycle'] = 'triggerCycle' @_hash end |
.nullables ⇒ Object
An array for nullable fields
79 80 81 |
# File 'lib/verizon/models/create_trigger_request.rb', line 79 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/verizon/models/create_trigger_request.rb', line 64 def self.optionals %w[ account_name anomaly_trigger_request data_trigger_request group_name name session_trigger_request sms_trigger_request trigger_category trigger_cycle ] end |