Class: Twilio::REST::Intelligence::V2::TranscriptInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/transcript.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ TranscriptInstance

Initialize the TranscriptInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Transcript resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 618

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'service_sid' => payload['service_sid'],
        'sid' => payload['sid'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'status' => payload['status'],
        'channel' => payload['channel'],
        'data_logging' => payload['data_logging'],
        'language_code' => payload['language_code'],
        'customer_key' => payload['customer_key'],
        'media_start_time' => Twilio.deserialize_iso8601_datetime(payload['media_start_time']),
        'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
        'url' => payload['url'],
        'redaction' => payload['redaction'],
        'encryption_credential_sid' => payload['encryption_credential_sid'],
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



660
661
662
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 660

def 
    @properties['account_sid']
end

#channelHash

Returns Media Channel describing Transcript Source and Participant Mapping.

Returns:

  • (Hash)

    Media Channel describing Transcript Source and Participant Mapping



696
697
698
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 696

def channel
    @properties['channel']
end

#contextTranscriptContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



651
652
653
654
655
656
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 651

def context
    unless @instance_context
        @instance_context = TranscriptContext.new(@version , @params['sid'])
    end
    @instance_context
end

#customer_keyString

Returns:

  • (String)


714
715
716
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 714

def customer_key
    @properties['customer_key']
end

#data_loggingBoolean

Returns Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent.

Returns:

  • (Boolean)

    Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent.



702
703
704
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 702

def data_logging
    @properties['data_logging']
end

#date_createdTime

Returns The date that this Transcript was created, given in ISO 8601 format.

Returns:

  • (Time)

    The date that this Transcript was created, given in ISO 8601 format.



678
679
680
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 678

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this Transcript was updated, given in ISO 8601 format.

Returns:

  • (Time)

    The date that this Transcript was updated, given in ISO 8601 format.



684
685
686
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 684

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the TranscriptInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



757
758
759
760
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 757

def delete

    context.delete
end

#durationString

Returns The duration of this Transcript’s source.

Returns:

  • (String)

    The duration of this Transcript’s source



726
727
728
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 726

def duration
    @properties['duration']
end

#encrypted_operator_resultsencrypted_operator_results

Access the encrypted_operator_results

Returns:



794
795
796
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 794

def encrypted_operator_results
    context.encrypted_operator_results
end

#encrypted_sentencesencrypted_sentences

Access the encrypted_sentences

Returns:



780
781
782
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 780

def encrypted_sentences
    context.encrypted_sentences
end

#encryption_credential_sidString

Returns The unique SID identifier of the Public Key resource used to encrypt the sentences and operator results.

Returns:

  • (String)

    The unique SID identifier of the Public Key resource used to encrypt the sentences and operator results.



744
745
746
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 744

def encryption_credential_sid
    @properties['encryption_credential_sid']
end

#fetchTranscriptInstance

Fetch the TranscriptInstance

Returns:



765
766
767
768
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 765

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



814
815
816
817
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 814

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Intelligence.V2.TranscriptInstance #{values}>"
end

#language_codeString

Returns The default language code of the audio.

Returns:

  • (String)

    The default language code of the audio.



708
709
710
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 708

def language_code
    @properties['language_code']
end

Returns:

  • (Hash)


750
751
752
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 750

def links
    @properties['links']
end

#mediamedia

Access the media

Returns:



787
788
789
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 787

def media
    context.media
end

#media_start_timeTime

Returns The date that this Transcript’s media was started, given in ISO 8601 format.

Returns:

  • (Time)

    The date that this Transcript’s media was started, given in ISO 8601 format.



720
721
722
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 720

def media_start_time
    @properties['media_start_time']
end

#operator_resultsoperator_results

Access the operator_results

Returns:



801
802
803
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 801

def operator_results
    context.operator_results
end

#redactionBoolean

Returns If the transcript has been redacted, a redacted alternative of the transcript will be available.

Returns:

  • (Boolean)

    If the transcript has been redacted, a redacted alternative of the transcript will be available.



738
739
740
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 738

def redaction
    @properties['redaction']
end

#sentencessentences

Access the sentences

Returns:



773
774
775
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 773

def sentences
    context.sentences
end

#service_sidString

Returns The unique SID identifier of the Service.

Returns:

  • (String)

    The unique SID identifier of the Service.



666
667
668
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 666

def service_sid
    @properties['service_sid']
end

#sidString

Returns A 34 character string that uniquely identifies this Transcript.

Returns:

  • (String)

    A 34 character string that uniquely identifies this Transcript.



672
673
674
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 672

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


690
691
692
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 690

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



807
808
809
810
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 807

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Intelligence.V2.TranscriptInstance #{values}>"
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



732
733
734
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript.rb', line 732

def url
    @properties['url']
end