class Twilio::REST::Api::V2010::AccountContext::RecordingList
Public Class Methods
Initialize the RecordingList
@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 Recording resource.
@return [RecordingList] RecordingList
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/api/v2010/account/recording.rb 22 def initialize(version, account_sid: nil) 23 super(version) 24 25 # Path Solution 26 @solution = {account_sid: account_sid} 27 @uri = "/Accounts/#{@solution[:account_sid]}/Recordings.json" 28 end
Public Instance Methods
When passed a block, yields RecordingInstance
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/recording.rb 99 def each 100 limits = @version.read_limits 101 102 page = self.page(page_size: limits[:page_size], ) 103 104 @version.stream(page, 105 limit: limits[:limit], 106 page_limit: limits[:page_limit]).each {|x| yield x} 107 end
Retrieve a single page of RecordingInstance
records from the API. Request
is executed immediately. @param [String] target_url API-generated URL for the requested results page @return [Page] Page
of RecordingInstance
# File lib/twilio-ruby/rest/api/v2010/account/recording.rb 146 def get_page(target_url) 147 response = @version.domain.request( 148 'GET', 149 target_url 150 ) 151 RecordingPage.new(@version, response, @solution) 152 end
Lists RecordingInstance
records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. @param [Time] date_created_before Only include recordings that were created on this date @param [Time] date_created Only include recordings that were created on this date @param [Time] date_created_after Only include recordings that were created on this date @param [String] call_sid The
{Call}[https://www.twilio.com/docs/voice/api/call-resource] SID of the resources to read.
@param [String] conference_sid The Conference SID that identifies the conference
associated with the recording to read.
@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/recording.rb 49 def list(date_created_before: :unset, date_created: :unset, date_created_after: :unset, call_sid: :unset, conference_sid: :unset, limit: nil, page_size: nil) 50 self.stream( 51 date_created_before: date_created_before, 52 date_created: date_created, 53 date_created_after: date_created_after, 54 call_sid: call_sid, 55 conference_sid: conference_sid, 56 limit: limit, 57 page_size: page_size 58 ).entries 59 end
Retrieve a single page of RecordingInstance
records from the API. Request
is executed immediately. @param [Time] date_created_before Only include recordings that were created on this date @param [Time] date_created Only include recordings that were created on this date @param [Time] date_created_after Only include recordings that were created on this date @param [String] call_sid The
{Call}[https://www.twilio.com/docs/voice/api/call-resource] SID of the resources to read.
@param [String] conference_sid The Conference SID that identifies the conference
associated with the recording to read.
@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 RecordingInstance
# File lib/twilio-ruby/rest/api/v2010/account/recording.rb 124 def page(date_created_before: :unset, date_created: :unset, date_created_after: :unset, call_sid: :unset, conference_sid: :unset, page_token: :unset, page_number: :unset, page_size: :unset) 125 params = Twilio::Values.of({ 126 'DateCreated<' => Twilio.serialize_iso8601_datetime(date_created_before), 127 'DateCreated' => Twilio.serialize_iso8601_datetime(date_created), 128 'DateCreated>' => Twilio.serialize_iso8601_datetime(date_created_after), 129 'CallSid' => call_sid, 130 'ConferenceSid' => conference_sid, 131 'PageToken' => page_token, 132 'Page' => page_number, 133 'PageSize' => page_size, 134 }) 135 136 response = @version.page('GET', @uri, params: params) 137 138 RecordingPage.new(@version, response, @solution) 139 end
Streams RecordingInstance
records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached. @param [Time] date_created_before Only include recordings that were created on this date @param [Time] date_created Only include recordings that were created on this date @param [Time] date_created_after Only include recordings that were created on this date @param [String] call_sid The
{Call}[https://www.twilio.com/docs/voice/api/call-resource] SID of the resources to read.
@param [String] conference_sid The Conference SID that identifies the conference
associated with the recording to read.
@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/recording.rb 80 def stream(date_created_before: :unset, date_created: :unset, date_created_after: :unset, call_sid: :unset, conference_sid: :unset, limit: nil, page_size: nil) 81 limits = @version.read_limits(limit, page_size) 82 83 page = self.page( 84 date_created_before: date_created_before, 85 date_created: date_created, 86 date_created_after: date_created_after, 87 call_sid: call_sid, 88 conference_sid: conference_sid, 89 page_size: limits[:page_size], 90 ) 91 92 @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) 93 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/recording.rb 156 def to_s 157 '#<Twilio.Api.V2010.RecordingList>' 158 end