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

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

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

  • room_sid (String) (defaults to: nil)

    The SID of the Room resource for the Subscribe Rules

  • participant_sid (String) (defaults to: nil)

    The SID of the Participant resource for the Subscribe Rules.



25
26
27
28
29
30
31
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb', line 25

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:



36
37
38
39
40
41
42
43
44
45
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb', line 36

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

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

#to_sObject

Provide a user friendly representation



69
70
71
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb', line 69

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

#update(rules: :unset) ⇒ SubscribeRulesInstance

Update the SubscribeRulesInstance

Parameters:

Returns:



54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb', line 54

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

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

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