Class: Twilio::REST::Api::V2010::AccountContext::RecordingContext::AddOnResultContext::PayloadInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the PayloadInstance

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 Payload resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 442

def initialize(version, payload , account_sid: nil, reference_sid: nil, add_on_result_sid: nil, sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'add_on_result_sid' => payload['add_on_result_sid'],
        'account_sid' => payload['account_sid'],
        'label' => payload['label'],
        'add_on_sid' => payload['add_on_sid'],
        'add_on_configuration_sid' => payload['add_on_configuration_sid'],
        'content_type' => payload['content_type'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'reference_sid' => payload['reference_sid'],
        'subresource_uris' => payload['subresource_uris'],
    }

    # Context
    @instance_context = nil
    @params = { 'account_sid' =>   ,'reference_sid' => reference_sid  || @properties['reference_sid']  ,'add_on_result_sid' => add_on_result_sid  || @properties['add_on_result_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 Payload resource.

Returns:



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

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.



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

def add_on_configuration_sid
    @properties['add_on_configuration_sid']
end

#add_on_result_sidString

Returns The SID of the AddOnResult to which the payload belongs.

Returns:

  • (String)

    The SID of the AddOnResult to which the payload belongs.



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

def add_on_result_sid
    @properties['add_on_result_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.



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

def add_on_sid
    @properties['add_on_sid']
end

#content_typeString

Returns The MIME type of the payload.

Returns:

  • (String)

    The MIME type of the payload.



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

def content_type
    @properties['content_type']
end

#contextPayloadContext

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

Returns:



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

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

#datadata

Access the data

Returns:



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

def data
    context.data
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:



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

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:



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

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the PayloadInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



546
547
548
549
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 546

def delete

    context.delete
end

#fetchPayloadInstance

Fetch the PayloadInstance

Returns:



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



575
576
577
578
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 575

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

#labelString

Returns The string provided by the vendor that describes the payload.

Returns:

  • (String)

    The string provided by the vendor that describes the payload.



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

def label
    @properties['label']
end

#reference_sidString

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

Returns:

  • (String)

    The SID of the recording to which the AddOnResult resource that contains the payload belongs.



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

def reference_sid
    @properties['reference_sid']
end

#sidString

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

Returns:

  • (String)

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



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

def sid
    @properties['sid']
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.



539
540
541
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 539

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



568
569
570
571
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 568

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