All Classes Files Functions Variables Enumerations Enumerator Groups Pages
Resources.idl
Go to the documentation of this file.
1 /**
2  * @file Resources.idl
3  * @brief Work with resources as an tool for facilities like meeting rooms, cars, projectors etc.
4  *
5  * @author Dusan Juhas
6  *
7  * @copyright Copyright © 2017 Kerio Technologies s.r.o.
8  */
9 
10 #import <kerio/web/idl/SharedStructures.idl>
11 #import <AdminStructures.idl> //DataSource
12 #import <DistributedDomain.idl> //HomeServer
13 
14 module kerio {
15 module jsonapi {
16 module admin {
17 
18 /**
19  * Principal type
20  */
21 enum PrincipalType {
22  AuthDomainPrincipal, ///< represents all users from a specified domain
23  AuthUserPrincipal, ///< represents all users from all domains
24  AnyonePrincipal, ///< represents authorized users from all domains
25  UserPrincipal, ///< represents an user
26  GroupPrincipal, ///< represents an group
27  NonePrincipal ///< target is empty
28 };
29 
30 /**
31  * Principal descriptor
32  * [READ-ONLY]
33  */
35  PrincipalType type;
36  kerio::web::KId id;
37  string name;
38  string domainName;
39  string fullName;
40  string description;
41  boolean isEnabled;
42  DataSource itemSource; ///< internal/LDAP
43  HomeServer homeServer; ///< id of users homeserver if server is in Cluster; groups haven't homeserver
44 };
45 
46 /**
47  * List of principals
48  */
49 typedef sequence<PrincipalDescription> PrincipalList;
50 
51 
52 /**
53  * Export format type
54  */
55 enum ResourceType {
56  Room, ///< resource is a room
57  Equipment ///< resource is something else, eg: a car
58 };
59 
60 /**
61  * Resource details
62  */
63 struct Resource {
64  kerio::web::KId id; ///< [READ-ONLY] global identification of resource
65  kerio::web::KId domainId; ///< [REQUIRED FOR CREATE] [WRITE-ONCE] identification in which domain resource exists
66  string name; ///< [REQUIRED FOR CREATE] [WRITE-ONCE] resource name
67  string address; ///< [READ-ONLY] email of resource
68  string description; ///< resource description
69  ResourceType type; ///< type of the resource
70  boolean isEnabled; ///< is resource enabled? default == true
71  PrincipalList resourceUsers; ///< list of groups / users /
72  PrincipalDescription manager; ///< identification of user who is a manager
73 
74  HomeServer homeServer; ///< [READ-ONLY] Id of users homeserver if server is in Cluster
75 };
76 
77 /**
78  * List of resources
79  */
80 typedef sequence<Resource> ResourceList;
81 
82 
83 /**
84  * Resource management
85  */
86 interface Resources {
87 
88  /**
89  * Create new resources.
90  *
91  * @param errors - error message list
92  * @param result - list of IDs of created resources
93  * @param resources - new resource entities
94  */
95  void create(out kerio::web::ErrorList errors, out kerio::web::CreateResultList result, in ResourceList resources);
96 
97  /**
98  * Obtain a list of resources.
99  *
100  * @param list - resources
101  * @param totalItems - amount of resources for given search condition, useful when limit is defined in search query
102  * @param query - query conditions and limits
103  * @param domainId - domain identification
104  */
105  void get(out ResourceList list, out long totalItems, in kerio::web::SearchQuery query, in kerio::web::KId domainId);
106 
107  /**
108  * Obtain a list of potential resource targets (principals).
109  *
110  * @param list - principals
111  * @param query - query attributes and limits
112  * @param domain - domain restriction
113  */
114  void getPrincipalList(out PrincipalList list, out long totalItems, in kerio::web::SearchQuery query, in kerio::web::KId domainId);
115 
116  /**
117  * Remove resources.
118  *
119  * @param errors - error message list
120  * @param resourceIds - list of global identifiers of recource(s) to be deleted
121  */
122  void remove(out kerio::web::ErrorList errors, in kerio::web::KIdList resourceIds);
123 
124  /**
125  * Set existing resources.
126  *
127  * @param errors - error message list
128  * @param resourceIds - a list resource global identifier(s)
129  * @param pattern - pattern to use for new values
130  */
131  void set(out kerio::web::ErrorList errors, in kerio::web::KIdList resourceIds, in Resource pattern);
132 };
133 
134 }; }; };//end of namespace