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/participant.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the RoomParticipant resource.
-
#anonymize ⇒ anonymize
Access the anonymize.
-
#context ⇒ ParticipantContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#duration ⇒ String
The duration in seconds that the participant was ‘connected`.
-
#end_time ⇒ Time
The time when the participant disconnected from the room in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#UTC) format.
-
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance.
-
#identity ⇒ String
The application-defined string that uniquely identifies the resource’s User within a Room.
-
#initialize(version, payload, room_sid: nil, sid: nil) ⇒ ParticipantInstance
constructor
Initialize the ParticipantInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
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 we created to identify the RoomParticipant resource.
-
#start_time ⇒ Time
The time of participant connected to the room in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#UTC) format.
- #status ⇒ Status
-
#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
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 324 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 || @properties['room_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the RoomParticipant resource.
373 374 375 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 373 def account_sid @properties['account_sid'] end |
#anonymize ⇒ anonymize
Access the anonymize
469 470 471 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 469 def anonymize context.anonymize 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
352 353 354 355 356 357 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 352 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 and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
391 392 393 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 391 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
397 398 399 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 397 def date_updated @properties['date_updated'] end |
#duration ⇒ String
Returns The duration in seconds that the participant was ‘connected`. Populated only after the participant is `disconnected`.
415 416 417 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 415 def duration @properties['duration'] end |
#end_time ⇒ Time
Returns The time when the participant disconnected from the room in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#UTC) format.
409 410 411 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 409 def end_time @properties['end_time'] end |
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance
434 435 436 437 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 434 def fetch context.fetch end |
#identity ⇒ String
Returns The application-defined string that uniquely identifies the resource’s User within a Room. If a client joins with an existing Identity, the existing client is disconnected. See [access tokens](www.twilio.com/docs/video/tutorials/user-identity-access-tokens) and [limits](www.twilio.com/docs/video/programmable-video-limits) for more info.
385 386 387 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 385 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
489 490 491 492 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 489 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.ParticipantInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
427 428 429 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 427 def links @properties['links'] end |
#published_tracks ⇒ published_tracks
Access the published_tracks
476 477 478 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 476 def published_tracks context.published_tracks end |
#room_sid ⇒ String
Returns The SID of the participant’s room.
367 368 369 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 367 def room_sid @properties['room_sid'] end |
#sid ⇒ String
Returns The unique string that we created to identify the RoomParticipant resource.
361 362 363 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 361 def sid @properties['sid'] end |
#start_time ⇒ Time
Returns The time of participant connected to the room in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#UTC) format.
403 404 405 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 403 def start_time @properties['start_time'] end |
#status ⇒ Status
379 380 381 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 379 def status @properties['status'] end |
#subscribe_rules ⇒ subscribe_rules
Access the subscribe_rules
455 456 457 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 455 def subscribe_rules context.subscribe_rules end |
#subscribed_tracks ⇒ subscribed_tracks
Access the subscribed_tracks
462 463 464 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 462 def subscribed_tracks context.subscribed_tracks end |
#to_s ⇒ Object
Provide a user friendly representation
482 483 484 485 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 482 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.ParticipantInstance #{values}>" end |
#update(status: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
443 444 445 446 447 448 449 450 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 443 def update( status: :unset ) context.update( status: status, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
421 422 423 |
# File 'lib/twilio-ruby/rest/video/v1/room/participant.rb', line 421 def url @properties['url'] end |