class Twilio::REST::Video::V1::RoomContext::RoomRecordingList
Public Class Methods
Initialize the RoomRecordingList
@param [Version] version Version
that contains the resource @param [String] room_sid The SID of the Room resource the recording is
associated with.
@return [RoomRecordingList] RoomRecordingList
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/video/v1/room/recording.rb 21 def initialize(version, room_sid: nil) 22 super(version) 23 24 # Path Solution 25 @solution = {room_sid: room_sid} 26 @uri = "/Rooms/#{@solution[:room_sid]}/Recordings" 27 end
Public Instance Methods
When passed a block, yields RoomRecordingInstance
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/room/recording.rb 94 def each 95 limits = @version.read_limits 96 97 page = self.page(page_size: limits[:page_size], ) 98 99 @version.stream(page, 100 limit: limits[:limit], 101 page_limit: limits[:page_limit]).each {|x| yield x} 102 end
Retrieve a single page of RoomRecordingInstance
records from the API. Request
is executed immediately. @param [String] target_url API-generated URL for the requested results page @return [Page] Page
of RoomRecordingInstance
# File lib/twilio-ruby/rest/video/v1/room/recording.rb 139 def get_page(target_url) 140 response = @version.domain.request( 141 'GET', 142 target_url 143 ) 144 RoomRecordingPage.new(@version, response, @solution) 145 end
Lists RoomRecordingInstance
records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. @param [room_recording.Status] status Read only the recordings with this status.
Can be: `processing`, `completed`, or `deleted`.
@param [String] source_sid Read only the recordings that have this `source_sid`. @param [Time] date_created_after Read only recordings that started on or after
this {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] datetime with time zone.
@param [Time] date_created_before Read only Recordings that started before this
{ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] datetime with time zone.
@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/room/recording.rb 47 def list(status: :unset, source_sid: :unset, date_created_after: :unset, date_created_before: :unset, limit: nil, page_size: nil) 48 self.stream( 49 status: status, 50 source_sid: source_sid, 51 date_created_after: date_created_after, 52 date_created_before: date_created_before, 53 limit: limit, 54 page_size: page_size 55 ).entries 56 end
Retrieve a single page of RoomRecordingInstance
records from the API. Request
is executed immediately. @param [room_recording.Status] status Read only the recordings with this status.
Can be: `processing`, `completed`, or `deleted`.
@param [String] source_sid Read only the recordings that have this `source_sid`. @param [Time] date_created_after Read only recordings that started on or after
this {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] datetime with time zone.
@param [Time] date_created_before Read only Recordings that started before this
{ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] datetime with time zone.
@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 RoomRecordingInstance
# File lib/twilio-ruby/rest/video/v1/room/recording.rb 118 def page(status: :unset, source_sid: :unset, date_created_after: :unset, date_created_before: :unset, page_token: :unset, page_number: :unset, page_size: :unset) 119 params = Twilio::Values.of({ 120 'Status' => status, 121 'SourceSid' => source_sid, 122 'DateCreatedAfter' => Twilio.serialize_iso8601_datetime(date_created_after), 123 'DateCreatedBefore' => Twilio.serialize_iso8601_datetime(date_created_before), 124 'PageToken' => page_token, 125 'Page' => page_number, 126 'PageSize' => page_size, 127 }) 128 129 response = @version.page('GET', @uri, params: params) 130 131 RoomRecordingPage.new(@version, response, @solution) 132 end
Streams RoomRecordingInstance
records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached. @param [room_recording.Status] status Read only the recordings with this status.
Can be: `processing`, `completed`, or `deleted`.
@param [String] source_sid Read only the recordings that have this `source_sid`. @param [Time] date_created_after Read only recordings that started on or after
this {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] datetime with time zone.
@param [Time] date_created_before Read only Recordings that started before this
{ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] datetime with time zone.
@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/room/recording.rb 76 def stream(status: :unset, source_sid: :unset, date_created_after: :unset, date_created_before: :unset, limit: nil, page_size: nil) 77 limits = @version.read_limits(limit, page_size) 78 79 page = self.page( 80 status: status, 81 source_sid: source_sid, 82 date_created_after: date_created_after, 83 date_created_before: date_created_before, 84 page_size: limits[:page_size], 85 ) 86 87 @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) 88 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/video/v1/room/recording.rb 149 def to_s 150 '#<Twilio.Video.V1.RoomRecordingList>' 151 end