viewpoint2 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +216 -0
  3. data/lib/ews/calendar_accessors.rb +34 -0
  4. data/lib/ews/connection.rb +130 -0
  5. data/lib/ews/connection_helper.rb +35 -0
  6. data/lib/ews/convert_accessors.rb +56 -0
  7. data/lib/ews/errors.rb +56 -0
  8. data/lib/ews/ews_client.rb +103 -0
  9. data/lib/ews/exceptions/exceptions.rb +61 -0
  10. data/lib/ews/folder_accessors.rb +264 -0
  11. data/lib/ews/impersonation.rb +30 -0
  12. data/lib/ews/item_accessors.rb +231 -0
  13. data/lib/ews/mailbox_accessors.rb +99 -0
  14. data/lib/ews/message_accessors.rb +93 -0
  15. data/lib/ews/push_subscription_accessors.rb +33 -0
  16. data/lib/ews/room_accessors.rb +48 -0
  17. data/lib/ews/roomlist_accessors.rb +47 -0
  18. data/lib/ews/soap.rb +64 -0
  19. data/lib/ews/soap/builders/ews_builder.rb +1351 -0
  20. data/lib/ews/soap/ews_response.rb +84 -0
  21. data/lib/ews/soap/ews_soap_availability_response.rb +58 -0
  22. data/lib/ews/soap/ews_soap_free_busy_response.rb +119 -0
  23. data/lib/ews/soap/ews_soap_response.rb +103 -0
  24. data/lib/ews/soap/ews_soap_room_response.rb +53 -0
  25. data/lib/ews/soap/ews_soap_roomlist_response.rb +54 -0
  26. data/lib/ews/soap/exchange_availability.rb +61 -0
  27. data/lib/ews/soap/exchange_data_services.rb +780 -0
  28. data/lib/ews/soap/exchange_notification.rb +146 -0
  29. data/lib/ews/soap/exchange_synchronization.rb +93 -0
  30. data/lib/ews/soap/exchange_time_zones.rb +56 -0
  31. data/lib/ews/soap/exchange_user_configuration.rb +33 -0
  32. data/lib/ews/soap/exchange_web_service.rb +264 -0
  33. data/lib/ews/soap/parsers/ews_parser.rb +43 -0
  34. data/lib/ews/soap/parsers/ews_sax_document.rb +70 -0
  35. data/lib/ews/soap/response_message.rb +80 -0
  36. data/lib/ews/soap/responses/create_attachment_response_message.rb +47 -0
  37. data/lib/ews/soap/responses/create_item_response_message.rb +25 -0
  38. data/lib/ews/soap/responses/find_item_response_message.rb +80 -0
  39. data/lib/ews/soap/responses/get_events_response_message.rb +53 -0
  40. data/lib/ews/soap/responses/send_notification_response_message.rb +59 -0
  41. data/lib/ews/soap/responses/subscribe_response_message.rb +35 -0
  42. data/lib/ews/soap/responses/sync_folder_hierarchy_response_message.rb +36 -0
  43. data/lib/ews/soap/responses/sync_folder_items_response_message.rb +36 -0
  44. data/lib/ews/templates/calendar_item.rb +79 -0
  45. data/lib/ews/templates/forward_item.rb +24 -0
  46. data/lib/ews/templates/message.rb +76 -0
  47. data/lib/ews/templates/reply_to_item.rb +25 -0
  48. data/lib/ews/templates/task.rb +74 -0
  49. data/lib/ews/types.rb +194 -0
  50. data/lib/ews/types/attachment.rb +77 -0
  51. data/lib/ews/types/attendee.rb +41 -0
  52. data/lib/ews/types/calendar_folder.rb +50 -0
  53. data/lib/ews/types/calendar_item.rb +133 -0
  54. data/lib/ews/types/contact.rb +7 -0
  55. data/lib/ews/types/contacts_folder.rb +8 -0
  56. data/lib/ews/types/copied_event.rb +51 -0
  57. data/lib/ews/types/created_event.rb +24 -0
  58. data/lib/ews/types/deleted_event.rb +24 -0
  59. data/lib/ews/types/distribution_list.rb +7 -0
  60. data/lib/ews/types/event.rb +62 -0
  61. data/lib/ews/types/export_items_response_message.rb +52 -0
  62. data/lib/ews/types/file_attachment.rb +65 -0
  63. data/lib/ews/types/folder.rb +60 -0
  64. data/lib/ews/types/free_busy_changed_event.rb +24 -0
  65. data/lib/ews/types/generic_folder.rb +418 -0
  66. data/lib/ews/types/item.rb +450 -0
  67. data/lib/ews/types/item_attachment.rb +84 -0
  68. data/lib/ews/types/item_field_uri_map.rb +208 -0
  69. data/lib/ews/types/mailbox_user.rb +156 -0
  70. data/lib/ews/types/meeting_cancellation.rb +7 -0
  71. data/lib/ews/types/meeting_message.rb +7 -0
  72. data/lib/ews/types/meeting_request.rb +7 -0
  73. data/lib/ews/types/meeting_response.rb +7 -0
  74. data/lib/ews/types/message.rb +7 -0
  75. data/lib/ews/types/modified_event.rb +48 -0
  76. data/lib/ews/types/moved_event.rb +51 -0
  77. data/lib/ews/types/new_mail_event.rb +24 -0
  78. data/lib/ews/types/out_of_office.rb +147 -0
  79. data/lib/ews/types/post_item.rb +7 -0
  80. data/lib/ews/types/search_folder.rb +8 -0
  81. data/lib/ews/types/status_event.rb +39 -0
  82. data/lib/ews/types/task.rb +104 -0
  83. data/lib/ews/types/tasks_folder.rb +27 -0
  84. data/lib/viewpoint/logging.rb +27 -0
  85. data/lib/viewpoint/logging/config.rb +24 -0
  86. data/lib/viewpoint/string_utils.rb +76 -0
  87. data/lib/viewpoint2.rb +111 -0
  88. metadata +191 -0
@@ -0,0 +1,76 @@
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
20
+
21
+ class StringFormatException < ::Exception; end
22
+
23
+ # Collection of utility methods for working with Strings
24
+ module StringUtils
25
+
26
+ DURATION_RE = /
27
+ (?<start>P)
28
+ ((?<weeks>\d+)W)?
29
+ ((?<days>\d+)D)?
30
+ (?<time>T
31
+ ((?<hours>\d+)H)?
32
+ ((?<minutes>\d+)M)?
33
+ ((?<seconds>\d+)S)?
34
+ )?
35
+ /x
36
+
37
+ def self.included(klass)
38
+ klass.extend StringUtils
39
+ end
40
+
41
+ private
42
+
43
+ # Change CamelCased strings to ruby_cased strings
44
+ # It uses the lookahead assertion ?= In this case it basically says match
45
+ # anything followed by a capital letter, but not the capital letter itself.
46
+ # @see http://www.pcre.org/pcre.txt The PCRE guide for more details
47
+ def ruby_case(input)
48
+ input.to_s.split(/(?=[A-Z])/).join('_').downcase
49
+ end
50
+
51
+ # Change a ruby_cased string to CamelCased
52
+ def camel_case(input)
53
+ input.to_s.split(/_/).map { |i|
54
+ i.sub(/^./) { |s| s.upcase }
55
+ }.join
56
+ end
57
+
58
+ # Convert an ISO8601 Duration format to seconds
59
+ # @see http://tools.ietf.org/html/rfc2445#section-4.3.6
60
+ # @param [String] input
61
+ # @return [nil,Fixnum] the number of seconds in this duration
62
+ # nil if there is no known duration
63
+ def iso8601_duration_to_seconds(input)
64
+ return nil if input.nil? || input.empty?
65
+ match_data = DURATION_RE.match(input)
66
+ raise(StringFormatException, "Invalid duration given") if match_data.nil?
67
+ duration = 0
68
+ duration += match_data[:weeks].to_i * 604800
69
+ duration += match_data[:days].to_i * 86400
70
+ duration += match_data[:hours].to_i * 3600
71
+ duration += match_data[:minutes].to_i * 60
72
+ duration += match_data[:seconds].to_i
73
+ end
74
+
75
+ end # StringUtils
76
+ end # Viewpoint
@@ -0,0 +1,111 @@
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
+ require 'kconv' if(RUBY_VERSION.start_with? '1.9') # bug in rubyntlm with ruby 1.9.x
20
+ require 'date'
21
+ require 'base64'
22
+ require 'nokogiri'
23
+ require 'ostruct'
24
+ require 'logging'
25
+
26
+ # String utilities
27
+ require 'viewpoint/string_utils'
28
+
29
+ # Load the logging setup
30
+ require 'viewpoint/logging'
31
+
32
+ # Load the Exception classes
33
+ require 'ews/exceptions/exceptions'
34
+
35
+ # Load the backend SOAP / EWS infrastructure.
36
+ require 'ews/soap'
37
+ require 'ews/soap/response_message'
38
+ require 'ews/soap/ews_response'
39
+ require 'ews/soap/ews_soap_response'
40
+ require 'ews/soap/ews_soap_availability_response'
41
+ require 'ews/soap/ews_soap_free_busy_response'
42
+ require 'ews/soap/ews_soap_room_response'
43
+ require 'ews/soap/ews_soap_roomlist_response'
44
+ require 'ews/soap/builders/ews_builder'
45
+ require 'ews/soap/parsers/ews_parser'
46
+ require 'ews/soap/parsers/ews_sax_document'
47
+ # Mix-ins for the ExchangeWebService
48
+ require 'ews/soap/exchange_data_services'
49
+ require 'ews/soap/exchange_notification'
50
+ require 'ews/soap/exchange_synchronization'
51
+ require 'ews/soap/exchange_availability'
52
+ require 'ews/soap/exchange_user_configuration'
53
+ require 'ews/soap/exchange_time_zones'
54
+ require 'ews/soap/exchange_web_service'
55
+
56
+ require 'ews/errors'
57
+ require 'ews/connection_helper'
58
+ require 'ews/connection'
59
+
60
+ require 'ews/impersonation'
61
+
62
+ # Base Types
63
+ require 'ews/types'
64
+ require 'ews/types/item_field_uri_map'
65
+ require 'ews/types/generic_folder'
66
+ require 'ews/types/item'
67
+ # Folders
68
+ require 'ews/types/folder'
69
+ require 'ews/types/calendar_folder'
70
+ require 'ews/types/contacts_folder'
71
+ require 'ews/types/tasks_folder'
72
+ require 'ews/types/search_folder'
73
+ # Items
74
+ require 'ews/types/message'
75
+ require 'ews/types/calendar_item'
76
+ require 'ews/types/contact'
77
+ require 'ews/types/distribution_list'
78
+ require 'ews/types/meeting_message'
79
+ require 'ews/types/meeting_request'
80
+ require 'ews/types/meeting_response'
81
+ require 'ews/types/meeting_cancellation'
82
+ require 'ews/types/task'
83
+ require 'ews/types/attachment'
84
+ require 'ews/types/file_attachment'
85
+ require 'ews/types/item_attachment'
86
+ require 'ews/types/mailbox_user'
87
+ require 'ews/types/attendee'
88
+ require 'ews/types/out_of_office'
89
+ require 'ews/types/export_items_response_message'
90
+ require 'ews/types/post_item'
91
+
92
+ # Events
93
+ require 'ews/types/event'
94
+ require 'ews/types/copied_event'
95
+ require 'ews/types/created_event'
96
+ require 'ews/types/deleted_event'
97
+ require 'ews/types/free_busy_changed_event'
98
+ require 'ews/types/modified_event'
99
+ require 'ews/types/moved_event'
100
+ require 'ews/types/new_mail_event'
101
+ require 'ews/types/status_event'
102
+
103
+ # Template Objects
104
+ require 'ews/templates/message'
105
+ require 'ews/templates/forward_item'
106
+ require 'ews/templates/reply_to_item'
107
+ require 'ews/templates/calendar_item'
108
+ require 'ews/templates/task'
109
+
110
+ # The proxy between the models and the web service
111
+ require 'ews/ews_client'
metadata ADDED
@@ -0,0 +1,191 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: viewpoint2
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Dan Wanek
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-07-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nokogiri
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: httpclient
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubyntlm
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: logging
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: 'A Ruby client access library for Microsoft Exchange Web Services (EWS). Examples
70
+ can be found here: http://distributed-frostbite.blogspot.com'
71
+ email: dan.wanek@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files:
75
+ - README.md
76
+ files:
77
+ - README.md
78
+ - lib/ews/calendar_accessors.rb
79
+ - lib/ews/connection.rb
80
+ - lib/ews/connection_helper.rb
81
+ - lib/ews/convert_accessors.rb
82
+ - lib/ews/errors.rb
83
+ - lib/ews/ews_client.rb
84
+ - lib/ews/exceptions/exceptions.rb
85
+ - lib/ews/folder_accessors.rb
86
+ - lib/ews/impersonation.rb
87
+ - lib/ews/item_accessors.rb
88
+ - lib/ews/mailbox_accessors.rb
89
+ - lib/ews/message_accessors.rb
90
+ - lib/ews/push_subscription_accessors.rb
91
+ - lib/ews/room_accessors.rb
92
+ - lib/ews/roomlist_accessors.rb
93
+ - lib/ews/soap.rb
94
+ - lib/ews/soap/builders/ews_builder.rb
95
+ - lib/ews/soap/ews_response.rb
96
+ - lib/ews/soap/ews_soap_availability_response.rb
97
+ - lib/ews/soap/ews_soap_free_busy_response.rb
98
+ - lib/ews/soap/ews_soap_response.rb
99
+ - lib/ews/soap/ews_soap_room_response.rb
100
+ - lib/ews/soap/ews_soap_roomlist_response.rb
101
+ - lib/ews/soap/exchange_availability.rb
102
+ - lib/ews/soap/exchange_data_services.rb
103
+ - lib/ews/soap/exchange_notification.rb
104
+ - lib/ews/soap/exchange_synchronization.rb
105
+ - lib/ews/soap/exchange_time_zones.rb
106
+ - lib/ews/soap/exchange_user_configuration.rb
107
+ - lib/ews/soap/exchange_web_service.rb
108
+ - lib/ews/soap/parsers/ews_parser.rb
109
+ - lib/ews/soap/parsers/ews_sax_document.rb
110
+ - lib/ews/soap/response_message.rb
111
+ - lib/ews/soap/responses/create_attachment_response_message.rb
112
+ - lib/ews/soap/responses/create_item_response_message.rb
113
+ - lib/ews/soap/responses/find_item_response_message.rb
114
+ - lib/ews/soap/responses/get_events_response_message.rb
115
+ - lib/ews/soap/responses/send_notification_response_message.rb
116
+ - lib/ews/soap/responses/subscribe_response_message.rb
117
+ - lib/ews/soap/responses/sync_folder_hierarchy_response_message.rb
118
+ - lib/ews/soap/responses/sync_folder_items_response_message.rb
119
+ - lib/ews/templates/calendar_item.rb
120
+ - lib/ews/templates/forward_item.rb
121
+ - lib/ews/templates/message.rb
122
+ - lib/ews/templates/reply_to_item.rb
123
+ - lib/ews/templates/task.rb
124
+ - lib/ews/types.rb
125
+ - lib/ews/types/attachment.rb
126
+ - lib/ews/types/attendee.rb
127
+ - lib/ews/types/calendar_folder.rb
128
+ - lib/ews/types/calendar_item.rb
129
+ - lib/ews/types/contact.rb
130
+ - lib/ews/types/contacts_folder.rb
131
+ - lib/ews/types/copied_event.rb
132
+ - lib/ews/types/created_event.rb
133
+ - lib/ews/types/deleted_event.rb
134
+ - lib/ews/types/distribution_list.rb
135
+ - lib/ews/types/event.rb
136
+ - lib/ews/types/export_items_response_message.rb
137
+ - lib/ews/types/file_attachment.rb
138
+ - lib/ews/types/folder.rb
139
+ - lib/ews/types/free_busy_changed_event.rb
140
+ - lib/ews/types/generic_folder.rb
141
+ - lib/ews/types/item.rb
142
+ - lib/ews/types/item_attachment.rb
143
+ - lib/ews/types/item_field_uri_map.rb
144
+ - lib/ews/types/mailbox_user.rb
145
+ - lib/ews/types/meeting_cancellation.rb
146
+ - lib/ews/types/meeting_message.rb
147
+ - lib/ews/types/meeting_request.rb
148
+ - lib/ews/types/meeting_response.rb
149
+ - lib/ews/types/message.rb
150
+ - lib/ews/types/modified_event.rb
151
+ - lib/ews/types/moved_event.rb
152
+ - lib/ews/types/new_mail_event.rb
153
+ - lib/ews/types/out_of_office.rb
154
+ - lib/ews/types/post_item.rb
155
+ - lib/ews/types/search_folder.rb
156
+ - lib/ews/types/status_event.rb
157
+ - lib/ews/types/task.rb
158
+ - lib/ews/types/tasks_folder.rb
159
+ - lib/viewpoint/logging.rb
160
+ - lib/viewpoint/logging/config.rb
161
+ - lib/viewpoint/string_utils.rb
162
+ - lib/viewpoint2.rb
163
+ homepage: http://github.com/zenchild/Viewpoint
164
+ licenses: []
165
+ metadata: {}
166
+ post_install_message:
167
+ rdoc_options:
168
+ - "-x"
169
+ - test/
170
+ - "-x"
171
+ - examples/
172
+ require_paths:
173
+ - lib
174
+ required_ruby_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: 1.9.1
179
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ requirements: []
185
+ rubyforge_project:
186
+ rubygems_version: 2.5.1
187
+ signing_key:
188
+ specification_version: 4
189
+ summary: A Ruby client access library for Microsoft Exchange Web Services (EWS)
190
+ test_files: []
191
+ has_rdoc: