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
Deletes the IncomingPhoneNumberInstance.
-
#fetch ⇒ IncomingPhoneNumberInstance
Fetch a IncomingPhoneNumberInstance.
-
#initialize(version, account_sid, sid) ⇒ IncomingPhoneNumberContext
constructor
Initialize the IncomingPhoneNumberContext.
-
#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) ⇒ IncomingPhoneNumberInstance
Update the IncomingPhoneNumberInstance.
Constructor Details
#initialize(version, account_sid, sid) ⇒ IncomingPhoneNumberContext
Initialize the IncomingPhoneNumberContext
324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 324 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
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 459 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
Deletes the IncomingPhoneNumberInstance
451 452 453 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 451 def delete @version.delete('delete', @uri) end |
#fetch ⇒ IncomingPhoneNumberInstance
Fetch a IncomingPhoneNumberInstance
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 431 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) IncomingPhoneNumberInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
484 485 486 487 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 484 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) ⇒ IncomingPhoneNumberInstance
Update the IncomingPhoneNumberInstance
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 416 417 418 419 420 421 422 423 424 425 426 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb', line 390 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) 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, }) payload = @version.update( 'POST', @uri, data: data, ) IncomingPhoneNumberInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |