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

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

Instance Method Summary collapse

Constructor Details

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

Initialize the PublishedTrackInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this PublishedTrack resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



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

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'],
        '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  || @properties['room_sid']  ,'participant_sid' => participant_sid  || @properties['participant_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#contextPublishedTrackContext

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

Returns:



240
241
242
243
244
245
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 240

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

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



273
274
275
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 273

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



279
280
281
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 279

def date_updated
    @properties['date_updated']
end

#enabledBoolean

Returns Whether the track is enabled.

Returns:

  • (Boolean)

    Whether the track is enabled.



285
286
287
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 285

def enabled
    @properties['enabled']
end

#fetchPublishedTrackInstance

Fetch the PublishedTrackInstance

Returns:



304
305
306
307
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 304

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



318
319
320
321
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 318

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

#kindKind

Returns:

  • (Kind)


291
292
293
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 291

def kind
    @properties['kind']
end

#nameString

Returns The track name. Must be no more than 128 characters, and be unique among the participant’s published tracks.

Returns:

  • (String)

    The track name. Must be no more than 128 characters, and be unique among the participant’s published tracks.



267
268
269
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 267

def name
    @properties['name']
end

#participant_sidString

Returns The SID of the Participant resource with the published track.

Returns:

  • (String)

    The SID of the Participant resource with the published track.



255
256
257
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 255

def participant_sid
    @properties['participant_sid']
end

#room_sidString

Returns The SID of the Room resource where the track is published.

Returns:

  • (String)

    The SID of the Room resource where the track is published.



261
262
263
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 261

def room_sid
    @properties['room_sid']
end

#sidString

Returns The unique string that we created to identify the RoomParticipantPublishedTrack resource.

Returns:

  • (String)

    The unique string that we created to identify the RoomParticipantPublishedTrack resource.



249
250
251
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 249

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



311
312
313
314
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 311

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

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource.



297
298
299
# File 'lib/twilio-ruby/rest/video/v1/room/participant/published_track.rb', line 297

def url
    @properties['url']
end