Class: Verizon::UsageTriggerResponse

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

Overview

UsageTriggerResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(trigger_id = nil, trigger_name = nil, account_name = nil, service_name = ServiceNameEnum::LOCATION, threshold_value = nil, allow_excess = nil, send_sms_notification = nil, sms_phone_numbers = nil, send_email_notification = nil, email_addresses = nil, create_date = nil, update_date = nil) ⇒ UsageTriggerResponse

Returns a new instance of UsageTriggerResponse.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/verizon/models/usage_trigger_response.rb', line 88

def initialize(trigger_id = nil, trigger_name = nil,  = nil,
               service_name = ServiceNameEnum::LOCATION,
               threshold_value = nil, allow_excess = nil,
               send_sms_notification = nil, sms_phone_numbers = nil,
               send_email_notification = nil, email_addresses = nil,
               create_date = nil, update_date = nil)
  @trigger_id = trigger_id
  @trigger_name = trigger_name
  @account_name = 
  @service_name = service_name
  @threshold_value = threshold_value
  @allow_excess = allow_excess
  @send_sms_notification = send_sms_notification
  @sms_phone_numbers = sms_phone_numbers
  @send_email_notification = send_email_notification
  @email_addresses = email_addresses
  @create_date = create_date
  @update_date = update_date
end

Instance Attribute Details

#account_nameString

Account name

Returns:

  • (String)


22
23
24
# File 'lib/verizon/models/usage_trigger_response.rb', line 22

def 
  @account_name
end

#allow_excessTrueClass | FalseClass

allowExcess determines whether to restrict usage after exceeds limits

Returns:

  • (TrueClass | FalseClass)


34
35
36
# File 'lib/verizon/models/usage_trigger_response.rb', line 34

def allow_excess
  @allow_excess
end

#create_dateString

UTC Date when the usage trigger was created

Returns:

  • (String)


54
55
56
# File 'lib/verizon/models/usage_trigger_response.rb', line 54

def create_date
  @create_date
end

#email_addressesString

comma seperated value of list of Email addresses for Email notifications

Returns:

  • (String)


50
51
52
# File 'lib/verizon/models/usage_trigger_response.rb', line 50

def email_addresses
  @email_addresses
end

#send_email_notificationTrueClass | FalseClass

Send email alerts when the thresholdValue is reached.

Returns:

  • (TrueClass | FalseClass)


46
47
48
# File 'lib/verizon/models/usage_trigger_response.rb', line 46

def send_email_notification
  @send_email_notification
end

#send_sms_notificationTrueClass | FalseClass

Send SMS (text) alerts when the thresholdValue is reached.

Returns:

  • (TrueClass | FalseClass)


38
39
40
# File 'lib/verizon/models/usage_trigger_response.rb', line 38

def send_sms_notification
  @send_sms_notification
end

#service_nameServiceNameEnum

Service name

Returns:



26
27
28
# File 'lib/verizon/models/usage_trigger_response.rb', line 26

def service_name
  @service_name
end

#sms_phone_numbersString

comma seperated value of list of Phone numbers for SMS notifications

Returns:

  • (String)


42
43
44
# File 'lib/verizon/models/usage_trigger_response.rb', line 42

def sms_phone_numbers
  @sms_phone_numbers
end

#threshold_valueString

Percent of subscription at which trigger will send an alert

Returns:

  • (String)


30
31
32
# File 'lib/verizon/models/usage_trigger_response.rb', line 30

def threshold_value
  @threshold_value
end

#trigger_idString

Unique usage triggerId

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/usage_trigger_response.rb', line 14

def trigger_id
  @trigger_id
end

#trigger_nameString

Usage trigger name

Returns:

  • (String)


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

def trigger_name
  @trigger_name
end

#update_dateString

UTC Date when the usage trigger was last updated

Returns:

  • (String)


58
59
60
# File 'lib/verizon/models/usage_trigger_response.rb', line 58

def update_date
  @update_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/verizon/models/usage_trigger_response.rb', line 109

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  trigger_id = hash.key?('triggerId') ? hash['triggerId'] : nil
  trigger_name = hash.key?('triggerName') ? hash['triggerName'] : nil
   = hash.key?('accountName') ? hash['accountName'] : nil
  service_name = hash['serviceName'] ||= ServiceNameEnum::LOCATION
  threshold_value =
    hash.key?('thresholdValue') ? hash['thresholdValue'] : nil
  allow_excess = hash.key?('allowExcess') ? hash['allowExcess'] : nil
  send_sms_notification =
    hash.key?('sendSmsNotification') ? hash['sendSmsNotification'] : nil
  sms_phone_numbers =
    hash.key?('smsPhoneNumbers') ? hash['smsPhoneNumbers'] : nil
  send_email_notification =
    hash.key?('sendEmailNotification') ? hash['sendEmailNotification'] : nil
  email_addresses =
    hash.key?('emailAddresses') ? hash['emailAddresses'] : nil
  create_date = hash.key?('createDate') ? hash['createDate'] : nil
  update_date = hash.key?('updateDate') ? hash['updateDate'] : nil

  # Create object from extracted values.
  UsageTriggerResponse.new(trigger_id,
                           trigger_name,
                           ,
                           service_name,
                           threshold_value,
                           allow_excess,
                           send_sms_notification,
                           sms_phone_numbers,
                           send_email_notification,
                           email_addresses,
                           create_date,
                           update_date)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/verizon/models/usage_trigger_response.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['trigger_id'] = 'triggerId'
  @_hash['trigger_name'] = 'triggerName'
  @_hash['account_name'] = 'accountName'
  @_hash['service_name'] = 'serviceName'
  @_hash['threshold_value'] = 'thresholdValue'
  @_hash['allow_excess'] = 'allowExcess'
  @_hash['send_sms_notification'] = 'sendSmsNotification'
  @_hash['sms_phone_numbers'] = 'smsPhoneNumbers'
  @_hash['send_email_notification'] = 'sendEmailNotification'
  @_hash['email_addresses'] = 'emailAddresses'
  @_hash['create_date'] = 'createDate'
  @_hash['update_date'] = 'updateDate'
  @_hash
end

.nullablesObject

An array for nullable fields



84
85
86
# File 'lib/verizon/models/usage_trigger_response.rb', line 84

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
# File 'lib/verizon/models/usage_trigger_response.rb', line 79

def self.optionals
  []
end