Class: Twilio::REST::Intelligence::V2::TranscriptContext

Inherits:
Twilio::REST::InstanceContext show all
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

Constructor Details

#initialize(version, sid) ⇒ TranscriptContext

Initialize the TranscriptContext

Parameters:

  • Version that contains the resource

  • A 34 character string that uniquely identifies this Transcript.



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

#deleteBoolean

Delete the TranscriptInstance

Returns:

  • True if delete succeeds, false otherwise



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_metadataBoolean

Delete the TranscriptInstanceMetadata

Returns:

  • True if delete succeeds, false otherwise



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],
      )
      .new(@version, transcript_instance, response.headers, response.status_code)
end

#encrypted_operator_resultsEncryptedOperatorResultsList, EncryptedOperatorResultsContext

Access the encrypted_operator_results

Returns:



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_sentencesEncryptedSentencesList, EncryptedSentencesContext

Access the encrypted_sentences

Returns:



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

#fetchTranscriptInstance

Fetch the TranscriptInstance

Returns:

  • Fetched 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_metadataTranscriptInstance

Fetch the TranscriptInstanceMetadata

Returns:

  • Fetched TranscriptInstance



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],
    )
    .new(
        @version,
        transcript_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

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

#mediaMediaList, MediaContext

Access the media

Returns:



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

Returns:

  • if sid was passed.

Raises:



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

#sentencesSentenceList, SentenceContext

Access the sentences

Returns:



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_sObject

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