Class: Twilio::REST::Routes::V3::PhoneNumberInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Routes::V3::PhoneNumberInstance
- Defined in:
- lib/twilio-ruby/rest/routes/v3/phone_number.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account.
-
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this phone number was assigned an Inbound Processing Region, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that the Inbound Processing Region was updated for this phone number, given in ISO 8601 format.
-
#fetch ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance.
-
#friendly_name ⇒ String
A human readable description of the Inbound Processing Region assignments for this phone number, up to 64 characters.
-
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
constructor
Initialize the PhoneNumberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#messaging_region ⇒ String
The Inbound Processing Region used for this phone number for messaging.
-
#phone_number ⇒ String
The phone number in E.164 format.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(voice_region: :unset, messaging_region: :unset, friendly_name: :unset) ⇒ PhoneNumberInstance
Update the PhoneNumberInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#voice_region ⇒ String
The Inbound Processing Region used for this phone number for voice.
Constructor Details
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
Initialize the PhoneNumberInstance
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 339 def initialize(version, payload , phone_number: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'phone_number' => payload['phone_number'], 'url' => payload['url'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'voice_region' => payload['voice_region'], 'messaging_region' => payload['messaging_region'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = { 'phone_number' => phone_number || @properties['phone_number'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account.
386 387 388 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 386 def account_sid @properties['account_sid'] end |
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
365 366 367 368 369 370 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 365 def context unless @instance_context @instance_context = PhoneNumberContext.new(@version , @params['phone_number']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this phone number was assigned an Inbound Processing Region, given in ISO 8601 format.
410 411 412 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 410 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that the Inbound Processing Region was updated for this phone number, given in ISO 8601 format.
416 417 418 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 416 def date_updated @properties['date_updated'] end |
#fetch ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance
423 424 425 426 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 423 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human readable description of the Inbound Processing Region assignments for this phone number, up to 64 characters.
392 393 394 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 392 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
456 457 458 459 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 456 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Routes.V3.PhoneNumberInstance #{values}>" end |
#messaging_region ⇒ String
Returns The Inbound Processing Region used for this phone number for messaging.
404 405 406 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 404 def messaging_region @properties['messaging_region'] end |
#phone_number ⇒ String
Returns The phone number in E.164 format.
374 375 376 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 374 def phone_number @properties['phone_number'] end |
#to_s ⇒ Object
Provide a user friendly representation
449 450 451 452 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 449 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Routes.V3.PhoneNumberInstance #{values}>" end |
#update(voice_region: :unset, messaging_region: :unset, friendly_name: :unset) ⇒ PhoneNumberInstance
Update the PhoneNumberInstance
434 435 436 437 438 439 440 441 442 443 444 445 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 434 def update( voice_region: :unset, messaging_region: :unset, friendly_name: :unset ) context.update( voice_region: voice_region, messaging_region: messaging_region, friendly_name: friendly_name, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
380 381 382 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 380 def url @properties['url'] end |
#voice_region ⇒ String
Returns The Inbound Processing Region used for this phone number for voice.
398 399 400 |
# File 'lib/twilio-ruby/rest/routes/v3/phone_number.rb', line 398 def voice_region @properties['voice_region'] end |