|
| basic_service (const std::string &server_uri, const std::string &domain, const std::string &username, const std::string &password) |
| Constructs a new service with given credentials to a server specified by server_uri . More...
|
|
| basic_service (const std::string &server_uri, const internal::credentials &creds) |
| Constructs a new service with given credentials to a server specified by server_uri .
|
|
| basic_service (const std::string &server_uri, const internal::credentials &creds, const std::string &cainfo, const std::string &capath, const std::string &proxy_uri, const bool is_http_proxy_tunneling, const debug_callback &callback, const ssl_options ssl_opts=ssl_options::none) |
| Constructs a new service with given credentials to a server specified by server_uri .
|
|
std::vector< delegate_user > | add_delegate (const mailbox &mailbox, const std::vector< delegate_user > &delegates) |
| Add new delegates to given mailbox.
|
|
attachment_id | create_attachment (const item_id &parent_item, const attachment &a) |
| Lets you attach a file (or another item) to an existing item. More...
|
|
folder_id | create_folder (const folder &new_folder, const folder_id &parent_folder) |
| Create a new folder in the Exchange store. More...
|
|
std::vector< folder_id > | create_folder (const std::vector< folder > &new_folders, const folder_id &parent_folder) |
| Create a new folder in the Exchange store. More...
|
|
item_id | create_item (const task &the_task) |
| Creates a new task from the given object in the Exchange store. More...
|
|
item_id | create_item (const task &the_task, const folder_id &folder) |
| Creates a new task from the given object in the the specified folder. More...
|
|
std::vector< item_id > | create_item (const std::vector< task > &tasks) |
| Creates new tasks from the given vector in the Exchange store. More...
|
|
std::vector< item_id > | create_item (const std::vector< task > &tasks, const folder_id &folder) |
| Creates new tasks from the given vector in the the specified folder. More...
|
|
item_id | create_item (const contact &the_contact) |
| Creates a new contact from the given object in the Exchange store. More...
|
|
item_id | create_item (const contact &the_contact, const folder_id &folder) |
| Creates a new contact from the given object in the specified folder. More...
|
|
std::vector< item_id > | create_item (const std::vector< contact > &contacts) |
| Creates new contacts from the given vector in the Exchange store. More...
|
|
std::vector< item_id > | create_item (const std::vector< contact > &contacts, const folder_id &folder) |
| Creates new contacts from the given vector in the specified folder. More...
|
|
item_id | create_item (const calendar_item &the_calendar_item, send_meeting_invitations send_invitations=send_meeting_invitations::send_to_none) |
| Creates a new calendar item from the given object in the Exchange store. More...
|
|
item_id | create_item (const calendar_item &the_calendar_item, send_meeting_invitations send_invitations, const folder_id &folder) |
| Creates a new calendar item from the given object in the specified folder. More...
|
|
std::vector< item_id > | create_item (const std::vector< calendar_item > &calendar_items, send_meeting_invitations send_invitations=send_meeting_invitations::send_to_none) |
| Creates new calendar items from the given vector in the Exchange store. More...
|
|
std::vector< item_id > | create_item (const std::vector< calendar_item > &calendar_items, send_meeting_invitations send_invitations, const folder_id &folder) |
| Creates new calendar items from the given vector in the specified folder. More...
|
|
item_id | create_item (const message &the_message, message_disposition disposition) |
| Creates a new message in the Exchange store. More...
|
|
item_id | create_item (const message &the_message, message_disposition disposition, const folder_id &folder) |
| Creates a new message in the specified folder. More...
|
|
std::vector< item_id > | create_item (const std::vector< message > &messages, message_disposition disposition) |
| Creates new messages in the Exchange store. More...
|
|
std::vector< item_id > | create_item (const std::vector< message > &messages, message_disposition disposition, const folder_id &folder) |
| Creates new messages in the specified folder. More...
|
|
item_id | delete_attachment (const attachment_id &id) |
| Deletes given attachment from the Exchange store. More...
|
|
void | delete_calendar_item (calendar_item &&the_calendar_item, delete_type del_type=delete_type::hard_delete, send_meeting_cancellations cancellations=send_meeting_cancellations::send_to_none) |
| Delete a calendar item from the Exchange store.
|
|
void | delete_contact (contact &&the_contact) |
| Delete a contact from the Exchange store.
|
|
void | delete_folder (const folder_id &id, delete_type del_type=delete_type::hard_delete) |
| Delete a folder from the Exchange store.
|
|
void | delete_item (const item_id &id, delete_type del_type=delete_type::hard_delete, affected_task_occurrences affected=affected_task_occurrences::all_occurrences, send_meeting_cancellations cancellations=send_meeting_cancellations::send_to_none) |
| Delete an arbitrary item from the Exchange store.
|
|
void | delete_message (message &&the_message) |
| Delete a message item from the Exchange store.
|
|
void | delete_task (task &&the_task, delete_type del_type=delete_type::hard_delete, affected_task_occurrences affected=affected_task_occurrences::all_occurrences) |
| Delete a task item from the Exchange store.
|
|
std::vector< folder_id > | find_folder (const folder_id &parent_folder_id) |
| Sends a <FindFolder/> operation to the server. More...
|
|
std::vector< item_id > | find_item (const folder_id &parent_folder_id, const paging_view &view) |
|
std::vector< item_id > | find_item (const folder_id &parent_folder_id) |
|
std::vector< calendar_item > | find_item (const calendar_view &view, const folder_id &parent_folder_id, const item_shape &shape=item_shape()) |
| Returns all calendar items in given calendar view. More...
|
|
std::vector< item_id > | find_item (const folder_id &parent_folder_id, search_expression restriction) |
| Sends a <FindItem/> operation to the server. More...
|
|
attachment | get_attachment (const attachment_id &id, bool include_mime_content=false) |
| Retrieves an attachment from the Exchange store.
|
|
calendar_item | get_calendar_item (const item_id &id, const item_shape &shape=item_shape()) |
| Gets a calendar item from the Exchange store.
|
|
calendar_item | get_calendar_item (const occurrence_item_id &id, const item_shape &shape=item_shape()) |
| Gets a calendar item from the Exchange store.
|
|
std::vector< calendar_item > | get_calendar_items (const std::vector< item_id > &ids, const item_shape &shape=item_shape()) |
| Gets a bunch of calendar items from the Exchange store at once.
|
|
std::vector< calendar_item > | get_calendar_items (const std::vector< occurrence_item_id > &ids, const item_shape &shape=item_shape()) |
| Gets a bunch of calendar items from the Exchange store at once.
|
|
contact | get_contact (const item_id &id, const item_shape &shape=item_shape()) |
| Gets a contact from the Exchange store.
|
|
std::vector< contact > | get_contacts (const std::vector< item_id > &ids, const item_shape &shape=item_shape()) |
| Gets multiple contacts from the Exchange store.
|
|
std::vector< delegate_user > | get_delegate (const mailbox &mailbox, bool include_permissions=false) |
| Retrieves the delegate users and settings for the specified mailbox.
|
|
folder | get_folder (const folder_id &id) |
| Gets a folder from the Exchange store.
|
|
folder | get_folder (const folder_id &id, const std::vector< property_path > &additional_properties) |
| Gets a folder from the Exchange store.
|
|
std::vector< folder > | get_folders (const std::vector< folder_id > &ids) |
| Gets a list of folders from the Exchange store.
|
|
std::vector< folder > | get_folders (const std::vector< folder_id > &ids, const std::vector< property_path > &additional_properties) |
| Gets a list of folders from Exchange store.
|
|
message | get_message (const item_id &id, const item_shape &shape=item_shape()) |
| Gets a message item from the Exchange store.
|
|
std::vector< message > | get_messages (const std::vector< item_id > &ids, const item_shape &shape=item_shape()) |
| Gets multiple message items from the Exchange store.
|
|
server_version | get_request_server_version () const |
| Returns the schema version that is used in requests by this service.
|
|
std::vector< mailbox > | get_room_lists () |
| Gets all room lists in the Exchange store.
|
|
std::vector< mailbox > | get_rooms (const mailbox &room_list) |
| Gets all rooms from a room list in the Exchange store.
|
|
task | get_task (const item_id &id, const item_shape &shape=item_shape()) |
| Gets a task from the Exchange store.
|
|
std::vector< task > | get_tasks (const std::vector< item_id > &ids, const item_shape &shape=item_shape()) |
| Gets multiple tasks from the Exchange store.
|
|
time_zone | get_time_zone () |
| Returns the time zone ID currently used for the header of the request made by this service.
|
|
basic_service & | impersonate () |
|
basic_service & | impersonate (const connecting_sid &sid) |
|
folder_id | move_folder (folder_id folder, const folder_id &target) |
| Moves one folder to a folder. More...
|
|
std::vector< folder_id > | move_folder (const std::vector< folder_id > &folders, const folder_id &target) |
| Moves one or more folders to a target folder. More...
|
|
item_id | move_item (item_id item, const folder_id &folder) |
| Moves one item to a folder. More...
|
|
std::vector< item_id > | move_item (const std::vector< item_id > &items, const folder_id &folder) |
| Moves one or more items to a folder. More...
|
|
void | remove_delegate (const mailbox &mailbox, const std::vector< user_id > &delegates) |
|
resolution_set | resolve_names (const std::string &unresolved_entry, search_scope scope) |
| The ResolveNames operation resolves ambiguous email addresses and display names. More...
|
|
resolution_set | resolve_names (const std::string &unresolved_entry, search_scope scope, const std::vector< folder_id > &parent_folder_ids) |
| The ResolveNames operation resolves ambiguous email addresses and display names. More...
|
|
void | send_item (const item_id &id) |
|
void | send_item (const std::vector< item_id > &ids) |
|
void | send_item (const item_id &id, const folder_id &folder) |
| Sends a message that is already in the Exchange store. More...
|
|
void | send_item (const std::vector< item_id > &ids, const folder_id &folder) |
| Sends messages that are already in the Exchange store. More...
|
|
void | set_cainfo (const std::string &path) |
| Sets the path to file holding certificates.
|
|
void | set_capath (const std::string &path) |
| Sets the path to the certificates directory.
|
|
void | set_debug_callback (const debug_callback &callback) |
| Sets the callback for debug messages.
|
|
void | set_http_proxy_tunnel (const bool value) |
| Activate or deactivates HTTP proxy tunneling.
|
|
void | set_proxy (const std::string &url) |
| Sets the URL of the proxy which should be used for connecting to the EWS service.
|
|
void | set_request_server_version (server_version vers) |
| Sets the schema version that will be used in requests made by this service.
|
|
void | set_ssl_options (const ssl_options value) |
| Sets the SSL options.
|
|
void | set_time_zone (const time_zone time_zone) |
| Sets the time zone ID used in the header of the request made by this service.
|
|
void | set_timeout (std::chrono::seconds d) |
| Sets maximum time the request is allowed to take. More...
|
|
sync_folder_hierarchy_result | sync_folder_hierarchy (const folder_id &folder_id) |
| Synchronizes the folder hierarchy in the Exchange store.
|
|
sync_folder_hierarchy_result | sync_folder_hierarchy (const folder_id &folder_id, const std::string &sync_state) |
|
sync_folder_items_result | sync_folder_items (const folder_id &folder_id, int max_changes_returned=512) |
| Synchronizes a folder in the Exchange store.
|
|
sync_folder_items_result | sync_folder_items (const folder_id &folder_id, const std::string &sync_state, int max_changes_returned=512) |
|
sync_folder_items_result | sync_folder_items (const folder_id &folder_id, const std::string &sync_state, const std::vector< item_id > &ignored_items, int max_changes_returned=512) |
|
folder_id | update_folder (folder_id folder_id, update change) |
| Update an existing folder's property. More...
|
|
folder_id | update_folder (folder_id folder_id, const std::vector< update > &changes) |
| Update multiple properties of an existing folder. More...
|
|
item_id | update_item (item_id id, update change, conflict_resolution resolution=conflict_resolution::auto_resolve, send_meeting_invitations_or_cancellations invitations_or_cancellations=send_meeting_invitations_or_cancellations::send_to_none) |
| Update an existing item's property. More...
|
|
item_id | update_item (item_id id, update change, conflict_resolution resolution, send_meeting_invitations_or_cancellations invitations_or_cancellations, const folder_id &folder) |
| Update an existing item's property in the specified folder. More...
|
|
item_id | update_item (item_id id, const std::vector< update > &changes, conflict_resolution resolution=conflict_resolution::auto_resolve, send_meeting_invitations_or_cancellations invitations_or_cancellations=send_meeting_invitations_or_cancellations::send_to_none) |
| Update multiple properties of an existing item. More...
|
|
item_id | update_item (item_id id, const std::vector< update > &changes, conflict_resolution resolution, send_meeting_invitations_or_cancellations invitations_or_cancellations, const folder_id &folder) |
| Update multiple properties of an existing item in the specified folder. More...
|
|
template<typename RequestHandler = internal::http_request>
class ews::basic_service< RequestHandler >
Allows you to perform operations on an Exchange server.
A service object is used to establish a connection to an Exchange server, authenticate against it, and make one, or more likely, multiple API calls to it, called operations. The basic_service class provides all operations that can be performed on an Exchange server as public member-functions, e.g.,
- create_item (<CreateItem>)
- delete_item (<DeleteItem>)
- find_item (<FindItem>)
- send_item (<SendItem>)
- update_item (<UpdateItem>)
- delete_calendar_item (<DeleteItem>)
- delete_contact (<DeleteItem>)
- delete_message (<DeleteItem>)
- delete_task (<DeleteItem>)
- get_calendar_item (<GetItem>)
- get_contact (<GetItem>)
- get_message (<GetItem>)
- get_task (<GetItem>)
- add_delegate (<AddDelegate>)
- get_delegate (<GetDelegate>)
- create_attachment (<CreateAttachment>)
- delete_attachment (<DeleteAttachment>)
- get_attachment (<GetAttachment>)
- create_folder (<CreateFolder>)
- delete_folder (<DeleteFolder>)
- find_folder (<FindFolder>)
- get_folder (<GetFolder>)
to name a few.
General Usage
Usually you want to create one service instance and keep it alive as long as you need a connection to the Exchange server. A TCP connection is established as soon as you make the first call to the server. That TCP connection is kept alive as long as the instance is around. Upon destruction, the TCP connection is closed.
While you can create a new service object for each call to, lets say create_item, it is not encouraged to do so because with every new service instance you construct you'd create a new TCP connection and authenticate to the server again which would imply a great deal of overhead for just a single API call. Instead, try to re-use a service object for as many calls to the API as possible.
Thread Safety
Instances of this class are re-entrant but not thread safe. This means that you should not share references to service instances across threads without providing synchronization but it is totally safe to have multiple distinct service instances in different threads.