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
The account_sid.
-
#codecs ⇒ Array[participant.Codec]
The codecs.
-
#context ⇒ ParticipantContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#duration_sec ⇒ String
The duration_sec.
-
#edge_location ⇒ participant.EdgeLocation
The edge_location.
-
#end_reason ⇒ String
The end_reason.
-
#error_code ⇒ String
The error_code.
-
#error_code_url ⇒ String
The error_code_url.
-
#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
The join_time.
-
#leave_time ⇒ Time
The leave_time.
-
#media_region ⇒ participant.TwilioRealm
The media_region.
-
#participant_identity ⇒ String
The participant_identity.
-
#participant_sid ⇒ String
The participant_sid.
-
#properties ⇒ Hash
The properties.
-
#publisher_info ⇒ Hash
The publisher_info.
-
#room_sid ⇒ String
The room_sid.
-
#status ⇒ participant.RoomStatus
The status.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
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
Returns The account_sid.
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]
Returns The codecs.
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
Returns The duration_sec.
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
Returns The edge_location.
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
Returns The end_reason.
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
Returns The error_code.
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
Returns The error_code_url.
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
Returns The join_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
Returns The leave_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
Returns The media_region.
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
Returns The participant_identity.
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
Returns The participant_sid.
253 254 255 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 253 def participant_sid @properties['participant_sid'] end |
#properties ⇒ Hash
Returns The properties.
331 332 333 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 331 def properties @properties['properties'] end |
#publisher_info ⇒ Hash
Returns The publisher_info.
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
Returns The room_sid.
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
Returns The status.
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
Returns The url.
349 350 351 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 349 def url @properties['url'] end |