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.
-
#device_api_version ⇒ DeviceApiVersionEnum
Optional field to define the device api version of 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, device_api_version = DeviceApiVersionEnum::V2) ⇒ Participant
constructor
A new instance of Participant.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, callback_url = nil, publish_permissions = nil, sessions = nil, subscriptions = nil, tag = nil, device_api_version = DeviceApiVersionEnum::V2) ⇒ Participant
Returns a new instance of Participant.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 75 def initialize(id = nil, callback_url = nil, = nil, sessions = nil, subscriptions = nil, tag = nil, device_api_version = DeviceApiVersionEnum::V2) @id = id unless id == SKIP @callback_url = callback_url unless callback_url == SKIP @publish_permissions = unless == SKIP @sessions = sessions unless sessions == SKIP @subscriptions = subscriptions unless subscriptions == SKIP @tag = tag unless tag == SKIP @device_api_version = device_api_version unless device_api_version == SKIP end |
Instance Attribute Details
#callback_url ⇒ String
Full callback url to use for notifications about this participant
18 19 20 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 18 def callback_url @callback_url end |
#device_api_version ⇒ DeviceApiVersionEnum
Optional field to define the device api version of this participant
40 41 42 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 40 def device_api_version @device_api_version end |
#id ⇒ String
Unique id of the participant
14 15 16 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 14 def id @id end |
#publish_permissions ⇒ List of PublishPermissionEnum
Defines if this participant can publish audio or video
22 23 24 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 22 def @publish_permissions end |
#sessions ⇒ List of String
List of session ids this participant is associated with Capped to one
27 28 29 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 27 def sessions @sessions end |
#subscriptions ⇒ Subscriptions
List of session ids this participant is associated with Capped to one
32 33 34 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 32 def subscriptions @subscriptions end |
#tag ⇒ String
User defined tag to associate with the participant
36 37 38 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 36 def tag @tag end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP callback_url = hash.key?('callbackUrl') ? hash['callbackUrl'] : SKIP = hash.key?('publishPermissions') ? hash['publishPermissions'] : SKIP sessions = hash.key?('sessions') ? hash['sessions'] : SKIP subscriptions = Subscriptions.from_hash(hash['subscriptions']) if hash['subscriptions'] tag = hash.key?('tag') ? hash['tag'] : SKIP device_api_version = hash['deviceApiVersion'] ||= DeviceApiVersionEnum::V2 # Create object from extracted values. Participant.new(id, callback_url, , sessions, subscriptions, tag, device_api_version) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 43 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['device_api_version'] = 'deviceApiVersion' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
69 70 71 72 73 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 69 def nullables %w[ callback_url ] end |
#optionals ⇒ Object
An array for optional fields
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb', line 56 def optionals %w[ id callback_url publish_permissions sessions subscriptions tag device_api_version ] end |