Module: Viewpoint::EWS::MailboxAccessors
Overview
This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
Copyright © 2011 Dan Wanek <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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.}" end users end |