Class: Plivo::Resources::Number
- Inherits:
-
Base::Resource
- Object
- Base::Resource
- Plivo::Resources::Number
- Defined in:
- lib/plivo/resources/numbers.rb
Constant Summary
Constants included from Utils
Instance Attribute Summary
Attributes inherited from Base::Resource
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(client, options = nil) ⇒ Number
constructor
A new instance of Number.
- #to_s ⇒ Object
- #update(options = nil) ⇒ Object
Methods included from Utils
GetSortedQueryParamString?, compute_signatureV3?, expected_type?, expected_value?, generate_url?, getMapFromQueryString?, is_one_among_string_url?, multi_valid_param?, raise_invalid_request, valid_account?, valid_date_format?, valid_mainaccount?, valid_multiple_destination_integers?, valid_multiple_destination_nos?, valid_param?, valid_range?, valid_signature?, valid_signatureV3?, valid_subaccount?, valid_url?
Constructor Details
#initialize(client, options = nil) ⇒ Number
Returns a new instance of Number.
132 133 134 135 136 |
# File 'lib/plivo/resources/numbers.rb', line 132 def initialize(client, = nil) @_name = 'Number' @_identifier_string = 'number' super end |
Instance Method Details
#delete ⇒ Object
165 166 167 |
# File 'lib/plivo/resources/numbers.rb', line 165 def delete perform_delete end |
#to_s ⇒ Object
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/plivo/resources/numbers.rb', line 169 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, tendlc_campaign_id: @tendlc_campaign_id, tendlc_registration_status: @tendlc_registration_status, toll_free_sms_verification: @toll_free_sms_verification, renewal_date: @renewal_date, cnam_lookup: @cnam_lookup, toll_free_sms_verification_id: @toll_free_sms_verification_id, toll_free_sms_verification_order_status: @toll_free_sms_verification_order_status }.to_s end |
#update(options = nil) ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/plivo/resources/numbers.rb', line 138 def update( = nil) valid_param?(:options, , Hash, true) params = {} if .key?(:subaccount) && valid_subaccount?([:subaccount], true) params[:subaccount] = [:subaccount] end %i[alias app_id cnam_lookup].each do |param| if .key?(param) && valid_param?(param, [param], [String, Symbol], true) params[param] = [param] end end %i[verification_info].each do |param| if .key?(param) && valid_param?(param, [param], Hash, true) params[param] = [param] end end perform_update(params) end |