Class: Twilio::REST::Insights::V2::ReportInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Insights::V2::ReportInstance
- Defined in:
- lib/twilio-ruby/rest/insights/v2/report.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account.
-
#answer_rate_device_type ⇒ Hash<String, Float>
Answer rate for each device type.
- #answering_machine_detection ⇒ InsightsV2OutboundPhoneNumberReportAnsweringMachineDetection
-
#blocked_calls_by_carrier ⇒ Array<CountyCarrierValue>
Percentage of blocked calls by carrier per country.
-
#call_answer_score ⇒ Float
The call answer score measures customers behavior to the delivered calls.
- #call_state_percentage ⇒ InsightsV2InboundPhoneNumberReportCallStatePercentage
-
#calls_by_device_type ⇒ Hash<String, Integer>
Number of calls made with each device type.
-
#context ⇒ ReportContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#create(insights_v2_create_account_report_request: :unset) ⇒ ReportInstance
Create the ReportInstance.
-
#fetch ⇒ ReportInstance
Fetch the ReportInstance.
-
#handle ⇒ String
Inbound phone number handle represented in the report.
-
#initialize(version, payload, report_id: nil) ⇒ ReportInstance
constructor
Initialize the ReportInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#long_duration_calls_percentage ⇒ Float
Percentage of long duration calls ( >= 60 seconds).
-
#potential_robocalls_percentage ⇒ Float
Percentage of completed outbound calls to unassigned or unallocated phone numbers.
- #report ⇒ AccountReport
-
#report_id ⇒ String
The report identifier as Voice Insights Report TTID.
- #request_meta ⇒ ReportMetadata
-
#short_duration_calls_percentage ⇒ Float
Percentage of completed outbound calls under 10 seconds (PSTN Short call tags); More than 15% is typically low trust measured.
-
#silent_calls_percentage ⇒ Float
Percentage of inbound calls with silence tags over total outbound calls.
- #status ⇒ ReportStatus
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#total_calls ⇒ String
Total number of calls made with the given handle during the report period.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, report_id: nil) ⇒ ReportInstance
Initialize the ReportInstance
753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 753 def initialize(version, payload , report_id: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'report_id' => payload['report_id'], 'status' => payload['status'], 'request_meta' => payload['request_meta'], 'url' => payload['url'], 'handle' => payload['handle'], 'total_calls' => payload['total_calls'] == nil ? payload['total_calls'] : payload['total_calls'].to_i, 'call_answer_score' => payload['call_answer_score'], 'call_state_percentage' => payload['call_state_percentage'], 'silent_calls_percentage' => payload['silent_calls_percentage'], 'calls_by_device_type' => payload['calls_by_device_type'], 'answer_rate_device_type' => payload['answer_rate_device_type'], 'blocked_calls_by_carrier' => payload['blocked_calls_by_carrier'], 'short_duration_calls_percentage' => payload['short_duration_calls_percentage'], 'long_duration_calls_percentage' => payload['long_duration_calls_percentage'], 'potential_robocalls_percentage' => payload['potential_robocalls_percentage'], 'answering_machine_detection' => payload['answering_machine_detection'], 'report' => payload['report'], } # Context @instance_context = nil @params = { 'report_id' => report_id || @properties['report_id'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account.
797 798 799 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 797 def account_sid @properties['account_sid'] end |
#answer_rate_device_type ⇒ Hash<String, Float>
Returns Answer rate for each device type. voip, mobile, landline, unknown.
863 864 865 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 863 def answer_rate_device_type @properties['answer_rate_device_type'] end |
#answering_machine_detection ⇒ InsightsV2OutboundPhoneNumberReportAnsweringMachineDetection
893 894 895 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 893 def answering_machine_detection @properties['answering_machine_detection'] end |
#blocked_calls_by_carrier ⇒ Array<CountyCarrierValue>
Returns Percentage of blocked calls by carrier per country.
869 870 871 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 869 def blocked_calls_by_carrier @properties['blocked_calls_by_carrier'] end |
#call_answer_score ⇒ Float
Returns The call answer score measures customers behavior to the delivered calls. The score is a value between 0 and 100, where 100 indicates that all calls were successfully answered.
839 840 841 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 839 def call_answer_score @properties['call_answer_score'] end |
#call_state_percentage ⇒ InsightsV2InboundPhoneNumberReportCallStatePercentage
845 846 847 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 845 def call_state_percentage @properties['call_state_percentage'] end |
#calls_by_device_type ⇒ Hash<String, Integer>
Returns Number of calls made with each device type. voip, mobile, landline, unknown.
857 858 859 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 857 def calls_by_device_type @properties['calls_by_device_type'] end |
#context ⇒ ReportContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
788 789 790 791 792 793 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 788 def context unless @instance_context @instance_context = ReportContext.new(@version , @params['report_id']) end @instance_context end |
#create(insights_v2_create_account_report_request: :unset) ⇒ ReportInstance
Create the ReportInstance
907 908 909 910 911 912 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 907 def create(insights_v2_create_account_report_request: :unset ) context.create( ) end |
#fetch ⇒ ReportInstance
Fetch the ReportInstance
917 918 919 920 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 917 def fetch context.fetch end |
#handle ⇒ String
Returns Inbound phone number handle represented in the report.
827 828 829 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 827 def handle @properties['handle'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
931 932 933 934 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 931 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V2.ReportInstance #{values}>" end |
#long_duration_calls_percentage ⇒ Float
Returns Percentage of long duration calls ( >= 60 seconds).
881 882 883 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 881 def long_duration_calls_percentage @properties['long_duration_calls_percentage'] end |
#potential_robocalls_percentage ⇒ Float
Returns Percentage of completed outbound calls to unassigned or unallocated phone numbers.
887 888 889 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 887 def potential_robocalls_percentage @properties['potential_robocalls_percentage'] end |
#report ⇒ AccountReport
899 900 901 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 899 def report @properties['report'] end |
#report_id ⇒ String
Returns The report identifier as Voice Insights Report TTID.
803 804 805 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 803 def report_id @properties['report_id'] end |
#request_meta ⇒ ReportMetadata
815 816 817 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 815 def @properties['request_meta'] end |
#short_duration_calls_percentage ⇒ Float
Returns Percentage of completed outbound calls under 10 seconds (PSTN Short call tags); More than 15% is typically low trust measured.
875 876 877 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 875 def short_duration_calls_percentage @properties['short_duration_calls_percentage'] end |
#silent_calls_percentage ⇒ Float
Returns Percentage of inbound calls with silence tags over total outbound calls. A silent tag is indicative of a connectivity issue or muted audio.
851 852 853 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 851 def silent_calls_percentage @properties['silent_calls_percentage'] end |
#status ⇒ ReportStatus
809 810 811 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 809 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
924 925 926 927 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 924 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V2.ReportInstance #{values}>" end |
#total_calls ⇒ String
Returns Total number of calls made with the given handle during the report period.
833 834 835 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 833 def total_calls @properties['total_calls'] end |
#url ⇒ String
Returns The URL of this resource.
821 822 823 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 821 def url @properties['url'] end |