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.
-
#subscribe_rules ⇒ subscribe_rules
Access the subscribe_rules.
-
#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
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 335 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.
384 385 386 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 384 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
363 364 365 366 367 368 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 363 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.
402 403 404 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 402 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.
408 409 410 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 408 def date_updated @properties['date_updated'] end |
#duration ⇒ String
Returns Duration of time in seconds this Participant was connected.
426 427 428 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 426 def duration @properties['duration'] end |
#end_time ⇒ Time
Returns The time of Participant disconnected from the Room, given as a UTC ISO 8601 Timestamp.
420 421 422 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 420 def end_time @properties['end_time'] end |
#fetch ⇒ ParticipantInstance
Fetch a ParticipantInstance
445 446 447 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 445 def fetch context.fetch end |
#identity ⇒ String
Returns The unique name identifier that is assigned to this Participant.
396 397 398 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 396 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
487 488 489 490 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 487 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.ParticipantInstance #{values}>" end |
#links ⇒ String
Returns The links.
438 439 440 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 438 def links @properties['links'] end |
#published_tracks ⇒ published_tracks
Access the published_tracks
460 461 462 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 460 def published_tracks context.published_tracks end |
#room_sid ⇒ String
Returns A system-generated 34-character string that uniquely identifies.
378 379 380 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 378 def room_sid @properties['room_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
372 373 374 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 372 def sid @properties['sid'] end |
#start_time ⇒ Time
Returns The time of Participant connected to the Room, given as a UTC ISO 8601 Timestamp.
414 415 416 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 414 def start_time @properties['start_time'] end |
#status ⇒ participant.Status
Returns A string representing the status of the Participant.
390 391 392 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 390 def status @properties['status'] end |
#subscribe_rules ⇒ subscribe_rules
Access the subscribe_rules
474 475 476 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 474 def subscribe_rules context.subscribe_rules end |
#subscribed_tracks ⇒ subscribed_tracks
Access the subscribed_tracks
467 468 469 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 467 def subscribed_tracks context.subscribed_tracks end |
#to_s ⇒ Object
Provide a user friendly representation
480 481 482 483 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 480 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.ParticipantInstance #{values}>" end |
#update(status: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
453 454 455 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 453 def update(status: :unset) context.update(status: status, ) end |
#url ⇒ String
Returns The absolute URL for this resource.
432 433 434 |
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant.rb', line 432 def url @properties['url'] end |