Class: Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberContext::AssignedAddOnInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, resource_sid: nil, sid: nil) ⇒ AssignedAddOnInstance

Initialize the AssignedAddOnInstance

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

  • sid (String) (defaults to: nil) —

    The SID of the Call resource to fetch.



504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 504

def initialize(version, payload , account_sid: nil, resource_sid: nil, sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'resource_sid' => payload['resource_sid'],
        'friendly_name' => payload['friendly_name'],
        'description' => payload['description'],
        'configuration' => payload['configuration'],
        'unique_name' => payload['unique_name'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'uri' => payload['uri'],
        'subresource_uris' => payload['subresource_uris'],
    }

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

Instance Method Details

#account_sid ⇒ String

Returns The SID of the Account that created the resource.

Returns:

  • (String) —

    The SID of the Account that created the resource.



547
548
549
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 547

def 
    @properties['account_sid']
end

#configuration ⇒ Hash

Returns A JSON string that represents the current configuration of this Add-on installation.

Returns:

  • (Hash) —

    A JSON string that represents the current configuration of this Add-on installation.



571
572
573
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 571

def configuration
    @properties['configuration']
end

#context ⇒ AssignedAddOnContext

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

Returns:



532
533
534
535
536
537
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 532

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

#date_created ⇒ Time

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

Returns:

  • (Time) —

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



583
584
585
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 583

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

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

Returns:

  • (Time) —

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



589
590
591
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 589

def date_updated
    @properties['date_updated']
end

#delete ⇒ Boolean

Delete the AssignedAddOnInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



608
609
610
611
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 608

def delete

    context.delete
end

#description ⇒ String

Returns A short description of the functionality that the Add-on provides.

Returns:

  • (String) —

    A short description of the functionality that the Add-on provides.



565
566
567
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 565

def description
    @properties['description']
end

#extensions ⇒ extensions

Access the extensions

Returns:



624
625
626
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 624

def extensions
    context.extensions
end

#fetch ⇒ AssignedAddOnInstance

Fetch the AssignedAddOnInstance

Returns:



616
617
618
619
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 616

def fetch

    context.fetch
end

#friendly_name ⇒ String

Returns The string that you assigned to describe the resource.

Returns:

  • (String) —

    The string that you assigned to describe the resource.



559
560
561
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 559

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



637
638
639
640
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 637

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

#resource_sid ⇒ String

Returns The SID of the Phone Number to which the Add-on is assigned.

Returns:

  • (String) —

    The SID of the Phone Number to which the Add-on is assigned.



553
554
555
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 553

def resource_sid
    @properties['resource_sid']
end

#sid ⇒ String

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

Returns:

  • (String) —

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



541
542
543
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 541

def sid
    @properties['sid']
end

#subresource_uris ⇒ Hash

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

Returns:

  • (Hash) —

    A list of related resources identified by their relative URIs.



601
602
603
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 601

def subresource_uris
    @properties['subresource_uris']
end

#to_s ⇒ Object

Provide a user friendly representation



630
631
632
633
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 630

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

#unique_name ⇒ String

Returns An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource.

Returns:

  • (String) —

    An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource.



577
578
579
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 577

def unique_name
    @properties['unique_name']
end

#uri ⇒ String

Returns The URI of the resource, relative to https://api.twilio.com.

Returns:

  • (String) —

    The URI of the resource, relative to https://api.twilio.com.



595
596
597
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 595

def uri
    @properties['uri']
end