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, EncryptedOperatorResultsInstanceMetadata, EncryptedOperatorResultsList, EncryptedOperatorResultsListResponse, EncryptedOperatorResultsPage, EncryptedOperatorResultsPageMetadata, EncryptedSentencesContext, EncryptedSentencesInstance, EncryptedSentencesInstanceMetadata, EncryptedSentencesList, EncryptedSentencesListResponse, EncryptedSentencesPage, EncryptedSentencesPageMetadata, MediaContext, MediaInstance, MediaInstanceMetadata, MediaList, MediaListResponse, MediaPage, MediaPageMetadata, OperatorResultContext, OperatorResultInstance, OperatorResultInstanceMetadata, OperatorResultList, OperatorResultListResponse, OperatorResultPage, OperatorResultPageMetadata, SentenceInstance, SentenceList, SentenceListResponse, SentencePage, SentencePageMetadata
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the TranscriptInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the TranscriptInstanceMetadata.
-
#encrypted_operator_results ⇒ EncryptedOperatorResultsList, EncryptedOperatorResultsContext
Access the encrypted_operator_results.
-
#encrypted_sentences ⇒ EncryptedSentencesList, EncryptedSentencesContext
Access the encrypted_sentences.
-
#fetch ⇒ TranscriptInstance
Fetch the TranscriptInstance.
-
#fetch_with_metadata ⇒ TranscriptInstance
Fetch the TranscriptInstanceMetadata.
-
#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
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 297 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
315 316 317 318 319 320 321 322 323 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 315 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the TranscriptInstanceMetadata
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 328 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) transcript_instance = TranscriptInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) TranscriptInstanceMetadata.new(@version, transcript_instance, response.headers, response.status_code) end |
#encrypted_operator_results ⇒ EncryptedOperatorResultsList, EncryptedOperatorResultsContext
Access the encrypted_operator_results
423 424 425 426 427 428 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 423 def encrypted_operator_results EncryptedOperatorResultsContext.new( @version, @solution[:sid] ) end |
#encrypted_sentences ⇒ EncryptedSentencesList, EncryptedSentencesContext
Access the encrypted_sentences
403 404 405 406 407 408 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 403 def encrypted_sentences EncryptedSentencesContext.new( @version, @solution[:sid] ) end |
#fetch ⇒ TranscriptInstance
Fetch the TranscriptInstance
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 347 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 |
#fetch_with_metadata ⇒ TranscriptInstance
Fetch the TranscriptInstanceMetadata
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 366 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) transcript_instance = TranscriptInstance.new( @version, response.body, sid: @solution[:sid], ) TranscriptInstanceMetadata.new( @version, transcript_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
458 459 460 461 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 458 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |
#media ⇒ MediaList, MediaContext
Access the media
413 414 415 416 417 418 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 413 def media MediaContext.new( @version, @solution[:sid] ) end |
#operator_results(operator_sid = :unset) ⇒ OperatorResultList, OperatorResultContext
Access the operator_results
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 433 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
392 393 394 395 396 397 398 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 392 def sentences unless @sentences @sentences = SentenceList.new( @version, transcript_sid: @solution[:sid], ) end @sentences end |
#to_s ⇒ Object
Provide a user friendly representation
451 452 453 454 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 451 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |