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(redacted: :unset) ⇒ 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
210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 210 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
225 226 227 228 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 225 def delete @version.delete('DELETE', @uri) end |
#fetch(redacted: :unset) ⇒ TranscriptInstance
Fetch the TranscriptInstance
234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 234 def fetch( redacted: :unset ) params = Twilio::Values.of({ 'Redacted' => redacted, }) payload = @version.fetch('GET', @uri, params: params) TranscriptInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
299 300 301 302 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 299 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |
#media ⇒ MediaList, MediaContext
Access the media
283 284 285 286 287 288 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 283 def media MediaContext.new( @version, @solution[:sid] ) end |
#operator_results(operator_sid = :unset) ⇒ OperatorResultList, OperatorResultContext
Access the operator_results
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 264 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
253 254 255 256 257 258 259 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 253 def sentences unless @sentences @sentences = SentenceList.new( @version, transcript_sid: @solution[:sid], ) end @sentences end |
#to_s ⇒ Object
Provide a user friendly representation
292 293 294 295 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 292 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |