4 #ifndef INCLUDE_CBE_GROUP_H_
5 #define INCLUDE_CBE_GROUP_H_
8 #include "cbe/util/Context.h"
9 #include "cbe/Member.h"
10 #include "cbe/Types.h"
12 #include "cbe/delegate/Error.h"
13 #include "cbe/delegate/CreateGroupDelegate.h"
14 #include "cbe/delegate/CreateRoleDelegate.h"
15 #include "cbe/delegate/LeaveDelegate.h"
16 #include "cbe/delegate/ListMembersDelegate.h"
17 #include "cbe/delegate/ListRolesDelegate.h"
18 #include "cbe/delegate/RemoveRoleDelegate.h"
20 #include "cbe/delegate/group/JoinDelegate.h"
21 #include "cbe/delegate/group/RemoveDelegate.h"
22 #include "cbe/delegate/group/RenameDelegate.h"
24 #include "cbe/delegate/Error.h"
25 #include "cbe/util/ErrorInfo.h"
26 #include "cbe/util/Exception.h"
27 #include "cbe/util/Optional.h"
31 using GroupPtr = std::shared_ptr<CBI::Group>;
32 class GroupEventProtocol;
33 using GroupDelegatePtr = std::shared_ptr<GroupEventProtocol>;
81 using Requests = std::vector<cbe::Request>;
106 std::string memberAlias,
132 std::string memberAlias,
163 std::string memberAlias,
191 std::string applicationComment,
215 std::string applicationComment);
247 std::string applicationComment,
804 explicit operator bool()
const;
808 std::shared_ptr<Impl> pImpl{};
811 Group(CBI::GroupPtr cbiPeerPtr);
812 CBI::Group& getCbiPeer()
const;
A collection of Item, can also represent a table or folder.
Definition: Container.h:63
For managing the groups.
Definition: GroupManager.h:30
Resultset of data retrieved in a search for Group.
Definition: GroupQueryResult.h:27
A group of members.
Definition: Group.h:42
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,...
delegate::group::RemoveSuccess remove()
Synchronous [exception] removes the specified group. Synchronous version of remove(RemoveDelegatePtr)...
cbe::Container groupContainer() const
void listBannedMembers(ListBannedMembersDelegatePtr delegate)
Lists all banned former members, or users.
delegate::ListMembersDelegate::Members listMembers()
Synchronous [exception] list members of the specifed group. Synchronous version of listMembers(ListMe...
cbe::util::Optional< cbe::Group > createGroup(std::string name, std::string memberAlias, cbe::Visibility visibility, CreateGroupError &error)
void listMembers(ListMembersDelegatePtr delegate)
List all members in the group.
delegate::LeaveDelegatePtr LeaveDelegatePtr
Definition: Group.h:256
cbe::util::Optional< delegate::group::RemoveSuccess > remove(RemoveError &error)
Synchronous [non-throwing] removes the specified group. Synchronous version of remove(RemoveDelegateP...
void rename(std::string newName, RenameDelegatePtr delegate)
Rename the Group; group id does not change.
delegate::group::JoinDelegatePtr JoinDelegatePtr
Definition: Group.h:173
cbe::util::Optional< cbe::Group > join(std::string alias, cbe::Visibility memberVisibility, std::string applicationComment, JoinError &error)
Synchronous [non-throwing] Ask to join a group. Synchronous version of join(alias,...
cbe::Group join(std::string alias, cbe::Visibility memberVisibility, std::string applicationComment)
Synchronous [exception] Ask to join a group. Synchronous version of join(std::string,...
delegate::group::RenameSuccess rename(std::string newName)
Synchronous [exception] renames a group Synchronous version of rename(std::string ,...
cbe::Role createRole(std::string name)
Synchronous [exception] creates a new role in the specified group. Synchronous version of createRole(...
void remove(RemoveDelegatePtr delegate)
Remove group.
delegate::ListMembersDelegatePtr ListMembersDelegatePtr
Definition: Group.h:455
delegate::CreateRoleDelegatePtr CreateRoleDelegatePtr
Definition: Group.h:653
cbe::Visibility getVisibility() const
void createRole(std::string name, CreateRoleDelegatePtr delegate)
Creates a new role in the group.
cbe::util::Optional< cbe::RoleId > removeRole(RoleId roleId, RemoveRoleError &error)
Synchronous [non-throwing] removes a role in the specified group. Synchronous version of removeRole(r...
cbe::RoleId removeRole(RoleId roleId)
Synchronous [exception] removes a role in the specified group. Synchronous version of removeRole(Role...
delegate::ListRolesDelegate::Roles listRoles()
Synchronous [exception] list roles of a group. Synchronous version of listRoles(ListRolesDelegatePtr)...
cbe::util::Optional< delegate::LeaveSuccess > leave(LeaveError &error)
Synchronous [non-throwing] leaves the specified group. Synchronous version of leave(LeaveDelegatePtr)...
delegate::group::RemoveDelegatePtr RemoveDelegatePtr
Definition: Group.h:322
cbe::util::Optional< delegate::group::RenameSuccess > rename(std::string newName, RenameError &error)
Synchronous [non-throwing] renames a group Synchronous version of rename(newName,RenameDelegatePtr) ,...
delegate::group::RenameDelegatePtr RenameDelegatePtr
Definition: Group.h:389
void listRoles(ListRolesDelegatePtr delegate)
Lists all roles in the group.
cbe::util::Optional< cbe::Role > createRole(std::string name, CreateRoleError &error)
Synchronous [non-throwing] creates a new role in the specified group. Synchronous version of createRo...
Requests requests() const
Group(cbe::DefaultCtor)
Default constructor.
cbe::util::Optional< delegate::ListRolesDelegate::Roles > listRoles(ListRolesError &error)
Synchronous [non-throwing] list roles of a group. Synchronous version of listRoles(ListRolesDelegateP...
cbe::GroupId parentId() const
void removeRole(RoleId roleId, RemoveRoleDelegatePtr delegate)
delegate::ListRolesDelegatePtr ListRolesDelegatePtr
Definition: Group.h:588
cbe::Group createGroup(std::string name, std::string memberAlias, cbe::Visibility visibility, CreateGroupDelegatePtr delegate)
Create a new Group.
cbe::Group createGroup(std::string name, std::string memberAlias, cbe::Visibility visibility)
Synchronous [exception] creates a new group Synchronous version of createGroup(name,...
void leave(LeaveDelegatePtr delegate)
Leave group.
std::vector< cbe::Member > listBannedMembers()
Synchronous [exception] list the banned members of the specified group. Synchronous version of listBa...
delegate::LeaveSuccess leave()
Synchronous [exception] leaves the specified group. Synchronous version of leave(LeaveDelegatePtr) ,...
cbe::util::Optional< std::vector< cbe::Member > > listBannedMembers(ListBannedMembersError &error)
Synchronous [non-throwing] list the banned members of the specified group. Synchronous version of lis...
delegate::RemoveRoleDelegatePtr RemoveRoleDelegatePtr
Definition: Group.h:719
cbe::util::Optional< delegate::ListMembersDelegate::Members > listMembers(ListMembersError &error)
Synchronous [non-throwing] list members of the specifed group. Synchronous version of listMembers(Lis...
delegate::CreateGroupDelegatePtr CreateGroupDelegatePtr
Definition: Group.h:91
delegate::ListMembersDelegatePtr ListBannedMembersDelegatePtr
Definition: Group.h:523
User role information.
Definition: Role.h:34
Definition: LeaveDelegate.h:64
Convenience type that bundles all parameters passed to method cbe::delegate::group::RemoveDelegate::o...
Definition: RemoveDelegate.h:76
Convenience type that bundles all parameters passed to method cbe::delegate::group::RenameDelegate::o...
Definition: RenameSuccess.h:17
Class template Optional manages an optional contained value - i.e., a value that is either present or...
Definition: Optional.h:20
std::shared_ptr< RenameDelegate > RenameDelegatePtr
Definition: RenameDelegate.h:63
std::shared_ptr< RemoveDelegate > RemoveDelegatePtr
Definition: RemoveDelegate.h:69
std::shared_ptr< JoinDelegate > JoinDelegatePtr
Definition: JoinDelegate.h:65
std::shared_ptr< CreateGroupDelegate > CreateGroupDelegatePtr
Definition: CreateGroupDelegate.h:63
std::shared_ptr< CreateRoleDelegate > CreateRoleDelegatePtr
Definition: CreateRoleDelegate.h:60
std::shared_ptr< ListRolesDelegate > ListRolesDelegatePtr
Definition: ListRolesDelegate.h:66
std::shared_ptr< ListMembersDelegate > ListMembersDelegatePtr
Definition: ListMembersDelegate.h:68
std::shared_ptr< RemoveRoleDelegate > RemoveRoleDelegatePtr
Definition: RemoveRoleDelegate.h:60
std::shared_ptr< LeaveDelegate > LeaveDelegatePtr
Definition: LeaveDelegate.h:63
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
std::uint64_t RoleId
Uniquely identifies the Role.
Definition: Types.h:108
Visibility
Definition: Types.h:375
DefaultCtor
Default constructor marker.
Definition: Types.h:204
std::uint64_t GroupId
Uniquely identifies the Group.
Definition: Types.h:84
Definition: CreateGroupDelegate.h:42
exception thrown by cbe::Group::createGroup() if the request fails.
Definition: CreateGroupDelegate.h:52
Definition: CreateRoleDelegate.h:39
exception thrown by cbe::Role::createRole() if the request fails.
Definition: CreateRoleDelegate.h:49
Definition: LeaveDelegate.h:42
exception thrown by cbe::Group::leave() if the if the request fails.
Definition: LeaveDelegate.h:52
Definition: ListMembersDelegate.h:44
exception thrown by cbe::Group::listMembers() if the request fails.
Definition: ListMembersDelegate.h:54
Definition: ListRolesDelegate.h:42
exception thrown by cbe::Group::ListRoles() if the request fails.
Definition: ListRolesDelegate.h:52
Definition: RemoveRoleDelegate.h:39
exception thrown by cbe::Role::removeRole() if the request fails.
Definition: RemoveRoleDelegate.h:49
Definition: JoinDelegate.h:42
exception thrown by cbe::Group::join() if the request fails.
Definition: JoinDelegate.h:52
Definition: RemoveDelegate.h:45
exception thrown by cbe::Group::remove() if the request fails.
Definition: RemoveDelegate.h:55
Definition: RenameDelegate.h:41
exception thrown by cbe::Group::rename() if the request fails.
Definition: RenameDelegate.h:51