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