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](www.twilio.com/docs/iam/api/account) that created the Room resource.
-
#audio_only ⇒ Boolean
When set to true, indicates that the participants in the room will only publish audio.
-
#context ⇒ RoomContext
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 of the room in seconds.
-
#empty_room_timeout ⇒ String
Specifies how long (in minutes) a room will remain active after last participant leaves.
-
#enable_turn ⇒ Boolean
Deprecated, now always considered to be true.
-
#end_time ⇒ Time
The UTC end time of the room in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#UTC) format.
-
#fetch ⇒ RoomInstance
Fetch the RoomInstance.
-
#initialize(version, payload, sid: nil) ⇒ RoomInstance
constructor
Initialize the RoomInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#large_room ⇒ Boolean
Indicates if this is a large room.
-
#links ⇒ Hash
The URLs of related resources.
-
#max_concurrent_published_tracks ⇒ String
The maximum number of published audio, video, and data tracks all participants combined are allowed to publish 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 Room’s media server.
-
#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 Twilio created to identify the Room resource.
- #status ⇒ RoomStatus
-
#status_callback ⇒ String
The URL Twilio calls using the ‘status_callback_method` to send status information to your application on every room event.
-
#status_callback_method ⇒ String
The HTTP method Twilio uses to call ‘status_callback`.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#transcriptions ⇒ transcriptions
Access the transcriptions.
- #type ⇒ RoomType
-
#unique_name ⇒ String
An application-defined string that uniquely identifies the resource.
-
#unused_room_timeout ⇒ String
Specifies how long (in minutes) a room will remain active if no one joins.
-
#update(status: nil) ⇒ RoomInstance
Update the RoomInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#video_codecs ⇒ Array<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
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 413 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'] == nil ? payload['max_participants'] : payload['max_participants'].to_i, 'max_participant_duration' => payload['max_participant_duration'] == nil ? payload['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'], 'empty_room_timeout' => payload['empty_room_timeout'] == nil ? payload['empty_room_timeout'] : payload['empty_room_timeout'].to_i, 'unused_room_timeout' => payload['unused_room_timeout'] == nil ? payload['unused_room_timeout'] : payload['unused_room_timeout'].to_i, 'large_room' => payload['large_room'], '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](www.twilio.com/docs/iam/api/account) that created the Room resource.
486 487 488 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 486 def account_sid @properties['account_sid'] end |
#audio_only ⇒ Boolean
Returns When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed.
570 571 572 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 570 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
453 454 455 456 457 458 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 453 def context unless @instance_context @instance_context = RoomContext.new(@version , @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.
474 475 476 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 474 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.
480 481 482 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 480 def date_updated @properties['date_updated'] end |
#duration ⇒ String
Returns The duration of the room in seconds.
522 523 524 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 522 def duration @properties['duration'] end |
#empty_room_timeout ⇒ String
Returns Specifies how long (in minutes) a room will remain active after last participant leaves. Can be configured when creating a room via REST API. For Ad-Hoc rooms this value cannot be changed.
576 577 578 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 576 def empty_room_timeout @properties['empty_room_timeout'] end |
#enable_turn ⇒ Boolean
Returns Deprecated, now always considered to be true.
492 493 494 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 492 def enable_turn @properties['enable_turn'] end |
#end_time ⇒ Time
Returns The UTC end time of the room in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#UTC) format.
516 517 518 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 516 def end_time @properties['end_time'] end |
#fetch ⇒ RoomInstance
Fetch the RoomInstance
607 608 609 610 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 607 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
662 663 664 665 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 662 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RoomInstance #{values}>" end |
#large_room ⇒ Boolean
Returns Indicates if this is a large room.
588 589 590 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 588 def large_room @properties['large_room'] end |
#links ⇒ Hash
Returns The URLs of related resources.
600 601 602 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 600 def links @properties['links'] end |
#max_concurrent_published_tracks ⇒ String
Returns The maximum number of published audio, video, and data tracks all participants combined are allowed to publish in the room at the same time. Check [Programmable Video Limits](www.twilio.com/docs/video/programmable-video-limits) for more details. If it is set to 0 it means unconstrained.
546 547 548 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 546 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. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours).
540 541 542 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 540 def max_participant_duration @properties['max_participant_duration'] end |
#max_participants ⇒ String
Returns The maximum number of concurrent Participants allowed in the room.
534 535 536 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 534 def max_participants @properties['max_participants'] end |
#media_region ⇒ String
Returns The region for the Room’s media server. Can be one of the [available Media Regions](www.twilio.com/docs/video/ip-addresses#media-servers).
564 565 566 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 564 def media_region @properties['media_region'] end |
#participants ⇒ participants
Access the participants
635 636 637 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 635 def participants context.participants end |
#record_participants_on_connect ⇒ Boolean
Returns Whether to start recording when Participants connect.
552 553 554 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 552 def record_participants_on_connect @properties['record_participants_on_connect'] end |
#recording_rules ⇒ recording_rules
Access the recording_rules
628 629 630 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 628 def recording_rules context.recording_rules end |
#recordings ⇒ recordings
Access the recordings
649 650 651 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 649 def recordings context.recordings end |
#sid ⇒ String
Returns The unique string that Twilio created to identify the Room resource.
462 463 464 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 462 def sid @properties['sid'] end |
#status ⇒ RoomStatus
468 469 470 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 468 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL Twilio calls using the ‘status_callback_method` to send status information to your application on every room event. See [Status Callbacks](www.twilio.com/docs/video/api/status-callbacks) for more info.
504 505 506 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 504 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method Twilio uses to call ‘status_callback`. Can be `POST` or `GET` and defaults to `POST`.
510 511 512 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 510 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
655 656 657 658 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 655 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RoomInstance #{values}>" end |
#transcriptions ⇒ transcriptions
Access the transcriptions
642 643 644 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 642 def transcriptions context.transcriptions end |
#type ⇒ RoomType
528 529 530 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 528 def type @properties['type'] end |
#unique_name ⇒ String
Returns An application-defined string that uniquely identifies the resource. It can be used as a ‘room_sid` in place of the resource’s ‘sid` in the URL to address the resource, assuming it does not contain any [reserved characters](tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`.
498 499 500 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 498 def unique_name @properties['unique_name'] end |
#unused_room_timeout ⇒ String
Returns Specifies how long (in minutes) a room will remain active if no one joins. Can be configured when creating a room via REST API. For Ad-Hoc rooms this value cannot be changed.
582 583 584 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 582 def unused_room_timeout @properties['unused_room_timeout'] end |
#update(status: nil) ⇒ RoomInstance
Update the RoomInstance
616 617 618 619 620 621 622 623 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 616 def update( status: nil ) context.update( status: status, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
594 595 596 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 594 def url @properties['url'] end |
#video_codecs ⇒ Array<VideoCodec>
Returns An array of the video codecs that are supported when publishing a track in the room. Can be: ‘VP8` and `H264`.
558 559 560 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 558 def video_codecs @properties['video_codecs'] end |