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
163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 163 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
257 258 259 260 261 262 263 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 257 def anonymize AnonymizeContext.new( @version, @solution[:room_sid], @solution[:sid] ) end |
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 179 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ParticipantInstance.new( @version, payload, room_sid: @solution[:room_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
293 294 295 296 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 293 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
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 268 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
227 228 229 230 231 232 233 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 227 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
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 238 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
286 287 288 289 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 286 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Video.V1.ParticipantContext #{context}>" end |
#update(status: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 200 def update( status: :unset ) data = Twilio::Values.of({ 'Status' => status, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ParticipantInstance.new( @version, payload, room_sid: @solution[:room_sid], sid: @solution[:sid], ) end |