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

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, recording_sid: nil, sid: nil) ⇒ TranscriptionInstance

Initialize the TranscriptionInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created this Transcription resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 237

def initialize(version, payload , account_sid: nil, recording_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'api_version' => payload['api_version'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'duration' => payload['duration'],
        'price' => payload['price'],
        'price_unit' => payload['price_unit'],
        'recording_sid' => payload['recording_sid'],
        'sid' => payload['sid'],
        'status' => payload['status'],
        'transcription_text' => payload['transcription_text'],
        'type' => payload['type'],
        'uri' => payload['uri'],
    }

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

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Transcription resource.

Returns:



275
276
277
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 275

def 
    @properties['account_sid']
end

#api_versionString

Returns The API version used to create the transcription.

Returns:

  • (String)

    The API version used to create the transcription.



281
282
283
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 281

def api_version
    @properties['api_version']
end

#contextTranscriptionContext

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

Returns:



266
267
268
269
270
271
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 266

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

#date_createdTime

Returns The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



287
288
289
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 287

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



293
294
295
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 293

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the TranscriptionInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



354
355
356
357
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 354

def delete

    context.delete
end

#durationString

Returns The duration of the transcribed audio in seconds.

Returns:

  • (String)

    The duration of the transcribed audio in seconds.



299
300
301
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 299

def duration
    @properties['duration']
end

#fetchTranscriptionInstance

Fetch the TranscriptionInstance

Returns:



362
363
364
365
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 362

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



376
377
378
379
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 376

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

#priceFloat

Returns The charge for the transcript in the currency associated with the account. This value is populated after the transcript is complete so it may not be available immediately.

Returns:

  • (Float)

    The charge for the transcript in the currency associated with the account. This value is populated after the transcript is complete so it may not be available immediately.



305
306
307
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 305

def price
    @properties['price']
end

#price_unitString

Returns The currency in which ‘price` is measured, in [ISO 4127](www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).

Returns:



311
312
313
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 311

def price_unit
    @properties['price_unit']
end

#recording_sidString

Returns The SID of the [Recording](www.twilio.com/docs/voice/api/recording) from which the transcription was created.

Returns:



317
318
319
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 317

def recording_sid
    @properties['recording_sid']
end

#sidString

Returns The unique string that that we created to identify the Transcription resource.

Returns:

  • (String)

    The unique string that that we created to identify the Transcription resource.



323
324
325
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 323

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


329
330
331
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 329

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



369
370
371
372
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 369

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

#transcription_textString

Returns The text content of the transcription.

Returns:

  • (String)

    The text content of the transcription.



335
336
337
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 335

def transcription_text
    @properties['transcription_text']
end

#typeString

Returns The transcription type.

Returns:

  • (String)

    The transcription type.



341
342
343
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 341

def type
    @properties['type']
end

#uriString

Returns The URI of the resource, relative to ‘api.twilio.com`.

Returns:

  • (String)

    The URI of the resource, relative to ‘api.twilio.com`.



347
348
349
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb', line 347

def uri
    @properties['uri']
end