Class: Twilio::REST::Video::V1::RoomContext::ParticipantContext::SubscribeRulesList

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

Instance Method Summary collapse

Constructor Details

#initialize(version, room_sid: nil, participant_sid: nil) ⇒ SubscribeRulesList

Initialize the SubscribeRulesList

Parameters:

  • version (Version)

    Version that contains the resource



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

def initialize(version, room_sid: nil, participant_sid: nil)
    super(version)
    # Path Solution
    @solution = { room_sid: room_sid, participant_sid: participant_sid }
    @uri = "/Rooms/#{@solution[:room_sid]}/Participants/#{@solution[:participant_sid]}/SubscribeRules"
    
end

Instance Method Details

#fetchSubscribeRulesInstance

Fetch the SubscribeRulesInstance

Returns:



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

def fetch

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

#to_sObject

Provide a user friendly representation



87
88
89
# File 'lib/twilio-ruby/rest/video/v1/room/participant/subscribe_rules.rb', line 87

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

#update(rules: :unset) ⇒ SubscribeRulesInstance

Update the SubscribeRulesInstance

Parameters:

Returns:



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

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)
    SubscribeRulesInstance.new(
        @version,
        payload,
        room_sid: @solution[:room_sid],
        participant_sid: @solution[:participant_sid],
    )
end