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

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/insights/v1/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

  • call_sid (String) (defaults to: nil)

    The call_sid


111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/twilio-ruby/rest/insights/v1/call/summary.rb', line 111

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

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid


158
159
160
# File 'lib/twilio-ruby/rest/insights/v1/call/summary.rb', line 158

def 
  @properties['account_sid']
end

#annotationHash

Returns The annotation.

Returns:

  • (Hash)

    The annotation


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

def annotation
  @properties['annotation']
end

#attributesHash

Returns The attributes.

Returns:

  • (Hash)

    The attributes


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

def attributes
  @properties['attributes']
end

#call_sidString

Returns The call_sid.

Returns:

  • (String)

    The call_sid


164
165
166
# File 'lib/twilio-ruby/rest/insights/v1/call/summary.rb', line 164

def call_sid
  @properties['call_sid']
end

#call_statecall_summary.CallState

Returns The call_state.

Returns:

  • (call_summary.CallState)

    The call_state


176
177
178
# File 'lib/twilio-ruby/rest/insights/v1/call/summary.rb', line 176

def call_state
  @properties['call_state']
end

#call_typecall_summary.CallType

Returns The call_type.

Returns:

  • (call_summary.CallType)

    The call_type


170
171
172
# File 'lib/twilio-ruby/rest/insights/v1/call/summary.rb', line 170

def call_type
  @properties['call_type']
end

#carrier_edgeHash

Returns The carrier_edge.

Returns:

  • (Hash)

    The carrier_edge


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

def carrier_edge
  @properties['carrier_edge']
end

#client_edgeHash

Returns The client_edge.

Returns:

  • (Hash)

    The client_edge


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

def client_edge
  @properties['client_edge']
end

#connect_durationString

Returns The connect_duration.

Returns:

  • (String)

    The connect_duration


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

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:


149
150
151
152
153
154
# File 'lib/twilio-ruby/rest/insights/v1/call/summary.rb', line 149

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

#created_timeTime

Returns The created_time.

Returns:

  • (Time)

    The created_time


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

def created_time
  @properties['created_time']
end

#durationString

Returns The duration.

Returns:

  • (String)

    The duration


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

def duration
  @properties['duration']
end

#end_timeTime

Returns The end_time.

Returns:

  • (Time)

    The end_time


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

def end_time
  @properties['end_time']
end

#fetch(processing_state: :unset) ⇒ CallSummaryInstance

Fetch the CallSummaryInstance

Parameters:

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

    The processing_state

Returns:


292
293
294
# File 'lib/twilio-ruby/rest/insights/v1/call/summary.rb', line 292

def fetch(processing_state: :unset)
  context.fetch(processing_state: processing_state, )
end

#fromHash

Returns The from.

Returns:

  • (Hash)

    The from


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

def from
  @properties['from']
end

#inspectObject

Provide a detailed, user friendly representation


305
306
307
308
# File 'lib/twilio-ruby/rest/insights/v1/call/summary.rb', line 305

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

#processing_statecall_summary.ProcessingState

Returns The processing_state.

Returns:

  • (call_summary.ProcessingState)

    The processing_state


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

def processing_state
  @properties['processing_state']
end

#propertiesHash

Returns The properties.

Returns:

  • (Hash)

    The properties


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

def properties
  @properties['properties']
end

#sdk_edgeHash

Returns The sdk_edge.

Returns:

  • (Hash)

    The sdk_edge


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

def sdk_edge
  @properties['sdk_edge']
end

#sip_edgeHash

Returns The sip_edge.

Returns:

  • (Hash)

    The sip_edge


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

def sip_edge
  @properties['sip_edge']
end

#start_timeTime

Returns The start_time.

Returns:

  • (Time)

    The start_time


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

def start_time
  @properties['start_time']
end

#tagsArray[String]

Returns The tags.

Returns:

  • (Array[String])

    The tags


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

def tags
  @properties['tags']
end

#toHash

Returns The to.

Returns:

  • (Hash)

    The to


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

def to
  @properties['to']
end

#to_sObject

Provide a user friendly representation


298
299
300
301
# File 'lib/twilio-ruby/rest/insights/v1/call/summary.rb', line 298

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

#trustHash

Returns The trust.

Returns:

  • (Hash)

    The trust


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

def trust
  @properties['trust']
end

#urlString

Returns The url.

Returns:

  • (String)

    The url


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

def url
  @properties['url']
end