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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, room_sid: nil, participant_sid: nil, sid: nil) ⇒ SubscribedTrackInstance

Initialize the SubscribedTrackInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • room_sid (String) (defaults to: nil)

    The SID of the room where the track is published.

  • participant_sid (String) (defaults to: nil)

    The SID of the participant that subscribes to the track.

  • sid (String) (defaults to: nil)

    The SID of the RoomParticipantSubscribedTrack resource to fetch.



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 212

def initialize(version, payload, room_sid: nil, participant_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'participant_sid' => payload['participant_sid'],
      'publisher_sid' => payload['publisher_sid'],
      'room_sid' => payload['room_sid'],
      'name' => payload['name'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'enabled' => payload['enabled'],
      'kind' => payload['kind'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {
      'room_sid' => room_sid,
      'participant_sid' => participant_sid,
      'sid' => sid || @properties['sid'],
  }
end

Instance Method Details

#contextSubscribedTrackContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



242
243
244
245
246
247
248
249
250
251
252
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 242

def context
  unless @instance_context
    @instance_context = SubscribedTrackContext.new(
        @version,
        @params['room_sid'],
        @params['participant_sid'],
        @params['sid'],
    )
  end
  @instance_context
end

#date_createdTime

Returns The ISO 8601 date and time in GMT when the resource was created.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the resource was created



286
287
288
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 286

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The ISO 8601 date and time in GMT when the resource was last updated.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the resource was last updated



292
293
294
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 292

def date_updated
  @properties['date_updated']
end

#enabledBoolean

Returns Whether the track is enabled.

Returns:

  • (Boolean)

    Whether the track is enabled



298
299
300
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 298

def enabled
  @properties['enabled']
end

#fetchSubscribedTrackInstance

Fetch the SubscribedTrackInstance

Returns:



317
318
319
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 317

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



330
331
332
333
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 330

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Video.V1.SubscribedTrackInstance #{values}>"
end

#kindsubscribed_track.Kind

Returns The track type.

Returns:

  • (subscribed_track.Kind)

    The track type



304
305
306
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 304

def kind
  @properties['kind']
end

#nameString

Returns The track name.

Returns:

  • (String)

    The track name



280
281
282
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 280

def name
  @properties['name']
end

#participant_sidString

Returns The SID of the participant that subscribes to the track.

Returns:

  • (String)

    The SID of the participant that subscribes to the track



262
263
264
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 262

def participant_sid
  @properties['participant_sid']
end

#publisher_sidString

Returns The SID of the participant that publishes the track.

Returns:

  • (String)

    The SID of the participant that publishes the track



268
269
270
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 268

def publisher_sid
  @properties['publisher_sid']
end

#room_sidString

Returns The SID of the room where the track is published.

Returns:

  • (String)

    The SID of the room where the track is published



274
275
276
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 274

def room_sid
  @properties['room_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource



256
257
258
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 256

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



323
324
325
326
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 323

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Video.V1.SubscribedTrackInstance #{values}>"
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource



310
311
312
# File 'lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb', line 310

def url
  @properties['url']
end