class Twilio::REST::Insights::V1::RoomContext::ParticipantInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the ParticipantInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] room_sid
Unique identifier for the room. @param [String] participant_sid
The SID of the Participant resource. @return [ParticipantInstance] ParticipantInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 204 def initialize(version, payload, room_sid: nil, participant_sid: nil) 205 super(version) 206 207 # Marshaled Properties 208 @properties = { 209 'participant_sid' => payload['participant_sid'], 210 'participant_identity' => payload['participant_identity'], 211 'join_time' => Twilio.deserialize_iso8601_datetime(payload['join_time']), 212 'leave_time' => Twilio.deserialize_iso8601_datetime(payload['leave_time']), 213 'duration_sec' => payload['duration_sec'].to_i, 214 'account_sid' => payload['account_sid'], 215 'room_sid' => payload['room_sid'], 216 'status' => payload['status'], 217 'codecs' => payload['codecs'], 218 'end_reason' => payload['end_reason'], 219 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i, 220 'error_code_url' => payload['error_code_url'], 221 'media_region' => payload['media_region'], 222 'properties' => payload['properties'], 223 'edge_location' => payload['edge_location'], 224 'publisher_info' => payload['publisher_info'], 225 'url' => payload['url'], 226 } 227 228 # Context 229 @instance_context = nil 230 @params = { 231 'room_sid' => room_sid, 232 'participant_sid' => participant_sid || @properties['participant_sid'], 233 } 234 end
Public Instance Methods
@return [String] Account SID associated with the room.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 283 def account_sid 284 @properties['account_sid'] 285 end
@return [Array] Codecs detected from the participant.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 301 def codecs 302 @properties['codecs'] 303 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ParticipantContext] ParticipantContext
for this ParticipantInstance
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 240 def context 241 unless @instance_context 242 @instance_context = ParticipantContext.new( 243 @version, 244 @params['room_sid'], 245 @params['participant_sid'], 246 ) 247 end 248 @instance_context 249 end
@return [String] Amount of time in seconds the participant was in the room.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 277 def duration_sec 278 @properties['duration_sec'] 279 end
@return [participant.EdgeLocation] Name of the edge location the participant connected to.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 337 def edge_location 338 @properties['edge_location'] 339 end
@return [String] Reason the participant left the room.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 307 def end_reason 308 @properties['end_reason'] 309 end
@return [String] Errors encountered by the participant.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 313 def error_code 314 @properties['error_code'] 315 end
@return [String] Twilio
error code dictionary link.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 319 def error_code_url 320 @properties['error_code_url'] 321 end
Fetch the ParticipantInstance
@return [ParticipantInstance] Fetched ParticipantInstance
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 356 def fetch 357 context.fetch 358 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 369 def inspect 370 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 371 "<Twilio.Insights.V1.ParticipantInstance #{values}>" 372 end
@return [Time] When the participant joined the room.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 265 def join_time 266 @properties['join_time'] 267 end
@return [Time] When the participant left the room
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 271 def leave_time 272 @properties['leave_time'] 273 end
@return [participant.TwilioRealm] Twilio
media region the participant connected to.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 325 def media_region 326 @properties['media_region'] 327 end
@return [String] The application-defined string that uniquely identifies the participant within a Room.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 259 def participant_identity 260 @properties['participant_identity'] 261 end
@return [String] Unique identifier for the participant.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 253 def participant_sid 254 @properties['participant_sid'] 255 end
@return [Hash] Object containing information about the participant's data from the room.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 331 def properties 332 @properties['properties'] 333 end
@return [Hash] Object containing information about the SDK name and version.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 343 def publisher_info 344 @properties['publisher_info'] 345 end
@return [String] Unique identifier for the room.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 289 def room_sid 290 @properties['room_sid'] 291 end
@return [participant.RoomStatus] Status of the room.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 295 def status 296 @properties['status'] 297 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 362 def to_s 363 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 364 "<Twilio.Insights.V1.ParticipantInstance #{values}>" 365 end
@return [String] URL of the participant resource.
# File lib/twilio-ruby/rest/insights/v1/room/participant.rb 349 def url 350 @properties['url'] 351 end