Module: Viewpoint::EWS::MailboxAccessors
Overview
This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
Copyright
Constant Summary
Constants included from Viewpoint::EWS
Instance Attribute Summary
Attributes included from Viewpoint::EWS
Instance Method Summary collapse
-
#get_user_availability(emails, opts) ⇒ Object
GetUserAvailability request.
-
#search_contacts(ustring) ⇒ Array<MailboxUser>
Resolve contacts in the Exchange Data Store.
Methods included from Viewpoint::EWS
#remove_impersonation, root_logger, #set_impersonation
Instance Method Details
#get_user_availability(emails, opts) ⇒ Object
GetUserAvailability request
57 58 59 60 61 62 |
# File 'lib/ews/mailbox_accessors.rb', line 57 def get_user_availability(emails, opts) opts = opts.clone args = get_user_availability_args(emails, opts) resp = ews.get_user_availability(args.merge(opts)) get_user_availability_parser(resp) end |
#search_contacts(ustring) ⇒ Array<MailboxUser>
Resolve contacts in the Exchange Data Store
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/ews/mailbox_accessors.rb', line 25 def search_contacts(ustring) resp = ews.resolve_names(:name => ustring) users = [] if(resp.status == 'Success') mb = resp.[:elems][:resolution_set][:elems][0][:resolution][:elems][0] users << Types::MailboxUser.new(ews, mb[:mailbox][:elems]) elsif(resp.code == 'ErrorNameResolutionMultipleResults') resp.[:elems][:resolution_set][:elems].each do |u| if u[:resolution][:elems][0][:mailbox] users << Types::MailboxUser.new(ews, u[:resolution][:elems][0][:mailbox][:elems]) end end else raise EwsError, "Find User produced an error: #{resp.code}: #{resp.message}" end users end |