All Classes Namespaces Files Functions Variables Groups
Structures.idl
Go to the documentation of this file.
1 /**
2  * @file Structures.idl
3  * @brief Data structures shared among webmail API.
4  *
5  * @author Dusan Juhas, Frantisek Boranek
6  *
7  * @copyright Copyright © 2017 Kerio Technologies s.r.o.
8  *
9  * @defgroup Common
10  * @{
11  */
12 
13 #import <kerio/web/idl/SharedStructures.idl>
14 #import <common.idl>
15 
16 module kerio {
17 module jsonapi {
18 module webmail {
19 
20 
21 const long ErrorCodeParseError = -32700; // Parse error. Request wasn't valid JSON. (HTTP Status 500)
22 const long ErrorCodeInternalError = -32603; // Internal error. (HTTP Status 500
23 const long ErrorCodeInvalidParams = -32602; // Invalid params. (HTTP Status 500)
24 const long ErrorCodeMethodNotFound = -32601; // Method not found.The requested method doesn't exist. (HTTP Status 404)
25 const long ErrorCodeInvalidRequest = -32600; // Invalid request. (Too many files uploaded.etc.) (HTTP Status 500)
26 
27 // -32099 to -32000 (Reserved for Kerio-defined server errors.)
28 const long ErrorCodeMultiServerBackendMaintenance = -32003; ///< Error generated on client side only
29 const long ErrorCodeTimedout = -32002; ///< Error generated on client side only
30 const long ErrorCodeSessionExpired = -32001; ///< Session expired. (HTTP Status 500)
31 
32 const long ErrorCodeCommunicationFailure = -1; ///< Error generated on client side only
33 
34 // 1 to 999 (Reserved)
35 const long ErrorCodeRequestEntityTooLarge = 413; ///< The client tried to upload a file bigger than limit. (Generally any HTTP POST request, including JSON-RPC Request.)
36 
37 // 1000 to 1999 (Reserved for Kerio-common errors)
38 const long ErrorCodeOperationFailed = 1000; ///< The command was accepted, the operation was run and returned an error.
39 const long ErrorCodeAlreadyExists = 1001; ///< Can't create the item, as it already exists.
40 const long ErrorCodeNoSuchEntity = 1002; ///< Message / folder / etc. doesn't exist.
41 const long ErrorCodeNotPermitted = 1003; ///< Server refused to proceed. E.g. Can't delete default folder.
42 const long ErrorCodeAccessDenied = 1004; ///< Insufficient privileges for the required operation.
43 // 4000 to 4999 (Reserved for Connect)
44 const long ErrorCodeDangerousOperation = 4000; ///< Operation is dangerous. Used for reporting in validation functions.
45 const long ErrorCodePartialSuccess = 4001; ///< Operation ended partial successful.
46 const long ErrorCodeChangePswFailed = 4002; ///< Failed to change your password. The new password was not accepted.
47 
48 // 4100 to 4199 (Reserved for Connect/Webmail specific)
49 const long ErrorCodeFolderReindexing = 4100; ///< Folder is already being reindexed. Try later.
50 const long ErrorCodeOperationInProgress = 4101; ///< Long lasting operation blocks perform the request. Try later.
51 const long ErrorCodeQuotaReached = 4102; ///< Items quota or disk size quota was reached.
52 const long ErrorCodeSendingFailed = 4103; ///< Failed to send email.
53 const long ErrorCodeNoSuchFolder = 4104; ///< Folder of given GUID doesn't exist.
54 const long ErrorCodeOperatorSessionExpired = 4105; ///< Session to Operator expired.
55 
56 
57 typedef string UtcTime; ///< Time according RFC 2445, eg. 070000Z means 07:00 AM
58 typedef longlong Watermark; ///< Max. 9007199254740992, min. -9007199254740992
59 
60 enum PriorityType {
61  Normal, ///< default value
62  Low,
63  High
64 };
65 
66 enum ItemType {
67  itMail,
68  itCalendar,
69  itContact,
70  itTask,
71  itNote,
72  itCalendarInbox
73 };
74 
75 /**
76  * Details about a particular item created.
77  */
78 struct CreateResult {
79  long inputIndex; ///< 0-based index to input array, e.g. 3 means that the relates to the 4th element of the input parameter array
80  kerio::web::KId id; ///< ID of created item.
81  Watermark watermark; ///< item version from journal
82 };
83 
84 typedef sequence<CreateResult> CreateResultList;
85 
86 /**
87  * Details about a particular item updated.
88  */
89 struct SetResult {
90  long inputIndex; ///< 0-based index to input array, e.g. 3 means that the relates to the 4th element of the input parameter array
91  kerio::web::KId id; ///< if not empty the item was moved and its ID was changed to this value
92  Watermark watermark; ///< item version from journal
93 };
94 
95 typedef sequence<SetResult> SetResultList;
96 
97 struct Image {
98  string url; ///< [READ ONLY] URL to obtain image via HTTP GET request.
99  string id; ///< [READ ONLY] Id of uploaded image.
100 };
101 
102 typedef sequence<Image> ImageList;
103 
104 }; }; }; // end of namespace
105 
106 /**
107  * @}
108  */