Class: Twilio::REST::Insights::V1::CallInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Insights::V1::CallInstance
- Defined in:
- lib/twilio-ruby/rest/insights/v1/call.rb
Instance Method Summary collapse
-
#annotation ⇒ annotation
Access the annotation.
-
#context ⇒ CallContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#events ⇒ events
Access the events.
-
#fetch ⇒ CallInstance
Fetch the CallInstance.
-
#initialize(version, payload, sid: nil) ⇒ CallInstance
constructor
Initialize the CallInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #links ⇒ Hash
-
#metrics ⇒ metrics
Access the metrics.
- #sid ⇒ String
-
#summary ⇒ summary
Access the summary.
-
#to_s ⇒ Object
Provide a user friendly representation.
- #url ⇒ String
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CallInstance
Initialize the CallInstance
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 312 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#annotation ⇒ annotation
Access the annotation
389 390 391 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 389 def annotation context.annotation end |
#context ⇒ CallContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
332 333 334 335 336 337 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 332 def context unless @instance_context @instance_context = CallContext.new(@version , @params['sid']) end @instance_context end |
#events ⇒ events
Access the events
375 376 377 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 375 def events context.events end |
#fetch ⇒ CallInstance
Fetch the CallInstance
360 361 362 363 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 360 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
402 403 404 405 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 402 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.CallInstance #{values}>" end |
#links ⇒ Hash
353 354 355 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 353 def links @properties['links'] end |
#metrics ⇒ metrics
Access the metrics
368 369 370 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 368 def metrics context.metrics end |
#sid ⇒ String
341 342 343 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 341 def sid @properties['sid'] end |
#summary ⇒ summary
Access the summary
382 383 384 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 382 def summary context.summary end |
#to_s ⇒ Object
Provide a user friendly representation
395 396 397 398 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 395 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.CallInstance #{values}>" end |
#url ⇒ String
347 348 349 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 347 def url @properties['url'] end |