class Twilio::REST::Api::V2010::AccountContext::RecordingContext::TranscriptionInstance

Public Class Methods

new(version, payload, account_sid: nil, recording_sid: nil, sid: nil) click to toggle source

Initialize the TranscriptionInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that created the
Transcription resource.

@param [String] recording_sid The SID of the

{Recording}[https://www.twilio.com/docs/voice/api/recording] from which the
transcription was created.

@param [String] sid The Twilio-provided string that uniquely identifies the

Transcription resource to fetch.

@return [TranscriptionInstance] TranscriptionInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
227 def initialize(version, payload, account_sid: nil, recording_sid: nil, sid: nil)
228   super(version)
229 
230   # Marshaled Properties
231   @properties = {
232       'account_sid' => payload['account_sid'],
233       'api_version' => payload['api_version'],
234       'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
235       'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
236       'duration' => payload['duration'],
237       'price' => payload['price'].to_f,
238       'price_unit' => payload['price_unit'],
239       'recording_sid' => payload['recording_sid'],
240       'sid' => payload['sid'],
241       'status' => payload['status'],
242       'transcription_text' => payload['transcription_text'],
243       'type' => payload['type'],
244       'uri' => payload['uri'],
245   }
246 
247   # Context
248   @instance_context = nil
249   @params = {
250       'account_sid' => account_sid,
251       'recording_sid' => recording_sid,
252       'sid' => sid || @properties['sid'],
253   }
254 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
274 def account_sid
275   @properties['account_sid']
276 end
api_version() click to toggle source

@return [String] The API version used to create the transcription

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
280 def api_version
281   @properties['api_version']
282 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [TranscriptionContext] TranscriptionContext for this TranscriptionInstance

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
260 def context
261   unless @instance_context
262     @instance_context = TranscriptionContext.new(
263         @version,
264         @params['account_sid'],
265         @params['recording_sid'],
266         @params['sid'],
267     )
268   end
269   @instance_context
270 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was created

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
286 def date_created
287   @properties['date_created']
288 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was last updated

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
292 def date_updated
293   @properties['date_updated']
294 end
delete() click to toggle source

Delete the TranscriptionInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
360 def delete
361   context.delete
362 end
duration() click to toggle source

@return [String] The duration of the transcribed audio in seconds.

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
298 def duration
299   @properties['duration']
300 end
fetch() click to toggle source

Fetch the TranscriptionInstance @return [TranscriptionInstance] Fetched TranscriptionInstance

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
353 def fetch
354   context.fetch
355 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
373 def inspect
374   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
375   "<Twilio.Api.V2010.TranscriptionInstance #{values}>"
376 end
price() click to toggle source

@return [String] The charge for the transcription

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
304 def price
305   @properties['price']
306 end
price_unit() click to toggle source

@return [String] The currency in which price is measured

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
310 def price_unit
311   @properties['price_unit']
312 end
recording_sid() click to toggle source

@return [String] The SID that identifies the transcription's recording

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
316 def recording_sid
317   @properties['recording_sid']
318 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
322 def sid
323   @properties['sid']
324 end
status() click to toggle source

@return [transcription.Status] The status of the transcription

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
328 def status
329   @properties['status']
330 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
366 def to_s
367   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
368   "<Twilio.Api.V2010.TranscriptionInstance #{values}>"
369 end
transcription_text() click to toggle source

@return [String] The text content of the transcription.

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
334 def transcription_text
335   @properties['transcription_text']
336 end
type() click to toggle source

@return [String] The transcription type

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
340 def type
341   @properties['type']
342 end
uri() click to toggle source

@return [String] The URI of the resource, relative to `api.twilio.com`

    # File lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb
346 def uri
347   @properties['uri']
348 end