class Twilio::REST::Bulkexports::V1::ExportContext::DayList

Public Class Methods

new(version, resource_type: nil) click to toggle source

Initialize the DayList @param [Version] version Version that contains the resource @param [String] resource_type The type of communication – Messages, Calls,

Conferences, and Participants

@return [DayList] DayList

Calls superclass method Twilio::REST::ListResource::new
   # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
21 def initialize(version, resource_type: nil)
22   super(version)
23 
24   # Path Solution
25   @solution = {resource_type: resource_type}
26   @uri = "/Exports/#{@solution[:resource_type]}/Days"
27 end

Public Instance Methods

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

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

   # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
67 def each
68   limits = @version.read_limits
69 
70   page = self.page(page_size: limits[:page_size], )
71 
72   @version.stream(page,
73                   limit: limits[:limit],
74                   page_limit: limits[:page_limit]).each {|x| yield x}
75 end
get_page(target_url) click to toggle source

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

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
101 def get_page(target_url)
102   response = @version.domain.request(
103       'GET',
104       target_url
105   )
106   DayPage.new(@version, response, @solution)
107 end
list(limit: nil, page_size: nil) click to toggle source

Lists DayInstance 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/bulkexports/v1/export/day.rb
40 def list(limit: nil, page_size: nil)
41   self.stream(limit: limit, page_size: page_size).entries
42 end
page(page_token: :unset, page_number: :unset, page_size: :unset) click to toggle source

Retrieve a single page of DayInstance 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 DayInstance

   # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
84 def page(page_token: :unset, page_number: :unset, page_size: :unset)
85   params = Twilio::Values.of({
86       'PageToken' => page_token,
87       'Page' => page_number,
88       'PageSize' => page_size,
89   })
90 
91   response = @version.page('GET', @uri, params: params)
92 
93   DayPage.new(@version, response, @solution)
94 end
stream(limit: nil, page_size: nil) click to toggle source

Streams DayInstance 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/bulkexports/v1/export/day.rb
55 def stream(limit: nil, page_size: nil)
56   limits = @version.read_limits(limit, page_size)
57 
58   page = self.page(page_size: limits[:page_size], )
59 
60   @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
61 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
111 def to_s
112   '#<Twilio.Bulkexports.V1.DayList>'
113 end