SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
GroupManager.h
1 /*
2  Copyright © CloudBackend AB 2020-2023.
3  */
4 
5 #ifndef INCLUDE_CBE_GROUP_MANAGER_H_
6 #define INCLUDE_CBE_GROUP_MANAGER_H_
7 
8 #include "cbe/Types.h"
9 
10 #include "cbe/GroupFilter.h"
11 
12 #include "cbe/delegate/Error.h"
13 #include "cbe/delegate/ListGroupsDelegate.h"
14 #include "cbe/delegate/SearchGroupsDelegate.h"
15 
16 #include "cbe/util/Context.h"
17 #include "cbe/util/ErrorInfo.h"
18 #include "cbe/util/Exception.h"
19 #include "cbe/util/Optional.h"
20 
21 namespace CBI {
22 class GroupManager;
23 } // namespace CBI
24 
25 namespace cbe {
26 
30 class GroupManager {
31 public:
44 #ifndef CBE_NO_SYNC
48  using ListGroupsException = delegate::ListGroupsDelegate::Exception;
62  std::vector<cbe::Group> listGroups();
69  using ListGroupsError = delegate::ListGroupsDelegate::ErrorInfo;
91 #endif // #ifndef CBE_NO_SYNC
92  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
111  SearchGroupsDelegatePtr delegate,
112  cbe::GroupId parentGroupId = 0);
119 #ifndef CBE_NO_SYNC
123  using SearchGroupsException = delegate::SearchGroupsDelegate::Exception;
138  cbe::GroupFilter filter,
139  cbe::GroupId parentGroupId = 0);
140 
147  using SearchGroupsError = delegate::SearchGroupsDelegate::ErrorInfo;
169  cbe::GroupFilter filter,
170  cbe::GroupId parentGroupId,
171  SearchGroupsError& error);
172 #endif // #ifndef CBE_NO_SYNC
173  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
174 
179 
189  ~GroupManager();
190 
203  explicit operator bool() const;
204 private:
205  struct Impl;
206  std::shared_ptr<Impl> pImpl{};
207 
208  friend class CloudBackend;
209  GroupManager(CBI::GroupManager& cbiPeer);
210  CBI::GroupManager& getCbiPeer() const;
211 }; // class GroupManager
212 
213 } // namespace cbe
214 
215 #endif // INCLUDE_CBE_GROUP_MANAGER_H_
The session that holds the connection with the cloud.
Definition: CloudBackend.h:47
To filter when searching a list of Group.
Definition: GroupFilter.h:31
For managing the groups.
Definition: GroupManager.h:30
cbe::GroupId getTenantId() const
void searchGroups(cbe::GroupFilter filter, SearchGroupsDelegatePtr delegate, cbe::GroupId parentGroupId=0)
GroupManager(cbe::DefaultCtor)
Default constructor.
delegate::ListGroupsDelegatePtr ListGroupsDelegatePtr
Definition: GroupManager.h:37
void listGroups(ListGroupsDelegatePtr delegate)
delegate::SearchGroupsDelegatePtr SearchGroupsDelegatePtr
Definition: GroupManager.h:99
Resultset of data retrieved in a search for Group.
Definition: GroupQueryResult.h:27
Class template Optional manages an optional contained value - i.e., a value that is either present or...
Definition: Optional.h:20
std::shared_ptr< ListGroupsDelegate > ListGroupsDelegatePtr
Definition: ListGroupsDelegate.h:64
std::shared_ptr< SearchGroupsDelegate > SearchGroupsDelegatePtr
Definition: SearchGroupsDelegate.h:62
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
DefaultCtor
Default constructor marker.
Definition: Types.h:204
std::uint64_t GroupId
Uniquely identifies the Group.
Definition: Types.h:84
Definition: ListGroupsDelegate.h:42
Definition: SearchGroupsDelegate.h:38