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

  # Context
  @instance_context = nil
  @params = {'call_sid' => call_sid, }
end

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid


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

def 
  @properties['account_sid']
end

#attributesHash

Returns The attributes.

Returns:

  • (Hash)

    The attributes


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

def attributes
  @properties['attributes']
end

#call_sidString

Returns The call_sid.

Returns:

  • (String)

    The call_sid


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

def call_sid
  @properties['call_sid']
end

#call_statecall_summary.CallState

Returns The call_state.

Returns:

  • (call_summary.CallState)

    The call_state


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

def call_state
  @properties['call_state']
end

#call_typecall_summary.CallType

Returns The call_type.

Returns:

  • (call_summary.CallType)

    The call_type


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

def call_type
  @properties['call_type']
end

#carrier_edgeHash

Returns The carrier_edge.

Returns:

  • (Hash)

    The carrier_edge


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

def carrier_edge
  @properties['carrier_edge']
end

#client_edgeHash

Returns The client_edge.

Returns:

  • (Hash)

    The client_edge


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

def client_edge
  @properties['client_edge']
end

#connect_durationString

Returns The connect_duration.

Returns:

  • (String)

    The connect_duration


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

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:


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

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


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

def created_time
  @properties['created_time']
end

#durationString

Returns The duration.

Returns:

  • (String)

    The duration


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

def duration
  @properties['duration']
end

#end_timeTime

Returns The end_time.

Returns:

  • (Time)

    The end_time


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

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:


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

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

#fromHash

Returns The from.

Returns:

  • (Hash)

    The from


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

def from
  @properties['from']
end

#inspectObject

Provide a detailed, user friendly representation


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

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


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

def processing_state
  @properties['processing_state']
end

#propertiesHash

Returns The properties.

Returns:

  • (Hash)

    The properties


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

def properties
  @properties['properties']
end

#sdk_edgeHash

Returns The sdk_edge.

Returns:

  • (Hash)

    The sdk_edge


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

def sdk_edge
  @properties['sdk_edge']
end

#sip_edgeHash

Returns The sip_edge.

Returns:

  • (Hash)

    The sip_edge


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

def sip_edge
  @properties['sip_edge']
end

#start_timeTime

Returns The start_time.

Returns:

  • (Time)

    The start_time


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

def start_time
  @properties['start_time']
end

#tagsArray[String]

Returns The tags.

Returns:

  • (Array[String])

    The tags


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

def tags
  @properties['tags']
end

#toHash

Returns The to.

Returns:

  • (Hash)

    The to


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

def to
  @properties['to']
end

#to_sObject

Provide a user friendly representation


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

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


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

def trust
  @properties['trust']
end

#urlString

Returns The url.

Returns:

  • (String)

    The url


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

def url
  @properties['url']
end