Class: Twilio::REST::Api::V2010::AccountContext::CallInstance
- Inherits:
- 
      InstanceResource
      
        - Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::CallInstance
 
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/call.rb
Instance Method Summary collapse
- 
  
    
      #account_sid  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The unique id of the Account responsible for creating this Call. 
- 
  
    
      #annotation  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The annotation provided for the Call. 
- 
  
    
      #answered_by  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    If this call was initiated with answering machine detection, either ‘human` or `machine`. 
- 
  
    
      #api_version  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The API Version the Call was created through. 
- 
  
    
      #caller_name  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    If this call was an incoming call to a phone number with Caller ID Lookup enabled, the caller’s name. 
- 
  
    
      #context  ⇒ CallContext 
    
    
  
  
  
  
  
  
  
  
  
    Generate an instance context for the instance, the context is capable of performing various actions. 
- 
  
    
      #date_created  ⇒ Time 
    
    
  
  
  
  
  
  
  
  
  
    The date that this resource was created. 
- 
  
    
      #date_updated  ⇒ Time 
    
    
  
  
  
  
  
  
  
  
  
    The date that this resource was last updated. 
- 
  
    
      #delete  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    Deletes the CallInstance. 
- 
  
    
      #direction  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    A string describing the direction of the call. 
- 
  
    
      #duration  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The duration. 
- 
  
    
      #end_time  ⇒ Time 
    
    
  
  
  
  
  
  
  
  
  
    The end time of the Call. 
- 
  
    
      #feedback  ⇒ feedback 
    
    
  
  
  
  
  
  
  
  
  
    Access the feedback. 
- 
  
    
      #fetch  ⇒ CallInstance 
    
    
  
  
  
  
  
  
  
  
  
    Fetch a CallInstance. 
- 
  
    
      #forwarded_from  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    If this Call was an incoming call forwarded from another number, the forwarding phone number (depends on carrier supporting forwarding). 
- 
  
    
      #from  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The phone number, SIP address or Client identifier that made this Call. 
- 
  
    
      #from_formatted  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The phone number, SIP address or Client identifier that made this Call. 
- 
  
    
      #group_sid  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    A 34 character Group Sid associated with this Call. 
- 
  
    
      #initialize(version, payload, account_sid: nil, sid: nil)  ⇒ CallInstance 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    Initialize the CallInstance. 
- 
  
    
      #inspect  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Provide a detailed, user friendly representation. 
- 
  
    
      #notifications  ⇒ notifications 
    
    
  
  
  
  
  
  
  
  
  
    Access the notifications. 
- 
  
    
      #parent_call_sid  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    A 34 character string that uniquely identifies the Call that created this leg. 
- 
  
    
      #phone_number_sid  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    If the call was inbound, this is the Sid of the IncomingPhoneNumber that received the call. 
- 
  
    
      #price  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The charge for this call, in the currency associated with the account. 
- 
  
    
      #price_unit  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The currency in which ‘Price` is measured. 
- 
  
    
      #recordings  ⇒ recordings 
    
    
  
  
  
  
  
  
  
  
  
    Access the recordings. 
- 
  
    
      #sid  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    A 34 character string that uniquely identifies this resource. 
- 
  
    
      #start_time  ⇒ Time 
    
    
  
  
  
  
  
  
  
  
  
    The start time of the Call. 
- 
  
    
      #status  ⇒ call.Status 
    
    
  
  
  
  
  
  
  
  
  
    The status. 
- 
  
    
      #subresource_uris  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    Call Instance Subresources. 
- 
  
    
      #to  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The phone number, SIP address or Client identifier that received this Call. 
- 
  
    
      #to_formatted  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The phone number, SIP address or Client identifier that received this Call. 
- 
  
    
      #to_s  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Provide a user friendly representation. 
- 
  
    
      #update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset)  ⇒ CallInstance 
    
    
  
  
  
  
  
  
  
  
  
    Update the CallInstance. 
- 
  
    
      #uri  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    The URI for this resource, relative to ‘api.twilio.com`. 
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ CallInstance
Initialize the CallInstance
| 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 482 def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'annotation' => payload['annotation'], 'answered_by' => payload['answered_by'], 'api_version' => payload['api_version'], 'caller_name' => payload['caller_name'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'direction' => payload['direction'], 'duration' => payload['duration'], 'end_time' => Twilio.deserialize_rfc2822(payload['end_time']), 'forwarded_from' => payload['forwarded_from'], 'from' => payload['from'], 'from_formatted' => payload['from_formatted'], 'group_sid' => payload['group_sid'], 'parent_call_sid' => payload['parent_call_sid'], 'phone_number_sid' => payload['phone_number_sid'], 'price' => payload['price'].to_f, 'price_unit' => payload['price_unit'], 'sid' => payload['sid'], 'start_time' => Twilio.deserialize_rfc2822(payload['start_time']), 'status' => payload['status'], 'subresource_uris' => payload['subresource_uris'], 'to' => payload['to'], 'to_formatted' => payload['to_formatted'], 'uri' => payload['uri'], } # Context @instance_context = nil @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } end | 
Instance Method Details
#account_sid ⇒ String
Returns The unique id of the Account responsible for creating this Call.
| 532 533 534 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 532 def account_sid @properties['account_sid'] end | 
#annotation ⇒ String
Returns The annotation provided for the Call.
| 538 539 540 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 538 def annotation @properties['annotation'] end | 
#answered_by ⇒ String
Returns If this call was initiated with answering machine detection, either ‘human` or `machine`. Empty otherwise.
| 544 545 546 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 544 def answered_by @properties['answered_by'] end | 
#api_version ⇒ String
Returns The API Version the Call was created through.
| 550 551 552 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 550 def api_version @properties['api_version'] end | 
#caller_name ⇒ String
Returns If this call was an incoming call to a phone number with Caller ID Lookup enabled, the caller’s name. Empty otherwise.
| 556 557 558 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 556 def caller_name @properties['caller_name'] end | 
#context ⇒ CallContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
| 523 524 525 526 527 528 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 523 def context unless @instance_context @instance_context = CallContext.new(@version, @params['account_sid'], @params['sid'], ) end @instance_context end | 
#date_created ⇒ Time
Returns The date that this resource was created.
| 562 563 564 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 562 def date_created @properties['date_created'] end | 
#date_updated ⇒ Time
Returns The date that this resource was last updated.
| 568 569 570 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 568 def date_updated @properties['date_updated'] end | 
#delete ⇒ Boolean
Deletes the CallInstance
| 683 684 685 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 683 def delete context.delete end | 
#direction ⇒ String
Returns A string describing the direction of the call. ‘inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `Dial` verb.
| 574 575 576 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 574 def direction @properties['direction'] end | 
#duration ⇒ String
Returns The duration.
| 580 581 582 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 580 def duration @properties['duration'] end | 
#end_time ⇒ Time
Returns The end time of the Call. Null if the call did not complete successfully.
| 586 587 588 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 586 def end_time @properties['end_time'] end | 
#feedback ⇒ feedback
Access the feedback
| 742 743 744 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 742 def feedback context.feedback end | 
#fetch ⇒ CallInstance
Fetch a CallInstance
| 690 691 692 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 690 def fetch context.fetch end | 
#forwarded_from ⇒ String
Returns If this Call was an incoming call forwarded from another number, the forwarding phone number (depends on carrier supporting forwarding). Empty otherwise.
| 592 593 594 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 592 def forwarded_from @properties['forwarded_from'] end | 
#from ⇒ String
Returns The phone number, SIP address or Client identifier that made this Call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formatted as ‘[email protected]`. Client identifiers are formatted `client:name`.
| 598 599 600 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 598 def from @properties['from'] end | 
#from_formatted ⇒ String
Returns The phone number, SIP address or Client identifier that made this Call. Formatted for display.
| 604 605 606 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 604 def from_formatted @properties['from_formatted'] end | 
#group_sid ⇒ String
Returns A 34 character Group Sid associated with this Call. Empty if no Group is associated with the Call.
| 610 611 612 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 610 def group_sid @properties['group_sid'] end | 
#inspect ⇒ Object
Provide a detailed, user friendly representation
| 755 756 757 758 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 755 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.CallInstance #{values}>" end | 
#notifications ⇒ notifications
Access the notifications
| 735 736 737 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 735 def notifications context.notifications end | 
#parent_call_sid ⇒ String
Returns A 34 character string that uniquely identifies the Call that created this leg.
| 616 617 618 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 616 def parent_call_sid @properties['parent_call_sid'] end | 
#phone_number_sid ⇒ String
Returns If the call was inbound, this is the Sid of the IncomingPhoneNumber that received the call. If the call was outbound, it is the Sid of the OutgoingCallerId from which the call was placed.
| 622 623 624 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 622 def phone_number_sid @properties['phone_number_sid'] end | 
#price ⇒ String
Returns The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
| 628 629 630 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 628 def price @properties['price'] end | 
#price_unit ⇒ String
Returns The currency in which ‘Price` is measured.
| 634 635 636 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 634 def price_unit @properties['price_unit'] end | 
#recordings ⇒ recordings
Access the recordings
| 728 729 730 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 728 def recordings context.recordings end | 
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
| 640 641 642 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 640 def sid @properties['sid'] end | 
#start_time ⇒ Time
Returns The start time of the Call. Null if the call has not yet been dialed.
| 646 647 648 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 646 def start_time @properties['start_time'] end | 
#status ⇒ call.Status
Returns The status.
| 652 653 654 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 652 def status @properties['status'] end | 
#subresource_uris ⇒ String
Returns Call Instance Subresources.
| 658 659 660 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 658 def subresource_uris @properties['subresource_uris'] end | 
#to ⇒ String
Returns The phone number, SIP address or Client identifier that received this Call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formatted as ‘[email protected]`. Client identifiers are formatted `client:name`.
| 664 665 666 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 664 def to @properties['to'] end | 
#to_formatted ⇒ String
Returns The phone number, SIP address or Client identifier that received this Call. Formatted for display.
| 670 671 672 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 670 def to_formatted @properties['to_formatted'] end | 
#to_s ⇒ Object
Provide a user friendly representation
| 748 749 750 751 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 748 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.CallInstance #{values}>" end | 
#update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset) ⇒ CallInstance
Update the CallInstance
| 713 714 715 716 717 718 719 720 721 722 723 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 713 def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset) context.update( url: url, method: method, status: status, fallback_url: fallback_url, fallback_method: fallback_method, status_callback: status_callback, status_callback_method: status_callback_method, ) end | 
#uri ⇒ String
Returns The URI for this resource, relative to ‘api.twilio.com`.
| 676 677 678 | # File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 676 def uri @properties['uri'] end |