Class: Twilio::REST::Video::V1::RoomContext::ParticipantInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Video::V1::RoomContext::ParticipantInstance
- Defined in:
- lib/twilio-ruby/rest/video/v1/room/room_participant.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the Account associated with this Room.
-
#context ⇒ ParticipantContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this resource was created, given as a UTC ISO 8601 Timestamp.
-
#date_updated ⇒ Time
The date that this resource was last updated, given as a UTC ISO 8601 Timestamp.
-
#duration ⇒ String
Duration of time in seconds this Participant was connected.
-
#end_time ⇒ Time
The time of Participant disconnected from the Room, given as a UTC ISO 8601 Timestamp.
-
#fetch ⇒ ParticipantInstance
Fetch a ParticipantInstance.
-
#identity ⇒ String
The unique name identifier that is assigned to this Participant.
-
#initialize(version, payload, room_sid: nil, sid: nil) ⇒ ParticipantInstance
constructor
Initialize the ParticipantInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#published_tracks ⇒ published_tracks
Access the published_tracks.
-
#room_sid ⇒ String
A system-generated 34-character string that uniquely identifies.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#start_time ⇒ Time
The time of Participant connected to the Room, given as a UTC ISO 8601 Timestamp.
-
#status ⇒ participant.Status
A string representing the status of the Participant.
-
#subscribed_tracks ⇒ subscribed_tracks
Access the subscribed_tracks.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance.
-
#url ⇒ String
The absolute URL for this resource.
Constructor Details
#initialize(version, payload, room_sid: nil, sid: nil) ⇒ ParticipantInstance
Initialize the ParticipantInstance
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 302 def initialize(version, payload, room_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'room_sid' => payload['room_sid'], 'account_sid' => payload['account_sid'], 'status' => payload['status'], 'identity' => payload['identity'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']), 'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']), 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i, 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'room_sid' => room_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the Account associated with this Room.
351 352 353 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 351 def account_sid @properties['account_sid'] end |
#context ⇒ ParticipantContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
330 331 332 333 334 335 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 330 def context unless @instance_context @instance_context = ParticipantContext.new(@version, @params['room_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this resource was created, given as a UTC ISO 8601 Timestamp.
369 370 371 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 369 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated, given as a UTC ISO 8601 Timestamp.
375 376 377 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 375 def date_updated @properties['date_updated'] end |
#duration ⇒ String
Returns Duration of time in seconds this Participant was connected.
393 394 395 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 393 def duration @properties['duration'] end |
#end_time ⇒ Time
Returns The time of Participant disconnected from the Room, given as a UTC ISO 8601 Timestamp.
387 388 389 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 387 def end_time @properties['end_time'] end |
#fetch ⇒ ParticipantInstance
Fetch a ParticipantInstance
412 413 414 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 412 def fetch context.fetch end |
#identity ⇒ String
Returns The unique name identifier that is assigned to this Participant.
363 364 365 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 363 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
447 448 449 450 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 447 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.ParticipantInstance #{values}>" end |
#links ⇒ String
Returns The links.
405 406 407 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 405 def links @properties['links'] end |
#published_tracks ⇒ published_tracks
Access the published_tracks
427 428 429 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 427 def published_tracks context.published_tracks end |
#room_sid ⇒ String
Returns A system-generated 34-character string that uniquely identifies.
345 346 347 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 345 def room_sid @properties['room_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
339 340 341 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 339 def sid @properties['sid'] end |
#start_time ⇒ Time
Returns The time of Participant connected to the Room, given as a UTC ISO 8601 Timestamp.
381 382 383 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 381 def start_time @properties['start_time'] end |
#status ⇒ participant.Status
Returns A string representing the status of the Participant.
357 358 359 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 357 def status @properties['status'] end |
#subscribed_tracks ⇒ subscribed_tracks
Access the subscribed_tracks
434 435 436 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 434 def subscribed_tracks context.subscribed_tracks end |
#to_s ⇒ Object
Provide a user friendly representation
440 441 442 443 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 440 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.ParticipantInstance #{values}>" end |
#update(status: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
420 421 422 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 420 def update(status: :unset) context.update(status: status, ) end |
#url ⇒ String
Returns The absolute URL for this resource.
399 400 401 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 399 def url @properties['url'] end |