Class: Twilio::REST::Intelligence::V2::TranscriptContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Intelligence::V2::TranscriptContext
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/transcript.rb,
lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb,
lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb,
lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Defined Under Namespace
Classes: MediaContext, MediaInstance, MediaList, MediaPage, OperatorResultContext, OperatorResultInstance, OperatorResultList, OperatorResultPage, SentenceInstance, SentenceList, SentencePage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the TranscriptInstance.
-
#fetch ⇒ TranscriptInstance
Fetch the TranscriptInstance.
-
#initialize(version, sid) ⇒ TranscriptContext
constructor
Initialize the TranscriptContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#media ⇒ MediaList, MediaContext
Access the media.
-
#operator_results(operator_sid = :unset) ⇒ OperatorResultList, OperatorResultContext
Access the operator_results.
-
#sentences ⇒ SentenceList, SentenceContext
Access the sentences.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ TranscriptContext
Initialize the TranscriptContext
212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 212 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Transcripts/#{@solution[:sid]}" # Dependents @sentences = nil @operator_results = nil @media = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the TranscriptInstance
227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 227 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ TranscriptInstance
Fetch the TranscriptInstance
236 237 238 239 240 241 242 243 244 245 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 236 def fetch payload = @version.fetch('GET', @uri) TranscriptInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
297 298 299 300 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 297 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |
#media ⇒ MediaList, MediaContext
Access the media
281 282 283 284 285 286 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 281 def media MediaContext.new( @version, @solution[:sid] ) end |
#operator_results(operator_sid = :unset) ⇒ OperatorResultList, OperatorResultContext
Access the operator_results
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 262 def operator_results(operator_sid=:unset) raise ArgumentError, 'operator_sid cannot be nil' if operator_sid.nil? if operator_sid != :unset return OperatorResultContext.new(@version, @solution[:sid],operator_sid ) end unless @operator_results @operator_results = OperatorResultList.new( @version, transcript_sid: @solution[:sid], ) end @operator_results end |
#sentences ⇒ SentenceList, SentenceContext
Access the sentences
251 252 253 254 255 256 257 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 251 def sentences unless @sentences @sentences = SentenceList.new( @version, transcript_sid: @solution[:sid], ) end @sentences end |
#to_s ⇒ Object
Provide a user friendly representation
290 291 292 293 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 290 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |