class Bandwidth::Participant

A participant object

Attributes

callback_url[RW]

Full callback url to use for notifications about this participant @return [String]

device_api_version[RW]

Optional field to define the device api version of this participant @return [DeviceApiVersionEnum]

id[RW]

Unique id of the participant @return [String]

publish_permissions[RW]

Defines if this participant can publish audio or video @return [List of PublishPermissionEnum]

sessions[RW]

List of session ids this participant is associated with Capped to one @return [List of String]

subscriptions[RW]

List of session ids this participant is associated with Capped to one @return [Subscriptions]

tag[RW]

User defined tag to associate with the participant @return [String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb, line 69
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash['id']
  callback_url = hash['callbackUrl']
  publish_permissions = hash['publishPermissions']
  sessions = hash['sessions']
  subscriptions = Subscriptions.from_hash(hash['subscriptions']) if
    hash['subscriptions']
  tag = hash['tag']
  device_api_version = hash['deviceApiVersion'] ||= DeviceApiVersionEnum::V2

  # Create object from extracted values.
  Participant.new(id,
                  callback_url,
                  publish_permissions,
                  sessions,
                  subscriptions,
                  tag,
                  device_api_version)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb, line 40
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
new(id = nil, callback_url = nil, publish_permissions = nil, sessions = nil, subscriptions = nil, tag = nil, device_api_version = DeviceApiVersionEnum::V2) click to toggle source
# File lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb, line 52
def initialize(id = nil,
               callback_url = nil,
               publish_permissions = nil,
               sessions = nil,
               subscriptions = nil,
               tag = nil,
               device_api_version = DeviceApiVersionEnum::V2)
  @id = id
  @callback_url = callback_url
  @publish_permissions = publish_permissions
  @sessions = sessions
  @subscriptions = subscriptions
  @tag = tag
  @device_api_version = device_api_version
end