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:, trigger_name: SKIP, threshold_value: SKIP, sms_phone_numbers: SKIP, email_addresses: SKIP, additional_properties: nil) ⇒ UsageTriggerUpdateRequest
constructor
A new instance of UsageTriggerUpdateRequest.
-
#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(account_name:, trigger_name: SKIP, threshold_value: SKIP, sms_phone_numbers: SKIP, email_addresses: SKIP, additional_properties: nil) ⇒ UsageTriggerUpdateRequest
Returns a new instance of UsageTriggerUpdateRequest.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 60 def initialize(account_name:, trigger_name: SKIP, threshold_value: SKIP, sms_phone_numbers: SKIP, email_addresses: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @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 @additional_properties = additional_properties 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.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 75 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 a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. UsageTriggerUpdateRequest.new(account_name: account_name, trigger_name: trigger_name, threshold_value: threshold_value, sms_phone_numbers: sms_phone_numbers, email_addresses: email_addresses, additional_properties: additional_properties) 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 |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
113 114 115 116 117 118 119 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 113 def inspect class_name = self.class.name.split('::').last "<#{class_name} trigger_name: #{@trigger_name.inspect}, account_name:"\ " #{@account_name.inspect}, threshold_value: #{@threshold_value.inspect}, sms_phone_numbers:"\ " #{@sms_phone_numbers.inspect}, email_addresses: #{@email_addresses.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
105 106 107 108 109 110 |
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 105 def to_s class_name = self.class.name.split('::').last "<#{class_name} trigger_name: #{@trigger_name}, account_name: #{@account_name},"\ " threshold_value: #{@threshold_value}, sms_phone_numbers: #{@sms_phone_numbers},"\ " email_addresses: #{@email_addresses}, additional_properties: #{@additional_properties}>" end |