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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, call_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.



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 392

def initialize(version, payload , account_sid: nil, call_sid: nil, sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'call_sid' => payload['call_sid'],
        'name' => payload['name'],
        'status' => payload['status'],
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'uri' => payload['uri'],
    }

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

Instance Method Details

#account_sid ⇒ String

Returns The SID of the Account that created this Transcription resource.

Returns:

  • (String) —

    The SID of the Account that created this Transcription resource.



431
432
433
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 431

def 
    @properties['account_sid']
end

#call_sid ⇒ String

Returns The SID of the Call the Transcription resource is associated with.

Returns:

  • (String) —

    The SID of the Call the Transcription resource is associated with.



437
438
439
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 437

def call_sid
    @properties['call_sid']
end

#context ⇒ TranscriptionContext

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

Returns:



416
417
418
419
420
421
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 416

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

#date_updated ⇒ Time

Returns The date and time in GMT that this resource was last updated, specified in RFC 2822 format.

Returns:

  • (Time) —

    The date and time in GMT that this resource was last updated, specified in RFC 2822 format.



455
456
457
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 455

def date_updated
    @properties['date_updated']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



487
488
489
490
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 487

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

#name ⇒ String

Returns The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription.

Returns:

  • (String) —

    The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription.



443
444
445
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 443

def name
    @properties['name']
end

#sid ⇒ String

Returns The SID of the Transcription resource.

Returns:

  • (String) —

    The SID of the Transcription resource.



425
426
427
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 425

def sid
    @properties['sid']
end

#status ⇒ Status

Returns:

  • (Status)


449
450
451
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 449

def status
    @properties['status']
end

#to_s ⇒ Object

Provide a user friendly representation



480
481
482
483
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 480

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

#update(status: nil) ⇒ TranscriptionInstance

Update the TranscriptionInstance

Parameters:

  • status (UpdateStatus) (defaults to: nil)

Returns:



469
470
471
472
473
474
475
476
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 469

def update(
  status: nil
)

    context.update(
        status: status, 
    )
end

#uri ⇒ String

Returns:

  • (String)


461
462
463
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 461

def uri
    @properties['uri']
end