class Twilio::REST::Video::V1::RoomContext::ParticipantContext::SubscribedTrackInstance

Public Class Methods

new(version, payload, room_sid: nil, participant_sid: nil, sid: nil) click to toggle source

Initialize the SubscribedTrackInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] room_sid The SID of the room where the track is published. @param [String] participant_sid The SID of the participant that subscribes to

the track.

@param [String] sid The SID of the RoomParticipantSubscribedTrack resource to

fetch.

@return [SubscribedTrackInstance] SubscribedTrackInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
212 def initialize(version, payload, room_sid: nil, participant_sid: nil, sid: nil)
213   super(version)
214 
215   # Marshaled Properties
216   @properties = {
217       'sid' => payload['sid'],
218       'participant_sid' => payload['participant_sid'],
219       'publisher_sid' => payload['publisher_sid'],
220       'room_sid' => payload['room_sid'],
221       'name' => payload['name'],
222       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
223       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
224       'enabled' => payload['enabled'],
225       'kind' => payload['kind'],
226       'url' => payload['url'],
227   }
228 
229   # Context
230   @instance_context = nil
231   @params = {
232       'room_sid' => room_sid,
233       'participant_sid' => participant_sid,
234       'sid' => sid || @properties['sid'],
235   }
236 end

Public Instance Methods

context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [SubscribedTrackContext] SubscribedTrackContext for this SubscribedTrackInstance

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
242 def context
243   unless @instance_context
244     @instance_context = SubscribedTrackContext.new(
245         @version,
246         @params['room_sid'],
247         @params['participant_sid'],
248         @params['sid'],
249     )
250   end
251   @instance_context
252 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
286 def date_created
287   @properties['date_created']
288 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
292 def date_updated
293   @properties['date_updated']
294 end
enabled() click to toggle source

@return [Boolean] Whether the track is enabled

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
298 def enabled
299   @properties['enabled']
300 end
fetch() click to toggle source

Fetch the SubscribedTrackInstance @return [SubscribedTrackInstance] Fetched SubscribedTrackInstance

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
317 def fetch
318   context.fetch
319 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
330 def inspect
331   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
332   "<Twilio.Video.V1.SubscribedTrackInstance #{values}>"
333 end
kind() click to toggle source

@return [subscribed_track.Kind] The track type

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
304 def kind
305   @properties['kind']
306 end
name() click to toggle source

@return [String] The track name

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
280 def name
281   @properties['name']
282 end
participant_sid() click to toggle source

@return [String] The SID of the participant that subscribes to the track

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
262 def participant_sid
263   @properties['participant_sid']
264 end
publisher_sid() click to toggle source

@return [String] The SID of the participant that publishes the track

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
268 def publisher_sid
269   @properties['publisher_sid']
270 end
room_sid() click to toggle source

@return [String] The SID of the room where the track is published

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
274 def room_sid
275   @properties['room_sid']
276 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
256 def sid
257   @properties['sid']
258 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
323 def to_s
324   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
325   "<Twilio.Video.V1.SubscribedTrackInstance #{values}>"
326 end
url() click to toggle source

@return [String] The absolute URL of the resource

    # File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb
310 def url
311   @properties['url']
312 end