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 unique Room identifier for the Subscribe Rules

  • participant_sid (String) (defaults to: nil)

    The unique Participant identifier 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 a SubscribeRulesInstance

Returns:



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

def fetch
  params = Twilio::Values.of({})

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

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

#to_sObject

Provide a user friendly representation



79
80
81
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb', line 79

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
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb', line 60

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