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
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
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
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
Access the events @return [events] events
# File lib/twilio-ruby/rest/insights/v1/call.rb 201 def events 202 context.events 203 end
Fetch the CallInstance
@return [CallInstance] Fetched CallInstance
# File lib/twilio-ruby/rest/insights/v1/call.rb 194 def fetch 195 context.fetch 196 end
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
@return [String] The links
# File lib/twilio-ruby/rest/insights/v1/call.rb 187 def links 188 @properties['links'] 189 end
Access the metrics @return [metrics] metrics
# File lib/twilio-ruby/rest/insights/v1/call.rb 208 def metrics 209 context.metrics 210 end
@return [String] The sid
# File lib/twilio-ruby/rest/insights/v1/call.rb 175 def sid 176 @properties['sid'] 177 end
Access the summary @return [summary] summary
# File lib/twilio-ruby/rest/insights/v1/call.rb 215 def summary 216 context.summary 217 end
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
@return [String] The url
# File lib/twilio-ruby/rest/insights/v1/call.rb 181 def url 182 @properties['url'] 183 end