Class: Twilio::REST::Video::V1::RoomInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Video::V1::RoomInstance
- Defined in:
- lib/twilio-ruby/rest/video/v1/room.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#audio_only ⇒ Boolean
Indicates whether the room will only contain audio track participants for group rooms.
-
#context ⇒ RoomContext
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
The duration of the room in seconds.
-
#enable_turn ⇒ Boolean
Enable Twilio’s Network Traversal TURN service.
-
#end_time ⇒ Time
The UTC end time of the room in UTC ISO 8601 format.
-
#fetch ⇒ RoomInstance
Fetch the RoomInstance.
-
#initialize(version, payload, sid: nil) ⇒ RoomInstance
constructor
Initialize the RoomInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The URLs of related resources.
-
#max_concurrent_published_tracks ⇒ String
The maximum number of published tracks allowed in the room at the same time.
-
#max_participant_duration ⇒ String
The maximum number of seconds a Participant can be connected to the room.
-
#max_participants ⇒ String
The maximum number of concurrent Participants allowed in the room.
-
#media_region ⇒ String
The region for the media server in Group Rooms.
-
#participants ⇒ participants
Access the participants.
-
#record_participants_on_connect ⇒ Boolean
Whether to start recording when Participants connect.
-
#recording_rules ⇒ recording_rules
Access the recording_rules.
-
#recordings ⇒ recordings
Access the recordings.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#status ⇒ room.RoomStatus
The status of the room.
-
#status_callback ⇒ String
The URL to send status information to your application.
-
#status_callback_method ⇒ String
The HTTP method we use to call status_callback.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ room.RoomType
The type of room.
-
#unique_name ⇒ String
An application-defined string that uniquely identifies the resource.
-
#update(status: nil) ⇒ RoomInstance
Update the RoomInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#video_codecs ⇒ Array[room.VideoCodec]
An array of the video codecs that are supported when publishing a track in the room.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ RoomInstance
Initialize the RoomInstance
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 353 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'status' => payload['status'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'account_sid' => payload['account_sid'], 'enable_turn' => payload['enable_turn'], 'unique_name' => payload['unique_name'], 'status_callback' => payload['status_callback'], 'status_callback_method' => payload['status_callback_method'], 'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']), 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i, 'type' => payload['type'], 'max_participants' => payload['max_participants'].to_i, 'max_participant_duration' => payload['max_participant_duration'].to_i, 'max_concurrent_published_tracks' => payload['max_concurrent_published_tracks'] == nil ? payload['max_concurrent_published_tracks'] : payload['max_concurrent_published_tracks'].to_i, 'record_participants_on_connect' => payload['record_participants_on_connect'], 'video_codecs' => payload['video_codecs'], 'media_region' => payload['media_region'], 'audio_only' => payload['audio_only'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
423 424 425 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 423 def account_sid @properties['account_sid'] end |
#audio_only ⇒ Boolean
Returns Indicates whether the room will only contain audio track participants for group rooms.
507 508 509 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 507 def audio_only @properties['audio_only'] end |
#context ⇒ RoomContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
390 391 392 393 394 395 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 390 def context unless @instance_context @instance_context = RoomContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
411 412 413 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 411 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.
417 418 419 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 417 def date_updated @properties['date_updated'] end |
#duration ⇒ String
Returns The duration of the room in seconds.
459 460 461 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 459 def duration @properties['duration'] end |
#enable_turn ⇒ Boolean
Returns Enable Twilio’s Network Traversal TURN service.
429 430 431 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 429 def enable_turn @properties['enable_turn'] end |
#end_time ⇒ Time
Returns The UTC end time of the room in UTC ISO 8601 format.
453 454 455 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 453 def end_time @properties['end_time'] end |
#fetch ⇒ RoomInstance
Fetch the RoomInstance
526 527 528 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 526 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
569 570 571 572 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 569 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RoomInstance #{values}>" end |
#links ⇒ String
Returns The URLs of related resources.
519 520 521 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 519 def links @properties['links'] end |
#max_concurrent_published_tracks ⇒ String
Returns The maximum number of published tracks allowed in the room at the same time.
483 484 485 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 483 def max_concurrent_published_tracks @properties['max_concurrent_published_tracks'] end |
#max_participant_duration ⇒ String
Returns The maximum number of seconds a Participant can be connected to the room.
477 478 479 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 477 def max_participant_duration @properties['max_participant_duration'] end |
#max_participants ⇒ String
Returns The maximum number of concurrent Participants allowed in the room.
471 472 473 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 471 def max_participants @properties['max_participants'] end |
#media_region ⇒ String
Returns The region for the media server in Group Rooms.
501 502 503 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 501 def media_region @properties['media_region'] end |
#participants ⇒ participants
Access the participants
549 550 551 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 549 def participants context.participants end |
#record_participants_on_connect ⇒ Boolean
Returns Whether to start recording when Participants connect.
489 490 491 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 489 def record_participants_on_connect @properties['record_participants_on_connect'] end |
#recording_rules ⇒ recording_rules
Access the recording_rules
556 557 558 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 556 def recording_rules context.recording_rules end |
#recordings ⇒ recordings
Access the recordings
542 543 544 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 542 def recordings context.recordings end |
#sid ⇒ String
Returns The unique string that identifies the resource.
399 400 401 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 399 def sid @properties['sid'] end |
#status ⇒ room.RoomStatus
Returns The status of the room.
405 406 407 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 405 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL to send status information to your application.
441 442 443 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 441 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method we use to call status_callback.
447 448 449 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 447 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
562 563 564 565 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 562 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RoomInstance #{values}>" end |
#type ⇒ room.RoomType
Returns The type of room.
465 466 467 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 465 def type @properties['type'] end |
#unique_name ⇒ String
Returns An application-defined string that uniquely identifies the resource.
435 436 437 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 435 def unique_name @properties['unique_name'] end |
#update(status: nil) ⇒ RoomInstance
Update the RoomInstance
535 536 537 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 535 def update(status: nil) context.update(status: status, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
513 514 515 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 513 def url @properties['url'] end |
#video_codecs ⇒ Array[room.VideoCodec]
Returns An array of the video codecs that are supported when publishing a track in the room.
495 496 497 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 495 def video_codecs @properties['video_codecs'] end |