class Twilio::REST::Numbers::V2::RegulatoryComplianceList::SupportingDocumentTypeList
Public Class Methods
Initialize the SupportingDocumentTypeList
@param [Version] version Version
that contains the resource @return [SupportingDocumentTypeList] SupportingDocumentTypeList
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb 19 def initialize(version) 20 super(version) 21 22 # Path Solution 23 @solution = {} 24 @uri = "/RegulatoryCompliance/SupportingDocumentTypes" 25 end
Public Instance Methods
When passed a block, yields SupportingDocumentTypeInstance
records from the API. This operation lazily loads records as efficiently as possible until the limit is reached.
# File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb 65 def each 66 limits = @version.read_limits 67 68 page = self.page(page_size: limits[:page_size], ) 69 70 @version.stream(page, 71 limit: limits[:limit], 72 page_limit: limits[:page_limit]).each {|x| yield x} 73 end
Retrieve a single page of SupportingDocumentTypeInstance
records from the API. Request
is executed immediately. @param [String] target_url API-generated URL for the requested results page @return [Page] Page
of SupportingDocumentTypeInstance
# File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb 99 def get_page(target_url) 100 response = @version.domain.request( 101 'GET', 102 target_url 103 ) 104 SupportingDocumentTypePage.new(@version, response, @solution) 105 end
Lists SupportingDocumentTypeInstance
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/numbers/v2/regulatory_compliance/supporting_document_type.rb 38 def list(limit: nil, page_size: nil) 39 self.stream(limit: limit, page_size: page_size).entries 40 end
Retrieve a single page of SupportingDocumentTypeInstance
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 SupportingDocumentTypeInstance
# File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb 82 def page(page_token: :unset, page_number: :unset, page_size: :unset) 83 params = Twilio::Values.of({ 84 'PageToken' => page_token, 85 'Page' => page_number, 86 'PageSize' => page_size, 87 }) 88 89 response = @version.page('GET', @uri, params: params) 90 91 SupportingDocumentTypePage.new(@version, response, @solution) 92 end
Streams SupportingDocumentTypeInstance
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/numbers/v2/regulatory_compliance/supporting_document_type.rb 53 def stream(limit: nil, page_size: nil) 54 limits = @version.read_limits(limit, page_size) 55 56 page = self.page(page_size: limits[:page_size], ) 57 58 @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) 59 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb 109 def to_s 110 '#<Twilio.Numbers.V2.SupportingDocumentTypeList>' 111 end