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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, room_sid: nil) ⇒ RecordingRulesList

Initialize the RecordingRulesList

Parameters:

  • version (Version)

    Version that contains the resource



28
29
30
31
32
33
34
# File 'lib/twilio-ruby/rest/video/v1/room/recording_rules.rb', line 28

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:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/twilio-ruby/rest/video/v1/room/recording_rules.rb', line 38

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    RecordingRulesInstance.new(
        @version,
        payload,
        room_sid: @solution[:room_sid],
    )
end

#to_sObject

Provide a user friendly representation



84
85
86
# File 'lib/twilio-ruby/rest/video/v1/room/recording_rules.rb', line 84

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

#update(rules: :unset) ⇒ RecordingRulesInstance

Update the RecordingRulesInstance

Parameters:

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

    A JSON-encoded array of recording rules.

Returns:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/twilio-ruby/rest/video/v1/room/recording_rules.rb', line 58

def update(
    rules: :unset
)

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

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    RecordingRulesInstance.new(
        @version,
        payload,
        room_sid: @solution[:room_sid],
    )
end