Class: Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb,
lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb,
lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb
Defined Under Namespace
Classes: AssignedAddOnContext, AssignedAddOnInstance, AssignedAddOnList, AssignedAddOnPage
Instance Method Summary collapse
-
#assigned_add_ons(sid = :unset) ⇒ AssignedAddOnList, AssignedAddOnContext
Access the assigned_add_ons.
-
#delete ⇒ Boolean
Delete the IncomingPhoneNumberInstance.
-
#fetch ⇒ IncomingPhoneNumberInstance
Fetch the IncomingPhoneNumberInstance.
-
#initialize(version, account_sid, sid) ⇒ IncomingPhoneNumberContext
constructor
Initialize the IncomingPhoneNumberContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(account_sid: :unset, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset, address_sid: :unset, bundle_sid: :unset) ⇒ IncomingPhoneNumberInstance
Update the IncomingPhoneNumberInstance.
Constructor Details
#initialize(version, account_sid, sid) ⇒ IncomingPhoneNumberContext
Initialize the IncomingPhoneNumberContext
282 283 284 285 286 287 288 289 290 291 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 282 def initialize(version, account_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/IncomingPhoneNumbers/#{@solution[:sid]}.json" # Dependents @assigned_add_ons = nil end |
Instance Method Details
#assigned_add_ons(sid = :unset) ⇒ AssignedAddOnList, AssignedAddOnContext
Access the assigned_add_ons
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 421 def assigned_add_ons(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return AssignedAddOnContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @assigned_add_ons @assigned_add_ons = AssignedAddOnList.new( @version, account_sid: @solution[:account_sid], resource_sid: @solution[:sid], ) end @assigned_add_ons end |
#delete ⇒ Boolean
Delete the IncomingPhoneNumberInstance
295 296 297 298 299 300 301 302 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 295 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ IncomingPhoneNumberInstance
Fetch the IncomingPhoneNumberInstance
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 307 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) IncomingPhoneNumberInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
446 447 448 449 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 446 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.IncomingPhoneNumberContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
439 440 441 442 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 439 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.IncomingPhoneNumberContext #{context}>" end |
#update(account_sid: :unset, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset, address_sid: :unset, bundle_sid: :unset) ⇒ IncomingPhoneNumberInstance
Update the IncomingPhoneNumberInstance
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 350 def update( account_sid: :unset, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset, address_sid: :unset, bundle_sid: :unset ) data = Twilio::Values.of({ 'AccountSid' => account_sid, 'ApiVersion' => api_version, 'FriendlyName' => friendly_name, 'SmsApplicationSid' => sms_application_sid, 'SmsFallbackMethod' => sms_fallback_method, 'SmsFallbackUrl' => sms_fallback_url, 'SmsMethod' => sms_method, 'SmsUrl' => sms_url, 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, 'VoiceApplicationSid' => voice_application_sid, 'VoiceCallerIdLookup' => voice_caller_id_lookup, 'VoiceFallbackMethod' => voice_fallback_method, 'VoiceFallbackUrl' => voice_fallback_url, 'VoiceMethod' => voice_method, 'VoiceUrl' => voice_url, 'EmergencyStatus' => emergency_status, 'EmergencyAddressSid' => emergency_address_sid, 'TrunkSid' => trunk_sid, 'VoiceReceiveMode' => voice_receive_mode, 'IdentitySid' => identity_sid, 'AddressSid' => address_sid, 'BundleSid' => bundle_sid, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) IncomingPhoneNumberInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |