class Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberContext::AssignedAddOnContext::AssignedAddOnExtensionList

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Public Class Methods

new(version, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil) click to toggle source

Initialize the AssignedAddOnExtensionList @param [Version] version Version that contains the resource @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that created the
resource.

@param [String] resource_sid The SID of the Phone Number to which the Add-on is

assigned.

@param [String] assigned_add_on_sid The SID that uniquely identifies the

assigned Add-on installation.

@return [AssignedAddOnExtensionList] AssignedAddOnExtensionList

Calls superclass method Twilio::REST::ListResource::new
   # File lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb
30 def initialize(version, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil)
31   super(version)
32 
33   # Path Solution
34   @solution = {
35       account_sid: account_sid,
36       resource_sid: resource_sid,
37       assigned_add_on_sid: assigned_add_on_sid
38   }
39   @uri = "/Accounts/#{@solution[:account_sid]}/IncomingPhoneNumbers/#{@solution[:resource_sid]}/AssignedAddOns/#{@solution[:assigned_add_on_sid]}/Extensions.json"
40 end

Public Instance Methods

each() { |x| ... } click to toggle source

When passed a block, yields AssignedAddOnExtensionInstance records from the API. This operation lazily loads records as efficiently as possible until the limit is reached.

   # File lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb
80 def each
81   limits = @version.read_limits
82 
83   page = self.page(page_size: limits[:page_size], )
84 
85   @version.stream(page,
86                   limit: limits[:limit],
87                   page_limit: limits[:page_limit]).each {|x| yield x}
88 end
get_page(target_url) click to toggle source

Retrieve a single page of AssignedAddOnExtensionInstance records from the API. Request is executed immediately. @param [String] target_url API-generated URL for the requested results page @return [Page] Page of AssignedAddOnExtensionInstance

    # File lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb
114 def get_page(target_url)
115   response = @version.domain.request(
116       'GET',
117       target_url
118   )
119   AssignedAddOnExtensionPage.new(@version, response, @solution)
120 end
list(limit: nil, page_size: nil) click to toggle source

Lists AssignedAddOnExtensionInstance records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. @param [Integer] limit Upper limit for the number of records to return. stream()

guarantees to never return more than limit.  Default is no limit

@param [Integer] page_size Number of records to fetch per request, when

not set will use the default value of 50 records.  If no page_size is defined
but a limit is defined, stream() will attempt to read the limit with the most
efficient page size, i.e. min(limit, 1000)

@return [Array] Array of up to limit results

   # File lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb
53 def list(limit: nil, page_size: nil)
54   self.stream(limit: limit, page_size: page_size).entries
55 end
page(page_token: :unset, page_number: :unset, page_size: :unset) click to toggle source

Retrieve a single page of AssignedAddOnExtensionInstance records from the API. Request is executed immediately. @param [String] page_token PageToken provided by the API @param [Integer] page_number Page Number, this value is simply for client state @param [Integer] page_size Number of records to return, defaults to 50 @return [Page] Page of AssignedAddOnExtensionInstance

    # File lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb
 97 def page(page_token: :unset, page_number: :unset, page_size: :unset)
 98   params = Twilio::Values.of({
 99       'PageToken' => page_token,
100       'Page' => page_number,
101       'PageSize' => page_size,
102   })
103 
104   response = @version.page('GET', @uri, params: params)
105 
106   AssignedAddOnExtensionPage.new(@version, response, @solution)
107 end
stream(limit: nil, page_size: nil) click to toggle source

Streams AssignedAddOnExtensionInstance records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached. @param [Integer] limit Upper limit for the number of records to return. stream()

guarantees to never return more than limit. Default is no limit.

@param [Integer] page_size Number of records to fetch per request, when

not set will use the default value of 50 records. If no page_size is defined
but a limit is defined, stream() will attempt to read the limit with the most
efficient page size, i.e. min(limit, 1000)

@return [Enumerable] Enumerable that will yield up to limit results

   # File lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb
68 def stream(limit: nil, page_size: nil)
69   limits = @version.read_limits(limit, page_size)
70 
71   page = self.page(page_size: limits[:page_size], )
72 
73   @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
74 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb
124 def to_s
125   '#<Twilio.Api.V2010.AssignedAddOnExtensionList>'
126 end