class Twilio::REST::Video::V1::RoomContext::ParticipantInstance
Public Class Methods
Initialize the ParticipantInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] room_sid
The SID of the participant's room. @param [String] sid The SID of the RoomParticipant resource to fetch. @return [ParticipantInstance] ParticipantInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 319 def initialize(version, payload, room_sid: nil, sid: nil) 320 super(version) 321 322 # Marshaled Properties 323 @properties = { 324 'sid' => payload['sid'], 325 'room_sid' => payload['room_sid'], 326 'account_sid' => payload['account_sid'], 327 'status' => payload['status'], 328 'identity' => payload['identity'], 329 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 330 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 331 'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']), 332 'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']), 333 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i, 334 'url' => payload['url'], 335 'links' => payload['links'], 336 } 337 338 # Context 339 @instance_context = nil 340 @params = {'room_sid' => room_sid, 'sid' => sid || @properties['sid'], } 341 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 368 def account_sid 369 @properties['account_sid'] 370 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ParticipantContext] ParticipantContext
for this ParticipantInstance
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 347 def context 348 unless @instance_context 349 @instance_context = ParticipantContext.new(@version, @params['room_sid'], @params['sid'], ) 350 end 351 @instance_context 352 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 386 def date_created 387 @properties['date_created'] 388 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 392 def date_updated 393 @properties['date_updated'] 394 end
@return [String] Duration of time in seconds the participant was connected
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 410 def duration 411 @properties['duration'] 412 end
@return [Time] The time when the participant disconnected from the room in ISO 8601 format
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 404 def end_time 405 @properties['end_time'] 406 end
Fetch the ParticipantInstance
@return [ParticipantInstance] Fetched ParticipantInstance
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 429 def fetch 430 context.fetch 431 end
@return [String] The string that identifies the resource's User
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 380 def identity 381 @properties['identity'] 382 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 474 def inspect 475 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 476 "<Twilio.Video.V1.ParticipantInstance #{values}>" 477 end
@return [String] The URLs of related resources
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 422 def links 423 @properties['links'] 424 end
Access the published_tracks
@return [published_tracks] published_tracks
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 447 def published_tracks 448 context.published_tracks 449 end
@return [String] The SID of the participant's room
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 362 def room_sid 363 @properties['room_sid'] 364 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 356 def sid 357 @properties['sid'] 358 end
@return [Time] The time of participant connected to the room in ISO 8601 format
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 398 def start_time 399 @properties['start_time'] 400 end
@return [participant.Status] The status of the Participant
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 374 def status 375 @properties['status'] 376 end
Access the subscribe_rules
@return [subscribe_rules] subscribe_rules
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 461 def subscribe_rules 462 context.subscribe_rules 463 end
Access the subscribed_tracks
@return [subscribed_tracks] subscribed_tracks
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 454 def subscribed_tracks 455 context.subscribed_tracks 456 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 467 def to_s 468 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 469 "<Twilio.Video.V1.ParticipantInstance #{values}>" 470 end
Update the ParticipantInstance
@param [participant.Status] status The new status of the resource. Can be:
`connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned.
@return [ParticipantInstance] Updated ParticipantInstance
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 440 def update(status: :unset) 441 context.update(status: status, ) 442 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/video/v1/room/room_participant.rb 416 def url 417 @properties['url'] 418 end