Class: Twilio::REST::Video::V1::RoomContext::ParticipantContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Video::V1::RoomContext::ParticipantContext
- Defined in:
- lib/twilio-ruby/rest/video/v1/room/participant.rb,
lib/twilio-ruby/rest/video/v1/room/participant/anonymize.rb,
lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb,
lib/twilio-ruby/rest/video/v1/room/participant/subscribe_rules.rb,
lib/twilio-ruby/rest/video/v1/room/participant/subscribed_track.rb
Defined Under Namespace
Classes: AnonymizeContext, AnonymizeInstance, AnonymizeList, AnonymizePage, PublishedTrackContext, PublishedTrackInstance, PublishedTrackList, PublishedTrackPage, SubscribeRulesInstance, SubscribeRulesList, SubscribeRulesPage, SubscribedTrackContext, SubscribedTrackInstance, SubscribedTrackList, SubscribedTrackPage
Instance Method Summary collapse
-
#anonymize ⇒ AnonymizeList, AnonymizeContext
Access the anonymize.
-
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance.
-
#initialize(version, room_sid, sid) ⇒ ParticipantContext
constructor
Initialize the ParticipantContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#published_tracks(sid = :unset) ⇒ PublishedTrackList, PublishedTrackContext
Access the published_tracks.
-
#subscribe_rules ⇒ SubscribeRulesList, SubscribeRulesContext
Access the subscribe_rules.
-
#subscribed_tracks(sid = :unset) ⇒ SubscribedTrackList, SubscribedTrackContext
Access the subscribed_tracks.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance.
Constructor Details
#initialize(version, room_sid, sid) ⇒ ParticipantContext
Initialize the ParticipantContext
159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 159 def initialize(version, room_sid, sid) super(version) # Path Solution @solution = { room_sid: room_sid, sid: sid, } @uri = "/Rooms/#{@solution[:room_sid]}/Participants/#{@solution[:sid]}" # Dependents @subscribe_rules = nil @subscribed_tracks = nil @anonymize = nil @published_tracks = nil end |
Instance Method Details
#anonymize ⇒ AnonymizeList, AnonymizeContext
Access the anonymize
241 242 243 244 245 246 247 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 241 def anonymize AnonymizeContext.new( @version, @solution[:room_sid], @solution[:sid] ) end |
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance
175 176 177 178 179 180 181 182 183 184 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 175 def fetch payload = @version.fetch('GET', @uri) ParticipantInstance.new( @version, payload, room_sid: @solution[:room_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
277 278 279 280 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 277 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Video.V1.ParticipantContext #{context}>" end |
#published_tracks(sid = :unset) ⇒ PublishedTrackList, PublishedTrackContext
Access the published_tracks
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 252 def published_tracks(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return PublishedTrackContext.new(@version, @solution[:room_sid], @solution[:sid],sid ) end unless @published_tracks @published_tracks = PublishedTrackList.new( @version, room_sid: @solution[:room_sid], participant_sid: @solution[:sid], ) end @published_tracks end |
#subscribe_rules ⇒ SubscribeRulesList, SubscribeRulesContext
Access the subscribe_rules
211 212 213 214 215 216 217 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 211 def subscribe_rules unless @subscribe_rules @subscribe_rules = SubscribeRulesList.new( @version, room_sid: @solution[:room_sid], participant_sid: @solution[:sid], ) end @subscribe_rules end |
#subscribed_tracks(sid = :unset) ⇒ SubscribedTrackList, SubscribedTrackContext
Access the subscribed_tracks
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 222 def subscribed_tracks(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return SubscribedTrackContext.new(@version, @solution[:room_sid], @solution[:sid],sid ) end unless @subscribed_tracks @subscribed_tracks = SubscribedTrackList.new( @version, room_sid: @solution[:room_sid], participant_sid: @solution[:sid], ) end @subscribed_tracks end |
#to_s ⇒ Object
Provide a user friendly representation
270 271 272 273 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 270 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Video.V1.ParticipantContext #{context}>" end |
#update(status: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 190 def update( status: :unset ) data = Twilio::Values.of({ 'Status' => status, }) payload = @version.update('POST', @uri, data: data) ParticipantInstance.new( @version, payload, room_sid: @solution[:room_sid], sid: @solution[:sid], ) end |