viewpoint 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -6
- data/lib/ews/calendar_accessors.rb +37 -33
- data/lib/ews/connection.rb +152 -125
- data/lib/ews/connection_helper.rb +36 -33
- data/lib/ews/convert_accessors.rb +58 -54
- data/lib/ews/errors.rb +59 -53
- data/lib/ews/ews_client.rb +92 -79
- data/lib/ews/exceptions/exceptions.rb +61 -61
- data/lib/ews/folder_accessors.rb +235 -234
- data/lib/ews/impersonation.rb +29 -23
- data/lib/ews/item_accessors.rb +215 -213
- data/lib/ews/mailbox_accessors.rb +82 -79
- data/lib/ews/meeting_accessors.rb +38 -31
- data/lib/ews/message_accessors.rb +83 -81
- data/lib/ews/push_subscription_accessors.rb +29 -27
- data/lib/ews/room_accessors.rb +48 -46
- data/lib/ews/roomlist_accessors.rb +47 -45
- data/lib/ews/soap/builders/ews_builder.rb +1191 -1176
- data/lib/ews/soap/ews_response.rb +68 -73
- data/lib/ews/soap/ews_soap_availability_response.rb +57 -57
- data/lib/ews/soap/ews_soap_free_busy_response.rb +115 -117
- data/lib/ews/soap/ews_soap_response.rb +99 -101
- data/lib/ews/soap/ews_soap_room_response.rb +45 -45
- data/lib/ews/soap/ews_soap_roomlist_response.rb +45 -46
- data/lib/ews/soap/exchange_availability.rb +54 -52
- data/lib/ews/soap/exchange_data_services.rb +693 -711
- data/lib/ews/soap/exchange_notification.rb +123 -128
- data/lib/ews/soap/exchange_synchronization.rb +82 -82
- data/lib/ews/soap/exchange_time_zones.rb +41 -44
- data/lib/ews/soap/exchange_user_configuration.rb +30 -27
- data/lib/ews/soap/exchange_web_service.rb +237 -233
- data/lib/ews/soap/parsers/ews_parser.rb +46 -42
- data/lib/ews/soap/parsers/ews_sax_document.rb +63 -58
- data/lib/ews/soap/response_message.rb +69 -68
- data/lib/ews/soap/responses/create_attachment_response_message.rb +45 -45
- data/lib/ews/soap/responses/create_item_response_message.rb +26 -25
- data/lib/ews/soap/responses/find_item_response_message.rb +76 -78
- data/lib/ews/soap/responses/get_events_response_message.rb +52 -51
- data/lib/ews/soap/responses/send_notification_response_message.rb +53 -51
- data/lib/ews/soap/responses/subscribe_response_message.rb +37 -34
- data/lib/ews/soap/responses/sync_folder_hierarchy_response_message.rb +38 -35
- data/lib/ews/soap/responses/sync_folder_items_response_message.rb +38 -35
- data/lib/ews/soap.rb +27 -26
- data/lib/ews/templates/calendar_item.rb +64 -60
- data/lib/ews/templates/forward_item.rb +19 -17
- data/lib/ews/templates/message.rb +61 -58
- data/lib/ews/templates/reply_to_item.rb +20 -18
- data/lib/ews/templates/task.rb +55 -55
- data/lib/ews/types/attachment.rb +75 -74
- data/lib/ews/types/attendee.rb +27 -25
- data/lib/ews/types/calendar_folder.rb +58 -59
- data/lib/ews/types/calendar_item.rb +133 -131
- data/lib/ews/types/contact.rb +11 -5
- data/lib/ews/types/contacts_folder.rb +10 -5
- data/lib/ews/types/copied_event.rb +47 -48
- data/lib/ews/types/created_event.rb +22 -20
- data/lib/ews/types/deleted_event.rb +22 -20
- data/lib/ews/types/distribution_list.rb +11 -5
- data/lib/ews/types/event.rb +60 -59
- data/lib/ews/types/export_items_response_message.rb +54 -50
- data/lib/ews/types/file_attachment.rb +63 -61
- data/lib/ews/types/folder.rb +58 -57
- data/lib/ews/types/free_busy_changed_event.rb +22 -20
- data/lib/ews/types/generic_folder.rb +348 -372
- data/lib/ews/types/item.rb +401 -397
- data/lib/ews/types/item_attachment.rb +87 -80
- data/lib/ews/types/item_field_uri_map.rb +201 -200
- data/lib/ews/types/mailbox_user.rb +146 -154
- data/lib/ews/types/meeting_cancellation.rb +11 -5
- data/lib/ews/types/meeting_message.rb +11 -5
- data/lib/ews/types/meeting_request.rb +11 -5
- data/lib/ews/types/meeting_response.rb +11 -5
- data/lib/ews/types/message.rb +11 -5
- data/lib/ews/types/modified_event.rb +43 -45
- data/lib/ews/types/moved_event.rb +47 -48
- data/lib/ews/types/new_mail_event.rb +22 -20
- data/lib/ews/types/out_of_office.rb +145 -144
- data/lib/ews/types/post_item.rb +11 -5
- data/lib/ews/types/search_folder.rb +10 -5
- data/lib/ews/types/status_event.rb +37 -36
- data/lib/ews/types/task.rb +39 -33
- data/lib/ews/types/tasks_folder.rb +31 -25
- data/lib/ews/types.rb +134 -139
- data/lib/viewpoint/logging/config.rb +19 -19
- data/lib/viewpoint/logging.rb +23 -17
- data/lib/viewpoint/string_utils.rb +31 -32
- data/lib/viewpoint.rb +18 -18
- metadata +50 -25
- data/Changelog.txt +0 -1004
|
@@ -1,70 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
|
|
1
|
+
# frozen_string_literal: true
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
# This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
|
|
4
|
+
#
|
|
5
|
+
# Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
5
18
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
module Viewpoint
|
|
20
|
+
module EWS
|
|
21
|
+
module SOAP
|
|
22
|
+
# Parse the incoming response document via a SAX parser instead of the
|
|
23
|
+
# traditional DOM parser. In early benchmarks this was performing about
|
|
24
|
+
# 132% faster than the DOM-based parser for large documents.
|
|
25
|
+
class EwsSaxDocument < Nokogiri::XML::SAX::Document
|
|
26
|
+
include Viewpoint::EWS
|
|
27
|
+
include Viewpoint::StringUtils
|
|
9
28
|
|
|
10
|
-
|
|
29
|
+
attr_reader :struct
|
|
11
30
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
=end
|
|
31
|
+
def initialize
|
|
32
|
+
super
|
|
33
|
+
@struct = {}
|
|
34
|
+
@elems = []
|
|
35
|
+
end
|
|
18
36
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
include Viewpoint::StringUtils
|
|
37
|
+
def characters(string)
|
|
38
|
+
# FIXME: Move white space removal to somewhere else.
|
|
39
|
+
# This function can be called multiple times. In this case newlines in Text Bodies get stripped.
|
|
40
|
+
# See: https://github.com/zenchild/Viewpoint/issues/90
|
|
41
|
+
# string.strip!
|
|
42
|
+
return if string.empty?
|
|
26
43
|
|
|
27
|
-
|
|
44
|
+
if @elems.last[:text]
|
|
45
|
+
@elems.last[:text] += string
|
|
46
|
+
else
|
|
47
|
+
@elems.last[:text] = string
|
|
48
|
+
end
|
|
49
|
+
end
|
|
28
50
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return if string.empty?
|
|
40
|
-
if @elems.last[:text]
|
|
41
|
-
@elems.last[:text] += string
|
|
42
|
-
else
|
|
43
|
-
@elems.last[:text] = string
|
|
44
|
-
end
|
|
45
|
-
end
|
|
51
|
+
def start_element_namespace(name, attributes = [], _prefix = nil, _uri = nil, _namespaces = [])
|
|
52
|
+
ruby_case(name).to_sym
|
|
53
|
+
elem = {}
|
|
54
|
+
unless attributes.empty?
|
|
55
|
+
elem[:attribs] = attributes.collect { |a|
|
|
56
|
+
{ ruby_case(a.localname).to_sym => a.value }
|
|
57
|
+
}.inject(&:merge)
|
|
58
|
+
end
|
|
59
|
+
@elems << elem
|
|
60
|
+
end
|
|
46
61
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
def end_element_namespace(name, _prefix = nil, _uri = nil)
|
|
63
|
+
name = ruby_case(name).to_sym
|
|
64
|
+
elem = @elems.pop
|
|
65
|
+
if @elems.empty?
|
|
66
|
+
@struct[name] = elem
|
|
67
|
+
else
|
|
68
|
+
@elems.last[:elems] = [] unless @elems.last[:elems].is_a?(Array)
|
|
69
|
+
@elems.last[:elems] << { name => elem }
|
|
70
|
+
end
|
|
71
|
+
end
|
|
54
72
|
end
|
|
55
|
-
@elems << elem
|
|
56
73
|
end
|
|
57
|
-
|
|
58
|
-
def end_element_namespace name, prefix=nil, uri=nil
|
|
59
|
-
name = ruby_case(name).to_sym
|
|
60
|
-
elem = @elems.pop
|
|
61
|
-
if @elems.empty?
|
|
62
|
-
@struct[name] = elem
|
|
63
|
-
else
|
|
64
|
-
@elems.last[:elems] = [] unless @elems.last[:elems].is_a?(Array)
|
|
65
|
-
@elems.last[:elems] << {name => elem}
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
74
|
end
|
|
70
75
|
end
|
|
@@ -1,74 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
module Viewpoint
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
|
|
4
|
+
#
|
|
5
|
+
# Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
|
|
19
|
+
module Viewpoint
|
|
20
|
+
module EWS
|
|
21
|
+
module SOAP
|
|
22
|
+
# Base class for parsed SOAP response messages.
|
|
23
|
+
class ResponseMessage
|
|
24
|
+
attr_reader :message, :type
|
|
25
|
+
|
|
26
|
+
def initialize(message)
|
|
27
|
+
@type = message.keys.first
|
|
28
|
+
@message = message[@type]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def response_class
|
|
32
|
+
message[:attribs][:response_class]
|
|
33
|
+
end
|
|
34
|
+
alias status response_class
|
|
35
|
+
|
|
36
|
+
def success?
|
|
37
|
+
response_class == 'Success'
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def message_text
|
|
41
|
+
safe_hash_access message, %i[elems message_text text]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def response_code
|
|
45
|
+
safe_hash_access message, %i[elems response_code text]
|
|
46
|
+
end
|
|
47
|
+
alias code response_code
|
|
48
|
+
|
|
49
|
+
def message_xml
|
|
50
|
+
safe_hash_access message, %i[elems message_xml text]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def items
|
|
54
|
+
safe_hash_access(message, %i[elems items elems]) || []
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
private
|
|
58
|
+
|
|
59
|
+
def safe_hash_access(hsh, keys)
|
|
60
|
+
key = keys.shift
|
|
61
|
+
return nil unless hsh.is_a?(Hash) && hsh.key?(key)
|
|
62
|
+
|
|
63
|
+
if keys.empty?
|
|
64
|
+
hsh[key]
|
|
65
|
+
else
|
|
66
|
+
safe_hash_access hsh[key], keys
|
|
67
|
+
end
|
|
68
|
+
end
|
|
67
69
|
end
|
|
68
70
|
end
|
|
69
|
-
|
|
70
71
|
end
|
|
71
|
-
end
|
|
72
|
+
end
|
|
72
73
|
|
|
73
74
|
require_relative './responses/create_item_response_message'
|
|
74
75
|
require_relative './responses/create_attachment_response_message'
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
module Viewpoint
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
|
|
4
|
+
#
|
|
5
|
+
# Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
|
|
19
|
+
module Viewpoint
|
|
20
|
+
module EWS
|
|
21
|
+
module SOAP
|
|
22
|
+
# Parses the Create Attachment operation SOAP response.
|
|
23
|
+
class CreateAttachmentResponseMessage < ResponseMessage
|
|
24
|
+
include Viewpoint::StringUtils
|
|
25
|
+
|
|
26
|
+
def attachments
|
|
27
|
+
return @attachments if @attachments
|
|
28
|
+
|
|
29
|
+
a = safe_hash_access message, %i[elems attachments elems]
|
|
30
|
+
@attachments = a.nil? ? nil : parse_attachments(a)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def parse_attachments(att)
|
|
36
|
+
att.collect do |a|
|
|
37
|
+
type = a.keys.first
|
|
38
|
+
klass = Viewpoint::EWS::Types.const_get(camel_case(type))
|
|
39
|
+
item = OpenStruct.new
|
|
40
|
+
item.ews = nil
|
|
41
|
+
klass.new(item, a[type])
|
|
42
|
+
end
|
|
43
|
+
end
|
|
42
44
|
end
|
|
43
45
|
end
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
end # Viewpoint::EWS::SOAP
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
module Viewpoint
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
|
|
4
|
+
#
|
|
5
|
+
# Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
|
|
19
|
+
module Viewpoint
|
|
20
|
+
module EWS
|
|
21
|
+
module SOAP
|
|
22
|
+
class CreateItemResponseMessage < ResponseMessage
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -1,80 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
module Viewpoint
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
|
|
4
|
+
#
|
|
5
|
+
# Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
|
|
19
|
+
module Viewpoint
|
|
20
|
+
module EWS
|
|
21
|
+
module SOAP
|
|
22
|
+
# Root folder reference in FindItem responses.
|
|
23
|
+
class RootFolder
|
|
24
|
+
attr_reader :root
|
|
25
|
+
|
|
26
|
+
def initialize(root)
|
|
27
|
+
@root = root
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def indexed_paging_offset
|
|
31
|
+
attrib :index_paging_offset
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def numerator_offset
|
|
35
|
+
attrib :numerator_offset
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def absolute_denominator
|
|
39
|
+
attrib :absolute_denominator
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def includes_last_item_in_range
|
|
43
|
+
attrib :includes_last_item_in_range
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def total_items_in_view
|
|
47
|
+
attrib :total_items_in_view
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def items
|
|
51
|
+
root[:elems][0][:items][:elems] || []
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def groups
|
|
55
|
+
root[:elems][0][:groups][:elems]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
private
|
|
59
|
+
|
|
60
|
+
def attrib(key)
|
|
61
|
+
return nil unless root.key?(:attribs)
|
|
62
|
+
|
|
63
|
+
root[:attribs][key]
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Parses the Find Item operation SOAP response.
|
|
68
|
+
class FindItemResponseMessage < ResponseMessage
|
|
69
|
+
def root_folder
|
|
70
|
+
return @root_folder if @root_folder
|
|
71
|
+
|
|
72
|
+
rf = safe_hash_access message, %i[elems root_folder]
|
|
73
|
+
@root_folder = rf.nil? ? nil : RootFolder.new(rf)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
64
76
|
end
|
|
65
|
-
|
|
66
77
|
end
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class FindItemResponseMessage < ResponseMessage
|
|
70
|
-
|
|
71
|
-
def root_folder
|
|
72
|
-
return @root_folder if @root_folder
|
|
73
|
-
|
|
74
|
-
rf = safe_hash_access message, [:elems, :root_folder]
|
|
75
|
-
@root_folder = rf.nil? ? nil : RootFolder.new(rf)
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
end # FindItemResponseMessage
|
|
79
|
-
|
|
80
|
-
end # Viewpoint::EWS::SOAP
|
|
78
|
+
end
|