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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, room_sid, participant_sid, sid) ⇒ SubscribedTrackContext

Initialize the SubscribedTrackContext

Parameters:

  • version (Version)

    Version that contains the resource

  • room_sid (String)

    The SID of the Room where the Track resource to fetch is subscribed.

  • participant_sid (String)

    The SID of the participant that subscribes to the Track resource to fetch.

  • sid (String)

    The SID of the RoomParticipantSubscribedTrack resource to fetch.



141
142
143
144
145
146
147
148
149
# File 'lib/twilio-ruby/rest/video/v1/room/participant/subscribed_track.rb', line 141

def initialize(version, room_sid, participant_sid, sid)
    super(version)

    # Path Solution
    @solution = { room_sid: room_sid, participant_sid: participant_sid, sid: sid,  }
    @uri = "/Rooms/#{@solution[:room_sid]}/Participants/#{@solution[:participant_sid]}/SubscribedTracks/#{@solution[:sid]}"

    
end

Instance Method Details

#fetchSubscribedTrackInstance

Fetch the SubscribedTrackInstance

Returns:



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/twilio-ruby/rest/video/v1/room/participant/subscribed_track.rb', line 153

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



181
182
183
184
# File 'lib/twilio-ruby/rest/video/v1/room/participant/subscribed_track.rb', line 181

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Video.V1.SubscribedTrackContext #{context}>"
end

#to_sObject

Provide a user friendly representation



174
175
176
177
# File 'lib/twilio-ruby/rest/video/v1/room/participant/subscribed_track.rb', line 174

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Video.V1.SubscribedTrackContext #{context}>"
end