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 SID of the Account that created this resource.
-
#annotation ⇒ String
The annotation provided for the call.
-
#answered_by ⇒ String
Either ‘human` or `machine` if this call was initiated with answering machine detection.
-
#api_version ⇒ String
The API Version used to create the call.
-
#caller_name ⇒ String
The caller’s name if this call was an incoming call to a phone number with caller ID Lookup enabled.
-
#context ⇒ CallContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT that this resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT that this resource was last updated.
-
#delete ⇒ Boolean
Delete the CallInstance.
-
#direction ⇒ String
A string describing the direction of the call.
-
#duration ⇒ String
The length of the call in seconds.
-
#end_time ⇒ Time
The end time of the call.
-
#events ⇒ events
Access the events.
-
#feedback ⇒ feedback
Access the feedback.
-
#fetch ⇒ CallInstance
Fetch the CallInstance.
-
#forwarded_from ⇒ String
The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding).
-
#from ⇒ String
The phone number, SIP address or Client identifier that made this call.
-
#from_formatted ⇒ String
The calling phone number, SIP address, or Client identifier formatted for display.
-
#group_sid ⇒ String
The 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
The SID that identifies the call that created this leg.
-
#payments ⇒ payments
Access the payments.
-
#phone_number_sid ⇒ String
If the call was inbound, this is the SID of the IncomingPhoneNumber resource 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.
-
#queue_time ⇒ String
The wait time in milliseconds before the call is placed.
-
#recordings ⇒ recordings
Access the recordings.
-
#sid ⇒ String
The unique string that identifies this resource.
-
#start_time ⇒ Time
The start time of the call.
-
#status ⇒ call.Status
The status of this call.
-
#subresource_uris ⇒ String
A list of related subresources identified by their relative URIs.
-
#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.
-
#trunk_sid ⇒ String
The (optional) unique identifier of the trunk resource that was used for this call.
-
#update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset) ⇒ CallInstance
Update the CallInstance.
-
#uri ⇒ String
The URI of this resource, relative to ‘api.twilio.com`.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ CallInstance
Initialize the CallInstance
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 623 def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'parent_call_sid' => payload['parent_call_sid'], 'account_sid' => payload['account_sid'], 'to' => payload['to'], 'to_formatted' => payload['to_formatted'], 'from' => payload['from'], 'from_formatted' => payload['from_formatted'], 'phone_number_sid' => payload['phone_number_sid'], 'status' => payload['status'], 'start_time' => Twilio.deserialize_rfc2822(payload['start_time']), 'end_time' => Twilio.deserialize_rfc2822(payload['end_time']), 'duration' => payload['duration'], 'price' => payload['price'], 'price_unit' => payload['price_unit'], 'direction' => payload['direction'], 'answered_by' => payload['answered_by'], 'annotation' => payload['annotation'], 'api_version' => payload['api_version'], 'forwarded_from' => payload['forwarded_from'], 'group_sid' => payload['group_sid'], 'caller_name' => payload['caller_name'], 'queue_time' => payload['queue_time'], 'trunk_sid' => payload['trunk_sid'], 'uri' => payload['uri'], 'subresource_uris' => payload['subresource_uris'], } # Context @instance_context = nil @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
699 700 701 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 699 def account_sid @properties['account_sid'] end |
#annotation ⇒ String
783 784 785 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 783 def annotation @properties['annotation'] end |
#answered_by ⇒ String
777 778 779 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 777 def answered_by @properties['answered_by'] end |
#api_version ⇒ String
789 790 791 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 789 def api_version @properties['api_version'] end |
#caller_name ⇒ String
807 808 809 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 807 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
666 667 668 669 670 671 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 666 def context unless @instance_context @instance_context = CallContext.new(@version, @params['account_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
681 682 683 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 681 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
687 688 689 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 687 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the CallInstance
838 839 840 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 838 def delete context.delete end |
#direction ⇒ String
771 772 773 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 771 def direction @properties['direction'] end |
#duration ⇒ String
753 754 755 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 753 def duration @properties['duration'] end |
#end_time ⇒ Time
747 748 749 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 747 def end_time @properties['end_time'] end |
#events ⇒ events
Access the events
918 919 920 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 918 def events context.events end |
#feedback ⇒ feedback
Access the feedback
911 912 913 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 911 def feedback context.feedback end |
#fetch ⇒ CallInstance
Fetch the CallInstance
845 846 847 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 845 def fetch context.fetch end |
#forwarded_from ⇒ String
795 796 797 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 795 def forwarded_from @properties['forwarded_from'] end |
#from ⇒ String
717 718 719 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 717 def from @properties['from'] end |
#from_formatted ⇒ String
723 724 725 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 723 def from_formatted @properties['from_formatted'] end |
#group_sid ⇒ String
801 802 803 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 801 def group_sid @properties['group_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
938 939 940 941 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 938 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.CallInstance #{values}>" end |
#notifications ⇒ notifications
Access the notifications
904 905 906 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 904 def notifications context.notifications end |
#parent_call_sid ⇒ String
693 694 695 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 693 def parent_call_sid @properties['parent_call_sid'] end |
#payments ⇒ payments
Access the payments
925 926 927 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 925 def payments context.payments end |
#phone_number_sid ⇒ String
729 730 731 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 729 def phone_number_sid @properties['phone_number_sid'] end |
#price ⇒ String
759 760 761 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 759 def price @properties['price'] end |
#price_unit ⇒ String
765 766 767 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 765 def price_unit @properties['price_unit'] end |
#queue_time ⇒ String
813 814 815 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 813 def queue_time @properties['queue_time'] end |
#recordings ⇒ recordings
Access the recordings
897 898 899 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 897 def recordings context.recordings end |
#sid ⇒ String
675 676 677 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 675 def sid @properties['sid'] end |
#start_time ⇒ Time
741 742 743 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 741 def start_time @properties['start_time'] end |
#status ⇒ call.Status
735 736 737 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 735 def status @properties['status'] end |
#subresource_uris ⇒ String
831 832 833 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 831 def subresource_uris @properties['subresource_uris'] end |
#to ⇒ String
705 706 707 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 705 def to @properties['to'] end |
#to_formatted ⇒ String
711 712 713 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 711 def to_formatted @properties['to_formatted'] end |
#to_s ⇒ Object
Provide a user friendly representation
931 932 933 934 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 931 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.CallInstance #{values}>" end |
#trunk_sid ⇒ String
819 820 821 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 819 def trunk_sid @properties['trunk_sid'] end |
#update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset) ⇒ CallInstance
Update the CallInstance
881 882 883 884 885 886 887 888 889 890 891 892 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 881 def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :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, twiml: twiml, ) end |
#uri ⇒ String
825 826 827 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 825 def uri @properties['uri'] end |