Class: Twilio::REST::Insights::V1::RoomContext::ParticipantInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/insights/v1/room/participant.rb

Instance Method Summary collapse

Constructor Details

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

Initialize the ParticipantInstance



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 222

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

Instance Method Details

#account_sidString



294
295
296
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 294

def 
    @properties['account_sid']
end

#codecsArray<Codec>



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

def codecs
    @properties['codecs']
end

#contextParticipantContext

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



255
256
257
258
259
260
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 255

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

#duration_secString



288
289
290
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 288

def duration_sec
    @properties['duration_sec']
end

#edge_locationEdgeLocation



348
349
350
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 348

def edge_location
    @properties['edge_location']
end

#end_reasonString



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

def end_reason
    @properties['end_reason']
end

#error_codeString



324
325
326
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 324

def error_code
    @properties['error_code']
end

#error_code_urlString



330
331
332
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 330

def error_code_url
    @properties['error_code_url']
end

#fetchParticipantInstance

Fetch the ParticipantInstance



367
368
369
370
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 367

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



381
382
383
384
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 381

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

#join_timeTime



276
277
278
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 276

def join_time
    @properties['join_time']
end

#leave_timeTime



282
283
284
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 282

def leave_time
    @properties['leave_time']
end

#media_regionTwilioRealm



336
337
338
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 336

def media_region
    @properties['media_region']
end

#participant_identityString



270
271
272
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 270

def participant_identity
    @properties['participant_identity']
end

#participant_sidString



264
265
266
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 264

def participant_sid
    @properties['participant_sid']
end

#propertiesHash



342
343
344
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 342

def properties
    @properties['properties']
end

#publisher_infoHash



354
355
356
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 354

def publisher_info
    @properties['publisher_info']
end

#room_sidString



300
301
302
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 300

def room_sid
    @properties['room_sid']
end

#statusRoomStatus



306
307
308
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 306

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



374
375
376
377
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 374

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

#urlString



360
361
362
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 360

def url
    @properties['url']
end