Class: Plivo::Resources::Number
Constant Summary
Constants included
from Utils
Utils::TYPE_WHITELIST
Instance Attribute Summary
#id
Instance Method Summary
collapse
Methods included from Utils
GetSortedQueryParamString?, compute_signatureV3?, expected_type?, expected_value?, generate_url?, getMapFromQueryString?, raise_invalid_request, valid_account?, valid_mainaccount?, valid_param?, valid_signature?, valid_signatureV3?, valid_subaccount?
Constructor Details
#initialize(client, options = nil) ⇒ Number
Returns a new instance of Number.
125
126
127
128
129
|
# File 'lib/plivo/resources/numbers.rb', line 125
def initialize(client, options = nil)
@_name = 'Number'
@_identifier_string = 'number'
super
end
|
Instance Method Details
#delete ⇒ Object
158
159
160
|
# File 'lib/plivo/resources/numbers.rb', line 158
def delete
perform_delete
end
|
#to_s ⇒ Object
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
# File 'lib/plivo/resources/numbers.rb', line 162
def to_s
{
api_id: @api_id,
added_on: @added_on,
alias: @alias,
application: @application,
carrier: @carrier,
monthly_rental_rate: @monthly_rental_rate,
number: @number,
number_type: @number_type,
region: @region,
resource_uri: @resource_uri,
sms_enabled: @sms_enabled,
sms_rate: @sms_rate,
sub_account: @sub_account,
voice_enabled: @voice_enabled,
voice_rate: @voice_rate
}.to_s
end
|
#update(options = nil) ⇒ Object
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
# File 'lib/plivo/resources/numbers.rb', line 131
def update(options = nil)
valid_param?(:options, options, Hash, true)
params = {}
if options.key?(:subaccount) &&
valid_subaccount?(options[:subaccount], true)
params[:subaccount] = options[:subaccount]
end
%i[alias app_id].each do |param|
if options.key?(param) &&
valid_param?(param, options[param], [String, Symbol], true)
params[param] = options[param]
end
end
%i[verification_info].each do |param|
if options.key?(param) &&
valid_param?(param, options[param], Hash, true)
params[param] = options[param]
end
end
perform_update(params)
end
|