class Twilio::REST::Insights::V1::CallInstance

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the CallInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The sid @return [CallInstance] CallInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/insights/v1/call.rb
151 def initialize(version, payload, sid: nil)
152   super(version)
153 
154   # Marshaled Properties
155   @properties = {'sid' => payload['sid'], 'url' => payload['url'], 'links' => payload['links'], }
156 
157   # Context
158   @instance_context = nil
159   @params = {'sid' => sid || @properties['sid'], }
160 end

Public Instance Methods

context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [CallContext] CallContext for this CallInstance

    # File lib/twilio-ruby/rest/insights/v1/call.rb
166 def context
167   unless @instance_context
168     @instance_context = CallContext.new(@version, @params['sid'], )
169   end
170   @instance_context
171 end
events() click to toggle source

Access the events @return [events] events

    # File lib/twilio-ruby/rest/insights/v1/call.rb
201 def events
202   context.events
203 end
fetch() click to toggle source

Fetch the CallInstance @return [CallInstance] Fetched CallInstance

    # File lib/twilio-ruby/rest/insights/v1/call.rb
194 def fetch
195   context.fetch
196 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/insights/v1/call.rb
228 def inspect
229   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
230   "<Twilio.Insights.V1.CallInstance #{values}>"
231 end
metrics() click to toggle source

Access the metrics @return [metrics] metrics

    # File lib/twilio-ruby/rest/insights/v1/call.rb
208 def metrics
209   context.metrics
210 end
sid() click to toggle source

@return [String] The sid

    # File lib/twilio-ruby/rest/insights/v1/call.rb
175 def sid
176   @properties['sid']
177 end
summary() click to toggle source

Access the summary @return [summary] summary

    # File lib/twilio-ruby/rest/insights/v1/call.rb
215 def summary
216   context.summary
217 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/insights/v1/call.rb
221 def to_s
222   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
223   "<Twilio.Insights.V1.CallInstance #{values}>"
224 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/insights/v1/call.rb
181 def url
182   @properties['url']
183 end