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 ⇒ String
The links.
-
#metrics ⇒ metrics
Access the metrics.
-
#sid ⇒ String
The sid.
-
#summary ⇒ summary
Access the summary.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CallInstance
Initialize the CallInstance
152 153 154 155 156 157 158 159 160 161 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 152 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
223 224 225 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 223 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
167 168 169 170 171 172 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 167 def context unless @instance_context @instance_context = CallContext.new(@version, @params['sid'], ) end @instance_context end |
#events ⇒ events
Access the events
202 203 204 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 202 def events context.events end |
#fetch ⇒ CallInstance
Fetch the CallInstance
195 196 197 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 195 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
236 237 238 239 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 236 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.CallInstance #{values}>" end |
#links ⇒ String
Returns The links.
188 189 190 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 188 def links @properties['links'] end |
#metrics ⇒ metrics
Access the metrics
209 210 211 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 209 def metrics context.metrics end |
#sid ⇒ String
Returns The sid.
176 177 178 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 176 def sid @properties['sid'] end |
#summary ⇒ summary
Access the summary
216 217 218 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 216 def summary context.summary end |
#to_s ⇒ Object
Provide a user friendly representation
229 230 231 232 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 229 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.CallInstance #{values}>" end |
#url ⇒ String
Returns The url.
182 183 184 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 182 def url @properties['url'] end |