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
Overview
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 [email protected].
Instance Method Summary collapse
-
#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
151 152 153 154 155 156 157 158 159 160 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 151 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
#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
166 167 168 169 170 171 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 166 def context unless @instance_context @instance_context = CallContext.new(@version, @params['sid'], ) end @instance_context end |
#events ⇒ events
Access the events
201 202 203 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 201 def events context.events end |
#fetch ⇒ CallInstance
Fetch the CallInstance
194 195 196 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 194 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
228 229 230 231 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 228 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.CallInstance #{values}>" end |
#links ⇒ String
Returns The links.
187 188 189 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 187 def links @properties['links'] end |
#metrics ⇒ metrics
Access the metrics
208 209 210 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 208 def metrics context.metrics end |
#sid ⇒ String
Returns The sid.
175 176 177 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 175 def sid @properties['sid'] end |
#summary ⇒ summary
Access the summary
215 216 217 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 215 def summary context.summary end |
#to_s ⇒ Object
Provide a user friendly representation
221 222 223 224 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 221 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.CallInstance #{values}>" end |
#url ⇒ String
Returns The url.
181 182 183 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 181 def url @properties['url'] end |