Class: Viewpoint::EWS::SOAP::ExchangeWebService
- Inherits:
-
Object
- Object
- Viewpoint::EWS::SOAP::ExchangeWebService
- Includes:
- Viewpoint::EWS, Viewpoint::EWS::SOAP, ExchangeAvailability, ExchangeDataServices, ExchangeNotification, ExchangeSynchronization, ExchangeUserConfiguration
- Defined in:
- lib/ews/soap/exchange_web_service.rb
Constant Summary
Constant Summary
Constants included from Viewpoint::EWS::SOAP
ActiveDirectory, ActiveDirectoryContacts, Contacts, ContactsActiveDirectory, HARD_DELETE, MOVE_TO_DELETED_ITEMS, NAMESPACES, NS_EWS_MESSAGES, NS_EWS_TYPES, NS_SOAP, SOFT_DELETE, VERSION_2007, VERSION_2007_SP1, VERSION_2010, VERSION_2010_SP1, VERSION_2010_SP2, VERSION_2013, VERSION_NONE
Instance Attribute Summary (collapse)
-
- (Object) auto_deepen
Returns the value of attribute auto_deepen.
-
- (Object) connection
Returns the value of attribute connection.
-
- (Object) no_auto_deepen_behavior
Returns the value of attribute no_auto_deepen_behavior.
-
- (Object) server_version
Returns the value of attribute server_version.
Attributes included from Viewpoint::EWS
Instance Method Summary (collapse)
-
- (Object) add_delegate(owner, delegate, permissions)
Adds one or more delegates to a principal's mailbox and sets specific access permissions.
- - (Object) create_managed_folder
- - (Object) delete_attachment
-
- (Object) do_soap_request(soapmsg, opts = {})
Send the SOAP request to the endpoint and parse it.
-
- (Object) get_delegate(owner)
Retrieves the delegate settings for a specific mailbox.
-
- (Object) get_user_availability(opts)
Provides detailed information about the availability of a set of users, rooms, and resources within a specified time window.
-
- (ExchangeWebService) initialize(connection, opts = {})
constructor
A new instance of ExchangeWebService.
- - (Object) parse_soap_response(soapmsg, opts = {})
-
- (Object) remove_delegate(owner, delegate)
Removes one or more delegates from a user's mailbox.
-
- (Object) update_delegate(owner, delegate, permissions)
Updates delegate permissions on a principal's mailbox.
Methods included from ExchangeSynchronization
#sync_folder_hierarchy, #sync_folder_items
Methods included from ExchangeUserConfiguration
Methods included from ExchangeAvailability
#get_user_oof_settings, #set_user_oof_settings
Methods included from ExchangeNotification
#get_events, #pull_subscribe_folder, #push_subscribe_folder, #subscribe, #unsubscribe
Methods included from ExchangeDataServices
#convert_id, #copy_folder, #copy_item, #create_attachment, #create_folder, #create_item, #delete_folder, #delete_item, #empty_folder, #expand_dl, #find_folder, #find_item, #get_attachment, #get_folder, #get_item, #move_folder, #move_item, #resolve_names, #send_item, #update_folder, #update_item
Methods included from Viewpoint::EWS
Constructor Details
- (ExchangeWebService) initialize(connection, opts = {})
A new instance of ExchangeWebService
37 38 39 40 41 42 43 |
# File 'lib/ews/soap/exchange_web_service.rb', line 37 def initialize(connection, opts = {}) super() @connection = connection @server_version = opts[:server_version] ? opts[:server_version] : VERSION_2010 @auto_deepen = true @no_auto_deepen_behavior = :raise end |
Instance Attribute Details
- (Object) auto_deepen
Returns the value of attribute auto_deepen
29 30 31 |
# File 'lib/ews/soap/exchange_web_service.rb', line 29 def auto_deepen @auto_deepen end |
- (Object) connection
Returns the value of attribute connection
29 30 31 |
# File 'lib/ews/soap/exchange_web_service.rb', line 29 def connection @connection end |
- (Object) no_auto_deepen_behavior
Returns the value of attribute no_auto_deepen_behavior
29 30 31 |
# File 'lib/ews/soap/exchange_web_service.rb', line 29 def no_auto_deepen_behavior @no_auto_deepen_behavior end |
- (Object) server_version
Returns the value of attribute server_version
29 30 31 |
# File 'lib/ews/soap/exchange_web_service.rb', line 29 def server_version @server_version end |
Instance Method Details
- (Object) add_delegate(owner, delegate, permissions)
Adds one or more delegates to a principal's mailbox and sets specific access permissions.
83 84 85 86 87 88 89 90 91 |
# File 'lib/ews/soap/exchange_web_service.rb', line 83 def add_delegate(owner, delegate, ) action = "#{SOAP_ACTION_PREFIX}/AddDelegate" resp = invoke("#{NS_EWS_MESSAGES}:AddDelegate", action) do |root| build!(root) do add_delegate!(owner, delegate, ) end end parse_soap_response(resp) end |
- (Object) create_managed_folder
53 54 55 56 57 58 59 |
# File 'lib/ews/soap/exchange_web_service.rb', line 53 def create_managed_folder action = "#{SOAP_ACTION_PREFIX}/CreateManagedFolder" resp = invoke("#{NS_EWS_MESSAGES}:CreateManagedFolder", action) do |create_managed_folder| build_create_managed_folder!(create_managed_folder) end parse_create_managed_folder(resp) end |
- (Object) delete_attachment
45 46 47 48 49 50 51 |
# File 'lib/ews/soap/exchange_web_service.rb', line 45 def action = "#{SOAP_ACTION_PREFIX}/DeleteAttachment" resp = invoke("#{NS_EWS_MESSAGES}:DeleteAttachment", action) do || () end (resp) end |
- (Object) do_soap_request(soapmsg, opts = {})
make this work for Viewpoint (imported from SPWS)
Send the SOAP request to the endpoint and parse it.
173 174 175 176 177 178 179 180 181 |
# File 'lib/ews/soap/exchange_web_service.rb', line 173 def do_soap_request(soapmsg, opts = {}) @log.debug <<-EOF.gsub(/^ {8}/, '') Sending SOAP Request: ---------------- #{soapmsg} ---------------- EOF connection.dispatch(self, soapmsg, opts) end |
- (Object) get_delegate(owner)
Retrieves the delegate settings for a specific mailbox.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/ews/soap/exchange_web_service.rb', line 65 def get_delegate(owner) action = "#{SOAP_ACTION_PREFIX}/GetDelegate" resp = invoke("#{NS_EWS_MESSAGES}:GetDelegate", action) do |root| root.set_attr('IncludePermissions', 'true') build!(root) do mailbox!(root, {:email_address => {:text => owner}}) end end parse_soap_response(resp) end |
- (Object) get_user_availability(opts)
Finish out :suggestions_view_options
Provides detailed information about the availability of a set of users, rooms, and resources within a specified time window.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/ews/soap/exchange_web_service.rb', line 145 def get_user_availability(opts) opts = opts.clone req = build_soap! do |type, builder| if(type == :header) else builder.nbuild.GetUserAvailabilityRequest {|x| x.parent.default_namespace = @default_ns builder.time_zone!(opts[:time_zone]) builder.nbuild.MailboxDataArray { opts[:mailbox_data].each do |mbd| builder.mailbox_data!(mbd) end } builder.(opts[:free_busy_view_options]) builder.(opts[:suggestions_view_options]) } end end do_soap_request(req, response_class: EwsSoapFreeBusyResponse) end |
- (Object) parse_soap_response(soapmsg, opts = {})
186 187 188 189 190 |
# File 'lib/ews/soap/exchange_web_service.rb', line 186 def parse_soap_response(soapmsg, opts = {}) raise EwsError, "Can't parse an empty response. Please check your endpoint." if(soapmsg.nil?) opts[:response_class] ||= EwsSoapResponse EwsParser.new(soapmsg).parse(opts) end |
- (Object) remove_delegate(owner, delegate)
Removes one or more delegates from a user's mailbox.
98 99 100 101 102 103 104 105 106 |
# File 'lib/ews/soap/exchange_web_service.rb', line 98 def remove_delegate(owner, delegate) action = "#{SOAP_ACTION_PREFIX}/RemoveDelegate" resp = invoke("#{NS_EWS_MESSAGES}:RemoveDelegate", action) do |root| build!(root) do remove_delegate!(owner, delegate) end end parse_soap_response(resp) end |
- (Object) update_delegate(owner, delegate, permissions)
Updates delegate permissions on a principal's mailbox
115 116 117 118 119 120 121 122 123 |
# File 'lib/ews/soap/exchange_web_service.rb', line 115 def update_delegate(owner, delegate, ) action = "#{SOAP_ACTION_PREFIX}/UpdateDelegate" resp = invoke("#{NS_EWS_MESSAGES}:UpdateDelegate", action) do |root| build!(root) do add_delegate!(owner, delegate, ) end end parse_soap_response(resp) end |