Class: Twilio::REST::Video::V1::RoomContext::ParticipantContext::SubscribeRulesList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Video::V1::RoomContext::ParticipantContext::SubscribeRulesList
- Defined in:
- lib/twilio-ruby/rest/video/v1/room/participant/subscribe_rules.rb
Instance Method Summary collapse
-
#fetch ⇒ SubscribeRulesInstance
Fetch the SubscribeRulesInstance.
-
#initialize(version, room_sid: nil, participant_sid: nil) ⇒ SubscribeRulesList
constructor
Initialize the SubscribeRulesList.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(rules: :unset) ⇒ SubscribeRulesInstance
Update the SubscribeRulesInstance.
Constructor Details
#initialize(version, room_sid: nil, participant_sid: nil) ⇒ SubscribeRulesList
Initialize the SubscribeRulesList
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
#fetch ⇒ SubscribeRulesInstance
Fetch the SubscribeRulesInstance
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_s ⇒ Object
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
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 |