SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
cbe::Group Class Reference

A group of members. More...

#include <Group.h>

Public Types

using Requests = std::vector< cbe::Request >
 
using CreateGroupDelegatePtr = delegate::CreateGroupDelegatePtr
 
using JoinDelegatePtr = delegate::group::JoinDelegatePtr
 
using LeaveDelegatePtr = delegate::LeaveDelegatePtr
 
using RemoveDelegatePtr = delegate::group::RemoveDelegatePtr
 
using RenameDelegatePtr = delegate::group::RenameDelegatePtr
 
using ListMembersDelegatePtr = delegate::ListMembersDelegatePtr
 
using ListBannedMembersDelegatePtr = delegate::ListMembersDelegatePtr
 
using ListRolesDelegatePtr = delegate::ListRolesDelegatePtr
 
using CreateRoleDelegatePtr = delegate::CreateRoleDelegatePtr
 
using RemoveRoleDelegatePtr = delegate::RemoveRoleDelegatePtr
 

Public Member Functions

std::string name () const
 
cbe::GroupId id () const
 
cbe::GroupId parentId () const
 
cbe::Container groupContainer () const
 
cbe::Visibility getVisibility () const
 
bool joined () const
 
Requests requests () const
 
cbe::Group createGroup (std::string name, std::string memberAlias, cbe::Visibility visibility, CreateGroupDelegatePtr delegate)
 Create a new Group. More...
 
void join (std::string alias, cbe::Visibility memberVisibility, std::string applicationComment, JoinDelegatePtr delegate)
 Synchronous [exception] Ask to join a group. In this first version All members will be Public, meaning visible for other member inside the group. All groups will also be open so all join requests should be accepted directly. More...
 
void leave (LeaveDelegatePtr delegate)
 Leave group. More...
 
void remove (RemoveDelegatePtr delegate)
 Remove group. More...
 
void rename (std::string newName, RenameDelegatePtr delegate)
 Rename the Group; group id does not change. More...
 
void listMembers (ListMembersDelegatePtr delegate)
 List all members in the group. More...
 
void listBannedMembers (ListBannedMembersDelegatePtr delegate)
 Lists all banned former members, or users. More...
 
void listRoles (ListRolesDelegatePtr delegate)
 Lists all roles in the group. More...
 
void createRole (std::string name, CreateRoleDelegatePtr delegate)
 Creates a new role in the group. More...
 
void removeRole (RoleId roleId, RemoveRoleDelegatePtr delegate)
 
 Group (cbe::DefaultCtor)
 Default constructor. More...
 
 operator bool () const
 Checks if the current instance is real. More...
 

Friends

class GroupManager
 
class GroupQueryResult
 

Detailed Description

A group of members.

Member Typedef Documentation

◆ CreateGroupDelegatePtr

Pointer to CreateGroupDelegate that is passed into:
Group::createGroup(std::string,std::string,CreateGroupDelegatePtr,cbe::Visibility).

◆ CreateRoleDelegatePtr

Pointer to cbe::delegate::CreateRoleDelegate that is passed into asynchronous version of method createRole()

◆ JoinDelegatePtr

Pointer to cbe::delegate::group::JoinDelegate that is passed into asynchronous version of method join()

◆ LeaveDelegatePtr

Pointer to cbe::delegate::LeaveDelegate that is passed into asynchronous version of method leave()

◆ ListBannedMembersDelegatePtr

◆ ListMembersDelegatePtr

◆ ListRolesDelegatePtr

Pointer to cbe::delegate::ListRolesDelegate that is passed into asynchronous version of method listRoles()

◆ RemoveDelegatePtr

Pointer to cbe::delegate::RemoveDelegate that is passed into asynchronous version of method remove()

◆ RemoveRoleDelegatePtr

Pointer to cbe::delegate::RemoveRoleDelegate that is passed into asynchronous version of method removeRole()

◆ RenameDelegatePtr

Pointer to cbe::delegate::RenameDelegate that is passed into asynchronous version of method rename()

Constructor & Destructor Documentation

◆ Group()

cbe::Group::Group ( cbe::DefaultCtor  )

Default constructor.

Construct a new object with the DefaultCtor to enable the operator bool() test

Member Function Documentation

◆ createGroup()

cbe::Group cbe::Group::createGroup ( std::string  name,
std::string  memberAlias,
cbe::Visibility  visibility,
CreateGroupDelegatePtr  delegate 
)

Create a new Group.

Note
Can only be used by Tenant admin/owners to create new groups.
Parameters
nameof the group
memberAliasanother popular name
delegatePointer to a delegate::CreateGroupDelegate instance that is implemented by the user.
visibilitydefault: public
Returns
cbe::Group
See also
Types.h for cbe::visibility enum cbe::Visibility::PublicGroup or cbe::Visibility::Private

◆ createRole()

void cbe::Group::createRole ( std::string  name,
CreateRoleDelegatePtr  delegate 
)

Creates a new role in the group.

Parameters
nameThe name of the role.
delegatePointer to a delegate::CreateRoleDelegate instance that is implemented by the user.

◆ getVisibility()

cbe::Visibility cbe::Group::getVisibility ( ) const

Visibility of the Group, Public is searchable and Private is not. In this early version you can create Private groups but the ability to invite has been blocked. (work in progress)

See also
Types.h for cbe::PublishVisibility enum

◆ groupContainer()

cbe::Container cbe::Group::groupContainer ( ) const

Every group has a drive/container where resources can be shared with the members of the group. Works like a shared container.

◆ id()

cbe::GroupId cbe::Group::id ( ) const

Returns the id number of the group.

◆ join()

void cbe::Group::join ( std::string  alias,
cbe::Visibility  memberVisibility,
std::string  applicationComment,
JoinDelegatePtr  delegate 
)

Synchronous [exception] Ask to join a group. In this first version All members will be Public, meaning visible for other member inside the group. All groups will also be open so all join requests should be accepted directly.

Note
This is completely different from the query chain join.
Parameters
aliasname
delegatePointer to a delegate::group::JoinDelegate instance that is implemented by the user.
memberVisibilitydefault: public
applicationCommentmessage to the owner regarding the application to join

◆ joined()

bool cbe::Group::joined ( ) const

Searched groups are obtained through the GroupQuery response. This list of groups have non-joined and joined groups. Already joined groups can be found on the groupManager.groups() and they are also cached. The joined bool is used to easily sort out groups in the GroupQuery.

◆ leave()

void cbe::Group::leave ( LeaveDelegatePtr  delegate)

Leave group.

Parameters
delegatePointer to a delegate::LeaveDelegate instance that is implemented by the user.

◆ listBannedMembers()

void cbe::Group::listBannedMembers ( ListBannedMembersDelegatePtr  delegate)

Lists all banned former members, or users.

Parameters
delegatePointer to a delegate::ListMembersDelegate instance that is implemented by the user.

◆ listMembers()

void cbe::Group::listMembers ( ListMembersDelegatePtr  delegate)

List all members in the group.

The member list is then retrieved via the delegate callback function cbe::delegate::ListMembersDelegate::onListMembersSuccess()

Parameters
delegatePointer to a delegate::ListMembersDelegate instance that is implemented by the user.

◆ listRoles()

void cbe::Group::listRoles ( ListRolesDelegatePtr  delegate)

Lists all roles in the group.

Parameters
delegatePointer to a delegate::ListRolesDelegate instance that is implemented by the user.

◆ name()

std::string cbe::Group::name ( ) const

Returns the name of the group.

◆ operator bool()

cbe::Group::operator bool ( ) const
explicit

Checks if the current instance is real.

An "unreal" instance implies typically a failed event.

Relies on the Default constructor Group(cbe::DefaultCtor)

Returns
true : is real
false : unreal; got nullptr; if current instance is unbound/undefined. I.e., if it is only default constructed.

◆ parentId()

cbe::GroupId cbe::Group::parentId ( ) const

Group's Parent id number.

◆ remove()

void cbe::Group::remove ( RemoveDelegatePtr  delegate)

Remove group.

Note
This is exlusive for Tenant group owners.
Parameters
delegatePointer to a delegate::group::RemoveDelegate instance that is implemented by the user.

◆ removeRole()

void cbe::Group::removeRole ( RoleId  roleId,
RemoveRoleDelegatePtr  delegate 
)
 @brief Removes a role in the group.

 @param roleId The id of the role to remove.

 @param delegate Pointer to a delegate::RemoveRoleDelegate instance

that is implemented by the user.

◆ rename()

void cbe::Group::rename ( std::string  newName,
RenameDelegatePtr  delegate 
)

Rename the Group; group id does not change.

Parameters
newNamethe new name for the group
delegatePointer to a delegate::group::RenameDelegate instance that is implemented by the user.

◆ requests()

Requests cbe::Group::requests ( ) const

Requests to join the group. To retrieve the list call listJoinRequests(cbe::GroupDelegatePtr delegate) on the group object.


The documentation for this class was generated from the following file: