class Twilio::REST::Video::V1::RecordingList
Public Class Methods
Initialize the RecordingList
@param [Version] version Version
that contains the resource @return [RecordingList] RecordingList
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/video/v1/recording.rb 18 def initialize(version) 19 super(version) 20 21 # Path Solution 22 @solution = {} 23 @uri = "/Recordings" 24 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/video/v1/recording.rb 107 def each 108 limits = @version.read_limits 109 110 page = self.page(page_size: limits[:page_size], ) 111 112 @version.stream(page, 113 limit: limits[:limit], 114 page_limit: limits[:page_limit]).each {|x| yield x} 115 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/video/v1/recording.rb 160 def get_page(target_url) 161 response = @version.domain.request( 162 'GET', 163 target_url 164 ) 165 RecordingPage.new(@version, response, @solution) 166 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 [recording.Status] status Read only the recordings that have this status.
Can be: `processing`, `completed`, or `deleted`.
@param [String] source_sid Read only the recordings that have this `source_sid`. @param [Array] grouping_sid Read only recordings with this
`grouping_sid`, which may include a `participant_sid` and/or a `room_sid`.
@param [Time] date_created_after Read only recordings that started on or after
this {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] date-time with time zone.
@param [Time] date_created_before Read only recordings that started before this
{ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`.
@param [recording.Type] media_type Read only recordings that have this media
type. Can be either `audio` or `video`.
@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/video/v1/recording.rb 50 def list(status: :unset, source_sid: :unset, grouping_sid: :unset, date_created_after: :unset, date_created_before: :unset, media_type: :unset, limit: nil, page_size: nil) 51 self.stream( 52 status: status, 53 source_sid: source_sid, 54 grouping_sid: grouping_sid, 55 date_created_after: date_created_after, 56 date_created_before: date_created_before, 57 media_type: media_type, 58 limit: limit, 59 page_size: page_size 60 ).entries 61 end
Retrieve a single page of RecordingInstance
records from the API. Request
is executed immediately. @param [recording.Status] status Read only the recordings that have this status.
Can be: `processing`, `completed`, or `deleted`.
@param [String] source_sid Read only the recordings that have this `source_sid`. @param [Array] grouping_sid Read only recordings with this
`grouping_sid`, which may include a `participant_sid` and/or a `room_sid`.
@param [Time] date_created_after Read only recordings that started on or after
this {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] date-time with time zone.
@param [Time] date_created_before Read only recordings that started before this
{ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`.
@param [recording.Type] media_type Read only recordings that have this media
type. Can be either `audio` or `video`.
@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/video/v1/recording.rb 137 def page(status: :unset, source_sid: :unset, grouping_sid: :unset, date_created_after: :unset, date_created_before: :unset, media_type: :unset, page_token: :unset, page_number: :unset, page_size: :unset) 138 params = Twilio::Values.of({ 139 'Status' => status, 140 'SourceSid' => source_sid, 141 'GroupingSid' => Twilio.serialize_list(grouping_sid) { |e| e }, 142 'DateCreatedAfter' => Twilio.serialize_iso8601_datetime(date_created_after), 143 'DateCreatedBefore' => Twilio.serialize_iso8601_datetime(date_created_before), 144 'MediaType' => media_type, 145 'PageToken' => page_token, 146 'Page' => page_number, 147 'PageSize' => page_size, 148 }) 149 150 response = @version.page('GET', @uri, params: params) 151 152 RecordingPage.new(@version, response, @solution) 153 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 [recording.Status] status Read only the recordings that have this status.
Can be: `processing`, `completed`, or `deleted`.
@param [String] source_sid Read only the recordings that have this `source_sid`. @param [Array] grouping_sid Read only recordings with this
`grouping_sid`, which may include a `participant_sid` and/or a `room_sid`.
@param [Time] date_created_after Read only recordings that started on or after
this {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] date-time with time zone.
@param [Time] date_created_before Read only recordings that started before this
{ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`.
@param [recording.Type] media_type Read only recordings that have this media
type. Can be either `audio` or `video`.
@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/video/v1/recording.rb 87 def stream(status: :unset, source_sid: :unset, grouping_sid: :unset, date_created_after: :unset, date_created_before: :unset, media_type: :unset, limit: nil, page_size: nil) 88 limits = @version.read_limits(limit, page_size) 89 90 page = self.page( 91 status: status, 92 source_sid: source_sid, 93 grouping_sid: grouping_sid, 94 date_created_after: date_created_after, 95 date_created_before: date_created_before, 96 media_type: media_type, 97 page_size: limits[:page_size], 98 ) 99 100 @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) 101 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/video/v1/recording.rb 170 def to_s 171 '#<Twilio.Video.V1.RecordingList>' 172 end