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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, transcript_sid: nil) ⇒ SentenceInstance

Initialize the SentenceInstance

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 Sentence resource.

  • sid (String)

    The SID of the Call resource to fetch.



171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 171

def initialize(version, payload , transcript_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'media_channel' => payload['media_channel'] == nil ? payload['media_channel'] : payload['media_channel'].to_i,
        'sentence_index' => payload['sentence_index'] == nil ? payload['sentence_index'] : payload['sentence_index'].to_i,
        'start_time' => payload['start_time'],
        'end_time' => payload['end_time'],
        'transcript' => payload['transcript'],
        'sid' => payload['sid'],
        'confidence' => payload['confidence'],
    }
end

Instance Method Details

#confidenceFloat

Returns:

  • (Float)


225
226
227
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 225

def confidence
    @properties['confidence']
end

#end_timeFloat

Returns Offset from the beginning of the transcript when this sentence ends.

Returns:

  • (Float)

    Offset from the beginning of the transcript when this sentence ends.



207
208
209
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 207

def end_time
    @properties['end_time']
end

#inspectObject

Provide a detailed, user friendly representation



237
238
239
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 237

def inspect
    "<Twilio.Intelligence.V2.SentenceInstance>"
end

#media_channelString

Returns The channel number.

Returns:

  • (String)

    The channel number.



189
190
191
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 189

def media_channel
    @properties['media_channel']
end

#sentence_indexString

Returns The index of the sentence in the transcript.

Returns:

  • (String)

    The index of the sentence in the transcript.



195
196
197
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 195

def sentence_index
    @properties['sentence_index']
end

#sidString

Returns A 34 character string that uniquely identifies this Sentence.

Returns:

  • (String)

    A 34 character string that uniquely identifies this Sentence.



219
220
221
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 219

def sid
    @properties['sid']
end

#start_timeFloat

Returns Offset from the beginning of the transcript when this sentence starts.

Returns:

  • (Float)

    Offset from the beginning of the transcript when this sentence starts.



201
202
203
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 201

def start_time
    @properties['start_time']
end

#to_sObject

Provide a user friendly representation



231
232
233
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 231

def to_s
    "<Twilio.Intelligence.V2.SentenceInstance>"
end

#transcriptString

Returns Transcript text.

Returns:

  • (String)

    Transcript text.



213
214
215
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 213

def transcript
    @properties['transcript']
end