Class: Twilio::REST::Insights::V2::InboundInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/insights/v2/inbound.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, report_id: nil) ⇒ InboundInstance

Initialize the InboundInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Inbound resource.

  • sid (String)

    The SID of the Call resource to fetch.



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 447

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'],
    }

    # Context
    @instance_context = nil
    @params = { 'report_id' => report_id  || @properties['report_id']  , }
end

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



483
484
485
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 483

def 
    @properties['account_sid']
end

#call_answer_scoreFloat

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.

Returns:

  • (Float)

    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.



525
526
527
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 525

def call_answer_score
    @properties['call_answer_score']
end

#call_state_percentageInsightsV2InboundPhoneNumberReportCallStatePercentage

Returns:

  • (InsightsV2InboundPhoneNumberReportCallStatePercentage)


531
532
533
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 531

def call_state_percentage
    @properties['call_state_percentage']
end

#contextInboundContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



474
475
476
477
478
479
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 474

def context
    unless @instance_context
        @instance_context = InboundContext.new(@version , @params['report_id'])
    end
    @instance_context
end

#create(insights_v2_create_phone_numbers_report_request: :unset) ⇒ InboundInstance

Create the InboundInstance

Parameters:

  • insights_v2_create_phone_numbers_report_request (InsightsV2CreatePhoneNumbersReportRequest) (defaults to: :unset)

Returns:



545
546
547
548
549
550
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 545

def create(insights_v2_create_phone_numbers_report_request: :unset
)

    context.create(
    )
end

#handleString

Returns Inbound phone number handle represented in the report.

Returns:

  • (String)

    Inbound phone number handle represented in the report.



513
514
515
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 513

def handle
    @properties['handle']
end

#inspectObject

Provide a detailed, user friendly representation



561
562
563
564
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 561

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Insights.V2.InboundInstance #{values}>"
end

#report_idString

Returns The report identifier as Voice Insights Report TTID.

Returns:

  • (String)

    The report identifier as Voice Insights Report TTID.



489
490
491
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 489

def report_id
    @properties['report_id']
end

#request_metaReportMetadata

Returns:

  • (ReportMetadata)


501
502
503
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 501

def request_meta
    @properties['request_meta']
end

#silent_calls_percentageFloat

Returns Percentage of inbound calls with silence tags over total outbound calls. A silent tag is indicative of a connectivity issue or muted audio.

Returns:

  • (Float)

    Percentage of inbound calls with silence tags over total outbound calls. A silent tag is indicative of a connectivity issue or muted audio.



537
538
539
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 537

def silent_calls_percentage
    @properties['silent_calls_percentage']
end

#statusReportStatus

Returns:

  • (ReportStatus)


495
496
497
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 495

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



554
555
556
557
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 554

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Insights.V2.InboundInstance #{values}>"
end

#total_callsString

Returns Total number of calls made with the given handle during the report period.

Returns:

  • (String)

    Total number of calls made with the given handle during the report period.



519
520
521
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 519

def total_calls
    @properties['total_calls']
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



507
508
509
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 507

def url
    @properties['url']
end