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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, reference_sid: nil, sid: nil) ⇒ AddOnResultInstance

Initialize the AddOnResultInstance

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](www.twilio.com/docs/api/rest/account) that created the Recording AddOnResult resource.

  • reference_sid (String) (defaults to: nil)

    The SID of the recording to which the AddOnResult resource belongs.

  • sid (String) (defaults to: nil)

    The Twilio-provided string that uniquely identifies the Recording AddOnResult resource to fetch.



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 264

def initialize(version, payload, account_sid: nil, reference_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'status' => payload['status'],
      'add_on_sid' => payload['add_on_sid'],
      'add_on_configuration_sid' => payload['add_on_configuration_sid'],
      'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
      'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
      'date_completed' => Twilio.deserialize_rfc2822(payload['date_completed']),
      'reference_sid' => payload['reference_sid'],
      'subresource_uris' => payload['subresource_uris'],
  }

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



314
315
316
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 314

def 
  @properties['account_sid']
end

#add_on_configuration_sidString

Returns The SID of the Add-on configuration.

Returns:

  • (String)

    The SID of the Add-on configuration



332
333
334
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 332

def add_on_configuration_sid
  @properties['add_on_configuration_sid']
end

#add_on_sidString

Returns The SID of the Add-on to which the result belongs.

Returns:

  • (String)

    The SID of the Add-on to which the result belongs



326
327
328
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 326

def add_on_sid
  @properties['add_on_sid']
end

#contextAddOnResultContext

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

Returns:



294
295
296
297
298
299
300
301
302
303
304
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 294

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

#date_completedTime

Returns The date and time in GMT that the result was completed.

Returns:

  • (Time)

    The date and time in GMT that the result was completed



350
351
352
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 350

def date_completed
  @properties['date_completed']
end

#date_createdTime

Returns The RFC 2822 date and time in GMT that the resource was created.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was created



338
339
340
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 338

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The RFC 2822 date and time in GMT that the resource was last updated.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was last updated



344
345
346
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 344

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the AddOnResultInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



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

def delete
  context.delete
end

#fetchAddOnResultInstance

Fetch a AddOnResultInstance

Returns:



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

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



396
397
398
399
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 396

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

#payloadspayloads

Access the payloads

Returns:



383
384
385
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 383

def payloads
  context.payloads
end

#reference_sidString

Returns The SID of the recording to which the AddOnResult resource belongs.

Returns:

  • (String)

    The SID of the recording to which the AddOnResult resource belongs



356
357
358
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 356

def reference_sid
  @properties['reference_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource



308
309
310
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 308

def sid
  @properties['sid']
end

#statusadd_on_result.Status

Returns The status of the result.

Returns:

  • (add_on_result.Status)

    The status of the result



320
321
322
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 320

def status
  @properties['status']
end

#subresource_urisString

Returns A list of related resources identified by their relative URIs.

Returns:

  • (String)

    A list of related resources identified by their relative URIs



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

def subresource_uris
  @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



389
390
391
392
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 389

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