Class: Twilio::REST::Video::V1::RoomContext::RecordingRulesList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, room_sid: nil) ⇒ RecordingRulesList

Initialize the RecordingRulesList

Parameters:

  • version (Version)

    Version that contains the resource

  • room_sid (String) (defaults to: nil)

    The SID of the Room resource for the Recording Rules


20
21
22
23
24
25
26
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb', line 20

def initialize(version, room_sid: nil)
  super(version)

  # Path Solution
  @solution = {room_sid: room_sid}
  @uri = "/Rooms/#{@solution[:room_sid]}/RecordingRules"
end

Instance Method Details

#fetchRecordingRulesInstance

Fetch the RecordingRulesInstance

Returns:


31
32
33
34
35
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb', line 31

def fetch
  payload = @version.fetch('GET', @uri)

  RecordingRulesInstance.new(@version, payload, room_sid: @solution[:room_sid], )
end

#to_sObject

Provide a user friendly representation


51
52
53
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb', line 51

def to_s
  '#<Twilio.Video.V1.RecordingRulesList>'
end

#update(rules: :unset) ⇒ RecordingRulesInstance

Update the RecordingRulesInstance

Parameters:

  • rules (Hash) (defaults to: :unset)

    A JSON-encoded array of recording rules.

Returns:


41
42
43
44
45
46
47
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb', line 41

def update(rules: :unset)
  data = Twilio::Values.of({'Rules' => Twilio.serialize_object(rules), })

  payload = @version.update('POST', @uri, data: data)

  RecordingRulesInstance.new(@version, payload, room_sid: @solution[:room_sid], )
end