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 that created this AddOnResult resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 436

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  || @properties['reference_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 Recording AddOnResult resource.

Returns:



478
479
480
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 478

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.



496
497
498
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 496

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.



490
491
492
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 490

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:



463
464
465
466
467
468
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 463

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 specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



514
515
516
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 514

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



502
503
504
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 502

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:



508
509
510
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 508

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the AddOnResultInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



533
534
535
536
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 533

def delete

    context.delete
end

#fetchAddOnResultInstance

Fetch the AddOnResultInstance

Returns:



541
542
543
544
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 541

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



562
563
564
565
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 562

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

#payloadspayloads

Access the payloads

Returns:



549
550
551
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 549

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.



520
521
522
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 520

def reference_sid
    @properties['reference_sid']
end

#sidString

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

Returns:

  • (String)

    The unique string that that we created to identify the Recording AddOnResult resource.



472
473
474
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 472

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


484
485
486
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 484

def status
    @properties['status']
end

#subresource_urisHash

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

Returns:

  • (Hash)

    A list of related resources identified by their relative URIs.



526
527
528
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 526

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



555
556
557
558
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb', line 555

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