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
172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 172 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
248 249 250 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 248 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
191 192 193 194 195 196 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 191 def context unless @instance_context @instance_context = CallContext.new(@version , @params['sid']) end @instance_context end |
#events ⇒ events
Access the events
234 235 236 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 234 def events context.events end |
#fetch ⇒ CallInstance
Fetch the CallInstance
219 220 221 222 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 219 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
261 262 263 264 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 261 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.CallInstance #{values}>" end |
#links ⇒ Hash
212 213 214 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 212 def links @properties['links'] end |
#metrics ⇒ metrics
Access the metrics
227 228 229 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 227 def metrics context.metrics end |
#sid ⇒ String
200 201 202 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 200 def sid @properties['sid'] end |
#summary ⇒ summary
Access the summary
241 242 243 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 241 def summary context.summary end |
#to_s ⇒ Object
Provide a user friendly representation
254 255 256 257 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 254 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.CallInstance #{values}>" end |
#url ⇒ String
206 207 208 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 206 def url @properties['url'] end |