Method: Twilio::REST::Studio::V1::FlowContext::ExecutionList#stream

Defined in:
lib/twilio-ruby/rest/studio/v1/flow/execution.rb

#stream(date_created_from: :unset, date_created_to: :unset, limit: nil, page_size: nil) ⇒ Enumerable

Streams Instance records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached.

Parameters:

  • date_created_from (Time) (defaults to: :unset)

    Only show Execution resources starting on or after this [ISO 8601](en.wikipedia.org/wiki/ISO_8601) date-time, given as YYYY-MM-DDThh:mm:ss-hh:mm.

  • date_created_to (Time) (defaults to: :unset)

    Only show Execution resources starting before this [ISO 8601](en.wikipedia.org/wiki/ISO_8601) date-time, given as YYYY-MM-DDThh:mm:ss-hh:mm.

  • limit (Integer) (defaults to: nil)

    Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit

  • page_size (Integer) (defaults to: nil)

    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)

Returns:

  • (Enumerable)

    Enumerable that will yield up to limit results



142
143
144
145
146
147
148
149
150
151
# File 'lib/twilio-ruby/rest/studio/v1/flow/execution.rb', line 142

def stream(date_created_from: :unset, date_created_to: :unset, limit: nil, page_size: nil)
    limits = @version.read_limits(limit, page_size)

    page = self.page(
        date_created_from: date_created_from,
        date_created_to: date_created_to,
        page_size: limits[:page_size], )

    @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
end