# bandwidth # # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). module Bandwidth # A participant object class Participant < BaseModel # Unique id of the participant # @return [String] attr_accessor :id # Full callback url to use for notifications about this participant # @return [String] attr_accessor :callback_url # Defines if this participant can publish audio or video # @return [List of PublishPermissionEnum] attr_accessor :publish_permissions # List of session ids this participant is associated with # Capped to one # @return [List of String] attr_accessor :sessions # List of session ids this participant is associated with # Capped to one # @return [Subscriptions] attr_accessor :subscriptions # User defined tag to associate with the participant # @return [String] attr_accessor :tag # Optional field to define the device api version of this participant # @return [DeviceApiVersionEnum] attr_accessor :device_api_version # A mapping from model property names to API property names. 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 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 # Creates an instance of the object from a hash. 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 end end