Class: Twilio::REST::Insights::V1::CallContext::CallSummaryInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/insights/v1/call/call_summary.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, call_sid: nil) ⇒ CallSummaryInstance

Initialize the CallSummaryInstance

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 CallSummary resource.

  • sid (String)

    The SID of the Call resource to fetch.



280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 280

def initialize(version, payload , call_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'call_sid' => payload['call_sid'],
        'call_type' => payload['call_type'],
        'call_state' => payload['call_state'],
        'answered_by' => payload['answered_by'],
        'processing_state' => payload['processing_state'],
        'created_time' => Twilio.deserialize_iso8601_datetime(payload['created_time']),
        'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']),
        'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
        'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
        'connect_duration' => payload['connect_duration'] == nil ? payload['connect_duration'] : payload['connect_duration'].to_i,
        'from' => payload['from'],
        'to' => payload['to'],
        'carrier_edge' => payload['carrier_edge'],
        'client_edge' => payload['client_edge'],
        'sdk_edge' => payload['sdk_edge'],
        'sip_edge' => payload['sip_edge'],
        'tags' => payload['tags'],
        'url' => payload['url'],
        'attributes' => payload['attributes'],
        'properties' => payload['properties'],
        'trust' => payload['trust'],
        'annotation' => payload['annotation'],
        'agent_session_summaries' => payload['agent_session_summaries'],
    }

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

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



330
331
332
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 330

def 
    @properties['account_sid']
end

#agent_session_summariesArray<CallSummaryAgentSessionSummary>

Returns object List of session summaries for conversation relay. See Details: Call Summary for the object properties.

Returns:

  • (Array<CallSummaryAgentSessionSummary>)

    object List of session summaries for conversation relay. See Details: Call Summary for the object properties.



468
469
470
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 468

def agent_session_summaries
    @properties['agent_session_summaries']
end

#annotationHash

Returns object Programmatically labeled annotations for the Call. Developers can update the Call Summary records with Annotation during or after a Call. Annotations can be updated as long as the Call Summary record is addressable via the API. See Details: Call Summary for the object properties.

Returns:

  • (Hash)

    object Programmatically labeled annotations for the Call. Developers can update the Call Summary records with Annotation during or after a Call. Annotations can be updated as long as the Call Summary record is addressable via the API. See Details: Call Summary for the object properties.



462
463
464
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 462

def annotation
    @properties['annotation']
end

#answered_byAnsweredBy

Returns:

  • (AnsweredBy)


354
355
356
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 354

def answered_by
    @properties['answered_by']
end

#attributesHash

Returns object Attributes capturing call-flow-specific details. See Details: Call Summary for the object properties.

Returns:

  • (Hash)

    object Attributes capturing call-flow-specific details. See Details: Call Summary for the object properties.



444
445
446
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 444

def attributes
    @properties['attributes']
end

#call_sidString

Returns The unique SID identifier of the Call.

Returns:

  • (String)

    The unique SID identifier of the Call.



336
337
338
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 336

def call_sid
    @properties['call_sid']
end

#call_stateCallState

Returns:

  • (CallState)


348
349
350
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 348

def call_state
    @properties['call_state']
end

#call_typeCallType

Returns:

  • (CallType)


342
343
344
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 342

def call_type
    @properties['call_type']
end

#carrier_edgeHash

Returns object Contains metrics and properties for the Twilio media gateway of a PSTN call. See Details: Call Summary for the object properties.

Returns:

  • (Hash)

    object Contains metrics and properties for the Twilio media gateway of a PSTN call. See Details: Call Summary for the object properties.



408
409
410
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 408

def carrier_edge
    @properties['carrier_edge']
end

#client_edgeHash

Returns object Contains metrics and properties for the Twilio media gateway of a Client call. See Details: Call Summary for the object properties.

Returns:

  • (Hash)

    object Contains metrics and properties for the Twilio media gateway of a Client call. See Details: Call Summary for the object properties.



414
415
416
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 414

def client_edge
    @properties['client_edge']
end

#connect_durationString

Returns Duration between when the call was answered and when it ended.

Returns:

  • (String)

    Duration between when the call was answered and when it ended



390
391
392
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 390

def connect_duration
    @properties['connect_duration']
end

#contextCallSummaryContext

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

Returns:



321
322
323
324
325
326
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 321

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

#created_timeTime

Returns The time at which the Call was created, given in ISO 8601 format. Can be different from start_time in the event of queueing due to CPS.

Returns:

  • (Time)

    The time at which the Call was created, given in ISO 8601 format. Can be different from start_time in the event of queueing due to CPS



366
367
368
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 366

def created_time
    @properties['created_time']
end

#durationString

Returns Duration between when the call was initiated and the call was ended.

Returns:

  • (String)

    Duration between when the call was initiated and the call was ended



384
385
386
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 384

def duration
    @properties['duration']
end

#end_timeTime

Returns The time at which the Call was ended, given in ISO 8601 format.

Returns:

  • (Time)

    The time at which the Call was ended, given in ISO 8601 format.



378
379
380
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 378

def end_time
    @properties['end_time']
end

#fetch(processing_state: :unset) ⇒ CallSummaryInstance

Fetch the CallSummaryInstance

Parameters:

  • processing_state (ProcessingState) (defaults to: :unset)

    The Processing State of this Call Summary. One of complete, partial or all.

Returns:



476
477
478
479
480
481
482
483
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 476

def fetch(
  processing_state: :unset
)

    context.fetch(
        processing_state: processing_state, 
    )
end

#fromHash

Returns object The calling party. See Details: Call Summary for the object properties.

Returns:



396
397
398
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 396

def from
    @properties['from']
end

#inspectObject

Provide a detailed, user friendly representation



494
495
496
497
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 494

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

#processing_stateProcessingState

Returns:

  • (ProcessingState)


360
361
362
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 360

def processing_state
    @properties['processing_state']
end

#propertiesHash

Returns object Contains edge-agnostic call-level details. See Details: Call Summary for the object properties.

Returns:

  • (Hash)

    object Contains edge-agnostic call-level details. See Details: Call Summary for the object properties.



450
451
452
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 450

def properties
    @properties['properties']
end

#sdk_edgeHash

Returns object Contains metrics and properties for the SDK sensor library for Client calls. See Details: Call Summary for the object properties.

Returns:

  • (Hash)

    object Contains metrics and properties for the SDK sensor library for Client calls. See Details: Call Summary for the object properties.



420
421
422
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 420

def sdk_edge
    @properties['sdk_edge']
end

#sip_edgeHash

Returns object Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. See Details: Call Summary for the object properties.

Returns:

  • (Hash)

    object Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. See Details: Call Summary for the object properties.



426
427
428
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 426

def sip_edge
    @properties['sip_edge']
end

#start_timeTime

Returns The time at which the Call was started, given in ISO 8601 format.

Returns:

  • (Time)

    The time at which the Call was started, given in ISO 8601 format.



372
373
374
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 372

def start_time
    @properties['start_time']
end

#tagsArray<String>

Returns Tags applied to calls by Voice Insights analysis indicating a condition that could result in subjective degradation of the call quality.

Returns:

  • (Array<String>)

    Tags applied to calls by Voice Insights analysis indicating a condition that could result in subjective degradation of the call quality.



432
433
434
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 432

def tags
    @properties['tags']
end

#toHash

Returns object The called party. See Details: Call Summary for the object properties.

Returns:



402
403
404
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 402

def to
    @properties['to']
end

#to_sObject

Provide a user friendly representation



487
488
489
490
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 487

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

#trustHash

Returns object Contains trusted communications details including Branded Call and verified caller ID. See Details: Call Summary for the object properties.

Returns:

  • (Hash)

    object Contains trusted communications details including Branded Call and verified caller ID. See Details: Call Summary for the object properties.



456
457
458
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 456

def trust
    @properties['trust']
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



438
439
440
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 438

def url
    @properties['url']
end