Class: Verizon::UsageTriggerUpdateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::UsageTriggerUpdateRequest
- Defined in:
- lib/verizon/models/usage_trigger_update_request.rb
Overview
UsageTriggerUpdateRequest Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account name.
-
#email_addresses ⇒ String
Comma-separated list of email addresses to send alerts to.
-
#sms_phone_numbers ⇒ String
Comma-separated list of phone numbers to send SMS alerts to.
-
#threshold_value ⇒ String
The percent of subscribed usage required to activate the trigger, such as 90 or 100.
-
#trigger_name ⇒ String
Usage 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.
Instance Method Summary collapse
-
#initialize(account_name = nil, trigger_name = SKIP, threshold_value = SKIP, sms_phone_numbers = SKIP, email_addresses = SKIP) ⇒ UsageTriggerUpdateRequest
constructor
A new instance of UsageTriggerUpdateRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, trigger_name = SKIP, threshold_value = SKIP, sms_phone_numbers = SKIP, email_addresses = SKIP) ⇒ UsageTriggerUpdateRequest
Returns a new instance of UsageTriggerUpdateRequest.
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 60 def initialize(account_name = nil, trigger_name = SKIP, threshold_value = SKIP, sms_phone_numbers = SKIP, email_addresses = SKIP) @trigger_name = trigger_name unless trigger_name == SKIP @account_name = account_name @threshold_value = threshold_value unless threshold_value == SKIP @sms_phone_numbers = sms_phone_numbers unless sms_phone_numbers == SKIP @email_addresses = email_addresses unless email_addresses == SKIP end |
Instance Attribute Details
#account_name ⇒ String
Account name
18 19 20 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 18 def account_name @account_name end |
#email_addresses ⇒ String
Comma-separated list of email addresses to send alerts to.
32 33 34 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 32 def email_addresses @email_addresses end |
#sms_phone_numbers ⇒ String
Comma-separated list of phone numbers to send SMS alerts to. Digits only; no dashes or parentheses, etc.
28 29 30 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 28 def sms_phone_numbers @sms_phone_numbers end |
#threshold_value ⇒ String
The percent of subscribed usage required to activate the trigger, such as 90 or 100.
23 24 25 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 23 def threshold_value @threshold_value end |
#trigger_name ⇒ String
Usage trigger name
14 15 16 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 14 def trigger_name @trigger_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 73 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : nil trigger_name = hash.key?('triggerName') ? hash['triggerName'] : SKIP threshold_value = hash.key?('thresholdValue') ? hash['thresholdValue'] : SKIP sms_phone_numbers = hash.key?('smsPhoneNumbers') ? hash['smsPhoneNumbers'] : SKIP email_addresses = hash.key?('emailAddresses') ? hash['emailAddresses'] : SKIP # Create object from extracted values. UsageTriggerUpdateRequest.new(account_name, trigger_name, threshold_value, sms_phone_numbers, email_addresses) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 41 42 43 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['trigger_name'] = 'triggerName' @_hash['account_name'] = 'accountName' @_hash['threshold_value'] = 'thresholdValue' @_hash['sms_phone_numbers'] = 'smsPhoneNumbers' @_hash['email_addresses'] = 'emailAddresses' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 53 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 46 def self.optionals %w[ trigger_name threshold_value sms_phone_numbers email_addresses ] end |