lib/twilio-ruby/rest/video/v1/room.rb in twilio-ruby-5.4.3 vs lib/twilio-ruby/rest/video/v1/room.rb in twilio-ruby-5.4.4

- old
+ new

@@ -42,11 +42,11 @@ 'UniqueName' => unique_name, 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, 'MaxParticipants' => max_participants, 'RecordParticipantsOnConnect' => record_participants_on_connect, - 'VideoCodecs' => video_codecs, + 'VideoCodecs' => Twilio.serialize_list(video_codecs) { |e| e }, 'MediaRegion' => media_region, }) payload = @version.create( 'POST', @@ -217,10 +217,11 @@ @solution = {sid: sid,} @uri = "/Rooms/#{@solution[:sid]}" # Dependents @recordings = nil + @participants = nil end ## # Fetch a RoomInstance # @return [RoomInstance] Fetched RoomInstance @@ -269,10 +270,28 @@ @recordings end ## + # Access the participants + # @return [RoomParticipantList] + # @return [RoomParticipantContext] if sid was passed. + def participants(sid=:unset) + raise ArgumentError, 'sid cannot be nil' if sid.nil? + + if sid != :unset + return RoomParticipantContext.new(@version, @solution[:sid], sid,) + end + + unless @participants + @participants = RoomParticipantList.new(@version, room_sid: @solution[:sid],) + end + + @participants + end + + ## # Provide a user friendly representation def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Video.V1.RoomContext #{context}>" end @@ -445,9 +464,16 @@ ## # Access the recordings # @return [recordings] recordings def recordings context.recordings + end + + ## + # Access the participants + # @return [participants] participants + def participants + context.participants end ## # Provide a user friendly representation def to_s \ No newline at end of file