Class: Bandwidth::Participant
- Defined in:
- lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb
Overview
A participant object
Instance Attribute Summary collapse
-
#callback_url ⇒ String
Full callback url to use for notifications about this participant.
-
#id ⇒ String
Unique id of the participant.
-
#publish_permissions ⇒ List of PublishPermissionEnum
Defines if this participant can publish audio or video.
-
#sessions ⇒ List of String
List of session ids this participant is associated with Capped to one.
-
#subscriptions ⇒ Subscriptions
List of session ids this participant is associated with Capped to one.
-
#tag ⇒ String
User defined tag to associate with the participant.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(id = nil, callback_url = nil, publish_permissions = nil, sessions = nil, subscriptions = nil, tag = nil) ⇒ Participant
constructor
A new instance of Participant.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, callback_url = nil, publish_permissions = nil, sessions = nil, subscriptions = nil, tag = nil) ⇒ Participant
Returns a new instance of Participant.
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 47 def initialize(id = nil, callback_url = nil, = nil, sessions = nil, subscriptions = nil, tag = nil) @id = id @callback_url = callback_url @publish_permissions = @sessions = sessions @subscriptions = subscriptions @tag = tag end |
Instance Attribute Details
#callback_url ⇒ String
Full callback url to use for notifications about this participant
15 16 17 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 15 def callback_url @callback_url end |
#id ⇒ String
Unique id of the participant
11 12 13 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 11 def id @id end |
#publish_permissions ⇒ List of PublishPermissionEnum
Defines if this participant can publish audio or video
19 20 21 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 19 def @publish_permissions end |
#sessions ⇒ List of String
List of session ids this participant is associated with Capped to one
24 25 26 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 24 def sessions @sessions end |
#subscriptions ⇒ Subscriptions
List of session ids this participant is associated with Capped to one
29 30 31 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 29 def subscriptions @subscriptions end |
#tag ⇒ String
User defined tag to associate with the participant
33 34 35 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 33 def tag @tag end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash['id'] callback_url = hash['callbackUrl'] = hash['publishPermissions'] sessions = hash['sessions'] subscriptions = Subscriptions.from_hash(hash['subscriptions']) if hash['subscriptions'] tag = hash['tag'] # Create object from extracted values. Participant.new(id, callback_url, , sessions, subscriptions, tag) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['callback_url'] = 'callbackUrl' @_hash['publish_permissions'] = 'publishPermissions' @_hash['sessions'] = 'sessions' @_hash['subscriptions'] = 'subscriptions' @_hash['tag'] = 'tag' @_hash end |