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.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 134

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

    # 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.



182
183
184
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 182

def 
    @properties['account_sid']
end

#annotationHash

Returns 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.

Returns:

  • (Hash)

    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.



314
315
316
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 314

def annotation
    @properties['annotation']
end

#answered_byAnsweredBy

Returns:

  • (AnsweredBy)


206
207
208
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 206

def answered_by
    @properties['answered_by']
end

#attributesHash

Returns Attributes capturing call-flow-specific details.

Returns:

  • (Hash)

    Attributes capturing call-flow-specific details.



296
297
298
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 296

def attributes
    @properties['attributes']
end

#call_sidString

Returns The unique SID identifier of the Call.

Returns:

  • (String)

    The unique SID identifier of the Call.



188
189
190
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 188

def call_sid
    @properties['call_sid']
end

#call_stateCallState

Returns:

  • (CallState)


200
201
202
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 200

def call_state
    @properties['call_state']
end

#call_typeCallType

Returns:

  • (CallType)


194
195
196
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 194

def call_type
    @properties['call_type']
end

#carrier_edgeHash

Returns Contains metrics and properties for the Twilio media gateway of a PSTN call.

Returns:

  • (Hash)

    Contains metrics and properties for the Twilio media gateway of a PSTN call.



260
261
262
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 260

def carrier_edge
    @properties['carrier_edge']
end

#client_edgeHash

Returns Contains metrics and properties for the Twilio media gateway of a Client call.

Returns:

  • (Hash)

    Contains metrics and properties for the Twilio media gateway of a Client call.



266
267
268
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 266

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



242
243
244
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 242

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:



173
174
175
176
177
178
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 173

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



218
219
220
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 218

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



236
237
238
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 236

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.



230
231
232
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 230

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:



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

def fetch(
    processing_state: :unset
)

    context.fetch(
        processing_state: processing_state, 
    )
end

#fromHash

Returns The calling party.

Returns:

  • (Hash)

    The calling party.



248
249
250
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 248

def from
    @properties['from']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#processing_stateProcessingState

Returns:

  • (ProcessingState)


212
213
214
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 212

def processing_state
    @properties['processing_state']
end

#propertiesHash

Returns Contains edge-agnostic call-level details.

Returns:

  • (Hash)

    Contains edge-agnostic call-level details.



302
303
304
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 302

def properties
    @properties['properties']
end

#sdk_edgeHash

Returns Contains metrics and properties for the SDK sensor library for Client calls.

Returns:

  • (Hash)

    Contains metrics and properties for the SDK sensor library for Client calls.



272
273
274
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 272

def sdk_edge
    @properties['sdk_edge']
end

#sip_edgeHash

Returns Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call.

Returns:

  • (Hash)

    Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call.



278
279
280
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 278

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.



224
225
226
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 224

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.



284
285
286
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 284

def tags
    @properties['tags']
end

#toHash

Returns The called party.

Returns:

  • (Hash)

    The called party.



254
255
256
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 254

def to
    @properties['to']
end

#to_sObject

Provide a user friendly representation



333
334
335
336
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 333

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

#trustHash

Returns Contains trusted communications details including Branded Call and verified caller ID.

Returns:

  • (Hash)

    Contains trusted communications details including Branded Call and verified caller ID.



308
309
310
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 308

def trust
    @properties['trust']
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



290
291
292
# File 'lib/twilio-ruby/rest/insights/v1/call/call_summary.rb', line 290

def url
    @properties['url']
end