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
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 305 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
323 324 325 326 327 328 329 330 331 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 323 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
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 336 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
431 432 433 434 435 436 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 431 def encrypted_operator_results EncryptedOperatorResultsContext.new( @version, @solution[:sid] ) end |
#encrypted_sentences ⇒ EncryptedSentencesList, EncryptedSentencesContext
Access the encrypted_sentences
411 412 413 414 415 416 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 411 def encrypted_sentences EncryptedSentencesContext.new( @version, @solution[:sid] ) end |
#fetch ⇒ TranscriptInstance
Fetch the TranscriptInstance
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 355 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
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 374 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
466 467 468 469 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 466 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |
#media ⇒ MediaList, MediaContext
Access the media
421 422 423 424 425 426 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 421 def media MediaContext.new( @version, @solution[:sid] ) end |
#operator_results(operator_sid = :unset) ⇒ OperatorResultList, OperatorResultContext
Access the operator_results
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 441 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
400 401 402 403 404 405 406 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 400 def sentences unless @sentences @sentences = SentenceList.new( @version, transcript_sid: @solution[:sid], ) end @sentences end |
#to_s ⇒ Object
Provide a user friendly representation
459 460 461 462 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 459 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.TranscriptContext #{context}>" end |