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 unique ID of the Account associated with this Room.
-
#context ⇒ RoomContext
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
The duration of the Room in seconds.
-
#enable_turn ⇒ Boolean
Enable Twilio’s Network Traversal TURN service.
-
#end_time ⇒ Time
The end time of the Room, given as a UTC ISO 8601 Timestamp.
-
#fetch ⇒ RoomInstance
Fetch a RoomInstance.
-
#initialize(version, payload, sid: nil) ⇒ RoomInstance
constructor
Initialize the RoomInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#max_participants ⇒ String
Maximum number of concurrent Participants allowed in the Room.
-
#media_region ⇒ String
Region for the media server in Group Rooms.
-
#participants ⇒ participants
Access the participants.
-
#record_participants_on_connect ⇒ Boolean
Start recording when Participants connect.
-
#recordings ⇒ recordings
Access the recordings.
-
#sid ⇒ String
A system-generated 34-character string that uniquely identifies this resource.
-
#status ⇒ room.RoomStatus
A string representing the status of the Room.
-
#status_callback ⇒ String
A URL that Twilio sends asynchronous webhook requests to on every Room event.
-
#status_callback_method ⇒ String
HTTP method Twilio should use when requesting the above URL.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ room.RoomType
Type of Room, either peer-to-peer, group-small or group.
-
#unique_name ⇒ String
A developer-supplied Name of the Room.
-
#update(status: nil) ⇒ RoomInstance
Update the RoomInstance.
-
#url ⇒ String
The absolute URL for this resource.
-
#video_codecs ⇒ room.VideoCodec
The video_codecs.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ RoomInstance
Initialize the RoomInstance
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 339 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, 'record_participants_on_connect' => payload['record_participants_on_connect'], 'video_codecs' => payload['video_codecs'], 'media_region' => payload['media_region'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the Account associated with this Room.
406 407 408 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 406 def account_sid @properties['account_sid'] 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
373 374 375 376 377 378 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 373 def context unless @instance_context @instance_context = RoomContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this resource was created, given as a UTC ISO 8601 Timestamp.
394 395 396 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 394 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.
400 401 402 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 400 def date_updated @properties['date_updated'] end |
#duration ⇒ String
Returns The duration of the Room in seconds.
442 443 444 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 442 def duration @properties['duration'] end |
#enable_turn ⇒ Boolean
Returns Enable Twilio’s Network Traversal TURN service.
412 413 414 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 412 def enable_turn @properties['enable_turn'] end |
#end_time ⇒ Time
Returns The end time of the Room, given as a UTC ISO 8601 Timestamp.
436 437 438 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 436 def end_time @properties['end_time'] end |
#fetch ⇒ RoomInstance
Fetch a RoomInstance
491 492 493 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 491 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
526 527 528 529 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 526 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RoomInstance #{values}>" end |
#links ⇒ String
Returns The links.
484 485 486 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 484 def links @properties['links'] end |
#max_participants ⇒ String
Returns Maximum number of concurrent Participants allowed in the Room.
454 455 456 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 454 def max_participants @properties['max_participants'] end |
#media_region ⇒ String
Returns Region for the media server in Group Rooms.
472 473 474 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 472 def media_region @properties['media_region'] end |
#participants ⇒ participants
Access the participants
513 514 515 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 513 def participants context.participants end |
#record_participants_on_connect ⇒ Boolean
Returns Start recording when Participants connect.
460 461 462 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 460 def record_participants_on_connect @properties['record_participants_on_connect'] end |
#recordings ⇒ recordings
Access the recordings
506 507 508 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 506 def recordings context.recordings end |
#sid ⇒ String
Returns A system-generated 34-character string that uniquely identifies this resource.
382 383 384 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 382 def sid @properties['sid'] end |
#status ⇒ room.RoomStatus
Returns A string representing the status of the Room.
388 389 390 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 388 def status @properties['status'] end |
#status_callback ⇒ String
Returns A URL that Twilio sends asynchronous webhook requests to on every Room event.
424 425 426 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 424 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns HTTP method Twilio should use when requesting the above URL.
430 431 432 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 430 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
519 520 521 522 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 519 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RoomInstance #{values}>" end |
#type ⇒ room.RoomType
Returns Type of Room, either peer-to-peer, group-small or group.
448 449 450 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 448 def type @properties['type'] end |
#unique_name ⇒ String
Returns A developer-supplied Name of the Room.
418 419 420 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 418 def unique_name @properties['unique_name'] end |
#update(status: nil) ⇒ RoomInstance
Update the RoomInstance
499 500 501 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 499 def update(status: nil) context.update(status: status, ) end |
#url ⇒ String
Returns The absolute URL for this resource.
478 479 480 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 478 def url @properties['url'] end |
#video_codecs ⇒ room.VideoCodec
Returns The video_codecs.
466 467 468 |
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 466 def video_codecs @properties['video_codecs'] end |