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,
lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_sentences.rb,
lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_operator_results.rb
Defined Under Namespace
Classes: EncryptedOperatorResultsContext, EncryptedOperatorResultsInstance, EncryptedOperatorResultsList, EncryptedOperatorResultsPage, EncryptedSentencesContext, EncryptedSentencesInstance, EncryptedSentencesList, EncryptedSentencesPage, MediaContext, MediaInstance, MediaList, MediaPage, OperatorResultContext, OperatorResultInstance, OperatorResultList, OperatorResultPage, SentenceInstance, SentenceList, SentencePage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the TranscriptInstance.
-
#encrypted_operator_results ⇒ EncryptedOperatorResultsList, EncryptedOperatorResultsContext
Access the encrypted_operator_results.
-
#encrypted_sentences ⇒ EncryptedSentencesList, EncryptedSentencesContext
Access the encrypted_sentences.
-
#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
218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 218 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Transcripts/#{@solution[:sid]}" # Dependents @sentences = nil @encrypted_sentences = nil @media = nil @encrypted_operator_results = nil @operator_results = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the TranscriptInstance
235 236 237 238 239 240 241 242 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 235 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#encrypted_operator_results ⇒ EncryptedOperatorResultsList, EncryptedOperatorResultsContext
Access the encrypted_operator_results
298 299 300 301 302 303 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 298 def encrypted_operator_results EncryptedOperatorResultsContext.new( @version, @solution[:sid] ) end |
#encrypted_sentences ⇒ EncryptedSentencesList, EncryptedSentencesContext
Access the encrypted_sentences
278 279 280 281 282 283 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 278 def encrypted_sentences EncryptedSentencesContext.new( @version, @solution[:sid] ) end |
#fetch ⇒ TranscriptInstance
Fetch the TranscriptInstance
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 247 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) TranscriptInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
333 334 335 336 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 333 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |
#media ⇒ MediaList, MediaContext
Access the media
288 289 290 291 292 293 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 288 def media MediaContext.new( @version, @solution[:sid] ) end |
#operator_results(operator_sid = :unset) ⇒ OperatorResultList, OperatorResultContext
Access the operator_results
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 308 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
267 268 269 270 271 272 273 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 267 def sentences unless @sentences @sentences = SentenceList.new( @version, transcript_sid: @solution[:sid], ) end @sentences end |
#to_s ⇒ Object
Provide a user friendly representation
326 327 328 329 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 326 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |