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
Instance Method Summary collapse
-
#account_sid ⇒ String
Account SID associated with the room.
-
#codecs ⇒ Array<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 ⇒ EdgeLocation
-
#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 ⇒ TwilioRealm
-
#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 ⇒ RoomStatus
-
#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
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 380 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_sid ⇒ String
Returns Account SID associated with the room.
453 454 455 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 453 def account_sid @properties['account_sid'] end |
#codecs ⇒ Array<Codec>
Returns Codecs detected from the participant. Can be VP8, H264, or VP9.
471 472 473 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 471 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
414 415 416 417 418 419 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 414 def context unless @instance_context @instance_context = ParticipantContext.new(@version , @params['room_sid'], @params['participant_sid']) end @instance_context end |
#duration_sec ⇒ String
Returns Amount of time in seconds the participant was in the room.
447 448 449 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 447 def duration_sec @properties['duration_sec'] end |
#edge_location ⇒ EdgeLocation
507 508 509 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 507 def edge_location @properties['edge_location'] end |
#end_reason ⇒ String
Returns Reason the participant left the room. See [the list of possible values here](www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#end_reason).
477 478 479 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 477 def end_reason @properties['end_reason'] end |
#error_code ⇒ String
Returns Errors encountered by the participant.
483 484 485 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 483 def error_code @properties['error_code'] end |
#error_code_url ⇒ String
Returns Twilio error code dictionary link.
489 490 491 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 489 def error_code_url @properties['error_code_url'] end |
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance
526 527 528 529 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 526 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
540 541 542 543 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 540 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.ParticipantInstance #{values}>" end |
#join_time ⇒ Time
Returns When the participant joined the room.
435 436 437 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 435 def join_time @properties['join_time'] end |
#leave_time ⇒ Time
Returns When the participant left the room.
441 442 443 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 441 def leave_time @properties['leave_time'] end |
#media_region ⇒ TwilioRealm
495 496 497 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 495 def media_region @properties['media_region'] end |
#participant_identity ⇒ String
Returns The application-defined string that uniquely identifies the participant within a Room.
429 430 431 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 429 def participant_identity @properties['participant_identity'] end |
#participant_sid ⇒ String
Returns Unique identifier for the participant.
423 424 425 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 423 def participant_sid @properties['participant_sid'] end |
#properties ⇒ Hash
Returns Object containing information about the participant’s data from the room. See [below](www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#properties) for more information.
501 502 503 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 501 def properties @properties['properties'] end |
#publisher_info ⇒ Hash
Returns Object containing information about the SDK name and version. See [below](www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#publisher_info) for more information.
513 514 515 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 513 def publisher_info @properties['publisher_info'] end |
#room_sid ⇒ String
Returns Unique identifier for the room.
459 460 461 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 459 def room_sid @properties['room_sid'] end |
#status ⇒ RoomStatus
465 466 467 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 465 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
533 534 535 536 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 533 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.ParticipantInstance #{values}>" end |
#url ⇒ String
Returns URL of the participant resource.
519 520 521 |
# File 'lib/twilio-ruby/rest/insights/v1/room/participant.rb', line 519 def url @properties['url'] end |