Class: Twilio::REST::Video::V1::RoomInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/video/v1/room.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ RoomInstance

Initialize the RoomInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this Room resource.

  • sid (String) (defaults to: nil) —

    The SID of the Call resource to fetch.



697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 697

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 that created the Room resource.

Returns:

  • (String) —

    The SID of the Account that created the Room resource.



771
772
773
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 771

def 
    @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.

Returns:

  • (Boolean) —

    When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed.



855
856
857
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 855

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

Returns:



738
739
740
741
742
743
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 738

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 format.

Returns:

  • (Time) —

    The date and time in GMT when the resource was created specified in ISO 8601 format.



759
760
761
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 759

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 format.

Returns:

  • (Time) —

    The date and time in GMT when the resource was last updated specified in ISO 8601 format.



765
766
767
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 765

def date_updated
    @properties['date_updated']
end

#duration ⇒ String

Returns The duration of the room in seconds.

Returns:

  • (String) —

    The duration of the room in seconds.



807
808
809
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 807

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.

Returns:

  • (String) —

    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.



861
862
863
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 861

def empty_room_timeout
    @properties['empty_room_timeout']
end

#enable_turn ⇒ Boolean

Returns Deprecated, now always considered to be true.

Returns:

  • (Boolean) —

    Deprecated, now always considered to be true.



777
778
779
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 777

def enable_turn
    @properties['enable_turn']
end

#end_time ⇒ Time

Returns The UTC end time of the room in ISO 8601 format.

Returns:

  • (Time) —

    The UTC end time of the room in ISO 8601 format.



801
802
803
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 801

def end_time
    @properties['end_time']
end

#fetch ⇒ RoomInstance

Fetch the RoomInstance

Returns:



892
893
894
895
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 892

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



947
948
949
950
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 947

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.

Returns:

  • (Boolean) —

    Indicates if this is a large room.



873
874
875
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 873

def large_room
    @properties['large_room']
end

Returns The URLs of related resources.

Returns:

  • (Hash) —

    The URLs of related resources.



885
886
887
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 885

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 for more details. If it is set to 0 it means unconstrained.

Returns:

  • (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. Check Programmable Video Limits for more details. If it is set to 0 it means unconstrained.



831
832
833
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 831

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).

Returns:

  • (String) —

    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).



825
826
827
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 825

def max_participant_duration
    @properties['max_participant_duration']
end

#max_participants ⇒ String

Returns The maximum number of concurrent Participants allowed in the room.

Returns:

  • (String) —

    The maximum number of concurrent Participants allowed in the room.



819
820
821
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 819

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.

Returns:



849
850
851
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 849

def media_region
    @properties['media_region']
end

#participants ⇒ participants

Access the participants

Returns:



920
921
922
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 920

def participants
    context.participants
end

#record_participants_on_connect ⇒ Boolean

Returns Whether to start recording when Participants connect.

Returns:

  • (Boolean) —

    Whether to start recording when Participants connect.



837
838
839
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 837

def record_participants_on_connect
    @properties['record_participants_on_connect']
end

#recording_rules ⇒ recording_rules

Access the recording_rules

Returns:



913
914
915
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 913

def recording_rules
    context.recording_rules
end

#recordings ⇒ recordings

Access the recordings

Returns:



934
935
936
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 934

def recordings
    context.recordings
end

#sid ⇒ String

Returns The unique string that Twilio created to identify the Room resource.

Returns:

  • (String) —

    The unique string that Twilio created to identify the Room resource.



747
748
749
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 747

def sid
    @properties['sid']
end

#status ⇒ RoomStatus

Returns:

  • (RoomStatus)


753
754
755
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 753

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 for more info.

Returns:

  • (String) —

    The URL Twilio calls using the status_callback_method to send status information to your application on every room event. See Status Callbacks for more info.



789
790
791
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 789

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.

Returns:

  • (String) —

    The HTTP method Twilio uses to call status_callback. Can be POST or GET and defaults to POST.



795
796
797
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 795

def status_callback_method
    @properties['status_callback_method']
end

#to_s ⇒ Object

Provide a user friendly representation



940
941
942
943
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 940

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Video.V1.RoomInstance #{values}>"
end

#transcriptions ⇒ transcriptions

Access the transcriptions

Returns:



927
928
929
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 927

def transcriptions
    context.transcriptions
end

#type ⇒ RoomType

Returns:

  • (RoomType)


813
814
815
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 813

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 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.

Returns:

  • (String) —

    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 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.



783
784
785
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 783

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.

Returns:

  • (String) —

    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.



867
868
869
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 867

def unused_room_timeout
    @properties['unused_room_timeout']
end

#update(status: nil) ⇒ RoomInstance

Update the RoomInstance

Parameters:

  • status (RoomStatus) (defaults to: nil)

Returns:



901
902
903
904
905
906
907
908
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 901

def update(
  status: nil
)

    context.update(
        status: status, 
    )
end

#url ⇒ String

Returns The absolute URL of the resource.

Returns:

  • (String) —

    The absolute URL of the resource.



879
880
881
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 879

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.

Returns:

  • (Array<VideoCodec>) —

    An array of the video codecs that are supported when publishing a track in the room. Can be: VP8 and H264.



843
844
845
# File 'lib/twilio-ruby/rest/video/v1/room.rb', line 843

def video_codecs
    @properties['video_codecs']
end