class Twilio::REST::Video::V1::RoomInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the RoomInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The SID of the Room resource to fetch. @return [RoomInstance] RoomInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/video/v1/room.rb
345 def initialize(version, payload, sid: nil)
346   super(version)
347 
348   # Marshaled Properties
349   @properties = {
350       'sid' => payload['sid'],
351       'status' => payload['status'],
352       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
353       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
354       'account_sid' => payload['account_sid'],
355       'enable_turn' => payload['enable_turn'],
356       'unique_name' => payload['unique_name'],
357       'status_callback' => payload['status_callback'],
358       'status_callback_method' => payload['status_callback_method'],
359       'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
360       'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
361       'type' => payload['type'],
362       'max_participants' => payload['max_participants'].to_i,
363       'max_concurrent_published_tracks' => payload['max_concurrent_published_tracks'] == nil ? payload['max_concurrent_published_tracks'] : payload['max_concurrent_published_tracks'].to_i,
364       'record_participants_on_connect' => payload['record_participants_on_connect'],
365       'video_codecs' => payload['video_codecs'],
366       'media_region' => payload['media_region'],
367       'url' => payload['url'],
368       'links' => payload['links'],
369   }
370 
371   # Context
372   @instance_context = nil
373   @params = {'sid' => sid || @properties['sid'], }
374 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/video/v1/room.rb
413 def account_sid
414   @properties['account_sid']
415 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [RoomContext] RoomContext for this RoomInstance

    # File lib/twilio-ruby/rest/video/v1/room.rb
380 def context
381   unless @instance_context
382     @instance_context = RoomContext.new(@version, @params['sid'], )
383   end
384   @instance_context
385 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/video/v1/room.rb
401 def date_created
402   @properties['date_created']
403 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/video/v1/room.rb
407 def date_updated
408   @properties['date_updated']
409 end
duration() click to toggle source

@return [String] The duration of the room in seconds

    # File lib/twilio-ruby/rest/video/v1/room.rb
449 def duration
450   @properties['duration']
451 end
enable_turn() click to toggle source

@return [Boolean] Enable Twilio's Network Traversal TURN service

    # File lib/twilio-ruby/rest/video/v1/room.rb
419 def enable_turn
420   @properties['enable_turn']
421 end
end_time() click to toggle source

@return [Time] The UTC end time of the room in UTC ISO 8601 format

    # File lib/twilio-ruby/rest/video/v1/room.rb
443 def end_time
444   @properties['end_time']
445 end
fetch() click to toggle source

Fetch the RoomInstance @return [RoomInstance] Fetched RoomInstance

    # File lib/twilio-ruby/rest/video/v1/room.rb
504 def fetch
505   context.fetch
506 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/video/v1/room.rb
547 def inspect
548   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
549   "<Twilio.Video.V1.RoomInstance #{values}>"
550 end
max_concurrent_published_tracks() click to toggle source

@return [String] The maximum number of published tracks allowed in the room at the same time

    # File lib/twilio-ruby/rest/video/v1/room.rb
467 def max_concurrent_published_tracks
468   @properties['max_concurrent_published_tracks']
469 end
max_participants() click to toggle source

@return [String] The maximum number of concurrent Participants allowed in the room

    # File lib/twilio-ruby/rest/video/v1/room.rb
461 def max_participants
462   @properties['max_participants']
463 end
media_region() click to toggle source

@return [String] The region for the media server in Group Rooms

    # File lib/twilio-ruby/rest/video/v1/room.rb
485 def media_region
486   @properties['media_region']
487 end
participants() click to toggle source

Access the participants @return [participants] participants

    # File lib/twilio-ruby/rest/video/v1/room.rb
527 def participants
528   context.participants
529 end
record_participants_on_connect() click to toggle source

@return [Boolean] Whether to start recording when Participants connect

    # File lib/twilio-ruby/rest/video/v1/room.rb
473 def record_participants_on_connect
474   @properties['record_participants_on_connect']
475 end
recording_rules() click to toggle source

Access the recording_rules @return [recording_rules] recording_rules

    # File lib/twilio-ruby/rest/video/v1/room.rb
534 def recording_rules
535   context.recording_rules
536 end
recordings() click to toggle source

Access the recordings @return [recordings] recordings

    # File lib/twilio-ruby/rest/video/v1/room.rb
520 def recordings
521   context.recordings
522 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/video/v1/room.rb
389 def sid
390   @properties['sid']
391 end
status() click to toggle source

@return [room.RoomStatus] The status of the room

    # File lib/twilio-ruby/rest/video/v1/room.rb
395 def status
396   @properties['status']
397 end
status_callback() click to toggle source

@return [String] The URL to send status information to your application

    # File lib/twilio-ruby/rest/video/v1/room.rb
431 def status_callback
432   @properties['status_callback']
433 end
status_callback_method() click to toggle source

@return [String] The HTTP method we use to call status_callback

    # File lib/twilio-ruby/rest/video/v1/room.rb
437 def status_callback_method
438   @properties['status_callback_method']
439 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/video/v1/room.rb
540 def to_s
541   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
542   "<Twilio.Video.V1.RoomInstance #{values}>"
543 end
type() click to toggle source

@return [room.RoomType] The type of room

    # File lib/twilio-ruby/rest/video/v1/room.rb
455 def type
456   @properties['type']
457 end
unique_name() click to toggle source

@return [String] An application-defined string that uniquely identifies the resource

    # File lib/twilio-ruby/rest/video/v1/room.rb
425 def unique_name
426   @properties['unique_name']
427 end
update(status: nil) click to toggle source

Update the RoomInstance @param [room.RoomStatus] status The new status of the resource. Set to

`completed` to end the room.

@return [RoomInstance] Updated RoomInstance

    # File lib/twilio-ruby/rest/video/v1/room.rb
513 def update(status: nil)
514   context.update(status: status, )
515 end
url() click to toggle source

@return [String] The absolute URL of the resource

    # File lib/twilio-ruby/rest/video/v1/room.rb
491 def url
492   @properties['url']
493 end
video_codecs() click to toggle source

@return [Array] An array of the video codecs that are supported when publishing a track in the room

    # File lib/twilio-ruby/rest/video/v1/room.rb
479 def video_codecs
480   @properties['video_codecs']
481 end