viewpoint 1.1.1 → 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.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -8
  3. data/lib/ews/calendar_accessors.rb +37 -33
  4. data/lib/ews/connection.rb +151 -124
  5. data/lib/ews/connection_helper.rb +36 -33
  6. data/lib/ews/convert_accessors.rb +58 -54
  7. data/lib/ews/errors.rb +59 -53
  8. data/lib/ews/ews_client.rb +92 -79
  9. data/lib/ews/exceptions/exceptions.rb +61 -61
  10. data/lib/ews/folder_accessors.rb +235 -234
  11. data/lib/ews/impersonation.rb +29 -23
  12. data/lib/ews/item_accessors.rb +215 -213
  13. data/lib/ews/mailbox_accessors.rb +82 -79
  14. data/lib/ews/meeting_accessors.rb +38 -31
  15. data/lib/ews/message_accessors.rb +83 -81
  16. data/lib/ews/push_subscription_accessors.rb +29 -27
  17. data/lib/ews/room_accessors.rb +48 -46
  18. data/lib/ews/roomlist_accessors.rb +47 -45
  19. data/lib/ews/soap/builders/ews_builder.rb +1186 -1188
  20. data/lib/ews/soap/ews_response.rb +68 -73
  21. data/lib/ews/soap/ews_soap_availability_response.rb +57 -57
  22. data/lib/ews/soap/ews_soap_free_busy_response.rb +115 -117
  23. data/lib/ews/soap/ews_soap_response.rb +99 -101
  24. data/lib/ews/soap/ews_soap_room_response.rb +45 -45
  25. data/lib/ews/soap/ews_soap_roomlist_response.rb +45 -46
  26. data/lib/ews/soap/exchange_availability.rb +54 -52
  27. data/lib/ews/soap/exchange_data_services.rb +693 -711
  28. data/lib/ews/soap/exchange_notification.rb +123 -128
  29. data/lib/ews/soap/exchange_synchronization.rb +82 -82
  30. data/lib/ews/soap/exchange_time_zones.rb +41 -44
  31. data/lib/ews/soap/exchange_user_configuration.rb +30 -27
  32. data/lib/ews/soap/exchange_web_service.rb +237 -233
  33. data/lib/ews/soap/parsers/ews_parser.rb +46 -42
  34. data/lib/ews/soap/parsers/ews_sax_document.rb +63 -58
  35. data/lib/ews/soap/response_message.rb +69 -68
  36. data/lib/ews/soap/responses/create_attachment_response_message.rb +45 -45
  37. data/lib/ews/soap/responses/create_item_response_message.rb +26 -25
  38. data/lib/ews/soap/responses/find_item_response_message.rb +76 -78
  39. data/lib/ews/soap/responses/get_events_response_message.rb +52 -51
  40. data/lib/ews/soap/responses/send_notification_response_message.rb +53 -51
  41. data/lib/ews/soap/responses/subscribe_response_message.rb +37 -34
  42. data/lib/ews/soap/responses/sync_folder_hierarchy_response_message.rb +38 -35
  43. data/lib/ews/soap/responses/sync_folder_items_response_message.rb +38 -35
  44. data/lib/ews/soap.rb +27 -26
  45. data/lib/ews/templates/calendar_item.rb +64 -60
  46. data/lib/ews/templates/forward_item.rb +19 -17
  47. data/lib/ews/templates/message.rb +61 -67
  48. data/lib/ews/templates/reply_to_item.rb +20 -18
  49. data/lib/ews/templates/task.rb +55 -55
  50. data/lib/ews/types/attachment.rb +75 -74
  51. data/lib/ews/types/attendee.rb +27 -25
  52. data/lib/ews/types/calendar_folder.rb +60 -44
  53. data/lib/ews/types/calendar_item.rb +134 -116
  54. data/lib/ews/types/contact.rb +11 -5
  55. data/lib/ews/types/contacts_folder.rb +10 -5
  56. data/lib/ews/types/copied_event.rb +47 -48
  57. data/lib/ews/types/created_event.rb +22 -20
  58. data/lib/ews/types/deleted_event.rb +22 -20
  59. data/lib/ews/types/distribution_list.rb +11 -5
  60. data/lib/ews/types/event.rb +60 -59
  61. data/lib/ews/types/export_items_response_message.rb +54 -50
  62. data/lib/ews/types/file_attachment.rb +63 -61
  63. data/lib/ews/types/folder.rb +58 -57
  64. data/lib/ews/types/free_busy_changed_event.rb +22 -20
  65. data/lib/ews/types/generic_folder.rb +348 -372
  66. data/lib/ews/types/item.rb +401 -397
  67. data/lib/ews/types/item_attachment.rb +87 -80
  68. data/lib/ews/types/item_field_uri_map.rb +201 -200
  69. data/lib/ews/types/mailbox_user.rb +146 -154
  70. data/lib/ews/types/meeting_cancellation.rb +11 -5
  71. data/lib/ews/types/meeting_message.rb +11 -5
  72. data/lib/ews/types/meeting_request.rb +11 -5
  73. data/lib/ews/types/meeting_response.rb +11 -5
  74. data/lib/ews/types/message.rb +11 -5
  75. data/lib/ews/types/modified_event.rb +43 -45
  76. data/lib/ews/types/moved_event.rb +47 -48
  77. data/lib/ews/types/new_mail_event.rb +22 -20
  78. data/lib/ews/types/out_of_office.rb +145 -144
  79. data/lib/ews/types/post_item.rb +11 -5
  80. data/lib/ews/types/search_folder.rb +10 -5
  81. data/lib/ews/types/status_event.rb +37 -36
  82. data/lib/ews/types/task.rb +39 -33
  83. data/lib/ews/types/tasks_folder.rb +32 -22
  84. data/lib/ews/types.rb +134 -139
  85. data/lib/viewpoint/logging/config.rb +19 -19
  86. data/lib/viewpoint/logging.rb +23 -17
  87. data/lib/viewpoint/string_utils.rb +31 -32
  88. data/lib/viewpoint.rb +18 -18
  89. metadata +82 -11
  90. data/Changelog.txt +0 -1004
@@ -1,84 +1,91 @@
1
- =begin
2
- This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
3
-
4
- Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License");
7
- you may not use this file except in compliance with the License.
8
- You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
17
- =end
18
-
19
- module Viewpoint::EWS::Types
20
- class ItemAttachment < Attachment
21
-
22
- ITEM_ATTACH_KEY_PATHS = {
23
- item: [:item],
24
- message: [:message],
25
- calendar_item: [:calendar_item],
26
- contact: [:contact],
27
- task: [:task],
28
- meeting_message: [:meeting_message],
29
- meeting_request: [:meeting_request],
30
- meeting_response: [:meeting_response],
31
- meeting_cancellation: [:meeting_cancellation]
32
- }
33
-
34
- ITEM_ATTACH_KEY_TYPES = {
35
- message: :build_message,
36
- calendar_item: :build_calendar_item,
37
- contact: :build_contact,
38
- task: :build_task,
39
- meeting_message: :build_meeting_message,
40
- meeting_request: :build_meeting_request,
41
- meeting_response: :build_meeting_response,
42
- meeting_cancellation: :build_meeting_cancellation
43
- }
44
-
45
- ITEM_ATTACH_KEY_ALIAS = { }
46
-
47
- def get_all_properties!
48
- resp = ews.get_attachment attachment_ids: [self.id]
49
- @ews_item.merge!(parse_response(resp))
50
- end
51
-
52
- private
53
-
54
- def self.method_missing(method, *args, &block)
55
- if method.to_s =~ /^build_(.+)$/
56
- class_by_name($1).new(ews, args[0])
57
- else
58
- super
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 Types
22
+ # Item Attachment EWS data type.
23
+ class ItemAttachment < Attachment
24
+ ITEM_ATTACH_KEY_PATHS = {
25
+ item: [:item],
26
+ message: [:message],
27
+ calendar_item: [:calendar_item],
28
+ contact: [:contact],
29
+ task: [:task],
30
+ meeting_message: [:meeting_message],
31
+ meeting_request: [:meeting_request],
32
+ meeting_response: [:meeting_response],
33
+ meeting_cancellation: [:meeting_cancellation]
34
+ }.freeze
35
+
36
+ ITEM_ATTACH_KEY_TYPES = {
37
+ message: :build_message,
38
+ calendar_item: :build_calendar_item,
39
+ contact: :build_contact,
40
+ task: :build_task,
41
+ meeting_message: :build_meeting_message,
42
+ meeting_request: :build_meeting_request,
43
+ meeting_response: :build_meeting_response,
44
+ meeting_cancellation: :build_meeting_cancellation
45
+ }.freeze
46
+
47
+ ITEM_ATTACH_KEY_ALIAS = {}.freeze
48
+
49
+ def get_all_properties!
50
+ resp = ews.get_attachment attachment_ids: [id]
51
+ @ews_item.merge!(parse_response(resp))
52
+ end
53
+
54
+ def self.method_missing(method, *args, &block)
55
+ if method.to_s =~ /^build_(.+)$/
56
+ class_by_name(::Regexp.last_match(1)).new(ews, args[0])
57
+ else
58
+ super
59
+ end
60
+ end
61
+ private_class_method :method_missing
62
+
63
+ def self.respond_to_missing?(method, include_private = false)
64
+ method.to_s.match?(/^build_(.+)$/) || super
65
+ end
66
+ private_class_method :respond_to_missing?
67
+
68
+ def key_paths
69
+ super.merge(ITEM_ATTACH_KEY_PATHS)
70
+ end
71
+
72
+ def key_types
73
+ super.merge(ITEM_ATTACH_KEY_TYPES)
74
+ end
75
+
76
+ def key_alias
77
+ super.merge(ITEM_ATTACH_KEY_ALIAS)
78
+ end
79
+
80
+ def parse_response(resp)
81
+ unless resp.status == 'Success'
82
+ raise EwsError,
83
+ "Could not retrieve #{self.class}. #{resp.code}: #{resp.message}"
84
+ end
85
+
86
+ resp.response_message[:elems][:attachments][:elems][0][:item_attachment][:elems].inject(&:merge)
87
+ end
59
88
  end
60
89
  end
61
-
62
- def key_paths
63
- super.merge(ITEM_ATTACH_KEY_PATHS)
64
- end
65
-
66
- def key_types
67
- super.merge(ITEM_ATTACH_KEY_TYPES)
68
- end
69
-
70
- def key_alias
71
- super.merge(ITEM_ATTACH_KEY_ALIAS)
72
- end
73
-
74
- def parse_response(resp)
75
- if(resp.status == 'Success')
76
- resp.response_message[:elems][:attachments][:elems][0][:item_attachment][:elems].inject(&:merge)
77
- else
78
- raise EwsError, "Could not retrieve #{self.class}. #{resp.code}: #{resp.message}"
79
- end
80
- end
81
-
82
90
  end
83
91
  end
84
-