NAME

Bb::Collaborate::Ultra::Session

DESCRIPTION

This class is used to manage Sessions (Virtual Classrooms).

    use Bb::Collaborate::Ultra::Session;
    my $start = time() + 60;
    my $end = $start + 900;

    my $session;
    my $session = Bb::Collaborate::Ultra::Session->post($connection, {
	    name => 'Test Session',
	    startTime => $start,
	    endTime   => $end,
	    },
	);

Enrolling User in Sessions

AFAIK, there are two classes and two different modes for enrolling user to sessions:

(*) Ad-hoc users via Bb::Collaborate::Ultra::LaunchContext
    my $user = Bb::Collaborate::Ultra::User->new({
	extId => 'testLaunchUser',
	displayName => 'David Warring',
	email => 'david.warring@gmail.com',
	firstName => 'David',
	lastName => 'Warring',
    });

    my $launch_context = Bb::Collaborate::Ultra::LaunchContext->new({ launchingRole => 'moderator',
	 editingPermission => 'writer',
	 user => $user,
	 });

    my $join_url = $launch_context->join_session($session);
(*) Permanently managed users via Bb::Collaborate::Ultra::LaunchContext

Each user is created once.

    my $ultra_user = Bb::Collaborate::Ultra::User->create($connection, {
	extId => 'testLaunchUser',
	displayName => 'David Warring',
	email => 'david.warring@gmail.com',
	firstName => 'David',
	lastName => 'Warring',
    });
    my $ultra_user_id = $ultra_user->id;
    # somehow save the user id permanently...

The saved user-id may then be used to multiple times to join sessions:

     my $enrollment =  Bb::Collaborate::Ultra::Session::Enrollment->new({ launchingRole => 'moderator',
	 editingPermission => 'writer',
	 userId => $user2->id,
	 });
      my $join_url = $enrolment->enrol($session)->permanentUrl;

METHODS

This class supports the `get`, `post`, `patch` and `del` methods as described in https://xx-csa.bbcollab.com/documentation#Session

get_enrollments

Return a list of users, of type Bb::Collaborate::Ultra::Session::Enrollment.

my @enrollments = $session->get_enrollments;
for my $enrolment (@enrollments) {
    say "user @{[$enrolment->userId]} is enrolled as a @{[$enrollment->launchingRole]}";
}

get_logs

Returns logging (session-instance) information for completed sessions