Class: Verizon::UsageTriggerUpdateRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/usage_trigger_update_request.rb

Overview

UsageTriggerUpdateRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 60

def initialize( = nil, trigger_name = SKIP,
               threshold_value = SKIP, sms_phone_numbers = SKIP,
               email_addresses = SKIP)
  @trigger_name = trigger_name unless trigger_name == SKIP
  @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_nameString

Account name

Returns:

  • (String)


18
19
20
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 18

def 
  @account_name
end

#email_addressesString

Comma-separated list of email addresses to send alerts to.

Returns:

  • (String)


32
33
34
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 32

def email_addresses
  @email_addresses
end

#sms_phone_numbersString

Comma-separated list of phone numbers to send SMS alerts to. Digits only; no dashes or parentheses, etc.

Returns:

  • (String)


28
29
30
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 28

def sms_phone_numbers
  @sms_phone_numbers
end

#threshold_valueString

The percent of subscribed usage required to activate the trigger, such as 90 or 100.

Returns:

  • (String)


23
24
25
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 23

def threshold_value
  @threshold_value
end

#trigger_nameString

Usage trigger name

Returns:

  • (String)


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.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = 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(,
                                trigger_name,
                                threshold_value,
                                sms_phone_numbers,
                                email_addresses)
end

.namesObject

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

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/verizon/models/usage_trigger_update_request.rb', line 56

def self.nullables
  []
end

.optionalsObject

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