All Classes Namespaces Files Functions Variables Groups
Contacts.idl
Go to the documentation of this file.
1 /**
2  * @file Contacts.idl
3  * @brief %Contacts management
4  *
5  * @author Dusan Juhas, Frantisek Boranek
6  *
7  * @copyright Copyright © 2017 Kerio Technologies s.r.o.
8  */
9 
10 #import <Structures.idl>
11 #import <ContactsCommon.idl>
12 #import <Certificates.idl>
13 
14 module kerio {
15 module jsonapi {
16 module webmail {
17 module contacts {
18 
19 
20 enum ContactType {
21  ctContact,
22  ctDistributionList
23 };
24 
25 /**
26  * Contact detail.
27  */
28 struct Contact {
29  kerio::web::KId id;
30  kerio::web::KId folderId;
31  Watermark watermark;
32  ContactType type;
33 
34  string commonName;
35  string firstName;
36  string middleName;
37  string surName;
38  string titleBefore;
39  string titleAfter;
40  string nickName;
41 
42  kerio::jsonapi::contacts::PhoneNumberList phoneNumbers;
43  kerio::jsonapi::contacts::EmailAddressList emailAddresses;
44  kerio::jsonapi::contacts::PostalAddressList postalAddresses;
45  kerio::jsonapi::contacts::UrlList urls;
46 
47  UtcDateTime birthDay;
48  UtcDateTime anniversary;
49  string companyName;
50  string departmentName;
51  string profession;
52  string managerName;
53  string assistantName;
54  string comment;
55  string IMAddress;
57 
58  kerio::web::StringList categories;
59 
60  kerio::web::KId certSourceId; ///< [WRITE-ONLY]
61 
62  boolean isGalContact; ///< [READ-ONLY]
63 };
64 
65 typedef sequence<Contact> ContactList;
66 
67 
68 /**
69  * Export format type
70  */
71 enum ResourceType {
72  ResourceRoom, ///< resource is a room
73  ResourceEquipment ///< resource is something else, eg: a car
74 };
75 
76 /**
77  * Resource details [READ-ONLY]
78  */
79 struct Resource {
80  string name; ///< resource name
81  string address; ///< email of resource
82  string description; ///< resource description
83  ResourceType type; ///< type of the resource
84 };
85 
86 /**
87  * List of resources
88  */
89 typedef sequence<Resource> ResourceList;
90 
91 
92 /** Constants for composing kerio::web::SearchQuery */
93 module searchFields {
94  const string QUICKSEARCH = "QUICKSEARCH"; ///< [SEARCHABLE]
95  const string displayName = "displayName"; ///< [SEARCHABLE][SORTABLE] string
96  const string firstName = "firstName"; ///< [SEARCHABLE][SORTABLE] string
97  const string surName = "surName"; ///< [SEARCHABLE][SORTABLE] string
98  const string middleName = "middleName"; ///< [SEARCHABLE] string
99  const string nickName = "nickName"; ///< [SEARCHABLE] string
100  const string company = "company"; ///< [SEARCHABLE][SORTABLE] string
101  const string hasEmail = "hasEmail"; ///< [SEARCHABLE] boolean
102  const string email = "email"; ///< [SEARCHABLE][SORTABLE] string
103  const string phone = "phone"; ///< [SEARCHABLE][SORTABLE] string (work phone)
104  const string category = "category"; ///< [SEARCHABLE] string
105  const string homeAddress = "homeAddress"; ///< [SEARCHABLE] string
106  const string otherAddress = "otherAddress"; ///< [SEARCHABLE] string
107  const string guid = "guid"; ///< [SEARCHABLE] string
108  const string uid = "uid"; ///< [SEARCHABLE] string
109 
110  const string isDList = "isDList"; ///< [SEARCHABLE] boolean
111  const string listMember = "listMember"; ///< [SEARCHABLE] string
112 
113  const string fileAs = "fileAs"; ///< [SORTABLE]
114 
115 
116  // Resource fields
117  const string name = "name"; ///< [SEARCHABLE] string (resource name)
118  const string address = "address"; ///< [SEARCHABLE] string (email of resource)
119  const string description = "description"; ///< [SEARCHABLE] string (resource description)
120  const string type = "type"; ///< [SEARCHABLE] ResourceType (type of the resource)
121 };
122 
123 /**
124  * Contacts management.
125  */
126 interface Contacts {
127 
128  /**
129  * Copy existing contacts to folder
130  *
131  * @param errors - error message list
132  * @param ids - list of global identifiers of contacts to be copied
133  * @param folder - target folder
134  */
135  void copy(out kerio::web::ErrorList errors, out CreateResultList result, in kerio::web::KIdList ids, in kerio::web::KId folder);
136 
137  /**
138  * Create contact in particular folder
139  *
140  * @param errors - error message list
141  * @param result - list of ID of crated contacts
142  * @param contacts - new contacts; Field 'folderId' must be set.
143  */
144  void create(out kerio::web::ErrorList errors, out CreateResultList result, in ContactList contacts);
145 
146  /**
147  * Get a list of contacts.
148  *
149  * @param list - all found contacts
150  * @param totalItems - number of contacts found if there is no limit
151  * @param folderIds - list of global identifiers of folders to be listed.
152  * @param query - query attributes and limits
153  */
154  void get(out ContactList list, out long totalItems, in kerio::web::KIdList folderIds, in kerio::web::SearchQuery query);
155 
156  /**
157  * Get a list of contacts. It works the same way as Contacts.get but retuns only this fields:
158  * id, folderId, watermark, type, commonName, titleAfter, titleBefore, firstName, middleName, surName, nickName, emailAddresses, phoneNumbers, photo
159  *
160  * @param list - all found contacts
161  * @param totalItems - number of contacts found if there is no limit
162  * @param folderIds - list of global identifiers of folders to be listed.
163  * @param query - query attributes and limits
164  */
165  void getFromCache(out ContactList list, out long totalItems, in kerio::web::KIdList folderIds, in kerio::web::SearchQuery query);
166 
167  /**
168  * Get particular contacts. All members of struct Contact are filed in response.
169  *
170  * @param errors - list of errors which happened
171  * @param result - contacts of given IDs. All members of struct are returned.
172  * @param ids - global identifiers of contact.
173  */
174  void getById(out kerio::web::ErrorList errors, out ContactList result, in kerio::web::KIdList ids);
175 
176  /**
177  * Get particular contacts. These members of struct Contact are filed in response:
178  * id, folderId, watermark, type, commonName, titleAfter, titleBefore, firstName, middleName, surName, nickName, emailAddresses, phoneNumbers, photo
179  *
180  * @param errors - list of errors which happened
181  * @param result - contacts of given IDs.
182  * @param ids - global identifiers of contact.
183  */
184  void getByIdFromCache(out kerio::web::ErrorList errors, out ContactList result, in kerio::web::KIdList ids);
185 
186  /**
187  * Get contact from attachment.
188  *
189  * @param result - contact of given IDs. All members of struct are returned.
190  * @param id - global identifiers of mail attachment.
191  */
192  void getFromAttachment(out Contact result, in kerio::web::KId id);
193 
194  /**
195  * Get a list of resources that an user can schedule.
196  *
197  * @param list - all found resources
198  * @param totalItems - number of resources found if there is no limit
199  * @param query - query attributes and limits (empty query obtain all resources)
200  */
201  void getResources(out ResourceList list, out long totalItems, in kerio::web::SearchQuery query);
202 
203  /**
204  * Get a certificate for given email address.
205  *
206  * @param cert - found certificate
207  * @param email - email address of requested certificate
208  * @param id - global identifier of contacts to be searched
209  */
210  void getCertificate(out kerio::jsonapi::webmail::certificates::Certificate cert, in string email, in kerio::web::KId id);
211 
212  /**
213  * Remove a list of contacts.
214  *
215  * @param errors - list of contacts that failed to remove
216  * @param ids - list of global identifiers of contacts to be removed
217  */
218  void remove(out kerio::web::ErrorList errors, in kerio::web::KIdList ids);
219 
220  /**
221  * Set existing contacts.
222  *
223  * @param errors - error message list
224  * @param contacts - modifications of contacts. Field 'folderId' must be set.
225  */
226  void set(out kerio::web::ErrorList errors, out SetResultList result, in ContactList contacts);
227 
228  /**
229  * Move existing contacts to folder
230  *
231  * @param errors - error message list
232  * @param ids - list of global identifiers of contacts to be moved
233  * @param folder - target folder
234  */
235  void move(out kerio::web::ErrorList errors, out CreateResultList result, in kerio::web::KIdList ids, in kerio::web::KId folder);
236 
237  /**
238  * Get personal user contact
239  *
240  */
241  void getPersonal(out kerio::jsonapi::contacts::PersonalContact contact);
242 
243  /**
244  * Set personal user contact
245  *
246  */
247  void setPersonal(in kerio::jsonapi::contacts::PersonalContact contact);
248 
249 };
250 
251 }; }; }; }; // end of namespace
252 
253 /**
254  * @}
255  */