Class: Twilio::REST::Numbers::V2::CallerIdInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Numbers::V2::CallerIdInstance
- Defined in:
- lib/twilio-ruby/rest/numbers/v2/caller_id.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The Account SID that owns this Caller ID.
-
#context ⇒ CallerIdContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this resource was created.
-
#date_updated ⇒ Time
The date this resource was last updated.
-
#delete ⇒ Boolean
Delete the CallerIdInstance.
-
#friendly_name ⇒ String
A human-readable name for this caller ID.
-
#initialize(version, payload, caller_id_sid: nil) ⇒ CallerIdInstance
constructor
Initialize the CallerIdInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#phone_number ⇒ String
The phone number in E.164 format.
-
#sid ⇒ String
The unique SID of this Caller ID resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update ⇒ CallerIdInstance
Update the CallerIdInstance.
Constructor Details
#initialize(version, payload, caller_id_sid: nil) ⇒ CallerIdInstance
Initialize the CallerIdInstance
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 415 def initialize(version, payload , caller_id_sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'phone_number' => payload['phone_number'], 'friendly_name' => payload['friendly_name'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = { 'caller_id_sid' => caller_id_sid || @properties['caller_id_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The Account SID that owns this Caller ID.
453 454 455 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 453 def account_sid @properties['account_sid'] end |
#context ⇒ CallerIdContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
438 439 440 441 442 443 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 438 def context unless @instance_context @instance_context = CallerIdContext.new(@version , @params['caller_id_sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date this resource was created.
471 472 473 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 471 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this resource was last updated.
477 478 479 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 477 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the CallerIdInstance
484 485 486 487 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 484 def delete context.delete end |
#friendly_name ⇒ String
Returns A human-readable name for this caller ID.
465 466 467 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 465 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
506 507 508 509 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 506 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Numbers.V2.CallerIdInstance #{values}>" end |
#phone_number ⇒ String
Returns The phone number in E.164 format.
459 460 461 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 459 def phone_number @properties['phone_number'] end |
#sid ⇒ String
Returns The unique SID of this Caller ID resource.
447 448 449 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 447 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
499 500 501 502 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 499 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Numbers.V2.CallerIdInstance #{values}>" end |
#update ⇒ CallerIdInstance
Update the CallerIdInstance
492 493 494 495 |
# File 'lib/twilio-ruby/rest/numbers/v2/caller_id.rb', line 492 def update context.update end |