class Bandwidth::Subscriptions

Subscriptions Model.

Attributes

participants[RW]

Subset of participants to subscribe to in the session. Optional. @return [List of ParticipantSubscription]

session_id[RW]

Session the subscriptions are associated with If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session) @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/subscriptions.rb, line 35
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  session_id = hash['sessionId']
  # Parameter is an array, so we need to iterate through it
  participants = nil
  unless hash['participants'].nil?
    participants = []
    hash['participants'].each do |structure|
      participants << (ParticipantSubscription.from_hash(structure) if structure)
    end
  end

  # Create object from extracted values.
  Subscriptions.new(session_id,
                    participants)
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/subscriptions.rb, line 21
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['session_id'] = 'sessionId'
  @_hash['participants'] = 'participants'
  @_hash
end
new(session_id = nil, participants = nil) click to toggle source
# File lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb, line 28
def initialize(session_id = nil,
               participants = nil)
  @session_id = session_id
  @participants = participants
end