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