class Twilio::REST::Video::V1::RoomContext::ParticipantContext::PublishedTrackInstance
Public Class Methods
Initialize the PublishedTrackInstance
@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 resource where the track is
published.
@param [String] participant_sid
The SID of the Participant resource with the
published track.
@param [String] sid The SID of the RoomParticipantPublishedTrack resource to
fetch.
@return [PublishedTrackInstance] PublishedTrackInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 214 def initialize(version, payload, room_sid: nil, participant_sid: nil, sid: nil) 215 super(version) 216 217 # Marshaled Properties 218 @properties = { 219 'sid' => payload['sid'], 220 'participant_sid' => payload['participant_sid'], 221 'room_sid' => payload['room_sid'], 222 'name' => payload['name'], 223 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 224 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 225 'enabled' => payload['enabled'], 226 'kind' => payload['kind'], 227 'url' => payload['url'], 228 } 229 230 # Context 231 @instance_context = nil 232 @params = { 233 'room_sid' => room_sid, 234 'participant_sid' => participant_sid, 235 'sid' => sid || @properties['sid'], 236 } 237 end
Public Instance Methods
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [PublishedTrackContext] PublishedTrackContext
for this PublishedTrackInstance
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 243 def context 244 unless @instance_context 245 @instance_context = PublishedTrackContext.new( 246 @version, 247 @params['room_sid'], 248 @params['participant_sid'], 249 @params['sid'], 250 ) 251 end 252 @instance_context 253 end
@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_published_track.rb 281 def date_created 282 @properties['date_created'] 283 end
@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_published_track.rb 287 def date_updated 288 @properties['date_updated'] 289 end
@return [Boolean] Whether the track is enabled
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 293 def enabled 294 @properties['enabled'] 295 end
Fetch the PublishedTrackInstance
@return [PublishedTrackInstance] Fetched PublishedTrackInstance
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 312 def fetch 313 context.fetch 314 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 325 def inspect 326 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 327 "<Twilio.Video.V1.PublishedTrackInstance #{values}>" 328 end
@return [published_track.Kind] The track type
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 299 def kind 300 @properties['kind'] 301 end
@return [String] The track name
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 275 def name 276 @properties['name'] 277 end
@return [String] The SID of the Participant resource with the published track
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 263 def participant_sid 264 @properties['participant_sid'] 265 end
@return [String] The SID of the Room resource where the track is published
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 269 def room_sid 270 @properties['room_sid'] 271 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 257 def sid 258 @properties['sid'] 259 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 318 def to_s 319 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 320 "<Twilio.Video.V1.PublishedTrackInstance #{values}>" 321 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb 305 def url 306 @properties['url'] 307 end