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.



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 211

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_sidString

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

Returns:



249
250
251
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 249

def 
    @properties['account_sid']
end

#call_sidString

Returns The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with.

Returns:



255
256
257
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 255

def call_sid
    @properties['call_sid']
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:



234
235
236
237
238
239
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 234

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

#date_updatedTime

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

Returns:



273
274
275
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 273

def date_updated
    @properties['date_updated']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#nameString

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.



261
262
263
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 261

def name
    @properties['name']
end

#sidString

Returns The SID of the Transcription resource.

Returns:

  • (String)

    The SID of the Transcription resource.



243
244
245
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 243

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


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

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



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

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:



287
288
289
290
291
292
293
294
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 287

def update(
    status: nil
)

    context.update(
        status: status, 
    )
end

#uriString

Returns:

  • (String)


279
280
281
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 279

def uri
    @properties['uri']
end